@winchsa/ui 0.1.33 → 0.1.34

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 (300) hide show
  1. package/dist/components/Breadcrumbs.d.vue.ts +7 -0
  2. package/dist/components/Breadcrumbs.vue +46 -0
  3. package/dist/components/Breadcrumbs.vue.d.ts +7 -0
  4. package/dist/components/CustomizerSection.d.vue.ts +17 -0
  5. package/dist/components/CustomizerSection.vue +19 -0
  6. package/dist/components/CustomizerSection.vue.d.ts +17 -0
  7. package/dist/components/DialogCloseBtn.d.vue.ts +7 -0
  8. package/dist/components/DialogCloseBtn.vue +20 -0
  9. package/dist/components/DialogCloseBtn.vue.d.ts +7 -0
  10. package/dist/components/Drawer.d.vue.ts +28 -0
  11. package/dist/components/Drawer.vue +60 -0
  12. package/dist/components/Drawer.vue.d.ts +28 -0
  13. package/dist/components/IconBtn.d.vue.ts +18 -0
  14. package/dist/components/IconBtn.vue +24 -0
  15. package/dist/components/IconBtn.vue.d.ts +18 -0
  16. package/dist/components/LoadingBar.d.vue.ts +6 -0
  17. package/dist/components/LoadingBar.vue +31 -0
  18. package/dist/components/LoadingBar.vue.d.ts +6 -0
  19. package/dist/components/LoadingDialog.d.vue.ts +12 -0
  20. package/dist/components/LoadingDialog.vue +41 -0
  21. package/dist/components/LoadingDialog.vue.d.ts +12 -0
  22. package/dist/components/LoadingItem.d.vue.ts +25 -0
  23. package/dist/components/LoadingItem.vue +66 -0
  24. package/dist/components/LoadingItem.vue.d.ts +25 -0
  25. package/dist/components/Modal.d.vue.ts +50 -0
  26. package/dist/components/Modal.vue +155 -0
  27. package/dist/components/Modal.vue.d.ts +50 -0
  28. package/dist/components/MoreBtn.d.vue.ts +17 -0
  29. package/dist/components/MoreBtn.vue +28 -0
  30. package/dist/components/MoreBtn.vue.d.ts +17 -0
  31. package/dist/components/ScrollToTop.d.vue.ts +3 -0
  32. package/dist/components/ScrollToTop.vue +39 -0
  33. package/dist/components/ScrollToTop.vue.d.ts +3 -0
  34. package/dist/components/SiteTitle.d.vue.ts +3 -0
  35. package/dist/components/SiteTitle.vue +14 -0
  36. package/dist/components/SiteTitle.vue.d.ts +3 -0
  37. package/dist/components/Toaster.d.vue.ts +6 -0
  38. package/dist/components/Toaster.vue +19 -0
  39. package/dist/components/Toaster.vue.d.ts +6 -0
  40. package/dist/components/cards/AppCard.d.vue.ts +18 -0
  41. package/dist/components/cards/AppCard.vue +45 -0
  42. package/dist/components/cards/AppCard.vue.d.ts +18 -0
  43. package/dist/components/cards/AppCardActions.d.vue.ts +33 -0
  44. package/dist/components/cards/AppCardActions.vue +126 -0
  45. package/dist/components/cards/AppCardActions.vue.d.ts +33 -0
  46. package/dist/components/cards/CardStatisticsHorizontal.d.vue.ts +9 -0
  47. package/dist/components/cards/CardStatisticsHorizontal.vue +29 -0
  48. package/dist/components/cards/CardStatisticsHorizontal.vue.d.ts +9 -0
  49. package/dist/components/cards/CheckboxesCard.d.vue.ts +18 -0
  50. package/dist/components/cards/CheckboxesCard.vue +108 -0
  51. package/dist/components/cards/CheckboxesCard.vue.d.ts +18 -0
  52. package/dist/components/cards/HeaderCard.d.vue.ts +9 -0
  53. package/dist/components/cards/HeaderCard.vue +31 -0
  54. package/dist/components/cards/HeaderCard.vue.d.ts +9 -0
  55. package/dist/components/cards/ImageCard.d.vue.ts +33 -0
  56. package/dist/components/cards/ImageCard.vue +73 -0
  57. package/dist/components/cards/ImageCard.vue.d.ts +33 -0
  58. package/dist/components/cards/InputCard.d.vue.ts +21 -0
  59. package/dist/components/cards/InputCard.vue +60 -0
  60. package/dist/components/cards/InputCard.vue.d.ts +21 -0
  61. package/dist/components/cards/StaticCard.d.vue.ts +21 -0
  62. package/dist/components/cards/StaticCard.vue +37 -0
  63. package/dist/components/cards/StaticCard.vue.d.ts +21 -0
  64. package/dist/components/forms/Accordion.d.vue.ts +19 -0
  65. package/dist/components/forms/Accordion.vue +43 -0
  66. package/dist/components/forms/Accordion.vue.d.ts +19 -0
  67. package/dist/components/forms/AppBarSearch.d.vue.ts +43 -0
  68. package/dist/components/forms/AppBarSearch.vue +345 -0
  69. package/dist/components/forms/AppBarSearch.vue.d.ts +43 -0
  70. package/dist/components/forms/AppCombobox.d.vue.ts +13 -0
  71. package/dist/components/forms/AppCombobox.vue +60 -0
  72. package/dist/components/forms/AppCombobox.vue.d.ts +13 -0
  73. package/dist/components/forms/AppDrawerHeaderSection.d.vue.ts +20 -0
  74. package/dist/components/forms/AppDrawerHeaderSection.vue +21 -0
  75. package/dist/components/forms/AppDrawerHeaderSection.vue.d.ts +20 -0
  76. package/dist/components/forms/AppLabel.d.vue.ts +24 -0
  77. package/dist/components/forms/AppLabel.vue +47 -0
  78. package/dist/components/forms/AppLabel.vue.d.ts +24 -0
  79. package/dist/components/forms/AppLink.d.vue.ts +19 -0
  80. package/dist/components/forms/AppLink.vue +50 -0
  81. package/dist/components/forms/AppLink.vue.d.ts +19 -0
  82. package/dist/components/forms/AppNumberField.d.vue.ts +20 -0
  83. package/dist/components/forms/AppNumberField.vue +79 -0
  84. package/dist/components/forms/AppNumberField.vue.d.ts +20 -0
  85. package/dist/components/forms/AppOtpInput.d.vue.ts +13 -0
  86. package/dist/components/forms/AppOtpInput.vue +84 -0
  87. package/dist/components/forms/AppOtpInput.vue.d.ts +13 -0
  88. package/dist/components/forms/AppSearchHeader.d.vue.ts +8 -0
  89. package/dist/components/forms/AppSearchHeader.vue +72 -0
  90. package/dist/components/forms/AppSearchHeader.vue.d.ts +8 -0
  91. package/dist/components/forms/AppSelect.d.vue.ts +17 -0
  92. package/dist/components/forms/AppSelect.vue +91 -0
  93. package/dist/components/forms/AppSelect.vue.d.ts +17 -0
  94. package/dist/components/forms/AppStepper.d.vue.ts +21 -0
  95. package/dist/components/forms/AppStepper.vue +232 -0
  96. package/dist/components/forms/AppStepper.vue.d.ts +21 -0
  97. package/dist/components/forms/AppSwitch.d.vue.ts +16 -0
  98. package/dist/components/forms/AppSwitch.vue +59 -0
  99. package/dist/components/forms/AppSwitch.vue.d.ts +16 -0
  100. package/dist/components/forms/AppTextField.d.vue.ts +13 -0
  101. package/dist/components/forms/AppTextField.vue +59 -0
  102. package/dist/components/forms/AppTextField.vue.d.ts +13 -0
  103. package/dist/components/forms/AppTextarea.d.vue.ts +13 -0
  104. package/dist/components/forms/AppTextarea.vue +62 -0
  105. package/dist/components/forms/AppTextarea.vue.d.ts +13 -0
  106. package/dist/components/forms/AttachmentCropperInput.d.vue.ts +18 -0
  107. package/dist/components/forms/AttachmentCropperInput.vue +227 -0
  108. package/dist/components/forms/AttachmentCropperInput.vue.d.ts +18 -0
  109. package/dist/components/forms/AttachmentInput.d.vue.ts +16 -0
  110. package/dist/components/forms/AttachmentInput.vue +116 -0
  111. package/dist/components/forms/AttachmentInput.vue.d.ts +16 -0
  112. package/dist/components/forms/AutocompleteInput.d.vue.ts +84 -0
  113. package/dist/components/forms/AutocompleteInput.vue +760 -0
  114. package/dist/components/forms/AutocompleteInput.vue.d.ts +84 -0
  115. package/dist/components/forms/BankSelect.d.vue.ts +21 -0
  116. package/dist/components/forms/BankSelect.vue +43 -0
  117. package/dist/components/forms/BankSelect.vue.d.ts +21 -0
  118. package/dist/components/forms/BaseButton.d.vue.ts +20 -0
  119. package/dist/components/forms/BaseButton.vue +42 -0
  120. package/dist/components/forms/BaseButton.vue.d.ts +20 -0
  121. package/dist/components/forms/CounterInput.d.vue.ts +13 -0
  122. package/dist/components/forms/CounterInput.vue +71 -0
  123. package/dist/components/forms/CounterInput.vue.d.ts +13 -0
  124. package/dist/components/forms/CustomCheckboxes.d.vue.ts +25 -0
  125. package/dist/components/forms/CustomCheckboxes.vue +69 -0
  126. package/dist/components/forms/CustomCheckboxes.vue.d.ts +25 -0
  127. package/dist/components/forms/CustomCheckboxesWithIcon.d.vue.ts +25 -0
  128. package/dist/components/forms/CustomCheckboxesWithIcon.vue +80 -0
  129. package/dist/components/forms/CustomCheckboxesWithIcon.vue.d.ts +25 -0
  130. package/dist/components/forms/CustomCheckboxesWithImage.d.vue.ts +16 -0
  131. package/dist/components/forms/CustomCheckboxesWithImage.vue +67 -0
  132. package/dist/components/forms/CustomCheckboxesWithImage.vue.d.ts +16 -0
  133. package/dist/components/forms/CustomRadios.d.vue.ts +25 -0
  134. package/dist/components/forms/CustomRadios.vue +69 -0
  135. package/dist/components/forms/CustomRadios.vue.d.ts +25 -0
  136. package/dist/components/forms/CustomRadiosWithIcon.d.vue.ts +28 -0
  137. package/dist/components/forms/CustomRadiosWithIcon.vue +98 -0
  138. package/dist/components/forms/CustomRadiosWithIcon.vue.d.ts +28 -0
  139. package/dist/components/forms/CustomRadiosWithImage.d.vue.ts +35 -0
  140. package/dist/components/forms/CustomRadiosWithImage.vue +69 -0
  141. package/dist/components/forms/CustomRadiosWithImage.vue.d.ts +35 -0
  142. package/dist/components/forms/DatePicker.d.vue.ts +29 -0
  143. package/dist/components/forms/DatePicker.vue +392 -0
  144. package/dist/components/forms/DatePicker.vue.d.ts +29 -0
  145. package/dist/components/forms/DatePickerRange.d.vue.ts +24 -0
  146. package/dist/components/forms/DatePickerRange.vue +127 -0
  147. package/dist/components/forms/DatePickerRange.vue.d.ts +24 -0
  148. package/dist/components/forms/DraggedUploadFile.d.vue.ts +11 -0
  149. package/dist/components/forms/DraggedUploadFile.vue +120 -0
  150. package/dist/components/forms/DraggedUploadFile.vue.d.ts +11 -0
  151. package/dist/components/forms/ImageCardInput.d.vue.ts +35 -0
  152. package/dist/components/forms/ImageCardInput.vue +234 -0
  153. package/dist/components/forms/ImageCardInput.vue.d.ts +35 -0
  154. package/dist/components/forms/InputValidationWrapper.d.vue.ts +26 -0
  155. package/dist/components/forms/InputValidationWrapper.vue +24 -0
  156. package/dist/components/forms/InputValidationWrapper.vue.d.ts +26 -0
  157. package/dist/components/forms/LicensePlateInput.d.vue.ts +21 -0
  158. package/dist/components/forms/LicensePlateInput.vue +175 -0
  159. package/dist/components/forms/LicensePlateInput.vue.d.ts +21 -0
  160. package/dist/components/forms/ManualDate.d.vue.ts +20 -0
  161. package/dist/components/forms/ManualDate.vue +264 -0
  162. package/dist/components/forms/ManualDate.vue.d.ts +20 -0
  163. package/dist/components/forms/MobileInput.d.vue.ts +25 -0
  164. package/dist/components/forms/MobileInput.vue +118 -0
  165. package/dist/components/forms/MobileInput.vue.d.ts +25 -0
  166. package/dist/components/forms/PasswordInput.d.vue.ts +11 -0
  167. package/dist/components/forms/PasswordInput.vue +29 -0
  168. package/dist/components/forms/PasswordInput.vue.d.ts +11 -0
  169. package/dist/components/forms/RangeInput.d.vue.ts +10 -0
  170. package/dist/components/forms/RangeInput.vue +48 -0
  171. package/dist/components/forms/RangeInput.vue.d.ts +10 -0
  172. package/dist/components/forms/Tabs.d.vue.ts +23 -0
  173. package/dist/components/forms/Tabs.vue +35 -0
  174. package/dist/components/forms/Tabs.vue.d.ts +23 -0
  175. package/dist/components/forms/TimePicker.d.vue.ts +18 -0
  176. package/dist/components/forms/TimePicker.vue +370 -0
  177. package/dist/components/forms/TimePicker.vue.d.ts +18 -0
  178. package/dist/components/table/DataTable.d.vue.ts +70 -0
  179. package/dist/components/table/DataTable.vue +361 -0
  180. package/dist/components/table/DataTable.vue.d.ts +70 -0
  181. package/dist/components/table/EditableDataTable.d.vue.ts +21 -0
  182. package/dist/components/table/EditableDataTable.vue +330 -0
  183. package/dist/components/table/EditableDataTable.vue.d.ts +21 -0
  184. package/dist/components/table/EditableDataTableRow.d.vue.ts +20 -0
  185. package/dist/components/table/EditableDataTableRow.vue +253 -0
  186. package/dist/components/table/EditableDataTableRow.vue.d.ts +20 -0
  187. package/dist/components/table/FilterGenerator.d.vue.ts +13 -0
  188. package/dist/components/table/FilterGenerator.vue +231 -0
  189. package/dist/components/table/FilterGenerator.vue.d.ts +13 -0
  190. package/dist/components/table/StaticTable.d.vue.ts +34 -0
  191. package/dist/components/table/StaticTable.vue +152 -0
  192. package/dist/components/table/StaticTable.vue.d.ts +34 -0
  193. package/dist/components/table/TablePagination.d.vue.ts +15 -0
  194. package/dist/components/table/TablePagination.vue +73 -0
  195. package/dist/components/table/TablePagination.vue.d.ts +15 -0
  196. package/dist/composables/useIsMobile.d.ts +1 -0
  197. package/dist/composables/useIsMobile.js +10 -0
  198. package/dist/composables/useIsMobile.mjs +4 -0
  199. package/dist/composables/useTableFilters.d.ts +23 -0
  200. package/dist/composables/useTableFilters.js +197 -0
  201. package/dist/composables/useTableFilters.mjs +184 -0
  202. package/dist/images/avatar.png +0 -0
  203. package/dist/images/sa.svg +1 -0
  204. package/dist/index.d.ts +65 -0
  205. package/dist/index.js +454 -0
  206. package/dist/index.mjs +130 -0
  207. package/dist/lang/ar.json +54 -0
  208. package/dist/lang/en.json +54 -0
  209. package/dist/styles/assets/scss/variables/_template.scss +1 -0
  210. package/dist/styles/assets/scss/variables/_vuetify.scss +1 -0
  211. package/dist/styles/core/base/_components.scss +164 -0
  212. package/dist/styles/core/base/_dark.scss +16 -0
  213. package/dist/styles/core/base/_default-layout-w-vertical-nav.scss +106 -0
  214. package/dist/styles/core/base/_default-layout.scss +16 -0
  215. package/dist/styles/core/base/_index.scss +47 -0
  216. package/dist/styles/core/base/_layouts.scss +63 -0
  217. package/dist/styles/core/base/_misc.scss +20 -0
  218. package/dist/styles/core/base/_mixins.scss +84 -0
  219. package/dist/styles/core/base/_route-transitions.scss +70 -0
  220. package/dist/styles/core/base/_utilities.scss +418 -0
  221. package/dist/styles/core/base/_utils.scss +100 -0
  222. package/dist/styles/core/base/_variables.scss +190 -0
  223. package/dist/styles/core/base/_vertical-nav.scss +264 -0
  224. package/dist/styles/core/base/libs/_perfect-scrollbar.scss +35 -0
  225. package/dist/styles/core/base/libs/vuetify/_index.scss +1 -0
  226. package/dist/styles/core/base/libs/vuetify/_overrides.scss +380 -0
  227. package/dist/styles/core/base/libs/vuetify/_variables.scss +48 -0
  228. package/dist/styles/core/base/placeholders/_default-layout-vertical-nav.scss +48 -0
  229. package/dist/styles/core/base/placeholders/_default-layout.scss +3 -0
  230. package/dist/styles/core/base/placeholders/_index.scss +5 -0
  231. package/dist/styles/core/base/placeholders/_misc.scss +7 -0
  232. package/dist/styles/core/base/placeholders/_nav.scss +26 -0
  233. package/dist/styles/core/base/placeholders/_vertical-nav.scss +84 -0
  234. package/dist/styles/core/base/skins/_bordered.scss +60 -0
  235. package/dist/styles/core/base/skins/_index.scss +1 -0
  236. package/dist/styles/core/template/_components.scss +1035 -0
  237. package/dist/styles/core/template/_default-layout-w-vertical-nav.scss +20 -0
  238. package/dist/styles/core/template/_utilities.scss +20 -0
  239. package/dist/styles/core/template/_variables.scss +67 -0
  240. package/dist/styles/core/template/_vertical-nav.scss +41 -0
  241. package/dist/styles/core/template/index.css +18779 -0
  242. package/dist/styles/core/template/index.scss +15 -0
  243. package/dist/styles/core/template/libs/vuetify/_variables.scss +464 -0
  244. package/dist/styles/core/template/libs/vuetify/index.css +739 -0
  245. package/dist/styles/core/template/libs/vuetify/index.scss +1 -0
  246. package/dist/styles/core/template/pages/misc.css +16 -0
  247. package/dist/styles/core/template/pages/misc.scss +20 -0
  248. package/dist/styles/core/template/placeholders/_default-layout-vertical-nav.scss +9 -0
  249. package/dist/styles/core/template/placeholders/_index.scss +3 -0
  250. package/dist/styles/core/template/placeholders/_nav.scss +15 -0
  251. package/dist/styles/core/template/placeholders/_vertical-nav.scss +18 -0
  252. package/dist/styles/core/template/skins/_bordered.scss +36 -0
  253. package/dist/styles/core/template/skins/_index.scss +1 -0
  254. package/dist/styles/layouts/_classes.scss +3 -0
  255. package/dist/styles/layouts/_dashboard-layout.scss +43 -0
  256. package/dist/styles/layouts/_global.scss +10 -0
  257. package/dist/styles/layouts/_mixins.scss +28 -0
  258. package/dist/styles/layouts/_placeholders.scss +53 -0
  259. package/dist/styles/layouts/_rtl.scss +7 -0
  260. package/dist/styles/layouts/_variables.scss +22 -0
  261. package/dist/styles/layouts/index.css +14 -0
  262. package/dist/styles/layouts/index.scss +2 -0
  263. package/dist/types.d.ts +218 -0
  264. package/dist/utils/apiUrl.d.ts +1 -0
  265. package/dist/utils/apiUrl.js +15 -0
  266. package/dist/utils/apiUrl.mjs +8 -0
  267. package/dist/utils/client.d.ts +9 -0
  268. package/dist/utils/client.js +53 -0
  269. package/dist/utils/client.mjs +39 -0
  270. package/dist/utils/files.d.ts +2 -0
  271. package/dist/utils/files.js +35 -0
  272. package/dist/utils/files.mjs +22 -0
  273. package/dist/utils/formValidation.d.ts +7 -0
  274. package/dist/utils/formValidation.js +20 -0
  275. package/dist/utils/formValidation.mjs +13 -0
  276. package/dist/utils/formatters.d.ts +12 -0
  277. package/dist/utils/formatters.js +84 -0
  278. package/dist/utils/formatters.mjs +56 -0
  279. package/dist/utils/hijriDate.d.ts +58 -0
  280. package/dist/utils/hijriDate.js +168 -0
  281. package/dist/utils/hijriDate.mjs +1951 -0
  282. package/dist/utils/i18n.d.ts +8 -0
  283. package/dist/utils/i18n.js +36 -0
  284. package/dist/utils/i18n.mjs +27 -0
  285. package/dist/utils/index.d.ts +10 -0
  286. package/dist/utils/index.js +115 -0
  287. package/dist/utils/index.mjs +10 -0
  288. package/dist/utils/queryParams.d.ts +4 -0
  289. package/dist/utils/queryParams.js +26 -0
  290. package/dist/utils/queryParams.mjs +18 -0
  291. package/dist/utils/ruleValidator.d.ts +41 -0
  292. package/dist/utils/ruleValidator.js +210 -0
  293. package/dist/utils/ruleValidator.mjs +195 -0
  294. package/dist/utils/toaster.d.ts +12 -0
  295. package/dist/utils/toaster.js +68 -0
  296. package/dist/utils/toaster.mjs +58 -0
  297. package/dist/utils/utils.d.ts +9 -0
  298. package/dist/utils/utils.js +84 -0
  299. package/dist/utils/utils.mjs +67 -0
  300. package/package.json +1 -1
