@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,8 @@
1
+ export declare const i18n: () => import("vue-i18n").I18n<{
2
+ en: any;
3
+ ar: any;
4
+ }, {}, {}, string, false>;
5
+ export declare const createI18nInstance: (messages: object) => import("vue-i18n").I18n<{
6
+ en: any;
7
+ ar: any;
8
+ }, {}, {}, string, false>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.i18n = exports.createI18nInstance = void 0;
7
+ var _vueI18n = require("vue-i18n");
8
+ var _en = _interopRequireDefault(require("../lang/en.json"));
9
+ var _ar = _interopRequireDefault(require("../lang/ar.json"));
10
+ var _utils = require("./utils");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const defaultMessages = {
13
+ en: _en.default,
14
+ ar: _ar.default
15
+ };
16
+ let _i18nInstance = (0, _vueI18n.createI18n)({
17
+ legacy: false,
18
+ locale: "ar",
19
+ fallbackLocale: "ar",
20
+ globalInjection: true,
21
+ messages: defaultMessages
22
+ });
23
+ const i18n = () => _i18nInstance;
24
+ exports.i18n = i18n;
25
+ const createI18nInstance = messages => {
26
+ const mergedMessages = (0, _utils.mergeDeep)(defaultMessages, messages);
27
+ _i18nInstance = (0, _vueI18n.createI18n)({
28
+ legacy: false,
29
+ locale: "ar",
30
+ fallbackLocale: "ar",
31
+ globalInjection: true,
32
+ messages: mergedMessages
33
+ });
34
+ return _i18nInstance;
35
+ };
36
+ exports.createI18nInstance = createI18nInstance;
@@ -0,0 +1,27 @@
1
+ import { createI18n } from "vue-i18n";
2
+ import en from "../lang/en.json";
3
+ import ar from "../lang/ar.json";
4
+ import { mergeDeep } from "./utils.mjs";
5
+ const defaultMessages = {
6
+ en,
7
+ ar
8
+ };
9
+ let _i18nInstance = createI18n({
10
+ legacy: false,
11
+ locale: "ar",
12
+ fallbackLocale: "ar",
13
+ globalInjection: true,
14
+ messages: defaultMessages
15
+ });
16
+ export const i18n = () => _i18nInstance;
17
+ export const createI18nInstance = (messages) => {
18
+ const mergedMessages = mergeDeep(defaultMessages, messages);
19
+ _i18nInstance = createI18n({
20
+ legacy: false,
21
+ locale: "ar",
22
+ fallbackLocale: "ar",
23
+ globalInjection: true,
24
+ messages: mergedMessages
25
+ });
26
+ return _i18nInstance;
27
+ };
@@ -0,0 +1,10 @@
1
+ export * from './apiUrl';
2
+ export * from './client';
3
+ export * from './files';
4
+ export * from './formValidation';
5
+ export * from './formatters';
6
+ export * from './queryParams';
7
+ export * from './ruleValidator';
8
+ export * from './toaster';
9
+ export * from './i18n';
10
+ export * from './utils';
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _apiUrl = require("./apiUrl");
7
+ Object.keys(_apiUrl).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _apiUrl[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _apiUrl[key];
14
+ }
15
+ });
16
+ });
17
+ var _client = require("./client");
18
+ Object.keys(_client).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _client[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _client[key];
25
+ }
26
+ });
27
+ });
28
+ var _files = require("./files");
29
+ Object.keys(_files).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _files[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _files[key];
36
+ }
37
+ });
38
+ });
39
+ var _formValidation = require("./formValidation");
40
+ Object.keys(_formValidation).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _formValidation[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _formValidation[key];
47
+ }
48
+ });
49
+ });
50
+ var _formatters = require("./formatters");
51
+ Object.keys(_formatters).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _formatters[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _formatters[key];
58
+ }
59
+ });
60
+ });
61
+ var _queryParams = require("./queryParams");
62
+ Object.keys(_queryParams).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _queryParams[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _queryParams[key];
69
+ }
70
+ });
71
+ });
72
+ var _ruleValidator = require("./ruleValidator");
73
+ Object.keys(_ruleValidator).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _ruleValidator[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _ruleValidator[key];
80
+ }
81
+ });
82
+ });
83
+ var _toaster = require("./toaster");
84
+ Object.keys(_toaster).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _toaster[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _toaster[key];
91
+ }
92
+ });
93
+ });
94
+ var _i18n = require("./i18n");
95
+ Object.keys(_i18n).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _i18n[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _i18n[key];
102
+ }
103
+ });
104
+ });
105
+ var _utils = require("./utils");
106
+ Object.keys(_utils).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _utils[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _utils[key];
113
+ }
114
+ });
115
+ });
@@ -0,0 +1,10 @@
1
+ export * from "./apiUrl.mjs";
2
+ export * from "./client.mjs";
3
+ export * from "./files.mjs";
4
+ export * from "./formValidation.mjs";
5
+ export * from "./formatters.mjs";
6
+ export * from "./queryParams.mjs";
7
+ export * from "./ruleValidator.mjs";
8
+ export * from "./toaster.mjs";
9
+ export * from "./i18n.mjs";
10
+ export * from "./utils.mjs";
@@ -0,0 +1,4 @@
1
+ import type { RouteLocationNormalizedLoaded } from 'vue-router';
2
+ import type { Params } from '../types';
3
+ export declare const buildQueryString: (params: Params | undefined) => string;
4
+ export declare const decodeRouteParams: (to?: RouteLocationNormalizedLoaded) => URLSearchParams;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.decodeRouteParams = exports.buildQueryString = void 0;
7
+ var _vueRouter = require("vue-router");
8
+ const buildQueryString = params => {
9
+ const inputParams = params || {};
10
+ return Object.entries(inputParams).filter(([key, value]) => {
11
+ return key && value !== null && value !== void 0 && (Array.isArray(value) && value.length !== 0 || String(value).trim().length > 0);
12
+ }).map(([key, value]) => {
13
+ if (Array.isArray(value)) {
14
+ return value.map((subValue, index) => subValue ? `${key}[${index}]=${subValue}` : null).join("&");
15
+ }
16
+ return `${key}=${value}`;
17
+ }).join("&");
18
+ };
19
+ exports.buildQueryString = buildQueryString;
20
+ const decodeRouteParams = to => {
21
+ const route = to || (0, _vueRouter.useRoute)();
22
+ const path = decodeURIComponent(route.fullPath.replace(route.path, ""));
23
+ const params = new URLSearchParams(decodeURIComponent(path));
24
+ return params;
25
+ };
26
+ exports.decodeRouteParams = decodeRouteParams;
@@ -0,0 +1,18 @@
1
+ import { useRoute } from "vue-router";
2
+ export const buildQueryString = (params) => {
3
+ const inputParams = params || {};
4
+ return Object.entries(inputParams).filter(([key, value]) => {
5
+ return key && value !== null && value !== void 0 && (Array.isArray(value) && value.length !== 0 || String(value).trim().length > 0);
6
+ }).map(([key, value]) => {
7
+ if (Array.isArray(value)) {
8
+ return value.map((subValue, index) => subValue ? `${key}[${index}]=${subValue}` : null).join("&");
9
+ }
10
+ return `${key}=${value}`;
11
+ }).join("&");
12
+ };
13
+ export const decodeRouteParams = (to) => {
14
+ const route = to || useRoute();
15
+ const path = decodeURIComponent(route.fullPath.replace(route.path, ""));
16
+ const params = new URLSearchParams(decodeURIComponent(path));
17
+ return params;
18
+ };
@@ -0,0 +1,41 @@
1
+ import type { VForm } from 'vuetify/components/VForm';
2
+ export declare const ruleValidator: () => {
3
+ fileValidator: (file: File | undefined, maxSizeInMB: number, types: string[]) => boolean | undefined;
4
+ requiredValidator: (value: unknown) => string | true;
5
+ requiredLocationValidator: (locations: Array<{
6
+ name?: string;
7
+ address?: string;
8
+ lat?: number | null;
9
+ lng?: number | null;
10
+ }> | {
11
+ name?: string;
12
+ address?: string;
13
+ lat?: number | null;
14
+ lng?: number | null;
15
+ }) => string | true;
16
+ emailValidator: (value: unknown) => string | true;
17
+ alphaValidator: (value: unknown) => string | true;
18
+ alphaDashValidator: (value: unknown) => string | true;
19
+ alphaWithNumberValidator: (value: unknown) => string | true;
20
+ betweenValidator: (value: unknown, min: number, max: number) => string | true;
21
+ integerValidator: (value: unknown) => string | true;
22
+ numberValidator: (value: unknown) => string | true;
23
+ confirmedValidator: (value: string, target: string) => string | true;
24
+ urlValidator: (value: unknown) => string | true;
25
+ lengthValidator: (value: unknown, length: number) => string | true;
26
+ ibanValidator: (value: unknown) => string | true;
27
+ dateValidator: (value: unknown) => string | true;
28
+ regexValidator: (value: string, regex: RegExp, message?: string) => string | true;
29
+ idNumberValidator: (value: string | number | null) => string | undefined;
30
+ requiredManualDateValidator: (value: {
31
+ year?: string;
32
+ month?: string;
33
+ day?: string;
34
+ }) => string | true;
35
+ requiredPlateValidator: (value: string[] | null | undefined) => string | true;
36
+ };
37
+ export declare const useFormValidation: () => {
38
+ validateAndScroll: (refVForm: VForm | undefined) => Promise<boolean>;
39
+ validationType: import("vue").Ref<"input" | "submit", "input" | "submit">;
40
+ scrollToError: () => Promise<void>;
41
+ };
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useFormValidation = exports.ruleValidator = void 0;
7
+ var _vue = require("vue");
8
+ var _vueI18n = require("vue-i18n");
9
+ var _toaster = require("./toaster");
10
+ var _utils = require("./utils");
11
+ const ruleValidator = () => {
12
+ const {
13
+ t
14
+ } = (0, _vueI18n.useI18n)();
15
+ const requiredValidator = value => {
16
+ if ((0, _utils.isNullOrUndefined)(value) || (0, _utils.isEmptyArray)(value) || value === false) {
17
+ return t("validation.required");
18
+ }
19
+ return !!String(value).trim().length || t("validation.required");
20
+ };
21
+ const requiredLocationValidator = locations => {
22
+ const locationArray = Array.isArray(locations) ? locations : [locations];
23
+ if (!locationArray || locationArray.length === 0) {
24
+ return t("validation.required");
25
+ }
26
+ for (const location of locationArray) {
27
+ if (!location || !location.address || !String(location.address).trim() || location.lat === null || typeof location.lat !== "number" || location.lng === null || typeof location.lng !== "number") {
28
+ return t("validation.required");
29
+ }
30
+ }
31
+ return true;
32
+ };
33
+ const ibanValidator = value => {
34
+ if ((0, _utils.isNullOrUndefined)(value) || (0, _utils.isEmptyArray)(value) || value === false || String(value).length !== 24) {
35
+ return t("validation.iban");
36
+ }
37
+ return !!String(value).trim().length || t("validation.iban");
38
+ };
39
+ const idNumberValidator = value => {
40
+ const str = value?.toString() || "";
41
+ const validStarts = ["1", "2", "3", "4"];
42
+ if (str.length !== 10 || !validStarts.includes(str[0])) {
43
+ return t("validation.invalid");
44
+ }
45
+ };
46
+ const requiredManualDateValidator = value => {
47
+ if ((0, _utils.isEmpty)(value?.day) || (0, _utils.isEmpty)(value?.month) || (0, _utils.isEmpty)(value?.year)) {
48
+ return t("validation.required");
49
+ }
50
+ return true;
51
+ };
52
+ const emailValidator = value => {
53
+ if ((0, _utils.isEmpty)(value)) {
54
+ return true;
55
+ }
56
+ const re = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
57
+ if (Array.isArray(value)) {
58
+ return value.every(val => re.test(String(val))) || t("validation.email");
59
+ }
60
+ return re.test(String(value)) || t("validation.email");
61
+ };
62
+ const confirmedValidator = (value, target) => value === target || t("validation.confirmed");
63
+ const betweenValidator = (value, min, max) => {
64
+ const valueAsNumber = Number(value);
65
+ return Number(min) <= valueAsNumber && Number(max) >= valueAsNumber || t("validation.between", {
66
+ min,
67
+ max
68
+ });
69
+ };
70
+ const integerValidator = value => {
71
+ if ((0, _utils.isEmpty)(value)) {
72
+ return true;
73
+ }
74
+ if (Array.isArray(value)) {
75
+ return value.every(val => /^-?[0-9]+$/.test(String(val))) || t("validation.integer");
76
+ }
77
+ return /^-?[0-9]+$/.test(String(value)) || t("validation.integer");
78
+ };
79
+ const numberValidator = value => {
80
+ if ((0, _utils.isEmpty)(value)) {
81
+ return true;
82
+ }
83
+ return /^\d+(\.\d+)?$/.test(String(value)) || t("validation.number");
84
+ };
85
+ const alphaValidator = value => {
86
+ if ((0, _utils.isEmpty)(value)) {
87
+ return true;
88
+ }
89
+ return /^[A-Za-z\u0600-\u06FF\s]*$/i.test(String(value)) || t("validation.alphabetic");
90
+ };
91
+ const alphaWithNumberValidator = value => {
92
+ if ((0, _utils.isEmpty)(value)) {
93
+ return true;
94
+ }
95
+ return /^[A-Za-z\u0600-\u06FF0-9\s]*$/.test(String(value)) || t("validation.alphabetic");
96
+ };
97
+ const urlValidator = value => {
98
+ if ((0, _utils.isEmpty)(value)) {
99
+ return true;
100
+ }
101
+ const re = /^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}[.]?/;
102
+ return re.test(String(value)) || t("validation.url");
103
+ };
104
+ const lengthValidator = (value, length) => {
105
+ if ((0, _utils.isEmpty)(value)) {
106
+ return true;
107
+ }
108
+ return String(value).length === length || t("validation.length", {
109
+ length
110
+ });
111
+ };
112
+ const alphaDashValidator = value => {
113
+ if ((0, _utils.isEmpty)(value)) {
114
+ return true;
115
+ }
116
+ const valueAsString = String(value);
117
+ return /^[0-9A-Z_-]*$/i.test(valueAsString) || t("validation.alpha_dash");
118
+ };
119
+ const fileValidator = (file, maxSizeInMB, types) => {
120
+ if (!file) {
121
+ return false;
122
+ }
123
+ if (file.size > maxSizeInMB * 1024 * 1024) {
124
+ (0, _toaster.toaster)().error(t("validation.file_size_limit_exceeded", {
125
+ size: maxSizeInMB
126
+ }));
127
+ return;
128
+ }
129
+ if (!types.includes(file.type)) {
130
+ (0, _toaster.toaster)().error(t("validation.file_type_not_allowed", {
131
+ types: types.map(type => type.split("/")[1]).join(", ")
132
+ }));
133
+ return;
134
+ }
135
+ return true;
136
+ };
137
+ const requiredPlateValidator = value => {
138
+ if (!value || !value?.every(val => val !== "")) {
139
+ return t("validation.required");
140
+ }
141
+ return true;
142
+ };
143
+ const dateValidator = value => {
144
+ if ((0, _utils.isEmpty)(value)) {
145
+ return true;
146
+ }
147
+ const dateString = String(value);
148
+ const datePattern = /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(\d{4})$/;
149
+ if (!datePattern.test(dateString)) {
150
+ return t("validation.date", {
151
+ format: "DD/MM/YYYY"
152
+ });
153
+ }
154
+ return true;
155
+ };
156
+ const regexValidator = (value, regex, message) => {
157
+ return regex.test(value) || message || t("validation.invalid");
158
+ };
159
+ return {
160
+ fileValidator,
161
+ requiredValidator,
162
+ requiredLocationValidator,
163
+ emailValidator,
164
+ alphaValidator,
165
+ alphaDashValidator,
166
+ alphaWithNumberValidator,
167
+ betweenValidator,
168
+ integerValidator,
169
+ numberValidator,
170
+ confirmedValidator,
171
+ urlValidator,
172
+ lengthValidator,
173
+ ibanValidator,
174
+ dateValidator,
175
+ regexValidator,
176
+ idNumberValidator,
177
+ requiredManualDateValidator,
178
+ requiredPlateValidator
179
+ };
180
+ };
181
+ exports.ruleValidator = ruleValidator;
182
+ const useFormValidation = () => {
183
+ const validationType = (0, _vue.ref)("submit");
184
+ const validateAndScroll = async refVForm => {
185
+ const isValid = await refVForm?.validate();
186
+ await scrollToError();
187
+ if (isValid?.valid === false) {
188
+ await scrollToError();
189
+ validationType.value = "input";
190
+ return false;
191
+ }
192
+ return true;
193
+ };
194
+ const scrollToError = async () => {
195
+ validationType.value = "input";
196
+ await (0, _vue.nextTick)(() => {
197
+ const el = document.querySelector(".v-messages__message:first-of-type");
198
+ el?.scrollIntoView({
199
+ behavior: "smooth",
200
+ block: "center"
201
+ });
202
+ });
203
+ };
204
+ return {
205
+ validateAndScroll,
206
+ validationType,
207
+ scrollToError
208
+ };
209
+ };
210
+ exports.useFormValidation = useFormValidation;