@amirjalili1374/ui-kit 1.2.0 → 1.2.2

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 +11 -11
  2. package/package.json +3 -3
  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,204 +0,0 @@
1
- <template>
2
- <div class="description-input">
3
- <v-textarea
4
- v-model="internalValue"
5
- :label="label"
6
- :placeholder="placeholder"
7
- :rows="rows"
8
- :maxlength="maxlength"
9
- :disabled="disabled"
10
- :readonly="readonly"
11
- :clearable="clearable"
12
- :counter="showCounter || undefined"
13
- variant="outlined"
14
- density="comfortable"
15
- auto-grow
16
- @keydown="handleKeydown"
17
- @input="handleInput"
18
- @blur="handleBlur"
19
- />
20
- </div>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import { ref, watch } from 'vue';
25
-
26
- interface Props {
27
- modelValue?: string;
28
- label?: string;
29
- placeholder?: string;
30
- rows?: number;
31
- maxlength?: number;
32
- disabled?: boolean;
33
- readonly?: boolean;
34
- clearable?: boolean;
35
- showCounter?: boolean;
36
- autoNumbering?: boolean; // Enable/disable auto numbering
37
- startNumber?: number; // Starting number for auto numbering
38
- }
39
-
40
- const props = withDefaults(defineProps<Props>(), {
41
- modelValue: '',
42
- label: 'توضیحات',
43
- placeholder: 'توضیحات خود را وارد کنید...',
44
- rows: 4,
45
- maxlength: 1000,
46
- disabled: false,
47
- readonly: false,
48
- clearable: true,
49
- showCounter: true,
50
- autoNumbering: true,
51
- startNumber: 1
52
- });
53
-
54
- const emit = defineEmits<{
55
- (e: 'update:modelValue', value: string): void;
56
- (e: 'change', value: string): void;
57
- }>();
58
-
59
- const internalValue = ref(props.modelValue);
60
-
61
- // Watch for external modelValue changes
62
- watch(() => props.modelValue, (newValue) => {
63
- internalValue.value = newValue;
64
- });
65
-
66
- // Watch for internal value changes and emit
67
- watch(internalValue, (newValue) => {
68
- emit('update:modelValue', newValue);
69
- });
70
-
71
- // Handle keydown events for auto numbering
72
- const handleKeydown = (event: KeyboardEvent) => {
73
- if (!props.autoNumbering || props.disabled || props.readonly) {
74
- return;
75
- }
76
-
77
- const target = event.target as HTMLTextAreaElement;
78
- const { key, ctrlKey, shiftKey, altKey } = event;
79
-
80
- // Handle Enter key (new line with incrementing number)
81
- if (key === 'Enter' && !ctrlKey && !shiftKey && !altKey) {
82
- event.preventDefault();
83
- insertNumberedLine(target, true);
84
- }
85
-
86
- // Handle Inter key (new line with decrementing number)
87
- if (key === 'Inter' || (key === 'Enter' && shiftKey)) {
88
- event.preventDefault();
89
- insertNumberedLine(target, false);
90
- }
91
- };
92
-
93
- // Insert a numbered line
94
- const insertNumberedLine = (textarea: HTMLTextAreaElement, increment: boolean) => {
95
- const { selectionStart, selectionEnd, value } = textarea;
96
-
97
- // Get current line number
98
- const currentLineNumber = getCurrentLineNumber(value, selectionStart);
99
-
100
- // Calculate new line number
101
- const newLineNumber = increment ? currentLineNumber + 1 : Math.max(1, currentLineNumber - 1);
102
-
103
- // Create the new line text
104
- const newLineText = `\n${newLineNumber} - `;
105
-
106
- // Insert the new line
107
- const newValue = value.slice(0, selectionStart) + newLineText + value.slice(selectionEnd);
108
- internalValue.value = newValue;
109
-
110
- // Set cursor position after the new line
111
- const newCursorPosition = selectionStart + newLineText.length;
112
-
113
- // Use nextTick to ensure DOM is updated
114
- setTimeout(() => {
115
- textarea.setSelectionRange(newCursorPosition, newCursorPosition);
116
- textarea.focus();
117
- }, 0);
118
- };
119
-
120
- // Get the current line number from the text
121
- const getCurrentLineNumber = (text: string, cursorPosition: number): number => {
122
- // Find the current line
123
- const lines = text.split('\n');
124
- let currentPos = 0;
125
-
126
- for (let i = 0; i < lines.length; i++) {
127
- const lineLength = lines[i].length + 1; // +1 for newline
128
-
129
- if (currentPos + lineLength > cursorPosition) {
130
- // We found the current line
131
- const line = lines[i];
132
-
133
- // Check if line starts with a number pattern (e.g., "1 - ", "2 - ", etc.)
134
- const numberMatch = line.match(/^(\d+)\s*-\s*/);
135
- if (numberMatch) {
136
- return parseInt(numberMatch[1]);
137
- }
138
-
139
- // If no number found, return the line index + startNumber
140
- return props.startNumber + i;
141
- }
142
-
143
- currentPos += lineLength;
144
- }
145
-
146
- // If we're at the end, return the next number
147
- return props.startNumber + lines.length;
148
- };
149
-
150
- // Handle input changes
151
- const handleInput = (event: Event) => {
152
- const target = event.target as HTMLTextAreaElement;
153
- const value = target.value;
154
-
155
- // Auto-format existing text to add numbering if needed
156
- if (props.autoNumbering && value && !value.match(/^\d+\s*-\s/)) {
157
- const formattedValue = formatTextWithNumbering(value);
158
- if (formattedValue !== value) {
159
- internalValue.value = formattedValue;
160
- }
161
- }
162
- };
163
-
164
- // Format text to add numbering
165
- const formatTextWithNumbering = (text: string): string => {
166
- const lines = text.split('\n');
167
- const formattedLines = lines.map((line, index) => {
168
- // Skip empty lines
169
- if (!line.trim()) {
170
- return line;
171
- }
172
-
173
- // If line already has numbering, keep it
174
- if (line.match(/^\d+\s*-\s/)) {
175
- return line;
176
- }
177
-
178
- // Add numbering
179
- return `${props.startNumber + index} - ${line}`;
180
- });
181
-
182
- return formattedLines.join('\n');
183
- };
184
-
185
- // Handle blur event
186
- const handleBlur = () => {
187
- emit('change', internalValue.value);
188
- };
189
- </script>
190
-
191
- <style scoped>
192
- .description-input {
193
- width: 100%;
194
- }
195
-
196
- .description-input :deep(.v-textarea textarea) {
197
- font-family: 'Vazir', 'Tahoma', sans-serif;
198
- line-height: 1.6;
199
- }
200
-
201
- .description-input :deep(.v-textarea textarea:focus) {
202
- outline: none;
203
- }
204
- </style>
@@ -1,169 +0,0 @@
1
- <template>
2
- <v-btn
3
- v-bind="$attrs"
4
- :loading="loading"
5
- @click="handleDownload"
6
- class="download-button"
7
- >
8
- <v-icon v-if="icon" :start="iconStart" :end="iconEnd" :class="iconClass">{{ icon }}</v-icon>
9
- <span class="download-title">{{ title }}</span>
10
- <v-icon v-if="!icon" start :icon="icons.download" :class="iconClass"></v-icon>
11
- </v-btn>
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import { ref, computed } from 'vue'
16
- import { icons } from '@/plugins/mdi-icon'
17
-
18
- interface Props {
19
- url: string
20
- title?: string
21
- icon?: string
22
- iconStart?: boolean
23
- iconEnd?: boolean
24
- filename?: string
25
- method?: 'anchor' | 'fetch'
26
- }
27
-
28
- const props = withDefaults(defineProps<Props>(), {
29
- title: 'دانلود',
30
- iconStart: true,
31
- iconEnd: false,
32
- method: 'anchor'
33
- })
34
-
35
- const emit = defineEmits<{
36
- download: [url: string]
37
- error: [error: Error]
38
- success: [filename: string]
39
- }>()
40
-
41
- const loading = ref(false)
42
-
43
- // Computed class for icon positioning
44
- const iconClass = computed(() => {
45
- if (props.iconStart) return 'icon-start'
46
- if (props.iconEnd) return 'icon-end'
47
- return ''
48
- })
49
-
50
- const handleDownload = async () => {
51
- if (!props.url) {
52
- const error = new Error('URL is required for download')
53
- emit('error', error)
54
- return
55
- }
56
-
57
- loading.value = true
58
-
59
- try {
60
- if (props.method === 'fetch') {
61
- await downloadWithFetch()
62
- } else {
63
- await downloadWithAnchor()
64
- }
65
- } catch (error) {
66
- console.error('Download failed:', error)
67
- emit('error', error as Error)
68
- } finally {
69
- loading.value = false
70
- }
71
- }
72
-
73
- const downloadWithAnchor = async () => {
74
- // Create a temporary anchor element to trigger download
75
- const link = document.createElement('a')
76
- link.href = props.url
77
- link.download = props.filename || ''
78
- link.target = '_blank'
79
- link.rel = 'noopener noreferrer'
80
-
81
- // Append to body, click, and remove
82
- document.body.appendChild(link)
83
- link.click()
84
- document.body.removeChild(link)
85
-
86
- emit('download', props.url)
87
- emit('success', props.filename || 'downloaded-file')
88
- }
89
-
90
- const downloadWithFetch = async () => {
91
- try {
92
- const response = await fetch(props.url)
93
-
94
- if (!response.ok) {
95
- throw new Error(`Download failed: ${response.status} ${response.statusText}`)
96
- }
97
-
98
- const blob = await response.blob()
99
- const url = window.URL.createObjectURL(blob)
100
-
101
- const link = document.createElement('a')
102
- link.href = url
103
- link.download = props.filename || getFilenameFromUrl(props.url) || 'download'
104
-
105
- document.body.appendChild(link)
106
- link.click()
107
- document.body.removeChild(link)
108
-
109
- // Clean up the object URL
110
- window.URL.revokeObjectURL(url)
111
-
112
- emit('download', props.url)
113
- emit('success', props.filename || 'downloaded-file')
114
- } catch (error) {
115
- throw new Error(`Fetch download failed: ${error}`)
116
- }
117
- }
118
-
119
- const getFilenameFromUrl = (url: string): string => {
120
- try {
121
- const urlObj = new URL(url)
122
- const pathname = urlObj.pathname
123
- const filename = pathname.split('/').pop()
124
- return filename || 'download'
125
- } catch {
126
- return 'download'
127
- }
128
- }
129
-
130
- // Inherit all Vuetify button attributes except the ones we override
131
- defineOptions({
132
- inheritAttrs: false
133
- })
134
- </script>
135
-
136
- <style scoped>
137
- .download-button {
138
- display: flex;
139
- align-items: center;
140
- gap: 8px;
141
- }
142
-
143
- .download-title {
144
- margin: 0 4px;
145
- }
146
-
147
- .icon-start {
148
- margin-right: 4px;
149
- }
150
-
151
- .icon-end {
152
- margin-left: 4px;
153
- }
154
-
155
- /* RTL Support */
156
- [dir="rtl"] .download-button {
157
- gap: 8px;
158
- }
159
-
160
- [dir="rtl"] .icon-start {
161
- margin-right: 0;
162
- margin-left: 4px;
163
- }
164
-
165
- [dir="rtl"] .icon-end {
166
- margin-left: 0;
167
- margin-right: 4px;
168
- }
169
- </style>
@@ -1,105 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref } from 'vue';
3
-
4
- const props = defineProps({
5
- modelValue: {
6
- type: Number,
7
- required: false,
8
- default: 0,
9
- validator: (value) => value === null || value === undefined || typeof value === 'string' || typeof value === 'number'
10
- },
11
- label: {
12
- type: String,
13
- default: ''
14
- },
15
- placeholder: {
16
- type: String,
17
- default: ''
18
- },
19
- disabled: {
20
- type: Boolean,
21
- default: false
22
- },
23
- readonly: {
24
- type: Boolean,
25
- default: false
26
- },
27
- clearable: {
28
- type: Boolean,
29
- default: false
30
- },
31
- variant: {
32
- type: String,
33
- default: 'outlined'
34
- },
35
- errorMessages: {
36
- type: [String, Array],
37
- default: () => []
38
- },
39
- min: {
40
- type: Number,
41
- default: undefined
42
- },
43
- max: {
44
- type: Number,
45
- default: undefined
46
- },
47
- suffix: {
48
- type: String,
49
- default: ''
50
- },
51
- prefix: {
52
- type: String,
53
- default: ''
54
- }
55
- });
56
-
57
- const emit = defineEmits(['update:modelValue']);
58
-
59
- // Memoization for better performance
60
- const lastProcessedValue = ref<string | number | null | undefined>(null);
61
- const lastFormattedValue = ref<string>('');
62
-
63
- const displayValue = computed({
64
- get() {
65
- // Format with commas for display
66
- const val = props.modelValue;
67
- if (val === undefined || val === null || val === 0) return '';
68
- return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
69
- },
70
- set(val: string | null | undefined) {
71
- // Remove all non-digit characters and emit as number
72
- const safeVal = (val ?? '').replace(/[^\d]/g, '');
73
- emit('update:modelValue', safeVal === '' ? 0 : Number(safeVal));
74
- }
75
- });
76
-
77
- function onKeyPress(event: KeyboardEvent) {
78
- if (!/[0-9]/.test(event.key)) {
79
- event.preventDefault();
80
- }
81
- }
82
- </script>
83
-
84
- <template>
85
- <v-text-field
86
- v-model="displayValue"
87
- :label="props.label"
88
- :placeholder="props.placeholder"
89
- :disabled="props.disabled"
90
- :readonly="props.readonly"
91
- :clearable="props.clearable"
92
- :variant="props.variant as any"
93
- :error-messages="props.errorMessages as string[]"
94
- :suffix="props.suffix"
95
- :prefix="props.prefix"
96
- inputmode="numeric"
97
- pattern="[0-9]*"
98
- type="text"
99
- @keypress="onKeyPress"
100
- >
101
- <template v-for="(slot) in $slots" #[slot]="scope">
102
- <slot :name="slot" v-bind="scope || {}" />
103
- </template>
104
- </v-text-field>
105
- </template>