@@ -0,0 +1,392 @@
1
+ <script setup>
2
+ import { DatePicker as VCalendarDatePicker } from "v-calendar";
3
+ import "v-calendar/style.css";
4
+ import { useTheme } from "vuetify";
5
+ import { computed, onBeforeMount, onMounted, onBeforeUnmount, ref, watch, nextTick, useAttrs } from "vue";
6
+ import { useI18n } from "vue-i18n";
7
+ import { VTextField, VLabel } from "vuetify/components";
8
+ import { extractDate, formatDateWithoutTime } from "../../utils/formatters";
9
+ import { generateUniqueId } from "../../utils/utils";
10
+ const { t, locale } = useI18n();
11
+ const { current } = useTheme();
12
+ const props = defineProps({
13
+ modelValue: { type: [String, Date], required: false, default: "" },
14
+ format: { type: String, required: false, default: "DD-MM-YYYY" },
15
+ displayFormat: { type: String, required: false },
16
+ label: { type: String, required: false },
17
+ forcedLabel: { type: String, required: false },
18
+ minDate: { type: [String, Date, null], required: false },
19
+ maxDate: { type: [String, Date, null], required: false },
20
+ placeholder: { type: String, required: false },
21
+ disabled: { type: Boolean, required: false, skipCheck: true },
22
+ errorMessages: { type: [String, Array], required: false, default: "" },
23
+ clearable: { type: Boolean, required: false },
24
+ clearIcon: { type: String, required: false },
25
+ required: { type: Boolean, required: false },
26
+ rules: { type: Array, required: false },
27
+ showToday: { type: Boolean, required: false, default: true },
28
+ hideErrorMessage: { type: Boolean, required: false, default: false },
29
+ inTable: { type: Boolean, required: false }
30
+ });
31
+ const emit = defineEmits(["update:modelValue", "resetSelectedDate"]);
32
+ const popover = ref({
33
+ visibility: "focus",
34
+ placement: "top"
35
+ });
36
+ const inputValue = ref("");
37
+ const isFocus = ref(false);
38
+ const value = ref();
39
+ const guid = generateUniqueId();
40
+ const elementId = computed(() => {
41
+ const attrs = useAttrs();
42
+ const _elementIdToken = attrs.id || attrs.label;
43
+ return _elementIdToken ? `AppTextField-${_elementIdToken}-${guid}` : `datepicker-${_elementIdToken}-${guid}`;
44
+ });
45
+ const langLabel = computed(() => props.label ? t(props.label) : "");
46
+ const placeholder = computed(() => {
47
+ return props.placeholder || (langLabel.value ? t("inputs.placeholder_select", { name: langLabel.value }) : "");
48
+ });
49
+ const localeConfig = computed(() => ({
50
+ id: locale.value,
51
+ firstDayOfWeek: 2,
52
+ masks: { weekdays: "WWW" }
53
+ }));
54
+ const isValueToday = computed(() => formatDateWithoutTime(/* @__PURE__ */ new Date()) === formatDateWithoutTime(value.value));
55
+ const calendarAttributes = computed(() => props.showToday ? [{
56
+ key: "today",
57
+ highlight: {
58
+ fillMode: isValueToday.value ? "solid" : "outline",
59
+ contentStyle: { pointerEvents: isValueToday.value ? "none" : "auto", fontWeight: "600" }
60
+ },
61
+ dates: /* @__PURE__ */ new Date()
62
+ }] : []);
63
+ const selectAttribute = computed(() => {
64
+ return { highlight: { contentStyle: { pointerEvents: "none", fontWeight: "600" } } };
65
+ });
66
+ const resetSelectedDate = () => {
67
+ value.value = "";
68
+ inputValue.value = "";
69
+ emit("resetSelectedDate");
70
+ };
71
+ const formatDate = ($event) => {
72
+ const input = document.getElementById(elementId.value);
73
+ if (!$event) {
74
+ inputValue.value = "";
75
+ input?.focus();
76
+ resetSelectedDate();
77
+ return;
78
+ }
79
+ let cleaned = $event.replace(/[^0-9\\/]/g, "");
80
+ if (cleaned.length >= 2 && cleaned[2] !== "/") {
81
+ cleaned = `${cleaned.slice(0, 2)}/${cleaned.slice(2)}`;
82
+ }
83
+ if (cleaned.length >= 5 && cleaned[5] !== "/") {
84
+ cleaned = `${cleaned.slice(0, 5)}/${cleaned.slice(5)}`;
85
+ }
86
+ const parts = cleaned.split("/");
87
+ if (parts[0] && parseInt(parts[0], 10) > 31) {
88
+ parts[0] = "31";
89
+ }
90
+ if (parts[1] && parseInt(parts[1], 10) > 12) {
91
+ parts[1] = "12";
92
+ }
93
+ if (parts[2] && Number((/* @__PURE__ */ new Date()).getFullYear()) < Number(parts[2])) {
94
+ parts[2] = `${(/* @__PURE__ */ new Date()).getFullYear()}`;
95
+ }
96
+ if (parts[2] && parts[2].length > 4) {
97
+ parts[2] = "";
98
+ }
99
+ inputValue.value = parts.join("/");
100
+ if (parts[2] && parts[2].length > 3 && parts[1] && parts[0]) {
101
+ value.value = new Date(Number(parts[2]), Number(parts[1]) - 1, Number(parts[0]));
102
+ nextTick(() => {
103
+ isFocus.value = true;
104
+ });
105
+ }
106
+ input.value = parts.join("/");
107
+ input?.focus();
108
+ };
109
+ const customPosition = () => {
110
+ const datepickerInputElement = document.querySelector(`#${elementId.value}`);
111
+ const rect = datepickerInputElement?.getBoundingClientRect();
112
+ return {
113
+ top: (rect?.top || 0) + window.pageYOffset + (rect?.height || 100) / 2 + 46 / 2,
114
+ left: (rect?.left || 0) - (props.inTable ? rect?.width : 0)
115
+ };
116
+ };
117
+ const closeMenu = (event) => {
118
+ const vCalendarMenu = document.getElementById(`vc-calendar-container-${elementId.value}`);
119
+ const vCalendarInput = document.getElementById(`${elementId.value}`);
120
+ if (!vCalendarMenu?.contains(event.target) && !vCalendarInput?.contains(event.target)) {
121
+ isFocus.value = false;
122
+ }
123
+ };
124
+ const getFullTextDate = (date, format, hasTime = true) => {
125
+ if (date) {
126
+ const extractedDateParts = extractDate(date, format, hasTime);
127
+ const generatedStandardDate = extractedDateParts ? new Date(+extractedDateParts.year, +extractedDateParts.month - 1, +extractedDateParts.day) : "";
128
+ return generatedStandardDate;
129
+ } else {
130
+ return "";
131
+ }
132
+ };
133
+ const setCalendarValue = (dateValue) => {
134
+ value.value = dateValue;
135
+ inputValue.value = dateValue ? formatDateWithoutTime(dateValue, props.displayFormat) : "";
136
+ isFocus.value = false;
137
+ emit("update:modelValue", value.value ? formatDateWithoutTime(value.value, props.format) : "");
138
+ };
139
+ watch(() => props.modelValue, (val) => {
140
+ if (val) {
141
+ const date = getFullTextDate(val, props.format);
142
+ inputValue.value = formatDateWithoutTime(date, props.displayFormat)?.includes("NaN") ? "" : date ? formatDateWithoutTime(date, props.displayFormat) : "";
143
+ value.value = date;
144
+ } else {
145
+ inputValue.value = "";
146
+ resetSelectedDate();
147
+ }
148
+ }, {
149
+ immediate: true
150
+ });
151
+ onBeforeMount(() => {
152
+ if (props.modelValue) {
153
+ const date = getFullTextDate(props.modelValue, props.format);
154
+ inputValue.value = formatDateWithoutTime(date, props.displayFormat)?.includes("NaN") ? "" : date ? formatDateWithoutTime(date, props.displayFormat) : "";
155
+ }
156
+ });
157
+ onMounted(() => {
158
+ window.addEventListener("mouseup", closeMenu);
159
+ const observer = new MutationObserver((mutations) => {
160
+ mutations.forEach((mutation) => {
161
+ if (mutation && mutation.addedNodes) {
162
+ mutation.addedNodes.forEach((elm) => {
163
+ if (elm && typeof elm?.className === "string" && elm?.className?.includes("vc-nav-popover-container")) {
164
+ elm.addEventListener("click", (e) => {
165
+ if (e?.target?.classList?.contains("is-active")) {
166
+ document.body.click();
167
+ }
168
+ });
169
+ }
170
+ });
171
+ }
172
+ });
173
+ });
174
+ observer.observe(document.body, {
175
+ childList: true,
176
+ subtree: true
177
+ });
178
+ });
179
+ onBeforeUnmount(() => {
180
+ window.removeEventListener("mouseup", closeMenu);
181
+ });
182
+ </script>
183
+
184
+ <template>
185
+ <div class="d-flex flex-column w-100">
186
+ <VLabel
187
+ v-if="forcedLabel || label"
188
+ class="text-body-2 text-high-emphasis mb-2"
189
+ :text="forcedLabel || langLabel"
190
+ />
191
+ <div dir="ltr" class="h-100">
192
+ <div :dir="locale === 'en' ? 'ltr' : 'rtl'" class="d-flex justify-center align-center gap-2 h-100">
193
+ <VTextField
194
+ v-bind="{
195
+ ...$attrs
196
+ }"
197
+ :id="elementId"
198
+ :model-value="inputValue"
199
+ :placeholder="placeholder"
200
+ :append-inner-icon="$attrs['append-inner-icon'] || 'tabler-calendar-event'"
201
+ :disabled="disabled"
202
+ :clearable="clearable"
203
+ :clear-icon="clearIcon"
204
+ :rules="rules"
205
+ :hide-details="hideErrorMessage"
206
+ :error-messages="errorMessages"
207
+ style="padding-block: 0.125rem;"
208
+ autocomplete="off"
209
+ @update:model-value="formatDate"
210
+ @click:clear="resetSelectedDate"
211
+ @focus="isFocus = true"
212
+ @click="isFocus = true"
213
+ >
214
+ <template #details>
215
+ <span class="app-h-1" />
216
+ </template>
217
+ </VTextField>
218
+ </div>
219
+ <Teleport to="body">
220
+ <div
221
+ v-show="isFocus"
222
+ :id="`vc-calendar-container-${elementId}`"
223
+ class="position-absolute"
224
+ style="z-index: 1005;"
225
+ dir="ltr"
226
+ :style="{
227
+ left: `${customPosition().left - 20}px`,
228
+ top: `${customPosition().top + 10}px`
229
+ }"
230
+ >
231
+ <div class="position-relative">
232
+ <div class="vc-custom-arrow" />
233
+ <VCalendarDatePicker
234
+ :model-value="value"
235
+ dir="ltr"
236
+ class="vc-calender-custom"
237
+ :popover="popover"
238
+ :locale="localeConfig"
239
+ :attributes="calendarAttributes"
240
+ :select-attribute="selectAttribute"
241
+ :min-date="minDate instanceof Date ? minDate : typeof minDate === 'string' ? getFullTextDate(minDate, props.format, false) : null"
242
+ :max-date="maxDate instanceof Date ? maxDate : typeof maxDate === 'string' ? getFullTextDate(maxDate, props.format, false) : null"
243
+ :is-required="required"
244
+ :is-dark="current.dark"
245
+ inline
246
+ @update:model-value="setCalendarValue"
247
+ />
248
+ </div>
249
+ </div>
250
+ </Teleport>
251
+ </div>
252
+ </div>
253
+ </template>
254
+
255
+ <style scoped>
256
+ :deep(.v-input__control) .v-field__input {
257
+ padding-inline-start: 14px !important;
258
+ }
259
+ :deep(.v-input__control) .v-field__input input {
260
+ padding-inline-start: 0px !important;
261
+ font-size: 13px !important;
262
+ }
263
+ :deep(.v-input__control) .v-field .v-field__clearable {
264
+ inset-inline-start: -4px !important;
265
+ }
266
+
267
+ .app-border-primary {
268
+ border-color: rgb(var(--v-theme-primary)) !important;
269
+ }
270
+
271
+ :deep(.vc-blue) {
272
+ --vc-accent-50: #fdf7e6;
273
+ --vc-accent-100: #fcefbf;
274
+ --vc-accent-200: #fbe791;
275
+ --vc-accent-300: #fadd62;
276
+ --vc-accent-400: #fdc930;
277
+ --vc-accent-500: #fdc930;
278
+ --vc-accent-600: #fdc930;
279
+ --vc-accent-700: #fdc930;
280
+ --vc-accent-800: #fdc930;
281
+ --vc-accent-900: #fdc930;
282
+ color: #000 !important;
283
+ }
284
+
285
+ .vc-calender-custom {
286
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
287
+ }
288
+
289
+ :deep(.vc-nav-item.is-active) {
290
+ color: #000 !important;
291
+ }
292
+
293
+ :deep(.vc-monthly) .is-not-in-month * {
294
+ color: rgb(var(--v-theme-gray-600));
295
+ opacity: 1;
296
+ pointer-events: all !important;
297
+ }
298
+
299
+ :deep(.vc-light), :deep(.vc-dark) {
300
+ --vc-focus-ring: none !important;
301
+ }
302
+
303
+ :deep(.vc-title) span {
304
+ font-weight: 500 !important;
305
+ font-size: 16px !important;
306
+ }
307
+
308
+ :deep(.vc-nav-title) {
309
+ font-weight: 500 !important;
310
+ font-size: 14px !important;
311
+ }
312
+
313
+ :deep(.vc-weekday), :deep(.vc-nav-item) {
314
+ font-weight: 500 !important;
315
+ }
316
+
317
+ :deep(.vc-disabled) {
318
+ color: rgb(var(--v-theme-gray-600)) !important;
319
+ opacity: 0.5 !important;
320
+ cursor: not-allowed;
321
+ }
322
+
323
+ :deep(.vc-popover-content) {
324
+ min-width: 200px !important;
325
+ }
326
+
327
+ :deep(.vc-nav-item) {
328
+ width: auto !important;
329
+ padding-left: 2px !important;
330
+ padding-right: 2px !important;
331
+ display: flex;
332
+ align-items: center;
333
+ justify-content: center;
334
+ line-height: unset;
335
+ }
336
+
337
+ :deep(.vc-nav-item.is-current) {
338
+ background-color: transparent !important;
339
+ color: rgb(var(--v-theme-on-surface));
340
+ font-weight: 400 !important;
341
+ border: 2px solid rgb(var(--v-theme-primary)) !important;
342
+ }
343
+
344
+ :deep(.vc-arrow), :deep(.vc-weekday) {
345
+ color: rgb(var(--v-theme-on-surface));
346
+ }
347
+
348
+ :deep(.vc-bordered) {
349
+ border-color: rgba(var(--v-theme-gray-300));
350
+ }
351
+
352
+ :deep(.vc-custom-arrow) {
353
+ width: 15px;
354
+ height: 15px;
355
+ background: rgba(var(--v-theme-surface));
356
+ position: absolute;
357
+ z-index: 10;
358
+ border-top: 1px solid rgba(var(--v-theme-gray-300));
359
+ border-left: 1px solid rgba(var(--v-theme-gray-300));
360
+ left: 50%;
361
+ top: -7px;
362
+ transform: translateX(-50%) rotate(45deg);
363
+ }
364
+
365
+ :deep(.vc-popover-content-wrapper[data-popper-placement]) {
366
+ width: 100% !important;
367
+ height: 100% !important;
368
+ top: 0 !important;
369
+ transform: translate(0) !important;
370
+ }
371
+ :deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-nav-container {
372
+ margin-top: 2px;
373
+ }
374
+ :deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-popover-content {
375
+ background-color: rgba(var(--v-theme-surface));
376
+ margin-top: 0px !important;
377
+ width: 100% !important;
378
+ height: 100% !important;
379
+ }
380
+ :deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-popover-content .vc-nav-items {
381
+ padding: 15px;
382
+ gap: 20px;
383
+ }
384
+
385
+ :deep(.vc-custom-arrow) {
386
+ display: none !important;
387
+ }
388
+ </style>
389
+
390
+ <style>
391
+ .vc-calender-custom{box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)!important}
392
+ </style>
@@ -0,0 +1,29 @@
1
+ import 'v-calendar/style.css';
2
+ type __VLS_Props = {
3
+ modelValue?: string | Date;
4
+ format?: string;
5
+ displayFormat?: string;
6
+ label?: string;
7
+ forcedLabel?: string;
8
+ minDate?: string | Date | null;
9
+ maxDate?: string | Date | null;
10
+ placeholder?: string;
11
+ disabled?: boolean | undefined;
12
+ errorMessages?: string | string[];
13
+ clearable?: boolean;
14
+ clearIcon?: string;
15
+ required?: boolean;
16
+ rules?: ((value: unknown) => typeof value | string)[];
17
+ showToday?: boolean;
18
+ hideErrorMessage?: boolean;
19
+ inTable?: boolean;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
+ "update:modelValue": (value: string | Date) => any;
23
+ resetSelectedDate: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ "onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
26
+ onResetSelectedDate?: (() => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ modelValue: [Date | string, Date | string] | [] | undefined;
3
+ waitTo?: boolean;
4
+ label?: string;
5
+ rules?: ((value: unknown) => typeof value | string)[];
6
+ fromErrorMessages?: string;
7
+ toErrorMessages?: string;
8
+ fromLabel?: string;
9
+ toLabel?: string;
10
+ fromPlaceholder?: string;
11
+ toPlaceholder?: string;
12
+ clearable?: boolean;
13
+ fromMinDate?: Date | null;
14
+ toMinDate?: Date | null;
15
+ fromMaxDate?: Date | null;
16
+ toMaxDate?: Date | null;
17
+ };
18
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ "update:modelValue": (value: [string | Date | null, string | Date | null] | null) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: [string | Date | null, string | Date | null] | null) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -0,0 +1,127 @@
1
+ <script setup>
2
+ import { computed, ref, watch } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { VCol } from "vuetify/components";
5
+ import { useIsMobile } from "../../composables/useIsMobile";
6
+ import DatePicker from "./DatePicker.vue";
7
+ const { t } = useI18n();
8
+ const props = defineProps({
9
+ modelValue: { type: null, required: true },
10
+ waitTo: { type: Boolean, required: false },
11
+ label: { type: String, required: false },
12
+ rules: { type: Array, required: false },
13
+ fromErrorMessages: { type: String, required: false },
14
+ toErrorMessages: { type: String, required: false },
15
+ fromLabel: { type: String, required: false },
16
+ toLabel: { type: String, required: false },
17
+ fromPlaceholder: { type: String, required: false },
18
+ toPlaceholder: { type: String, required: false },
19
+ clearable: { type: Boolean, required: false },
20
+ fromMinDate: { type: [Date, null], required: false },
21
+ toMinDate: { type: [Date, null], required: false },
22
+ fromMaxDate: { type: [Date, null], required: false },
23
+ toMaxDate: { type: [Date, null], required: false }
24
+ });
25
+ const emits = defineEmits(["update:modelValue"]);
26
+ const from = ref(void 0);
27
+ const to = ref(void 0);
28
+ watch(
29
+ () => props.modelValue,
30
+ (value) => {
31
+ if (!value || value.length === 0) {
32
+ from.value = void 0;
33
+ to.value = void 0;
34
+ }
35
+ if (!Array.isArray(value)) {
36
+ return;
37
+ }
38
+ if (value?.[0] !== from.value && value?.[0] != "" && value?.[0] !== void 0 && value[0] !== null) {
39
+ from.value = value?.[0];
40
+ }
41
+ if (value?.[1] !== to.value && value?.[1] != "" && value?.[1] !== void 0 && value[1] !== null) {
42
+ to.value = value?.[1];
43
+ }
44
+ },
45
+ { immediate: true }
46
+ );
47
+ const onInput = () => {
48
+ const newValue = [
49
+ from.value || null,
50
+ to.value || null
51
+ ];
52
+ emits("update:modelValue", newValue);
53
+ };
54
+ const disableFrom = computed(() => props.waitTo ? !from.value : false);
55
+ const maxToDate = computed(() => props.toMaxDate || /* @__PURE__ */ new Date());
56
+ const maxFromDate = computed(() => props.fromMaxDate || to.value || /* @__PURE__ */ new Date());
57
+ const resetSelectedDate = (type) => {
58
+ if (type === "to") {
59
+ to.value = void 0;
60
+ }
61
+ if (type === "from") {
62
+ from.value = void 0;
63
+ }
64
+ if (!from.value && !to.value) {
65
+ emits("update:modelValue", null);
66
+ } else {
67
+ onInput();
68
+ }
69
+ };
70
+ const label = (type) => {
71
+ const baseLabel = t(props.label || "date");
72
+ if (type === "from") {
73
+ return props.fromLabel || t("inputs.from", { name: baseLabel });
74
+ }
75
+ if (type === "to") {
76
+ return props.toLabel || t("inputs.to", { name: baseLabel });
77
+ }
78
+ };
79
+ </script>
80
+
81
+ <template>
82
+ <VCol cols="12" sm="3" class="py-0">
83
+ <DatePicker
84
+ id="from"
85
+ v-model="from"
86
+ v-bind="{
87
+ ...$attrs,
88
+ }"
89
+ show-today
90
+ :rules="rules"
91
+ :clearable="clearable"
92
+ :error-messages="fromErrorMessages"
93
+ :min-date="fromMinDate"
94
+ :max-date="maxFromDate"
95
+ display-format="DD/MM/YYYY"
96
+ :label="props.label"
97
+ :forced-label="label('from')"
98
+ :placeholder="props.fromPlaceholder || t('inputs.from')"
99
+ :hide-error-message="useIsMobile().value"
100
+ @update:model-value="onInput"
101
+ @reset-selected-date="resetSelectedDate('from')"
102
+ />
103
+ </VCol>
104
+ <VCol cols="12" sm="3" class="py-0">
105
+ <DatePicker
106
+ id="to"
107
+ v-model="to"
108
+ v-bind="{
109
+ ...$attrs,
110
+ }"
111
+ show-today
112
+ :rules="rules"
113
+ :clearable="clearable"
114
+ :error-messages="toErrorMessages"
115
+ :min-date="from || toMinDate"
116
+ :max-date="maxToDate"
117
+ :disabled="disableFrom"
118
+ display-format="DD/MM/YYYY"
119
+ :label="props.label"
120
+ :forced-label="label('to')"
121
+ :placeholder="t('inputs.to')"
122
+ :hide-error-message="useIsMobile().value"
123
+ @update:model-value="onInput"
124
+ @reset-selected-date="resetSelectedDate('to')"
125
+ />
126
+ </VCol>
127
+ </template>
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ modelValue: [Date | string, Date | string] | [] | undefined;
3
+ waitTo?: boolean;
4
+ label?: string;
5
+ rules?: ((value: unknown) => typeof value | string)[];
6
+ fromErrorMessages?: string;
7
+ toErrorMessages?: string;
8
+ fromLabel?: string;
9
+ toLabel?: string;
10
+ fromPlaceholder?: string;
11
+ toPlaceholder?: string;
12
+ clearable?: boolean;
13
+ fromMinDate?: Date | null;
14
+ toMinDate?: Date | null;
15
+ fromMaxDate?: Date | null;
16
+ toMaxDate?: Date | null;
17
+ };
18
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ "update:modelValue": (value: [string | Date | null, string | Date | null] | null) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: [string | Date | null, string | Date | null] | null) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ modelValue: FileList[];
3
+ loading?: boolean;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ "update:model-value": (value: FileList[]) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ "onUpdate:model-value"?: ((value: FileList[]) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;