@amirjalili1374/ui-kit 1.2.0 → 1.2.1

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 (141) hide show
  1. package/README.md +10 -10
  2. package/package.json +1 -2
  3. package/src/assets/fonts/A Massir Spray.ttf +0 -0
  4. package/src/assets/fonts/BYekan.ttf +0 -0
  5. package/src/assets/fonts/BYekan.woff +0 -0
  6. package/src/assets/fonts/BYekan.woff2 +0 -0
  7. package/src/assets/fonts/Dima Shekasteh 2 Free.ttf +0 -0
  8. package/src/assets/fonts/Dima Shekasteh Free Regular.ttf +0 -0
  9. package/src/assets/fonts/IRANSansWeb.ts +0 -1
  10. package/src/assets/fonts/IRANSansWeb.ttf +0 -0
  11. package/src/assets/fonts/IRANSansXBlack.ttf +0 -0
  12. package/src/assets/fonts/IRANSansXBold.ttf +0 -0
  13. package/src/assets/fonts/IRANSansXDemiBold.ttf +0 -0
  14. package/src/assets/fonts/IRANSansXExtraBold.ttf +0 -0
  15. package/src/assets/fonts/IRANSansXLight.ttf +0 -0
  16. package/src/assets/fonts/IRANSansXMedium.ttf +0 -0
  17. package/src/assets/fonts/IRANSansXRegular.ttf +0 -0
  18. package/src/assets/fonts/IRANSansXThin.ttf +0 -0
  19. package/src/assets/fonts/IRANSansXUltraLight.ttf +0 -0
  20. package/src/assets/fonts/IranNastaliq.ttf +0 -0
  21. package/src/assets/fonts/Vazir-Medium-FD.ttf +0 -0
  22. package/src/assets/fonts/Vazir-Medium-FD.woff +0 -0
  23. package/src/assets/fonts/Vazir-Medium-FD.woff2 +0 -0
  24. package/src/assets/fonts/Vazir-Regular-FD.eot +0 -0
  25. package/src/assets/fonts/kalamehBold.woff +0 -0
  26. package/src/assets/fonts/kalamehBold.woff2 +0 -0
  27. package/src/assets/fonts/kalamehHeavy.woff +0 -0
  28. package/src/assets/fonts/kalamehHeavy.woff2 +0 -0
  29. package/src/assets/fonts/kalamehLight.woff +0 -0
  30. package/src/assets/fonts/kalamehLight.woff2 +0 -0
  31. package/src/assets/fonts/kalamehRegular.woff +0 -0
  32. package/src/assets/fonts/kalamehRegular.woff2 +0 -0
  33. package/src/assets/images/auth/social-google.svg +0 -6
  34. package/src/assets/images/favicon.svg +0 -18
  35. package/src/assets/images/icons/icon-card.svg +0 -5
  36. package/src/assets/images/logos/logo.svg +0 -12
  37. package/src/assets/images/logos/logolight.svg +0 -12
  38. package/src/assets/images/maintenance/img-error-bg.svg +0 -34
  39. package/src/assets/images/maintenance/img-error-blue.svg +0 -43
  40. package/src/assets/images/maintenance/img-error-purple.svg +0 -42
  41. package/src/assets/images/maintenance/img-error-text.svg +0 -27
  42. package/src/assets/images/profile/profile-user-account-svgrepo-com.svg +0 -12
  43. package/src/assets/images/profile/user-round.svg +0 -15
  44. package/src/assets/images/template/template-01.ts +0 -1
  45. package/src/assets/images/vectors/colorized-bg.svg +0 -40
  46. package/src/assets/images/vectors/logo_stroke_1px.svg +0 -26
  47. package/src/assets/images/vectors/logo_stroke_2px.svg +0 -26
  48. package/src/assets/scss/components/_approval-sections.scss +0 -75
  49. package/src/assets/styles/fonts.scss +0 -77
  50. package/src/components/Loading.vue +0 -88
  51. package/src/components/common/AppStepper.vue +0 -139
  52. package/src/components/shared/BaseBreadcrumb.vue +0 -55
  53. package/src/components/shared/BaseIcon.vue +0 -27
  54. package/src/components/shared/ConfirmDialog.vue +0 -72
  55. package/src/components/shared/CustomAutocomplete.vue +0 -306
  56. package/src/components/shared/CustomDataTable.vue +0 -1859
  57. package/src/components/shared/DescriptionInput.vue +0 -204
  58. package/src/components/shared/DownloadButton.vue +0 -169
  59. package/src/components/shared/MoneyInput.vue +0 -105
  60. package/src/components/shared/PdfViewer.vue +0 -645
  61. package/src/components/shared/ShamsiDatePicker.vue +0 -444
  62. package/src/components/shared/UiChildCard.vue +0 -17
  63. package/src/components/shared/UiParentCard.vue +0 -21
  64. package/src/components/shared/VPriceTextField.vue +0 -136
  65. package/src/composables/useDataTable.ts +0 -152
  66. package/src/composables/usePermissions.ts +0 -90
  67. package/src/composables/useRouteGuard.ts +0 -36
  68. package/src/composables/useTableActions.ts +0 -207
  69. package/src/composables/useTableHeaders.ts +0 -172
  70. package/src/composables/useTableSelection.ts +0 -201
  71. package/src/constants/enums/approval.ts +0 -13
  72. package/src/constants/enums/booleanEnum.ts +0 -11
  73. package/src/constants/enums/contractType.ts +0 -11
  74. package/src/constants/enums/lcProductType.ts +0 -21
  75. package/src/constants/enums/repaymentType.ts +0 -11
  76. package/src/directives/v-digit-limit.ts +0 -15
  77. package/src/directives/v-permission.ts +0 -31
  78. package/src/features/index.ts +0 -48
  79. package/src/index.ts +0 -119
  80. package/src/plugins/key-clock.ts +0 -39
  81. package/src/plugins/mdi-icon.ts +0 -31
  82. package/src/plugins/vuetify.ts +0 -74
  83. package/src/scss/_override.scss +0 -72
  84. package/src/scss/_variables.scss +0 -124
  85. package/src/scss/components/_VButtons.scss +0 -23
  86. package/src/scss/components/_VCard.scss +0 -20
  87. package/src/scss/components/_VCustomDataTable.scss +0 -282
  88. package/src/scss/components/_VField.scss +0 -9
  89. package/src/scss/components/_VInput.scss +0 -17
  90. package/src/scss/components/_VNavigationDrawer.scss +0 -3
  91. package/src/scss/components/_VShadow.scss +0 -3
  92. package/src/scss/components/_VStepper.scss +0 -235
  93. package/src/scss/components/_VTabs.scss +0 -11
  94. package/src/scss/components/_VTextField.scss +0 -40
  95. package/src/scss/components/_approval.scss +0 -128
  96. package/src/scss/layout/_container.scss +0 -147
  97. package/src/scss/layout/_sidebar.scss +0 -138
  98. package/src/scss/layout/_topbar.scss +0 -39
  99. package/src/scss/pages/_dashboards.scss +0 -97
  100. package/src/scss/style.scss +0 -21
  101. package/src/services/apiService.ts +0 -59
  102. package/src/services/axiosInstance.ts +0 -14
  103. package/src/stores/customizer.ts +0 -55
  104. package/src/stores/permissions.ts +0 -237
  105. package/src/theme/darkThemes/DarkModernTheme.ts +0 -54
  106. package/src/theme/darkThemes/DarkOrangeTheme.ts +0 -53
  107. package/src/theme/darkThemes/DarkPurpleTheme.ts +0 -54
  108. package/src/theme/darkThemes/DarkRedTheme.ts +0 -54
  109. package/src/theme/darkThemes/DarkSilverTheme.ts +0 -53
  110. package/src/theme/darkThemes/DarkSteelTealGreen.ts +0 -53
  111. package/src/theme/darkThemes/DarkTealTheme.ts +0 -52
  112. package/src/theme/lightThemes/ModernTheme.ts +0 -55
  113. package/src/theme/lightThemes/OrangeTheme.ts +0 -54
  114. package/src/theme/lightThemes/PurpleTheme.ts +0 -54
  115. package/src/theme/lightThemes/RedTheme.ts +0 -55
  116. package/src/theme/lightThemes/SilverTheme.ts +0 -55
  117. package/src/theme/lightThemes/SteelTealGreen.ts +0 -54
  118. package/src/theme/lightThemes/TealTheme.ts +0 -54
  119. package/src/types/approval/approvalType.ts +0 -473
  120. package/src/types/cartable/cartableTypes.ts +0 -169
  121. package/src/types/componentTypes/DataTableType.ts +0 -14
  122. package/src/types/componentTypes/DataTableTypes.ts +0 -130
  123. package/src/types/enums/global.ts +0 -267
  124. package/src/types/jalaali-js.d.ts +0 -6
  125. package/src/types/models/Base.ts +0 -4
  126. package/src/types/models/env.d.ts +0 -10
  127. package/src/types/models/person.ts +0 -13
  128. package/src/types/models/userInfo.ts +0 -29
  129. package/src/types/preApproval/preApprovalTypes.ts +0 -67
  130. package/src/types/shims-tabler-icons.d.ts +0 -58
  131. package/src/types/themeTypes/ThemeType.ts +0 -47
  132. package/src/types/vue-apexcharts.d.ts +0 -1
  133. package/src/types/vue3-print-nb.d.ts +0 -1
  134. package/src/types/vue_tabler_icon.d.ts +0 -10
  135. package/src/utils/NationalCodeValidator.ts +0 -33
  136. package/src/utils/date-convertor.ts +0 -40
  137. package/src/utils/greetingUtils.ts +0 -97
  138. package/src/utils/helpers/fake-backend.ts +0 -68
  139. package/src/utils/helpers/fetch-wrapper.ts +0 -86
  140. package/src/utils/number-formatter.ts +0 -33
  141. package/src/validators/nationalCodeRule.ts +0 -6
