@winchsa/ui 0.1.0

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 (305) hide show
  1. package/README.md +166 -0
  2. package/dist/components/Breadcrumbs.vue +46 -0
  3. package/dist/components/Breadcrumbs.vue.d.ts +6 -0
  4. package/dist/components/Drawer.vue +60 -0
  5. package/dist/components/Drawer.vue.d.ts +44 -0
  6. package/dist/components/IconBtn.vue +18 -0
  7. package/dist/components/IconBtn.vue.d.ts +30 -0
  8. package/dist/components/Modal.vue +155 -0
  9. package/dist/components/Modal.vue.d.ts +0 -0
  10. package/dist/components/SiteTitle.vue +14 -0
  11. package/dist/components/SiteTitle.vue.d.ts +2 -0
  12. package/dist/components/Toaster.vue +19 -0
  13. package/dist/components/Toaster.vue.d.ts +5 -0
  14. package/dist/components/cards/CheckboxesCard.vue +76 -0
  15. package/dist/components/cards/CheckboxesCard.vue.d.ts +20 -0
  16. package/dist/components/cards/HeaderCard.vue +31 -0
  17. package/dist/components/cards/HeaderCard.vue.d.ts +8 -0
  18. package/dist/components/cards/ImageCard.vue +73 -0
  19. package/dist/components/cards/ImageCard.vue.d.ts +63 -0
  20. package/dist/components/cards/InputCard.vue +60 -0
  21. package/dist/components/cards/InputCard.vue.d.ts +41 -0
  22. package/dist/components/cards/StaticCard.vue +37 -0
  23. package/dist/components/cards/StaticCard.vue.d.ts +33 -0
  24. package/dist/components/core/AppBarSearch.vue +345 -0
  25. package/dist/components/core/AppBarSearch.vue.d.ts +1587 -0
  26. package/dist/components/core/AppDrawerHeaderSection.vue +21 -0
  27. package/dist/components/core/AppDrawerHeaderSection.vue.d.ts +30 -0
  28. package/dist/components/core/AppSearchHeader.vue +72 -0
  29. package/dist/components/core/AppSearchHeader.vue.d.ts +7 -0
  30. package/dist/components/core/AppStepper.vue +232 -0
  31. package/dist/components/core/AppStepper.vue.d.ts +25 -0
  32. package/dist/components/core/CustomizerSection.vue +19 -0
  33. package/dist/components/core/CustomizerSection.vue.d.ts +25 -0
  34. package/dist/components/core/DialogCloseBtn.vue +20 -0
  35. package/dist/components/core/DialogCloseBtn.vue.d.ts +9 -0
  36. package/dist/components/core/MoreBtn.vue +27 -0
  37. package/dist/components/core/MoreBtn.vue.d.ts +25 -0
  38. package/dist/components/core/ScrollToTop.vue +39 -0
  39. package/dist/components/core/ScrollToTop.vue.d.ts +2 -0
  40. package/dist/components/core/app-form-elements/AppCombobox.vue +67 -0
  41. package/dist/components/core/app-form-elements/AppCombobox.vue.d.ts +0 -0
  42. package/dist/components/core/app-form-elements/AppSelect.vue +98 -0
  43. package/dist/components/core/app-form-elements/AppSelect.vue.d.ts +0 -0
  44. package/dist/components/core/app-form-elements/AppSwitch.vue +59 -0
  45. package/dist/components/core/app-form-elements/AppSwitch.vue.d.ts +27 -0
  46. package/dist/components/core/app-form-elements/AppTextField.vue +66 -0
  47. package/dist/components/core/app-form-elements/AppTextField.vue.d.ts +26 -0
  48. package/dist/components/core/app-form-elements/AppTextarea.vue +69 -0
  49. package/dist/components/core/app-form-elements/AppTextarea.vue.d.ts +26 -0
  50. package/dist/components/core/app-form-elements/CustomCheckboxes.vue +69 -0
  51. package/dist/components/core/app-form-elements/CustomCheckboxes.vue.d.ts +39 -0
  52. package/dist/components/core/app-form-elements/CustomCheckboxesWithIcon.vue +80 -0
  53. package/dist/components/core/app-form-elements/CustomCheckboxesWithIcon.vue.d.ts +39 -0
  54. package/dist/components/core/app-form-elements/CustomCheckboxesWithImage.vue +67 -0
  55. package/dist/components/core/app-form-elements/CustomCheckboxesWithImage.vue.d.ts +15 -0
  56. package/dist/components/core/app-form-elements/CustomRadios.vue +69 -0
  57. package/dist/components/core/app-form-elements/CustomRadios.vue.d.ts +40 -0
  58. package/dist/components/core/app-form-elements/CustomRadiosWithIcon.vue +98 -0
  59. package/dist/components/core/app-form-elements/CustomRadiosWithIcon.vue.d.ts +45 -0
  60. package/dist/components/core/app-form-elements/CustomRadiosWithImage.vue +69 -0
  61. package/dist/components/core/app-form-elements/CustomRadiosWithImage.vue.d.ts +53 -0
  62. package/dist/components/core/cards/AppCard.vue +45 -0
  63. package/dist/components/core/cards/AppCard.vue.d.ts +26 -0
  64. package/dist/components/core/cards/AppCardActions.vue +126 -0
  65. package/dist/components/core/cards/AppCardActions.vue.d.ts +79 -0
  66. package/dist/components/core/cards/CardStatisticsHorizontal.vue +29 -0
  67. package/dist/components/core/cards/CardStatisticsHorizontal.vue.d.ts +10 -0
  68. package/dist/components/forms/Accordion.vue +43 -0
  69. package/dist/components/forms/Accordion.vue.d.ts +35 -0
  70. package/dist/components/forms/AppLabel.vue +47 -0
  71. package/dist/components/forms/AppLabel.vue.d.ts +36 -0
  72. package/dist/components/forms/AppLink.vue +50 -0
  73. package/dist/components/forms/AppLink.vue.d.ts +27 -0
  74. package/dist/components/forms/AppNumberField.vue +85 -0
  75. package/dist/components/forms/AppNumberField.vue.d.ts +45 -0
  76. package/dist/components/forms/AppOtpInput.vue +84 -0
  77. package/dist/components/forms/AppOtpInput.vue.d.ts +16 -0
  78. package/dist/components/forms/AttachmentCropperInput.vue +228 -0
  79. package/dist/components/forms/AttachmentCropperInput.vue.d.ts +25 -0
  80. package/dist/components/forms/AttachmentInput.vue +116 -0
  81. package/dist/components/forms/AttachmentInput.vue.d.ts +20 -0
  82. package/dist/components/forms/AutocompleteInput.vue +759 -0
  83. package/dist/components/forms/AutocompleteInput.vue.d.ts +0 -0
  84. package/dist/components/forms/BankSelect.vue +43 -0
  85. package/dist/components/forms/BankSelect.vue.d.ts +19 -0
  86. package/dist/components/forms/BaseButton.vue +42 -0
  87. package/dist/components/forms/BaseButton.vue.d.ts +31 -0
  88. package/dist/components/forms/CounterInput.vue +71 -0
  89. package/dist/components/forms/CounterInput.vue.d.ts +15 -0
  90. package/dist/components/forms/DatePicker.vue +400 -0
  91. package/dist/components/forms/DatePicker.vue.d.ts +34 -0
  92. package/dist/components/forms/DatePickerRange.vue +129 -0
  93. package/dist/components/forms/DatePickerRange.vue.d.ts +23 -0
  94. package/dist/components/forms/DraggedUploadFile.vue +120 -0
  95. package/dist/components/forms/DraggedUploadFile.vue.d.ts +10 -0
  96. package/dist/components/forms/ImageCardInput.vue +234 -0
  97. package/dist/components/forms/ImageCardInput.vue.d.ts +0 -0
  98. package/dist/components/forms/InputValidationWrapper.vue +24 -0
  99. package/dist/components/forms/InputValidationWrapper.vue.d.ts +33 -0
  100. package/dist/components/forms/LicensePlateInput.vue +159 -0
  101. package/dist/components/forms/LicensePlateInput.vue.d.ts +16 -0
  102. package/dist/components/forms/ManualDate.vue +262 -0
  103. package/dist/components/forms/ManualDate.vue.d.ts +17 -0
  104. package/dist/components/forms/MobileInput.vue +118 -0
  105. package/dist/components/forms/MobileInput.vue.d.ts +49 -0
  106. package/dist/components/forms/PasswordInput.vue +29 -0
  107. package/dist/components/forms/PasswordInput.vue.d.ts +13 -0
  108. package/dist/components/forms/RangeInput.vue +48 -0
  109. package/dist/components/forms/RangeInput.vue.d.ts +5 -0
  110. package/dist/components/forms/Tabs.vue +35 -0
  111. package/dist/components/forms/Tabs.vue.d.ts +42 -0
  112. package/dist/components/forms/TimePicker.vue +370 -0
  113. package/dist/components/forms/TimePicker.vue.d.ts +23 -0
  114. package/dist/components/icons/EndMarker.vue +25 -0
  115. package/dist/components/icons/EndMarker.vue.d.ts +17 -0
  116. package/dist/components/icons/RedXIcon.vue +36 -0
  117. package/dist/components/icons/RedXIcon.vue.d.ts +2 -0
  118. package/dist/components/icons/StarFillIcon.vue +28 -0
  119. package/dist/components/icons/StarFillIcon.vue.d.ts +2 -0
  120. package/dist/components/icons/StartMarker.vue +25 -0
  121. package/dist/components/icons/StartMarker.vue.d.ts +17 -0
  122. package/dist/components/icons/WorkerIcon.vue +39 -0
  123. package/dist/components/icons/WorkerIcon.vue.d.ts +2 -0
  124. package/dist/components/loading/LoadingBar.vue +31 -0
  125. package/dist/components/loading/LoadingBar.vue.d.ts +5 -0
  126. package/dist/components/loading/LoadingDialog.vue +41 -0
  127. package/dist/components/loading/LoadingDialog.vue.d.ts +11 -0
  128. package/dist/components/loading/LoadingItem.vue +66 -0
  129. package/dist/components/loading/LoadingItem.vue.d.ts +47 -0
  130. package/dist/components/table/DataTable.vue +319 -0
  131. package/dist/components/table/DataTable.vue.d.ts +0 -0
  132. package/dist/components/table/EditableDataTable.vue +329 -0
  133. package/dist/components/table/EditableDataTable.vue.d.ts +73 -0
  134. package/dist/components/table/EditableDataTableRow.vue +243 -0
  135. package/dist/components/table/EditableDataTableRow.vue.d.ts +18 -0
  136. package/dist/components/table/FilterGenerator.vue +232 -0
  137. package/dist/components/table/FilterGenerator.vue.d.ts +14 -0
  138. package/dist/components/table/StaticTable.vue +152 -0
  139. package/dist/components/table/StaticTable.vue.d.ts +25 -0
  140. package/dist/components/table/TablePagination.vue +73 -0
  141. package/dist/components/table/TablePagination.vue.d.ts +13 -0
  142. package/dist/composables/use-is-mobile.d.ts +1 -0
  143. package/dist/composables/use-is-mobile.js +10 -0
  144. package/dist/composables/use-is-mobile.mjs +4 -0
  145. package/dist/composables/use-table-filters.d.ts +23 -0
  146. package/dist/composables/use-table-filters.js +196 -0
  147. package/dist/composables/use-table-filters.mjs +183 -0
  148. package/dist/fonts/NotoSans-Medium.ttf +0 -0
  149. package/dist/fonts/NotoSansArabic-Medium.ttf +0 -0
  150. package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.eot +0 -0
  151. package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.svg +9 -0
  152. package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.ttf +0 -0
  153. package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.woff +0 -0
  154. package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.woff2 +0 -0
  155. package/dist/images/avatar.png +0 -0
  156. package/dist/images/sa.svg +1 -0
  157. package/dist/images/successful-registration.svg +15 -0
  158. package/dist/index.d.ts +66 -0
  159. package/dist/index.js +447 -0
  160. package/dist/index.mjs +128 -0
  161. package/dist/styles/@core/scss/base/_components.scss +164 -0
  162. package/dist/styles/@core/scss/base/_dark.scss +16 -0
  163. package/dist/styles/@core/scss/base/_default-layout-w-vertical-nav.scss +106 -0
  164. package/dist/styles/@core/scss/base/_default-layout.scss +16 -0
  165. package/dist/styles/@core/scss/base/_index.scss +47 -0
  166. package/dist/styles/@core/scss/base/_layouts.scss +63 -0
  167. package/dist/styles/@core/scss/base/_misc.scss +20 -0
  168. package/dist/styles/@core/scss/base/_mixins.scss +84 -0
  169. package/dist/styles/@core/scss/base/_route-transitions.scss +70 -0
  170. package/dist/styles/@core/scss/base/_utilities.scss +418 -0
  171. package/dist/styles/@core/scss/base/_utils.scss +100 -0
  172. package/dist/styles/@core/scss/base/_variables.scss +190 -0
  173. package/dist/styles/@core/scss/base/_vertical-nav.scss +264 -0
  174. package/dist/styles/@core/scss/base/libs/_perfect-scrollbar.scss +35 -0
  175. package/dist/styles/@core/scss/base/libs/vuetify/_index.scss +1 -0
  176. package/dist/styles/@core/scss/base/libs/vuetify/_overrides.scss +385 -0
  177. package/dist/styles/@core/scss/base/libs/vuetify/_variables.scss +48 -0
  178. package/dist/styles/@core/scss/base/placeholders/_default-layout-vertical-nav.scss +48 -0
  179. package/dist/styles/@core/scss/base/placeholders/_default-layout.scss +3 -0
  180. package/dist/styles/@core/scss/base/placeholders/_index.scss +5 -0
  181. package/dist/styles/@core/scss/base/placeholders/_misc.scss +7 -0
  182. package/dist/styles/@core/scss/base/placeholders/_nav.scss +26 -0
  183. package/dist/styles/@core/scss/base/placeholders/_vertical-nav.scss +84 -0
  184. package/dist/styles/@core/scss/base/skins/_bordered.scss +60 -0
  185. package/dist/styles/@core/scss/base/skins/_index.scss +1 -0
  186. package/dist/styles/@core/scss/template/_components.scss +1035 -0
  187. package/dist/styles/@core/scss/template/_default-layout-w-vertical-nav.scss +20 -0
  188. package/dist/styles/@core/scss/template/_utilities.scss +20 -0
  189. package/dist/styles/@core/scss/template/_variables.scss +67 -0
  190. package/dist/styles/@core/scss/template/_vertical-nav.scss +41 -0
  191. package/dist/styles/@core/scss/template/index.css +18764 -0
  192. package/dist/styles/@core/scss/template/index.scss +15 -0
  193. package/dist/styles/@core/scss/template/libs/apex-chart.css +90 -0
  194. package/dist/styles/@core/scss/template/libs/apex-chart.scss +99 -0
  195. package/dist/styles/@core/scss/template/libs/shepherd.css +82 -0
  196. package/dist/styles/@core/scss/template/libs/shepherd.scss +88 -0
  197. package/dist/styles/@core/scss/template/libs/vuetify/_variables.scss +461 -0
  198. package/dist/styles/@core/scss/template/libs/vuetify/index.css +741 -0
  199. package/dist/styles/@core/scss/template/libs/vuetify/index.scss +1 -0
  200. package/dist/styles/@core/scss/template/pages/misc.css +16 -0
  201. package/dist/styles/@core/scss/template/pages/misc.scss +20 -0
  202. package/dist/styles/@core/scss/template/placeholders/_default-layout-vertical-nav.scss +9 -0
  203. package/dist/styles/@core/scss/template/placeholders/_index.scss +3 -0
  204. package/dist/styles/@core/scss/template/placeholders/_nav.scss +15 -0
  205. package/dist/styles/@core/scss/template/placeholders/_vertical-nav.scss +18 -0
  206. package/dist/styles/@core/scss/template/skins/_bordered.scss +36 -0
  207. package/dist/styles/@core/scss/template/skins/_index.scss +1 -0
  208. package/dist/styles/@layouts/styles/_classes.scss +3 -0
  209. package/dist/styles/@layouts/styles/_dashboard-layout.scss +43 -0
  210. package/dist/styles/@layouts/styles/_global.scss +10 -0
  211. package/dist/styles/@layouts/styles/_mixins.scss +28 -0
  212. package/dist/styles/@layouts/styles/_placeholders.scss +53 -0
  213. package/dist/styles/@layouts/styles/_rtl.scss +7 -0
  214. package/dist/styles/@layouts/styles/_variables.scss +22 -0
  215. package/dist/styles/@layouts/styles/index.css +14 -0
  216. package/dist/styles/@layouts/styles/index.scss +2 -0
  217. package/dist/styles/assets/scss/styles.css +16099 -0
  218. package/dist/styles/assets/scss/styles.scss +246 -0
  219. package/dist/styles/assets/scss/variables/_template.scss +1 -0
  220. package/dist/styles/assets/scss/variables/_vuetify.scss +1 -0
  221. package/dist/types.d.ts +226 -0
  222. package/dist/utils/apiUrl.d.ts +1 -0
  223. package/dist/utils/apiUrl.js +15 -0
  224. package/dist/utils/apiUrl.mjs +8 -0
  225. package/dist/utils/client.d.ts +9 -0
  226. package/dist/utils/client.js +39 -0
  227. package/dist/utils/client.mjs +25 -0
  228. package/dist/utils/files.d.ts +2 -0
  229. package/dist/utils/files.js +35 -0
  230. package/dist/utils/files.mjs +22 -0
  231. package/dist/utils/formValidation.d.ts +7 -0
  232. package/dist/utils/formValidation.js +20 -0
  233. package/dist/utils/formValidation.mjs +13 -0
  234. package/dist/utils/formatters.d.ts +12 -0
  235. package/dist/utils/formatters.js +84 -0
  236. package/dist/utils/formatters.mjs +56 -0
  237. package/dist/utils/index.d.ts +9 -0
  238. package/dist/utils/index.js +104 -0
  239. package/dist/utils/index.mjs +9 -0
  240. package/dist/utils/queryParams.d.ts +4 -0
  241. package/dist/utils/queryParams.js +26 -0
  242. package/dist/utils/queryParams.mjs +18 -0
  243. package/dist/utils/ruleValidator.d.ts +28 -0
  244. package/dist/utils/ruleValidator.js +158 -0
  245. package/dist/utils/ruleValidator.mjs +144 -0
  246. package/dist/utils/toaster.d.ts +12 -0
  247. package/dist/utils/toaster.js +71 -0
  248. package/dist/utils/toaster.mjs +59 -0
  249. package/dist/utils/utils.d.ts +8 -0
  250. package/dist/utils/utils.js +70 -0
  251. package/dist/utils/utils.mjs +56 -0
  252. package/package.json +79 -0
  253. package/src/styles/@core/scss/base/_components.scss +164 -0
  254. package/src/styles/@core/scss/base/_dark.scss +16 -0
  255. package/src/styles/@core/scss/base/_default-layout-w-vertical-nav.scss +106 -0
  256. package/src/styles/@core/scss/base/_default-layout.scss +16 -0
  257. package/src/styles/@core/scss/base/_index.scss +47 -0
  258. package/src/styles/@core/scss/base/_layouts.scss +63 -0
  259. package/src/styles/@core/scss/base/_misc.scss +20 -0
  260. package/src/styles/@core/scss/base/_mixins.scss +84 -0
  261. package/src/styles/@core/scss/base/_route-transitions.scss +70 -0
  262. package/src/styles/@core/scss/base/_utilities.scss +418 -0
  263. package/src/styles/@core/scss/base/_utils.scss +100 -0
  264. package/src/styles/@core/scss/base/_variables.scss +190 -0
  265. package/src/styles/@core/scss/base/_vertical-nav.scss +264 -0
  266. package/src/styles/@core/scss/base/libs/_perfect-scrollbar.scss +35 -0
  267. package/src/styles/@core/scss/base/libs/vuetify/_index.scss +1 -0
  268. package/src/styles/@core/scss/base/libs/vuetify/_overrides.scss +385 -0
  269. package/src/styles/@core/scss/base/libs/vuetify/_variables.scss +48 -0
  270. package/src/styles/@core/scss/base/placeholders/_default-layout-vertical-nav.scss +48 -0
  271. package/src/styles/@core/scss/base/placeholders/_default-layout.scss +3 -0
  272. package/src/styles/@core/scss/base/placeholders/_index.scss +5 -0
  273. package/src/styles/@core/scss/base/placeholders/_misc.scss +7 -0
  274. package/src/styles/@core/scss/base/placeholders/_nav.scss +26 -0
  275. package/src/styles/@core/scss/base/placeholders/_vertical-nav.scss +84 -0
  276. package/src/styles/@core/scss/base/skins/_bordered.scss +60 -0
  277. package/src/styles/@core/scss/base/skins/_index.scss +1 -0
  278. package/src/styles/@core/scss/template/_components.scss +1035 -0
  279. package/src/styles/@core/scss/template/_default-layout-w-vertical-nav.scss +20 -0
  280. package/src/styles/@core/scss/template/_utilities.scss +20 -0
  281. package/src/styles/@core/scss/template/_variables.scss +67 -0
  282. package/src/styles/@core/scss/template/_vertical-nav.scss +41 -0
  283. package/src/styles/@core/scss/template/index.scss +15 -0
  284. package/src/styles/@core/scss/template/libs/apex-chart.scss +99 -0
  285. package/src/styles/@core/scss/template/libs/shepherd.scss +88 -0
  286. package/src/styles/@core/scss/template/libs/vuetify/_variables.scss +461 -0
  287. package/src/styles/@core/scss/template/libs/vuetify/index.scss +1 -0
  288. package/src/styles/@core/scss/template/pages/misc.scss +20 -0
  289. package/src/styles/@core/scss/template/placeholders/_default-layout-vertical-nav.scss +9 -0
  290. package/src/styles/@core/scss/template/placeholders/_index.scss +3 -0
  291. package/src/styles/@core/scss/template/placeholders/_nav.scss +15 -0
  292. package/src/styles/@core/scss/template/placeholders/_vertical-nav.scss +18 -0
  293. package/src/styles/@core/scss/template/skins/_bordered.scss +36 -0
  294. package/src/styles/@core/scss/template/skins/_index.scss +1 -0
  295. package/src/styles/@layouts/styles/_classes.scss +3 -0
  296. package/src/styles/@layouts/styles/_dashboard-layout.scss +43 -0
  297. package/src/styles/@layouts/styles/_global.scss +10 -0
  298. package/src/styles/@layouts/styles/_mixins.scss +28 -0
  299. package/src/styles/@layouts/styles/_placeholders.scss +53 -0
  300. package/src/styles/@layouts/styles/_rtl.scss +7 -0
  301. package/src/styles/@layouts/styles/_variables.scss +22 -0
  302. package/src/styles/@layouts/styles/index.scss +2 -0
  303. package/src/styles/assets/scss/styles.scss +246 -0
  304. package/src/styles/assets/scss/variables/_template.scss +1 -0
  305. package/src/styles/assets/scss/variables/_vuetify.scss +1 -0
