adata-ui 2.1.40-beta.3 → 2.1.40-beta.5

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.
@@ -1,10 +1,9 @@
1
1
  <script setup lang="ts">
2
-
3
2
  const { t } = useI18n()
4
3
 
5
- const isOpen = defineModel<boolean>({default: false})
4
+ const isOpen = defineModel<boolean>({ default: false })
6
5
 
7
- const cancel = () => {
6
+ function cancel() {
8
7
  isOpen.value = false
9
8
  }
10
9
 
@@ -16,30 +15,28 @@ const modalText = {
16
15
  </script>
17
16
 
18
17
  <template>
19
- <a-modal
18
+ <a-modal-v2
20
19
  v-model="isOpen"
21
- name="application-accepted"
22
- :prevent-close="true"
20
+ width="424px"
21
+ :persistent="true"
23
22
  >
24
- <div class="flex flex-col gap-5">
25
- <p class="text-center heading-02">
26
- {{ modalText.title }}
27
- </p>
28
- <a-ill-ok class="w-full" />
29
- <p class="text-center body-400">
23
+ <div class="flex flex-col items-center justify-center gap-4 px-6 py-4">
24
+ <a-ill-ok />
25
+ <p class="body-400 text-center">
30
26
  {{ modalText.info }}
31
27
  </p>
32
28
  </div>
33
29
  <template #footer>
34
- <a-button
30
+ <a-button-v2
35
31
  view="outline"
32
+ color="blue"
36
33
  block
37
34
  @click="cancel"
38
35
  >
39
36
  {{ modalText.close }}
40
- </a-button>
37
+ </a-button-v2>
41
38
  </template>
42
- </a-modal>
39
+ </a-modal-v2>
43
40
  </template>
44
41
 
45
42
  <style scoped>
@@ -1,9 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { handleElementPosition } from '#adata-ui/utils/getMaxZindex'
3
-
4
2
  const props = withDefaults(
5
3
  defineProps<{
6
- tariff: string
4
+ tariff?: string
7
5
  deleteFromDom?: boolean
8
6
 
9
7
  }>(),
@@ -24,42 +22,37 @@ function confirm() {
24
22
  function cancel() {
25
23
  isOpen.value = false
26
24
  }
27
-
28
- if (props.deleteFromDom) {
29
- handleElementPosition('connecting-tariff')
30
- }
25
+ // `deleteFromDom` сохранён для совместимости API; ручной z-index в AModalV2 не нужен.
31
26
  </script>
32
27
 
33
28
  <template>
34
- <a-modal
29
+ <a-modal-v2
35
30
  v-model="isOpen"
36
- name="connecting-tariff"
31
+ width="424px"
37
32
  >
38
- <div class="flex flex-col gap-5">
39
- <p class="heading-02 text-center">
40
- {{ t('modals.connecting.title') }}
41
- </p>
42
- <a-ill-turn-on-tariff class="w-full"/>
33
+ <div class="flex flex-col items-center justify-center gap-4 px-6 py-4">
34
+ <a-ill-turn-on-tariff />
43
35
  <p class="body-400 whitespace-pre-wrap text-center">
44
36
  {{ t('modals.connecting.questions') }}
45
37
  </p>
46
38
  </div>
47
39
 
48
40
  <template #footer>
49
- <div class="flex gap-2 ">
50
- <a-button
41
+ <div class="flex w-full gap-2">
42
+ <a-button-v2
51
43
  view="outline"
44
+ color="blue"
52
45
  block
53
46
  @click="cancel"
54
47
  >
55
48
  {{ t('modals.buttons.close') }}
56
- </a-button>
57
- <a-button block @click="confirm">
49
+ </a-button-v2>
50
+ <a-button-v2 block @click="confirm">
58
51
  {{ t('reuse.yes') }}
59
- </a-button>
52
+ </a-button-v2>
60
53
  </div>
61
54
  </template>
62
- </a-modal>
55
+ </a-modal-v2>
63
56
  </template>
64
57
 
65
58
  <style scoped>
@@ -1,20 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type { UserInfo } from '~/api/modules/user/types'
3
- import { handleElementPosition } from '#adata-ui/utils/getMaxZindex'
4
-
5
- const props = withDefaults(defineProps<Props>(), {
6
- deleteFromDom: false,
7
- })
8
-
9
- const emit = defineEmits<{
10
- (e: 'next'): void
11
- }>()
12
3
 
13
4
  const { t } = useI18n()
14
5
 
15
- interface Props {
16
- deleteFromDom?: boolean
17
- }
18
6
  const { topUpSidePanel } = usePayment()
19
7
 
20
8
  const isOpen = defineModel<boolean>({ default: false })
@@ -27,49 +15,46 @@ function confirm() {
27
15
  function cancel() {
28
16
  isOpen.value = false
29
17
  }
30
-
31
- if (props.deleteFromDom) {
32
- handleElementPosition('insufficient-funds')
33
- }
34
18
  </script>
35
19
 
36
20
  <template>
37
- <a-modal
21
+ <a-modal-v2
38
22
  v-model="isOpen"
39
- name="insufficient-funds"
23
+ width="424px"
40
24
  >
41
- <div class="flex flex-col gap-5">
42
- <p class="heading-02 text-center">
25
+ <div class="flex flex-col gap-4 px-6 py-4">
26
+ <a-ill-empty-wallet class="self-center" />
27
+ <p class="text-center text-[18px] font-semibold">
43
28
  {{ t('modals.low_balance.title') }}
44
29
  </p>
45
- <a-ill-empty-wallet class="self-center" />
46
- <div class="m-[0_-32px] flex flex-col bg-green-500 py-1.5">
47
- <p class="body-600 text-center text-white ">
30
+ <p class="text-center">
31
+ {{ t('modals.low_balance.questions') }}
32
+ </p>
33
+ <div class="flex flex-col rounded-xl border border-blue-500 bg-blue-50 px-4 py-2 dark:border-blue-500 dark:bg-blue-950/40">
34
+ <p class="body-600 text-center text-blue-700 dark:text-blue-300">
48
35
  {{ t('modals.low_balance.current_balance') }}
49
36
  </p>
50
- <p class="body-600 text-center text-xl text-white ">
37
+ <p class="body-600 text-center text-xl text-blue-700 dark:text-blue-300">
51
38
  {{ userInfo?.balance ? userInfo?.balance.toLocaleString('ru-RU') : 0 }}₸
52
39
  </p>
53
40
  </div>
54
- <p class="text-center">
55
- {{ t('modals.low_balance.questions') }}
56
- </p>
57
41
  </div>
58
42
  <template #footer>
59
- <div class="flex gap-2 ">
60
- <a-button
43
+ <div class="flex gap-2">
44
+ <a-button-v2
61
45
  view="outline"
46
+ color="blue"
62
47
  block
63
48
  @click="cancel"
64
49
  >
65
50
  {{ t('modals.buttons.close') }}
66
- </a-button>
67
- <a-button block @click="confirm">
51
+ </a-button-v2>
52
+ <a-button-v2 block @click="confirm">
68
53
  {{ t('modals.buttons.topUp') }}
69
- </a-button>
54
+ </a-button-v2>
70
55
  </div>
71
56
  </template>
72
- </a-modal>
57
+ </a-modal-v2>
73
58
  </template>
74
59
 
75
60
  <style scoped>
@@ -1,5 +1,4 @@
1
1
  <script setup lang="ts">
2
-
3
2
  import { useUrls } from '#adata-ui/composables/useUrls'
4
3
 
5
4
  const { t } = useI18n()
@@ -16,11 +15,13 @@ function goTariffs() {
16
15
  <template>
17
16
  <a-modal v-model="isOpen" :title="t('modals.limit.title')">
18
17
  <div class="flex flex-col items-center gap-5 text-center text-sm">
19
- <a-ill-empty-wallet></a-ill-empty-wallet>
18
+ <a-ill-empty-wallet />
20
19
  <div>{{ t('modals.limit.content') }}</div>
21
20
  </div>
22
21
  <template #footer>
23
- <a-button @click="goTariffs" block>{{ t('modals.buttons.goTariffs') }}</a-button>
22
+ <a-button block @click="goTariffs">
23
+ {{ t('modals.buttons.goTariffs') }}
24
+ </a-button>
24
25
  </template>
25
26
  </a-modal>
26
27
  </template>
@@ -5,33 +5,31 @@ const { t } = useI18n()
5
5
 
6
6
  const isOpen = useNoAccessModal()
7
7
 
8
- const onClose = () => {
8
+ function onClose() {
9
9
  isOpen.value = false
10
10
  }
11
11
  </script>
12
12
 
13
13
  <template>
14
- <a-modal
14
+ <a-modal-v2
15
15
  v-model="isOpen"
16
- name="no-access-modal"
16
+ width="424px"
17
17
  >
18
- <div class="flex flex-col gap-5">
19
- <p class="heading-02 text-center">
20
- {{ t('modals.no_access.title') }}
21
- </p>
22
- <a-ill-door class="w-full" />
18
+ <div class="flex flex-col items-center justify-center gap-4 px-6 py-4">
19
+ <a-ill-door />
23
20
  <p class="body-400 whitespace-pre-wrap text-center">
24
21
  {{ t('modals.no_access.info') }}
25
22
  </p>
26
23
  </div>
27
24
  <template #footer>
28
- <a-button
25
+ <a-button-v2
29
26
  view="outline"
27
+ color="blue"
30
28
  block
31
29
  @click="onClose"
32
30
  >
33
31
  {{ t('modals.buttons.close') }}
34
- </a-button>
32
+ </a-button-v2>
35
33
  </template>
36
- </a-modal>
34
+ </a-modal-v2>
37
35
  </template>
@@ -66,7 +66,7 @@ if (props.deleteFromDom) {
66
66
  :name="`${item.name}`"
67
67
  side="right"
68
68
  :value="item.id"
69
- class="flex items-center justify-between gap-2 bg-gray-50 p-[10px_16px] rounded-md dark:bg-[#393D40]"
69
+ class="flex items-center justify-between gap-2 rounded-md bg-gray-50 p-[10px_16px] dark:bg-[#393D40]"
70
70
  >
71
71
  <div class="flex w-full items-center gap-2">
72
72
  <component :is="item.img" />
@@ -3,28 +3,30 @@ const { t } = useI18n()
3
3
 
4
4
  const isOpen = defineModel<boolean>({ required: true })
5
5
  </script>
6
+
6
7
  <template>
7
- <a-modal
8
+ <a-modal-v2
8
9
  v-model="isOpen"
9
10
  width="424px"
10
11
  >
11
- <template #header>
12
+ <div class="flex flex-col items-center justify-center gap-4 px-6 py-4">
13
+ <a-ill-ok />
12
14
  <p class="heading-02 text-center font-bold">
13
15
  {{ t('modals.report_bug.confirmed') }}
14
16
  </p>
15
- </template>
16
- <div class="flex flex-col gap-5 items-center">
17
- <a-ill-ok />
18
- <p class="text-sm text-center">
17
+ <p class="body-400 text-center">
19
18
  {{ t('modals.report_bug.gratitude') }}
20
19
  </p>
21
- <a-button
20
+ </div>
21
+ <template #footer>
22
+ <a-button-v2
22
23
  view="outline"
24
+ color="blue"
23
25
  block
24
26
  @click="isOpen = false"
25
27
  >
26
28
  {{ t('actions.close') }}
27
- </a-button>
28
- </div>
29
- </a-modal>
29
+ </a-button-v2>
30
+ </template>
31
+ </a-modal-v2>
30
32
  </template>
@@ -18,7 +18,7 @@ const env = myLayer.mode
18
18
 
19
19
  const mask = new Mask({ mask: '# (###) ### ## ##' })
20
20
 
21
- const isOpen = defineModel<boolean>()
21
+ const isOpen = defineModel<boolean>({ default: false })
22
22
  const form: any = reactive({
23
23
  name: '',
24
24
  email: '',
@@ -35,6 +35,7 @@ const scheme = z.object({
35
35
  })
36
36
 
37
37
  const submitted = ref(false)
38
+ const sending = ref(false)
38
39
 
39
40
  const { validation, getError } = useUIValidation(
40
41
  scheme,
@@ -58,6 +59,7 @@ watch(phone, () => {
58
59
  async function send() {
59
60
  submitted.value = true
60
61
  if (validation.value) return
62
+ sending.value = true
61
63
  try {
62
64
  await $fetch<any>(`https://users.${env}.kz/api/v1/message/error`, {
63
65
  method: 'POST',
@@ -79,86 +81,90 @@ async function send() {
79
81
  form.comment = ''
80
82
  phone.value = ''
81
83
  submitted.value = false
84
+ sending.value = false
82
85
  emit('close')
83
86
  }
84
87
  }
85
88
  </script>
86
89
 
87
90
  <template>
88
- <a-modal v-model="isOpen" data-test-id="report-form-modal">
91
+ <a-modal-v2 v-model="isOpen" width="424px">
89
92
  <template #header>
90
- <p class="heading-02 text-center" data-test-id="report-form-title">
93
+ <h2 class="text-base font-semibold text-gray-900 dark:text-gray-100" data-test-id="report-form-title">
91
94
  {{ t('modals.report_bug.title') }}
92
- </p>
95
+ </h2>
93
96
  </template>
94
- <div class="flex flex-col gap-5">
95
- <div class="flex flex-col items-center justify-center gap-5">
96
- <a-ill-stop-sign class="size-[185px]" />
97
+
98
+ <div class="flex flex-col gap-5 px-6 py-4">
99
+ <div class="flex flex-col items-center justify-center gap-4">
100
+ <a-ill-stop-sign class="size-[140px]" />
97
101
  <slot name="title">
98
102
  <p class="label-400 text-center">
99
103
  {{ name }}
100
104
  </p>
101
105
  </slot>
102
106
  </div>
103
- <div class="flex flex-col gap-2">
104
- <a-input-standard
107
+
108
+ <div class="flex flex-col gap-3">
109
+ <a-input-v2
105
110
  v-model="form.name"
106
111
  required
107
- :data-test-id="'report-form-name-input'"
108
112
  :label="t('modals.report_bug.labels.name')"
109
113
  :error="getError('name')"
114
+ data-test-id="report-form-name-input"
110
115
  />
111
- <a-input-standard
116
+ <a-input-v2
112
117
  v-model="form.email"
113
118
  required
114
- :data-test-id="'report-form-email-input'"
119
+ type="email"
115
120
  :label="t('modals.report_bug.labels.email')"
116
121
  :error="getError('email')"
122
+ data-test-id="report-form-email-input"
117
123
  />
118
- <a-input-standard
124
+ <a-input-v2
119
125
  v-model="phone"
120
- v-maska
121
126
  required
122
- data-maska="8 (###) ### ## ##"
127
+ type="tel"
123
128
  clearable
124
- :data-test-id="'report-form-phone-input'"
129
+ mask="8 (###) ### ## ##"
125
130
  :label="t('modals.report_bug.labels.phone')"
126
131
  :error="getError('phone_number')"
132
+ data-test-id="report-form-phone-input"
133
+ />
134
+ <a-textarea-v2
135
+ v-model="form.comment"
136
+ required
137
+ :rows="4"
138
+ resize="none"
139
+ :label="t('modals.report_bug.labels.comment')"
140
+ :error="getError('comment')"
141
+ data-test-id="report-form-comment-textarea"
127
142
  />
128
- <div>
129
- <a-textarea
130
- v-model="form.comment"
131
- required
132
- :data-test-id="'report-form-comment-textarea'"
133
- :label="t('modals.report_bug.labels.comment')"
134
- size="md"
135
- :error="getError('comment')"
136
- class="min-h-[120px]"
137
- :resizeable="false"
138
- />
139
- </div>
140
143
  </div>
141
144
  </div>
145
+
142
146
  <template #footer>
143
- <div class="flex w-full gap-2">
144
- <a-button
147
+ <div class="flex gap-2">
148
+ <a-button-v2
145
149
  view="outline"
146
- class="w-full"
150
+ color="blue"
151
+ block
147
152
  data-test-id="report-form-close-button"
148
153
  @click="emit('close')"
149
154
  >
150
155
  {{ t('actions.close') }}
151
- </a-button>
152
- <a-button
153
- class="w-full"
156
+ </a-button-v2>
157
+ <a-button-v2
158
+ block
159
+ :loading="sending"
154
160
  data-test-id="report-form-submit-button"
155
161
  @click="send"
156
162
  >
157
163
  {{ t('actions.send') }}
158
- </a-button>
164
+ </a-button-v2>
159
165
  </div>
160
166
  </template>
161
- </a-modal>
167
+ </a-modal-v2>
162
168
  </template>
163
169
 
164
170
  <style scoped></style>
@@ -1,5 +1,4 @@
1
1
  <script setup lang="ts">
2
-
3
2
  import { useUrls } from '#adata-ui/composables/useUrls'
4
3
 
5
4
  const emit = defineEmits<{
@@ -17,33 +16,33 @@ function runTimer() {
17
16
  const intervalId = setInterval(() => {
18
17
  if (timer.value <= 0) {
19
18
  isResend.value = true
20
- clearInterval(intervalId);
21
- return;
19
+ clearInterval(intervalId)
20
+ return
22
21
  }
23
- timer.value--;
24
- }, 1000);
22
+ timer.value--
23
+ }, 1000)
25
24
  }
26
25
 
27
26
  onMounted(() => resend())
28
27
 
29
- const resend = () => {
28
+ function resend() {
30
29
  isResend.value = false
31
30
  runTimer()
32
31
  emit('resend')
33
32
  }
34
- const goToMain = () => {
33
+ function goToMain() {
35
34
  if (route.query.url) {
36
35
  document.location.replace(route.query.url)
37
- } else {
36
+ }
37
+ else {
38
38
  document.location.replace(landing)
39
39
  }
40
40
  emit('close')
41
-
42
41
  }
43
42
  </script>
44
43
 
45
44
  <template>
46
- <div class="flex flex-col justify-center items-center gap-5">
45
+ <div class="flex flex-col items-center justify-center gap-5">
47
46
  <p class="heading-02">
48
47
  {{ $t('login.modal.title') }}
49
48
  </p>
@@ -57,65 +57,68 @@ onMounted(() => {
57
57
  </script>
58
58
 
59
59
  <template>
60
- <a-modal
60
+ <a-modal-v2
61
61
  v-model="isOpen"
62
- name="submit-application"
63
- :prevent-close="true"
62
+ width="424px"
63
+ persistent
64
64
  >
65
- <div class="flex flex-col gap-5">
66
- <p class="text-center heading-02">
65
+ <div class="flex flex-col gap-5 px-6 py-4">
66
+ <p class="heading-02 text-center">
67
67
  {{ t('modals.submit_application_modal.title') }}
68
68
  </p>
69
69
  <a-ill-mail class="w-full" />
70
- <div class="flex flex-col gap-2">
71
- <a-input-standard
70
+ <div class="flex flex-col gap-3">
71
+ <a-input-v2
72
72
  v-model="form.name"
73
+ required
73
74
  :label="t('modals.submit_application_modal.labels.name')"
74
75
  :error="getError('name')"
75
- required
76
76
  />
77
- <a-input-standard
77
+ <a-input-v2
78
78
  v-model="form.email"
79
+ required
80
+ type="email"
79
81
  :label="t('modals.submit_application_modal.labels.email')"
80
82
  :error="getError('email')"
81
- required
82
83
  />
83
- <a-input-standard
84
+ <a-input-v2
84
85
  v-model="form.phone"
85
- v-maska
86
+ required
87
+ type="tel"
88
+ clearable
89
+ mask="8 (###) ###-##-##"
86
90
  :label="t('modals.submit_application_modal.labels.phone')"
87
- data-maska="8 (###) ###-##-##"
88
91
  :error="getError('phone')"
89
- clearable
90
- required
91
92
  />
92
- <a-textarea
93
+ <a-textarea-v2
93
94
  v-model="form.comment"
95
+ required
96
+ :rows="4"
97
+ resize="none"
94
98
  :label="t('modals.submit_application_modal.labels.comment')"
95
99
  :error="getError('comment')"
96
- resizeable="none"
97
- required
98
100
  />
99
101
  </div>
100
102
  </div>
101
103
  <template #footer>
102
- <div class="flex gap-2 ">
103
- <a-button
104
+ <div class="flex gap-2">
105
+ <a-button-v2
104
106
  view="outline"
107
+ color="blue"
105
108
  block
106
109
  @click="cancel"
107
110
  >
108
111
  {{ t('reuse.close') }}
109
- </a-button>
110
- <a-button
112
+ </a-button-v2>
113
+ <a-button-v2
111
114
  block
112
115
  @click="send"
113
116
  >
114
117
  {{ t('reuse.send') }}
115
- </a-button>
118
+ </a-button-v2>
116
119
  </div>
117
120
  </template>
118
- </a-modal>
121
+ </a-modal-v2>
119
122
  </template>
120
123
 
121
124
  <style scoped>
@@ -298,7 +298,7 @@ function onTouchEnd() {
298
298
  </div>
299
299
 
300
300
  <header
301
- v-if="!hideHeader && (title || $slots.header)"
301
+ v-if="!hideHeader"
302
302
  class="flex shrink-0 items-center justify-between gap-3 border-b border-gray-200 px-5 py-4 dark:border-gray-800"
303
303
  @touchstart.passive="onTouchStart"
304
304
  @touchmove="onTouchMove"
@@ -306,17 +306,18 @@ function onTouchEnd() {
306
306
  @touchcancel="onTouchEnd"
307
307
  >
308
308
  <slot name="header">
309
- <h2 class="text-base font-semibold text-gray-900 dark:text-gray-100">
309
+ <h2 v-if="title" class="text-base font-semibold text-gray-900 dark:text-gray-100">
310
310
  {{ title }}
311
311
  </h2>
312
- <button
313
- type="button"
314
- class="rounded-md p-1 text-gray-500 transition hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-gray-200"
315
- @click="closeIfAllowed"
316
- >
317
- <a-icon-x-mark class="size-4" />
318
- </button>
319
312
  </slot>
313
+ <!-- Кнопка закрытия не зависит от title и слота header — рендерится всегда (если header не скрыт). -->
314
+ <button
315
+ type="button"
316
+ class="ml-auto rounded-md p-1 text-gray-500 transition hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-gray-200"
317
+ @click="closeIfAllowed"
318
+ >
319
+ <a-icon-x-mark class="size-4" />
320
+ </button>
320
321
  </header>
321
322
 
322
323
  <div class="min-h-0 flex-1 overflow-auto" :class="contentClass">
package/lang/en.ts CHANGED
@@ -470,7 +470,7 @@ const EnLocale: RuLocale = {
470
470
  },
471
471
  leaveNote: {
472
472
  title: 'Leave a note',
473
- placeholder: 'Write a note...',
473
+ placeholder: 'Your note',
474
474
  limit: 'The limit on notes for this company by you has expired',
475
475
  errors: {
476
476
  required: 'This field is required',