@@ -1,40 +0,0 @@
1
- // utils/dateConverter.ts
2
- import jalaali from 'jalaali-js';
3
-
4
- export class DateConverter {
5
- // Convert Gregorian to Shamsi
6
- static toShamsi(dateStr: string | null | undefined): string {
7
- // Handle null, undefined, or empty string
8
- if (!dateStr || dateStr === '') {
9
- return '';
10
- }
11
-
12
- try {
13
- const date = new Date(dateStr);
14
-
15
- // Check if the date is valid
16
- if (isNaN(date.getTime())) {
17
- return '';
18
- }
19
-
20
- const { gy, gm, gd } = {
21
- gy: date.getFullYear(),
22
- gm: date.getMonth() + 1, // JS months are 0-based
23
- gd: date.getDate(),
24
- };
25
-
26
- const { jy, jm, jd } = jalaali.toJalaali(gy, gm, gd);
27
- return `${jy}/${String(jm).padStart(2, '0')}/${String(jd).padStart(2, '0')}`;
28
- } catch (error) {
29
- console.error('Error converting date to Shamsi:', error, dateStr);
30
- return '';
31
- }
32
- }
33
-
34
- // Convert Shamsi to Gregorian
35
- static toGregorian(jalaliStr: string): string {
36
- const [jy, jm, jd] = jalaliStr.split('/').map(Number);
37
- const { gy, gm, gd } = jalaali.toGregorian(jy, jm, jd);
38
- return `${gy}-${String(gm).padStart(2, '0')}-${String(gd).padStart(2, '0')}`;
39
- }
40
- }
@@ -1,97 +0,0 @@
1
- export class GreetingUtils {
2
- /**
3
- * Get greeting based on time of day
4
- * @param serverTime - Server time in ISO string or Date object
5
- * @returns Appropriate greeting in Persian
6
- */
7
- static getGreeting(serverTime?: string | Date): string {
8
- const time = serverTime ? new Date(serverTime) : new Date();
9
- const hour = time.getHours();
10
-
11
- if (hour >= 5 && hour < 12) {
12
- return 'صبح بخیر';
13
- } else if (hour >= 12 && hour < 17) {
14
- return 'ظهر بخیر';
15
- } else if (hour >= 17 && hour < 20) {
16
- return 'عصر بخیر';
17
- } else {
18
- return 'شب بخیر';
19
- }
20
- }
21
-
22
- /**
23
- * Get greeting with user name
24
- * @param serverTime - Server time in ISO string or Date object
25
- * @param userName - User's name
26
- * @returns Greeting with user name
27
- */
28
- static getGreetingWithName(serverTime?: string | Date, userName?: string): string {
29
- const greeting = this.getGreeting(serverTime);
30
- const name = userName || 'کاربر';
31
- return `${greeting} ${name}`;
32
- }
33
-
34
- /**
35
- * Get greeting with time information
36
- * @param serverTime - Server time in ISO string or Date object
37
- * @returns Greeting with time period
38
- */
39
- static getGreetingWithTime(serverTime?: string | Date): string {
40
- const time = serverTime ? new Date(serverTime) : new Date();
41
- const hour = time.getHours();
42
- const minute = time.getMinutes();
43
-
44
- const greeting = this.getGreeting(serverTime);
45
- const timeString = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
46
-
47
- return `${greeting} - ساعت ${timeString}`;
48
- }
49
-
50
- /**
51
- * Get time period description
52
- * @param serverTime - Server time in ISO string or Date object
53
- * @returns Time period description in Persian
54
- */
55
- static getTimePeriod(serverTime?: string | Date): string {
56
- const time = serverTime ? new Date(serverTime) : new Date();
57
- const hour = time.getHours();
58
-
59
- if (hour >= 5 && hour < 12) {
60
- return 'صبح';
61
- } else if (hour >= 12 && hour < 17) {
62
- return 'ظهر';
63
- } else if (hour >= 17 && hour < 20) {
64
- return 'عصر';
65
- } else {
66
- return 'شب';
67
- }
68
- }
69
-
70
- /**
71
- * Get full greeting with date and time
72
- * @param serverTime - Server time in ISO string or Date object
73
- * @param userName - User's name
74
- * @returns Full greeting with date and time
75
- */
76
- static getFullGreeting(serverTime?: string | Date, userName?: string): string {
77
- const time = serverTime ? new Date(serverTime) : new Date();
78
- const greeting = this.getGreeting(serverTime);
79
- const name = userName || 'کاربر';
80
-
81
- // Format date in Persian
82
- const dateOptions: Intl.DateTimeFormatOptions = {
83
- weekday: 'long',
84
- year: 'numeric',
85
- month: 'long',
86
- day: 'numeric'
87
- };
88
-
89
- const persianDate = time.toLocaleDateString('fa-IR', dateOptions);
90
- const timeString = time.toLocaleTimeString('fa-IR', {
91
- hour: '2-digit',
92
- minute: '2-digit'
93
- });
94
-
95
- return `${greeting} ${name} - ${persianDate} - ساعت ${timeString}`;
96
- }
97
- }
@@ -1,68 +0,0 @@
1
- export { fakeBackend };
2
-
3
- interface User {
4
- id: number;
5
- username: string;
6
- password: string;
7
- firstName: string;
8
- lastName: string;
9
- }
10
-
11
- // interface ResponseBody {
12
- // id: number;
13
- // username: string;
14
- // firstName: string;
15
- // lastName: string;
16
- // token: string;
17
- // }
18
-
19
- function fakeBackend() {
20
- const users: User[] = [
21
- { id: 1, username: 'info@codedthemes.com', password: 'admin123', firstName: 'Codedthemes', lastName: '.com' }
22
- ];
23
-
24
- const customers = [
25
- {
26
- id: 1, firstName: 'امیر', lastName: 'جلیلی', nationalCode: '0018523897', personType: 'حقیقی',
27
- personRelationType: 'ویژه', customerType: 'کاسپین', address: 'تهران, ایران', postalCode: '1111111111',
28
- name: '021-12345678', branchName: 'تختی', branchCode: '1054'
29
- },
30
- ];
31
-
32
- const realFetch = window.fetch;
33
-
34
- window.fetch = function (url: string, opts: { method: string; headers: { [key: string]: string }; body?: string }) {
35
- return new Promise<Response>((resolve, reject) => {
36
- setTimeout(handleRoute, 500);
37
-
38
- function handleRoute() {
39
- switch (true) {
40
- case url.endsWith('/customers/search') && opts.method === 'POST':
41
- return searchCustomers();
42
- default:
43
- return realFetch(url, opts).then(resolve).catch(reject);
44
- }
45
- }
46
-
47
- function searchCustomers() {
48
- const { nationalCode, personType } = body();
49
- const results = customers.filter(
50
- (customer) =>
51
- (!nationalCode || customer.nationalCode.includes(nationalCode)) &&
52
- (!personType || customer.personType === personType)
53
- );
54
- return ok(results);
55
- }
56
-
57
- function ok(body: any): void {
58
- resolve(new Response(JSON.stringify(body), { status: 200, headers: { 'Content-Type': 'application/json' } }));
59
- }
60
-
61
-
62
- function body() {
63
- return opts.body && JSON.parse(opts.body);
64
- }
65
- });
66
- } as typeof window.fetch;
67
- }
68
-
@@ -1,86 +0,0 @@
1
- /**
2
- * Generic fetch wrapper for HTTP requests
3
- *
4
- * This is a simple wrapper around fetch API. Consuming apps can extend this
5
- * or provide their own authentication headers by configuring the authHeader function.
6
- */
7
-
8
- export interface AuthConfig {
9
- getToken?: () => string | null;
10
- getApiBaseUrl?: () => string | null;
11
- onUnauthorized?: () => void;
12
- }
13
-
14
- let authConfig: AuthConfig | null = null;
15
-
16
- /**
17
- * Configure authentication for fetch wrapper
18
- * @param config - Auth configuration
19
- */
20
- export function configureAuth(config: AuthConfig) {
21
- authConfig = config;
22
- }
23
-
24
- export const fetchWrapper = {
25
- get: request('GET'),
26
- post: request('POST'),
27
- put: request('PUT'),
28
- delete: request('DELETE')
29
- };
30
-
31
- interface RequestOptions {
32
- method: string;
33
- headers: Record<string, string>;
34
- body?: string;
35
- }
36
-
37
- function request(method: string) {
38
- return (url: string, body?: object) => {
39
- const requestOptions: RequestOptions = {
40
- method,
41
- headers: authHeader(url)
42
- };
43
- if (body) {
44
- requestOptions.headers['Content-Type'] = 'application/json';
45
- requestOptions.body = JSON.stringify(body);
46
- }
47
- return fetch(url, requestOptions).then(handleResponse);
48
- };
49
- }
50
-
51
- // helper functions
52
-
53
- function authHeader(url: string): Record<string, string> {
54
- // Return auth header with token if configured
55
- if (!authConfig) return {};
56
-
57
- const token = authConfig.getToken?.();
58
- const apiBaseUrl = authConfig.getApiBaseUrl?.();
59
-
60
- const isLoggedIn = !!token;
61
- const isApiUrl = apiBaseUrl ? url.startsWith(apiBaseUrl) : false;
62
-
63
- if (isLoggedIn && isApiUrl) {
64
- return { Authorization: `Bearer ${token}` };
65
- } else {
66
- return {};
67
- }
68
- }
69
-
70
- function handleResponse<T = any>(response: Response): Promise<T> {
71
- return response.text().then((text: string) => {
72
- const data = text && JSON.parse(text);
73
-
74
- if (!response.ok) {
75
- // Handle unauthorized/forbidden
76
- if ([401, 403].includes(response.status)) {
77
- authConfig?.onUnauthorized?.();
78
- }
79
-
80
- const error: string = (data && data.message) || response.statusText;
81
- return Promise.reject(error);
82
- }
83
-
84
- return data as T;
85
- });
86
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * Formats a number with comma separators
3
- * @param value - The number to format
4
- * @param decimals - Number of decimal places (default: 0)
5
- * @returns Formatted number string with comma separators
6
- */
7
- export const formatNumberWithCommas = (value: number | string, decimals: number = 0): string => {
8
- if (value === null || value === undefined) return '';
9
-
10
- // Convert to number if string
11
- const numValue = typeof value === 'string' ? parseFloat(value) : value;
12
-
13
- // Check if the value is a valid number
14
- if (isNaN(numValue)) return '';
15
-
16
- // Format the number with commas and specified decimal places
17
- return numValue.toLocaleString('en-US', {
18
- minimumFractionDigits: decimals,
19
- maximumFractionDigits: decimals
20
- });
21
- };
22
-
23
- /**
24
- * Formats a price with comma separators and currency symbol
25
- * @param value - The price to format
26
- * @param currency - Currency symbol (default: '')
27
- * @param decimals - Number of decimal places (default: 0)
28
- * @returns Formatted price string with comma separators and currency symbol
29
- */
30
- export const formatPrice = (value: number | string, currency: string = '', decimals: number = 0): string => {
31
- const formattedNumber = formatNumberWithCommas(value, decimals);
32
- return currency ? `${currency}${formattedNumber}` : formattedNumber;
33
- };
@@ -1,6 +0,0 @@
1
- import { NationalCodeValidator } from '@/utils/NationalCodeValidator';
2
-
3
- export function nationalCodeRule(nationalCode: string, customerType: 'Real' | 'Legal'): string | false {
4
- if (!NationalCodeValidator.isValid(nationalCode, customerType)) return 'کد ملی نامعتبر است';
5
- return false;
6
- }