@@ -0,0 +1,159 @@
1
+ <script setup>
2
+ import { computed, watch } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { VLabel, VIcon, VValidation, VMessages } from "vuetify/components";
5
+ const { t } = useI18n();
6
+ const props = defineProps({
7
+ hideDetails: { type: Boolean, required: false },
8
+ label: { type: String, required: false },
9
+ customId: { type: String, required: false },
10
+ errorMessages: { type: [Array, String], required: false },
11
+ error: { type: Boolean, required: false }
12
+ });
13
+ const model = defineModel({ type: [Array, null], ...{ default: ["", "", "", ""] } });
14
+ const LangLabel = computed(() => props.label ? t(props.label) : "");
15
+ const handleInput = (e, index) => {
16
+ const input = e.target;
17
+ const value = input.value;
18
+ if (!model.value) {
19
+ model.value = ["", "", "", ""];
20
+ }
21
+ if (e.inputType === "deleteContentBackward") {
22
+ model.value[index] = "";
23
+ if (index > 0) {
24
+ document.getElementById(`license-${props.customId || ""}-${index - 1}`)?.focus();
25
+ }
26
+ return;
27
+ }
28
+ if (index < 3) {
29
+ if (/\d/.test(value)) {
30
+ model.value[index] = "";
31
+ input.value = "";
32
+ return;
33
+ }
34
+ model.value[index] = value;
35
+ if (value) {
36
+ document.getElementById(`license-${props.customId || ""}-${index + 1}`)?.focus();
37
+ }
38
+ } else {
39
+ if (/\D/.test(value)) {
40
+ model.value[index] = "";
41
+ input.value = "";
42
+ return;
43
+ }
44
+ model.value[index] = value;
45
+ }
46
+ };
47
+ const clear = () => {
48
+ model.value = null;
49
+ };
50
+ const requiredRule = computed(() => {
51
+ return (value) => {
52
+ return value?.some(Boolean) || t("validation.required");
53
+ };
54
+ });
55
+ watch(() => model.value, (newVal) => {
56
+ if (Array.isArray(newVal)) {
57
+ model.value = newVal;
58
+ } else {
59
+ model.value = null;
60
+ }
61
+ }, { immediate: true });
62
+ </script>
63
+
64
+ <template>
65
+ <div class="d-flex flex-column h-100 w-100">
66
+ <VValidation
67
+ v-slot="{ errorMessages: validationErrors, isValid }"
68
+ v-model="model"
69
+ :rules="[requiredRule]"
70
+ validate-on="input lazy"
71
+ >
72
+ <div class="d-flex flex-column h-100">
73
+ <VLabel
74
+ v-if="label"
75
+ class="mb-2 text-body-2 text-high-emphasis"
76
+ :text="LangLabel"
77
+ />
78
+ <div
79
+ class="app-license-plate-input position-relative"
80
+ style="min-height: 45px;"
81
+ :class="{
82
+ 'app-license-plate-input--error': isValid.value === false || error
83
+ }"
84
+ >
85
+ <input
86
+ v-for="(_, index) in 4"
87
+ :id="`license-${customId || ''}-${index}`"
88
+ :key="`license-${customId || ''}-${index}`"
89
+ :value="model?.[index] ?? ''"
90
+ class="app-license-plate-input-cell"
91
+ type="text"
92
+ :maxlength="index === 3 ? 4 : 1"
93
+ :placeholder="index === 3 ? t('inputs.numbers') : t('inputs.character')"
94
+ @input="handleInput($event, index)"
95
+ >
96
+ <a
97
+ v-if="model?.some(Boolean)"
98
+ class="position-absolute"
99
+ style="inset-inline-end: 10px;"
100
+ @click="clear"
101
+ >
102
+ <VIcon
103
+ size="19"
104
+ style="color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !important;"
105
+ >
106
+ tabler-x
107
+ </VIcon>
108
+ </a>
109
+ </div>
110
+ <VMessages
111
+ v-if="!hideDetails"
112
+ class="mt-n1"
113
+ :messages="errorMessages || validationErrors.value"
114
+ :active="!isValid.value"
115
+ />
116
+ </div>
117
+ </VValidation>
118
+ </div>
119
+ </template>
120
+
121
+ <style scoped>
122
+ .app-license-plate-input {
123
+ display: grid;
124
+ grid-template-columns: 60px 60px 60px 1fr;
125
+ width: 100%;
126
+ min-height: 40px;
127
+ height: 100%;
128
+ align-items: center;
129
+ border: 1px solid rgba(var(--v-border-color), 0.29);
130
+ border-radius: 6px;
131
+ transition: all 0.5s;
132
+ box-sizing: border-box;
133
+ }
134
+ .app-license-plate-input.app-license-plate-input--error {
135
+ border-color: rgba(var(--v-theme-error), 1);
136
+ }
137
+ .app-license-plate-input:hover {
138
+ transition: all 0.3s;
139
+ border-color: rgba(var(--v-theme-primary), 1);
140
+ }
141
+ .app-license-plate-input:focus-within {
142
+ transition: all 0.3s;
143
+ border-color: rgba(var(--v-theme-primary));
144
+ }
145
+ .app-license-plate-input .app-license-plate-input-cell {
146
+ height: 100%;
147
+ text-align: center;
148
+ padding: 2px 6px;
149
+ font-size: 13px;
150
+ outline: none;
151
+ border-inline-end: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
152
+ }
153
+ .app-license-plate-input .app-license-plate-input-cell:last-of-type {
154
+ text-align: start;
155
+ padding-inline-start: 12px;
156
+ border: 0px;
157
+ width: 100%;
158
+ }
159
+ </style>
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ hideDetails?: boolean;
3
+ label?: string;
4
+ customId?: string;
5
+ errorMessages?: string[] | string;
6
+ error?: boolean;
7
+ };
8
+ type __VLS_PublicProps = {
9
+ modelValue?: string[] | null;
10
+ } & __VLS_Props;
11
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: string[] | null) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: string[] | null) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,262 @@
1
+ <script setup>
2
+ import momentHijri from "moment-hijri";
3
+ import { computed, ref, watch } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+ import { VLabel, VIcon, VValidation, VMessages } from "vuetify/components";
6
+ import { ruleValidator } from "../../utils/ruleValidator";
7
+ const { t } = useI18n();
8
+ const props = defineProps({
9
+ hideDetails: { type: Boolean, required: false },
10
+ label: { type: String, required: false },
11
+ customId: { type: String, required: false, default: "" },
12
+ modelValue: { type: String, required: false },
13
+ errorMessages: { type: [Array, String], required: false },
14
+ type: { type: null, required: false },
15
+ disabled: { type: Boolean, required: false }
16
+ });
17
+ const emit = defineEmits(["update:model-value"]);
18
+ const { requiredValidator } = ruleValidator();
19
+ const date = ref({
20
+ year: "",
21
+ month: "",
22
+ day: ""
23
+ });
24
+ const dayInputRef = ref(null);
25
+ const monthInputRef = ref(null);
26
+ const yearInputRef = ref(null);
27
+ const LangLabel = computed(() => props.label ? t(props.label) : "");
28
+ const yearIsInvalid = computed(() => {
29
+ return date.value.year ? date.value.year.length < 4 : false;
30
+ });
31
+ const onBackspace = (e, key) => {
32
+ const input = e.target;
33
+ if (e.key === "Backspace" && !date.value[key]) {
34
+ if (input.dataset.order === "2") {
35
+ dayInputRef.value?.focus();
36
+ } else if (input.dataset.order === "3") {
37
+ monthInputRef.value?.focus();
38
+ }
39
+ }
40
+ };
41
+ const onDayInput = (e) => {
42
+ const input = e.target;
43
+ if (e.inputType === "deleteContentBackward") {
44
+ date.value.day = date.value.day?.slice(0, -1);
45
+ return;
46
+ }
47
+ if (/\D/g.test(input.value)) {
48
+ date.value.day = date.value.day.replace(/\D/g, "");
49
+ input.value = date.value.day;
50
+ return;
51
+ }
52
+ if (parseInt(input.value) > 31) {
53
+ date.value.day = "31";
54
+ input.value = "31";
55
+ } else {
56
+ date.value.day = input.value;
57
+ }
58
+ if (date.value.day?.length > 1) {
59
+ monthInputRef.value?.focus();
60
+ }
61
+ };
62
+ const onMonthInput = (e) => {
63
+ const input = e.target;
64
+ if (e.inputType === "deleteContentBackward") {
65
+ date.value.month = date.value.month?.slice(0, -1);
66
+ return;
67
+ }
68
+ if (/\D/g.test(input.value)) {
69
+ date.value.month = date.value.month.replace(/\D/g, "");
70
+ input.value = date.value.month;
71
+ return;
72
+ }
73
+ if (parseInt(input.value) > 12) {
74
+ date.value.month = "12";
75
+ input.value = "12";
76
+ } else {
77
+ date.value.month = input.value;
78
+ }
79
+ if (date.value.month?.length > 1) {
80
+ yearInputRef.value?.focus();
81
+ }
82
+ };
83
+ const onYearInput = (e) => {
84
+ const input = e.target;
85
+ if (e.inputType === "deleteContentBackward") {
86
+ date.value.year = date.value.year?.slice(0, -1);
87
+ return;
88
+ }
89
+ if (/\D/g.test(input.value)) {
90
+ date.value.year = date.value.year.replace(/\D/g, "");
91
+ input.value = date.value.year;
92
+ return;
93
+ }
94
+ const currentYear = props.type === "hijri" ? momentHijri().iYear() : (/* @__PURE__ */ new Date()).getFullYear();
95
+ if (parseInt(input.value) > currentYear) {
96
+ date.value.year = String(currentYear);
97
+ input.value = String(currentYear);
98
+ } else {
99
+ date.value.year = input.value;
100
+ }
101
+ };
102
+ const clear = () => {
103
+ date.value = {
104
+ year: "",
105
+ month: "",
106
+ day: ""
107
+ };
108
+ };
109
+ const dateFormat = (type) => {
110
+ if (type === "day") {
111
+ date.value.day = date.value.day ? date.value.day.padStart(2, "0") : "";
112
+ }
113
+ if (type === "month") {
114
+ date.value.month = date.value.month ? date.value.month.padStart(2, "0") : "";
115
+ }
116
+ };
117
+ watch(() => date.value, (val) => {
118
+ emit("update:model-value", [val.year, val.month, val.day].join("-"));
119
+ }, {
120
+ deep: true
121
+ });
122
+ watch(() => props.type, clear, { deep: true });
123
+ watch(() => props.modelValue, (val) => {
124
+ if (val) {
125
+ const [year, month, day] = val.split("-") ?? [];
126
+ date.value = {
127
+ year: year ?? "",
128
+ month: month ?? "",
129
+ day: day ?? ""
130
+ };
131
+ } else {
132
+ date.value = {
133
+ year: "",
134
+ month: "",
135
+ day: ""
136
+ };
137
+ }
138
+ }, { deep: true, immediate: true });
139
+ </script>
140
+
141
+ <template>
142
+ <div>
143
+ <VValidation
144
+ v-slot="{ errorMessages: validationErrors, isValid }"
145
+ v-model="date"
146
+ :rules="[requiredValidator]"
147
+ >
148
+ <div class="d-flex flex-column">
149
+ <VLabel
150
+ v-if="label"
151
+ class="mb-2 text-body-2 text-high-emphasis"
152
+ :text="LangLabel"
153
+ />
154
+ <div class="app-date-input position-relative" style="min-height: 45px;" :class="{
155
+ 'app-date-input--error': !isValid || yearIsInvalid,
156
+ 'app-date-input--disabled': disabled
157
+ }">
158
+ <input
159
+ ref="dayInputRef"
160
+ data-order="1"
161
+ :value="date.day"
162
+ class="app-date-input-cell"
163
+ type="text"
164
+ maxlength="2"
165
+ :placeholder="t('inputs.day')"
166
+ :disabled="disabled"
167
+ autocomplete="off"
168
+ @input="onDayInput($event)"
169
+ @keyup="onBackspace($event, 'day')"
170
+ @blur="dateFormat('day')"
171
+ >
172
+ <input
173
+ ref="monthInputRef"
174
+ data-order="2"
175
+ :value="date.month"
176
+ class="app-date-input-cell"
177
+ type="text"
178
+ maxlength="2"
179
+ :placeholder="t('inputs.month')"
180
+ :disabled="disabled"
181
+ autocomplete="off"
182
+ @input="onMonthInput($event)"
183
+ @keyup="onBackspace($event, 'month')"
184
+ @blur="dateFormat('month')"
185
+ >
186
+ <input
187
+ ref="yearInputRef"
188
+ data-order="3"
189
+ :value="date.year"
190
+ class="app-date-input-cell"
191
+ type="text"
192
+ maxlength="4"
193
+ :placeholder="t('inputs.year')"
194
+ :disabled="disabled"
195
+ autocomplete="off"
196
+ @input="onYearInput($event)"
197
+ @keyup="onBackspace($event, 'year')"
198
+ >
199
+ <a
200
+ v-if="date && Object.values(date).filter(Boolean).length > 0"
201
+ class="position-absolute"
202
+ style="inset-inline-end: 10px;"
203
+ @click="clear"
204
+ >
205
+ <VIcon size="19" style="color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity)) !important;">tabler-x</VIcon>
206
+ </a>
207
+ </div>
208
+ <VMessages
209
+ v-if="!hideDetails"
210
+ class="mt-n1"
211
+ :messages="errorMessages || validationErrors.value"
212
+ :active="!isValid.value"
213
+ />
214
+ </div>
215
+ </VValidation>
216
+ </div>
217
+ </template>
218
+
219
+ <style scoped>
220
+ .app-date-input {
221
+ display: grid;
222
+ grid-template-columns: 60px 60px 1fr;
223
+ width: 100%;
224
+ min-height: 40px;
225
+ height: 100%;
226
+ align-items: center;
227
+ border: 1px solid rgba(var(--v-border-color), 0.29);
228
+ border-radius: 6px;
229
+ transition: all 0.5s;
230
+ box-sizing: border-box;
231
+ }
232
+ .app-date-input.app-date-input--error {
233
+ border-color: rgba(var(--v-theme-error), 1);
234
+ }
235
+ .app-date-input.app-date-input--disabled {
236
+ border-color: rgba(var(--v-border-color), var(--v-border-opacity)) !important;
237
+ background: rgb(var(--v-disabled-background)) !important;
238
+ }
239
+ .app-date-input:hover {
240
+ transition: all 0.3s;
241
+ border-color: rgba(var(--v-border-color), 1);
242
+ }
243
+ .app-date-input:focus-within {
244
+ transition: all 0.3s;
245
+ border-color: rgba(var(--v-theme-primary));
246
+ }
247
+ .app-date-input .app-date-input-cell {
248
+ height: 100%;
249
+ text-align: center;
250
+ padding: 2px 6px;
251
+ font-size: 13px;
252
+ outline: none;
253
+ border-inline-end: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
254
+ }
255
+ .app-date-input .app-date-input-cell:last-of-type {
256
+ text-align: start;
257
+ padding-inline-start: 12px;
258
+ border: 0px;
259
+ width: 100%;
260
+ min-width: 80px;
261
+ }
262
+ </style>
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ hideDetails?: boolean;
3
+ label?: string;
4
+ customId?: string;
5
+ modelValue?: string;
6
+ errorMessages?: string[] | string;
7
+ type?: 'gregorian' | 'hijri' | string | undefined;
8
+ disabled?: boolean;
9
+ };
10
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ "update:model-value": (value: string) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:model-value"?: ((value: string) => any) | undefined;
14
+ }>, {
15
+ customId: string;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ export default _default;
@@ -0,0 +1,118 @@
1
+ <script setup>
2
+ import { computed, useAttrs } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { VTextField, VLabel } from "vuetify/components";
5
+ import { ruleValidator } from "../../utils/ruleValidator";
6
+ const { t } = useI18n();
7
+ const { numberValidator } = ruleValidator();
8
+ const props = defineProps({
9
+ label: { type: String, required: false, default: "" },
10
+ rules: { type: Array, required: false }
11
+ });
12
+ const mobileValue = defineModel({ type: [Number, String] });
13
+ const elementId = computed(() => {
14
+ const attrs = useAttrs();
15
+ const _elementIdToken = attrs.id || attrs.label;
16
+ return _elementIdToken ? `AppTextField-${_elementIdToken}-${Math.random().toString(36).slice(2, 7)}` : void 0;
17
+ });
18
+ const LangLabel = computed(() => props.label ? t(props.label) : "");
19
+ const validateInput = (event) => {
20
+ const input = event.target;
21
+ let value = input.value.replace(/\D/g, "");
22
+ if (value.length > 0 && !/^0|^5/.test(value)) {
23
+ value = "";
24
+ }
25
+ mobileValue.value = value;
26
+ input.value = value;
27
+ };
28
+ </script>
29
+
30
+ <template>
31
+ <div
32
+ class="AppTextField flex-grow-1 mobile-input w-100"
33
+ :class="$attrs.class"
34
+ lang="en"
35
+ >
36
+ <VLabel
37
+ v-if="label"
38
+ :for="elementId"
39
+ class="mb-2 text-body-2 text-high-emphasis"
40
+ :text="LangLabel"
41
+ />
42
+
43
+ <VTextField
44
+ v-bind="{
45
+ ...$attrs,
46
+ class: null,
47
+ label: void 0,
48
+ variant: 'outlined',
49
+ id: elementId
50
+ }"
51
+ v-model="mobileValue"
52
+ lang="en"
53
+ placeholder="5xxxxxxxx"
54
+ :maxlength="mobileValue?.startsWith('0') ? 10 : 9"
55
+ type="text"
56
+ :rules="[numberValidator, ...(props.rules || [])]"
57
+ @input="validateInput"
58
+ >
59
+ <template
60
+ v-for="(_, name) in $slots"
61
+ #[name]="slotProps"
62
+ >
63
+ <slot
64
+ :name="name"
65
+ v-bind="slotProps || {}"
66
+ />
67
+ </template>
68
+ <template #details>
69
+ <span class="app-h-1" />
70
+ </template>
71
+ <template #append-inner>
72
+ <div
73
+ class="d-flex flex-nowrap"
74
+ >
75
+ <img
76
+ src="../../images/sa.svg"
77
+ alt="sa"
78
+ width="20"
79
+ >
80
+ <span class="ms-2"> +966 </span>
81
+ </div>
82
+ </template>
83
+ </VTextField>
84
+ </div>
85
+ </template>
86
+
87
+ <style>
88
+ .mobile-input .v-field__input {
89
+ padding-inline-start: 16px !important;
90
+ padding-inline-end: 16px !important;
91
+ }
92
+ .mobile-input .v-input__control .v-field__field {
93
+ border: none !important;
94
+ }
95
+ .mobile-input .v-field {
96
+ padding: 0 !important;
97
+ }
98
+ .mobile-input .v-input input,
99
+ .mobile-input .v-field__append-inner {
100
+ direction: ltr !important;
101
+ text-align: start !important;
102
+ }
103
+ .mobile-input .v-field__append-inner {
104
+ padding-inline-start: 16px;
105
+ }
106
+ .mobile-input .v-field__append-inner span {
107
+ direction: ltr;
108
+ font-size: 14px;
109
+ }
110
+
111
+ [dir=ltr] .mobile-input .v-field {
112
+ display: flex !important;
113
+ flex-direction: row-reverse !important;
114
+ }
115
+ [dir=ltr] .mobile-input .v-field--appended {
116
+ padding-inline-end: 0 !important;
117
+ }
118
+ </style>
@@ -0,0 +1,49 @@
1
+ import { VTextField, VLabel } from 'vuetify/components';
2
+ declare const numberValidator: (value: unknown) => string | true;
3
+ type __VLS_Props = {
4
+ label?: string;
5
+ rules?: ((value: unknown) => string | true)[];
6
+ };
7
+ declare const mobileValue: import("vue").ModelRef<string | number | undefined, string, string | number | undefined, string | number | undefined>;
8
+ declare const elementId: import("vue").ComputedRef<string | undefined>;
9
+ declare const LangLabel: import("vue").ComputedRef<string>;
10
+ declare const validateInput: (event: InputEvent) => void;
11
+ type __VLS_PublicProps = {
12
+ modelValue?: number | string;
13
+ } & __VLS_Props;
14
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
15
+ declare var __VLS_14: any, __VLS_15: any;
16
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
17
+ [K in NonNullable<typeof __VLS_14>]?: (props: typeof __VLS_15) => any;
18
+ }>;
19
+ declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
20
+ VTextField: typeof VTextField;
21
+ VLabel: typeof VLabel;
22
+ numberValidator: typeof numberValidator;
23
+ mobileValue: typeof mobileValue;
24
+ elementId: typeof elementId;
25
+ LangLabel: typeof LangLabel;
26
+ validateInput: typeof validateInput;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ "update:modelValue": (value: string | number | undefined) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
31
+ }>, {
32
+ modelValue: number | string;
33
+ label: string;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
36
+ "update:modelValue": (value: string | number | undefined) => any;
37
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
38
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
39
+ }>, {
40
+ modelValue: number | string;
41
+ label: string;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import AppTextField from "../core/app-form-elements/AppTextField.vue";
4
+ const props = defineProps({
5
+ modelValue: { type: [String, null], required: false, default: null },
6
+ label: { type: String, required: false, default: "" }
7
+ });
8
+ const emit = defineEmits(["update:modelValue"]);
9
+ const value = computed({
10
+ get() {
11
+ return props.modelValue;
12
+ },
13
+ set(value2) {
14
+ emit("update:modelValue", value2 || "");
15
+ }
16
+ });
17
+ const isPasswordVisible = ref(false);
18
+ </script>
19
+
20
+ <template>
21
+ <AppTextField
22
+ v-bind="$attrs"
23
+ v-model="value"
24
+ :label="label"
25
+ :type="isPasswordVisible ? 'text' : 'password'"
26
+ :append-inner-icon="isPasswordVisible ? 'tabler-eye-off' : 'tabler-eye'"
27
+ @click:append-inner="isPasswordVisible = !isPasswordVisible"
28
+ />
29
+ </template>
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string | null;
3
+ label?: string;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ "update:modelValue": (value: string | number) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
9
+ }>, {
10
+ modelValue: string | null;
11
+ label: string;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;