contactstudiocstools 1.0.224

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 (91) hide show
  1. package/README.md +94 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.ts +7 -0
  4. package/dist/module.json +5 -0
  5. package/dist/module.mjs +72 -0
  6. package/dist/runtime/components/Atom.Alert.vue +46 -0
  7. package/dist/runtime/components/Atom.Auth.vue +37 -0
  8. package/dist/runtime/components/Atom.BannerChatEmpty.vue +18 -0
  9. package/dist/runtime/components/Atom.BannerPage404.vue +28 -0
  10. package/dist/runtime/components/Atom.BannerPageUnauthorized.vue +18 -0
  11. package/dist/runtime/components/Atom.Breadcrumb.vue +26 -0
  12. package/dist/runtime/components/Atom.ChatContact.vue +136 -0
  13. package/dist/runtime/components/Atom.ChatContactSchedule.vue +87 -0
  14. package/dist/runtime/components/Atom.ChatMessageFooter.vue +25 -0
  15. package/dist/runtime/components/Atom.DarkMode.vue +67 -0
  16. package/dist/runtime/components/Atom.DraggableWindow.vue +102 -0
  17. package/dist/runtime/components/Atom.Dropdown.vue +9 -0
  18. package/dist/runtime/components/Atom.DropdownSearchable.vue +25 -0
  19. package/dist/runtime/components/Atom.Fetch.vue +46 -0
  20. package/dist/runtime/components/Atom.Field.vue +43 -0
  21. package/dist/runtime/components/Atom.FieldDate.vue +19 -0
  22. package/dist/runtime/components/Atom.FieldNumber.vue +19 -0
  23. package/dist/runtime/components/Atom.FieldPhone.vue +92 -0
  24. package/dist/runtime/components/Atom.FieldSelect.vue +28 -0
  25. package/dist/runtime/components/Atom.FieldSelectMultiple.vue +49 -0
  26. package/dist/runtime/components/Atom.FieldText.vue +19 -0
  27. package/dist/runtime/components/Atom.FieldTextarea.vue +41 -0
  28. package/dist/runtime/components/Atom.Loading.vue +80 -0
  29. package/dist/runtime/components/Atom.Notification.vue +48 -0
  30. package/dist/runtime/components/Atom.Ringtone.vue +23 -0
  31. package/dist/runtime/components/Atom.SelectTreeField.vue +49 -0
  32. package/dist/runtime/components/Atom.Snapshot.vue +33 -0
  33. package/dist/runtime/components/Atom.Tabs.vue +60 -0
  34. package/dist/runtime/components/Molecule.ChatMessageFile.vue +102 -0
  35. package/dist/runtime/components/Molecule.ChatMessageOption.vue +85 -0
  36. package/dist/runtime/components/Molecule.ChatMessageText.vue +36 -0
  37. package/dist/runtime/components/Molecule.ClientHistory.vue +62 -0
  38. package/dist/runtime/components/Molecule.DropdownDDI.vue +333 -0
  39. package/dist/runtime/components/Molecule.FieldGroup.vue +73 -0
  40. package/dist/runtime/components/Molecule.FieldSelectMultiple.vue +19 -0
  41. package/dist/runtime/components/Molecule.File.vue +84 -0
  42. package/dist/runtime/components/Molecule.SelectTreeSearchable.vue +126 -0
  43. package/dist/runtime/components/Molecule.Status.vue +154 -0
  44. package/dist/runtime/components/Molecule.TimeDaily.vue +9 -0
  45. package/dist/runtime/components/Organism.Attachments.vue +139 -0
  46. package/dist/runtime/components/Organism.ChatMessages.vue +31 -0
  47. package/dist/runtime/components/Organism.ChatRoom.vue +342 -0
  48. package/dist/runtime/components/Organism.ChatSchedule.vue +110 -0
  49. package/dist/runtime/components/Organism.ClientHistoryTable.vue +85 -0
  50. package/dist/runtime/components/Organism.ClientHistoryTimeline.vue +77 -0
  51. package/dist/runtime/components/Organism.FAQ.vue +88 -0
  52. package/dist/runtime/components/Organism.Form.vue +67 -0
  53. package/dist/runtime/components/Organism.FormMailing.vue +112 -0
  54. package/dist/runtime/components/Organism.HeaderMain.vue +79 -0
  55. package/dist/runtime/components/Organism.Manifestation.vue +146 -0
  56. package/dist/runtime/components/Organism.Nav.vue +27 -0
  57. package/dist/runtime/components/Organism.NavMain.vue +187 -0
  58. package/dist/runtime/components/Organism.PageContainer.vue +22 -0
  59. package/dist/runtime/components/Organism.Schedule.vue +170 -0
  60. package/dist/runtime/components/Organism.Tabulation.vue +237 -0
  61. package/dist/runtime/components/types/dto.d.ts +16 -0
  62. package/dist/runtime/components/types/dto.mjs +236 -0
  63. package/dist/runtime/components/types/helpers.d.ts +39 -0
  64. package/dist/runtime/components/types/helpers.mjs +295 -0
  65. package/dist/runtime/components/types/index.d.ts +4 -0
  66. package/dist/runtime/components/types/index.mjs +4 -0
  67. package/dist/runtime/components/types/types.d.ts +198 -0
  68. package/dist/runtime/components/types/types.mjs +35 -0
  69. package/dist/runtime/index.css +1 -0
  70. package/dist/runtime/plugins/clickOutside.d.ts +2 -0
  71. package/dist/runtime/plugins/clickOutside.mjs +16 -0
  72. package/dist/runtime/plugins/emitter.d.ts +2 -0
  73. package/dist/runtime/plugins/emitter.mjs +17 -0
  74. package/dist/runtime/public/192x192.png +0 -0
  75. package/dist/runtime/public/404.svg +1 -0
  76. package/dist/runtime/public/512x512.png +0 -0
  77. package/dist/runtime/public/chat.svg +138 -0
  78. package/dist/runtime/public/chatbg.png +0 -0
  79. package/dist/runtime/public/dev-sw.d.ts +0 -0
  80. package/dist/runtime/public/dev-sw.mjs +0 -0
  81. package/dist/runtime/public/empty.svg +1 -0
  82. package/dist/runtime/public/loading.svg +1 -0
  83. package/dist/runtime/public/messages.svg +1 -0
  84. package/dist/runtime/public/privacy.svg +1 -0
  85. package/dist/runtime/public/ringtone.mp3 +0 -0
  86. package/dist/runtime/public/security.svg +188 -0
  87. package/dist/runtime/public/snapshot.d.ts +15 -0
  88. package/dist/runtime/public/snapshot.mjs +77 -0
  89. package/dist/runtime/public/unauthorized.svg +1 -0
  90. package/dist/types.d.ts +10 -0
  91. package/package.json +50 -0
@@ -0,0 +1,333 @@
1
+ <template>
2
+ <div class="w-18">
3
+ <!-- banner -->
4
+ <figure
5
+ class="cursor-pointer"
6
+ :dropdown-trigger="dropdownID"
7
+ >
8
+ <span
9
+ class="fi mx-1"
10
+ :class="`fi-${selected.icon}`"
11
+ />
12
+ ({{ selected.ddi }})
13
+ <span class="bi-caret-down-fill text-[11px] text-secondary" />
14
+ </figure>
15
+ <!-- dropdown -->
16
+ <AtomDropdownSearchable
17
+ v-model="search"
18
+ :dropdown="dropdownID"
19
+ class="fixed"
20
+ >
21
+ <!-- items -->
22
+ <div class="max-h-36 overflow-y-auto scrollbar">
23
+ <li
24
+ v-for="({ icon, ddi, name }, i) in ddisFiltered"
25
+ :key="i"
26
+ class="list"
27
+ @click="selectDDI({ icon, ddi, name })"
28
+ >
29
+ <div class="item">
30
+ <span
31
+ class="fi mr-2"
32
+ :class="`fi-${icon}`"
33
+ />
34
+ {{ name }}
35
+ ({{ ddi }})
36
+ </div>
37
+ </li>
38
+ </div>
39
+ </AtomDropdownSearchable>
40
+ </div>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import { ref, reactive, computed } from "vue";
45
+ import { randomID, IDDI, IDDIs } from "./types";
46
+
47
+ // props
48
+ interface IProps {
49
+ modelValue: IDDI;
50
+ }
51
+ const props = defineProps<IProps>();
52
+
53
+ // computed
54
+ const ddisFiltered = computed<IDDIs>(() => {
55
+ if (!search.value.trim()) return ddis;
56
+
57
+ return ddis.filter(({ ddi, name }) => {
58
+ const ddiMatched = !!ddi.match(new RegExp(search.value, "i"));
59
+ const nameMatched = !!name.match(new RegExp(search.value, "i"));
60
+
61
+ return ddiMatched || nameMatched;
62
+ });
63
+ });
64
+
65
+ // data
66
+ const dropdownID = ref<string>(randomID());
67
+ const search = ref<string>("");
68
+ const selected = reactive<IDDI>(props.modelValue);
69
+ const ddis = reactive<IDDIs>([
70
+ { icon: "af", ddi: "+93", name: "Afeganistão" },
71
+ { icon: "za", ddi: "+27", name: "África do Sul" },
72
+ { icon: "al", ddi: "+355", name: "Albânia" },
73
+ { icon: "de", ddi: "+49", name: "Alemanha" },
74
+ { icon: "ad", ddi: "+376", name: "Andorra" },
75
+ { icon: "ao", ddi: "+244", name: "Angola" },
76
+ { icon: "ai", ddi: "+1", name: "Anguilla" },
77
+ { icon: "ag", ddi: "+1", name: "Antígua e Barbuda" },
78
+ { icon: "nl", ddi: "+599", name: "Antilhas Holandesas" },
79
+ { icon: "sa", ddi: "+966", name: "Arábia Saudita" },
80
+ { icon: "dz", ddi: "+213", name: "Argélia" },
81
+ { icon: "ar", ddi: "+54", name: "Argentina" },
82
+ { icon: "am", ddi: "+374", name: "Armênia" },
83
+ { icon: "aw", ddi: "+297", name: "Aruba" },
84
+ { icon: "ac", ddi: "+247", name: "Ascensão" },
85
+ { icon: "au", ddi: "+61", name: "Austrália" },
86
+ { icon: "at", ddi: "+43", name: "Áustria" },
87
+ { icon: "az", ddi: "+994", name: "Azerbaijão" },
88
+ { icon: "bs", ddi: "+1", name: "Bahamas" },
89
+ { icon: "bd", ddi: "+880", name: "Bangladesh" },
90
+ { icon: "bb", ddi: "+1", name: "Barbados" },
91
+ { icon: "bh", ddi: "+973", name: "Bahrein" },
92
+ { icon: "be", ddi: "+32", name: "Bélgica" },
93
+ { icon: "bz", ddi: "+501", name: "Belize" },
94
+ { icon: "bj", ddi: "+229", name: "Benim" },
95
+ { icon: "bm", ddi: "+1", name: "Bermudas" },
96
+ { icon: "by", ddi: "+375", name: "Bielorrússia" },
97
+ { icon: "bo", ddi: "+591", name: "Bolívia" },
98
+ { icon: "ba", ddi: "+387", name: "Bósnia e Herzegovina" },
99
+ { icon: "bw", ddi: "+267", name: "Botswana" },
100
+ { icon: "br", ddi: "+55", name: "Brasil" },
101
+ { icon: "bn", ddi: "+673", name: "Brunei" },
102
+ { icon: "bg", ddi: "+359", name: "Bulgária" },
103
+ { icon: "bf", ddi: "+226", name: "Burkina Faso" },
104
+ { icon: "bi", ddi: "+257", name: "Burundi" },
105
+ { icon: "bt", ddi: "+975", name: "Butão" },
106
+ { icon: "cv", ddi: "+238", name: "Cabo Verde" },
107
+ { icon: "cm", ddi: "+237", name: "Camarões" },
108
+ { icon: "kh", ddi: "+855", name: "Camboja" },
109
+ { icon: "ca", ddi: "+1", name: "Canadá" },
110
+ { icon: "kz", ddi: "+7", name: "Cazaquistão" },
111
+ { icon: "td", ddi: "+237", name: "Chade" },
112
+ { icon: "cl", ddi: "+56", name: "Chile" },
113
+ { icon: "cn", ddi: "+86", name: "República Popular da China" },
114
+ { icon: "cy", ddi: "+357", name: "Chipre" },
115
+ { icon: "co", ddi: "+57", name: "Colômbia" },
116
+ { icon: "km", ddi: "+269", name: "Comores" },
117
+ { icon: "cg", ddi: "+242", name: "Congo-Brazzaville" },
118
+ { icon: "cd", ddi: "+243", name: "Congo-Kinshasa" },
119
+ { icon: "kp", ddi: "+850", name: "Coreia do Norte" },
120
+ { icon: "kr", ddi: "+82", name: "Coreia do Sul" },
121
+ { icon: "ci", ddi: "+225", name: "Costa do Marfim" },
122
+ { icon: "cr", ddi: "+506", name: "Costa Rica" },
123
+ { icon: "hr", ddi: "+385", name: "Croácia" },
124
+ { icon: "cu", ddi: "+53", name: "Cuba" },
125
+ { icon: "dk", ddi: "+45", name: "Dinamarca" },
126
+ { icon: "dj", ddi: "+253", name: "Djibuti" },
127
+ { icon: "do", ddi: "+1", name: "Dominica" },
128
+ { icon: "eg", ddi: "+20", name: "Egipto" },
129
+ { icon: "sv", ddi: "+503", name: "El Salvador" },
130
+ { icon: "ae", ddi: "+971", name: "Emirados Árabes Unidos" },
131
+ { icon: "ec", ddi: "+593", name: "Equador" },
132
+ { icon: "er", ddi: "+291", name: "Eritreia" },
133
+ { icon: "sk", ddi: "+421", name: "Eslováquia" },
134
+ { icon: "si", ddi: "+386", name: "Eslovénia" },
135
+ { icon: "es", ddi: "+34", name: "Espanha" },
136
+ { icon: "us", ddi: "+1", name: "Estados Unidos" },
137
+ { icon: "ee", ddi: "+372", name: "Estónia" },
138
+ { icon: "sz", ddi: "+268", name: "Essuatíni" },
139
+ { icon: "et", ddi: "+251", name: "Etiópia" },
140
+ { icon: "fj", ddi: "+679", name: "Fiji" },
141
+ { icon: "ph", ddi: "+63", name: "Filipinas" },
142
+ { icon: "fi", ddi: "+358", name: "Finlândia" },
143
+ { icon: "fr", ddi: "+33", name: "França" },
144
+ { icon: "ga", ddi: "+241", name: "Gabão" },
145
+ { icon: "gm", ddi: "+220", name: "Gâmbia" },
146
+ { icon: "gh", ddi: "+233", name: "Gana" },
147
+ { icon: "ge", ddi: "+995", name: "Geórgia" },
148
+ { icon: "gi", ddi: "+350", name: "Gibraltar" },
149
+ { icon: "gd", ddi: "+1", name: "Granada" },
150
+ { icon: "gr", ddi: "+30", name: "Grécia" },
151
+ { icon: "gl", ddi: "+299", name: "Groenlândia" },
152
+ { icon: "gp", ddi: "+590", name: "Guadalupe" },
153
+ { icon: "gu", ddi: "+671", name: "Guam" },
154
+ { icon: "gt", ddi: "+502", name: "Guatemala" },
155
+ { icon: "gy", ddi: "+592", name: "Guiana" },
156
+ { icon: "gf", ddi: "+594", name: "Guiana Francesa" },
157
+ { icon: "gn", ddi: "+224", name: "Guiné" },
158
+ { icon: "gw", ddi: "+245", name: "Guiné-Bissau" },
159
+ { icon: "gq", ddi: "+240", name: "Guiné Equatorial" },
160
+ { icon: "ht", ddi: "+509", name: "Haiti" },
161
+ { icon: "hn", ddi: "+504", name: "Honduras" },
162
+ { icon: "hk", ddi: "+852", name: "Hong Kong" },
163
+ { icon: "hu", ddi: "+36", name: "Hungria" },
164
+ { icon: "ye", ddi: "+967", name: "Iêmen" },
165
+ { icon: "ky", ddi: "+1", name: "Ilhas Cayman" },
166
+ { icon: "cx", ddi: "+672", name: "Ilha Christmas" },
167
+ { icon: "cc", ddi: "+672", name: "Ilhas Cocos" },
168
+ { icon: "ck", ddi: "+682", name: "Ilhas Cook" },
169
+ { icon: "fo", ddi: "+298", name: "Ilhas Féroe" },
170
+ { icon: "hm", ddi: "+672", name: "Ilha Heard e Ilhas McDonald" },
171
+ { icon: "mv", ddi: "+960", name: "Maldivas" },
172
+ { icon: "fk", ddi: "+500", name: "Ilhas Malvinas" },
173
+ { icon: "mp", ddi: "+1", name: "Ilhas Marianas do Norte" },
174
+ { icon: "mh", ddi: "+692", name: "Ilhas Marshall" },
175
+ { icon: "nf", ddi: "+672", name: "Ilha Norfolk" },
176
+ { icon: "sb", ddi: "+677", name: "Ilhas Salomão" },
177
+ { icon: "vi", ddi: "+1", name: "Ilhas Virgens Americanas" },
178
+ { icon: "vg", ddi: "+1", name: "Ilhas Virgens Britânicas" },
179
+ { icon: "in", ddi: "+91", name: "Índia" },
180
+ { icon: "id", ddi: "+62", name: "Indonésia" },
181
+ { icon: "ir", ddi: "+98", name: "Irã" },
182
+ { icon: "iq", ddi: "+964", name: "Iraque" },
183
+ { icon: "ie", ddi: "+353", name: "Irlanda" },
184
+ { icon: "is", ddi: "+354", name: "Islândia" },
185
+ { icon: "il", ddi: "+972", name: " Israel" },
186
+ { icon: "it", ddi: "+39", name: "Itália" },
187
+ { icon: "jm", ddi: "+1", name: "Jamaica" },
188
+ { icon: "jp", ddi: "+81", name: "Japão" },
189
+ { icon: "jo", ddi: "+962", name: "Jordânia" },
190
+ { icon: "ki", ddi: "+686", name: "Kiribati" },
191
+ { icon: "xk", ddi: "+383", name: "Kosovo" },
192
+ { icon: "kw", ddi: "+965", name: "Kuwait" },
193
+ { icon: "la", ddi: "+856", name: "Laos" },
194
+ { icon: "ls", ddi: "+266", name: "Lesoto" },
195
+ { icon: "lv", ddi: "+371", name: "Letônia" },
196
+ { icon: "lb", ddi: "+961", name: "Líbano" },
197
+ { icon: "lr", ddi: "+231", name: "Libéria" },
198
+ { icon: "ly", ddi: "+218", name: "Líbia" },
199
+ { icon: "li", ddi: "+423", name: "Liechtenstein" },
200
+ { icon: "lt", ddi: "+370", name: "Lituânia" },
201
+ { icon: "lu", ddi: "+352", name: "Luxemburgo" },
202
+ { icon: "mo", ddi: "+853", name: "Macau" },
203
+ { icon: "mk", ddi: "+389", name: "República da Macedônia" },
204
+ { icon: "mg", ddi: "+261", name: "Madagascar" },
205
+ { icon: "my", ddi: "+60", name: "Malásia" },
206
+ { icon: "mw", ddi: "+265", name: "Malawi" },
207
+ { icon: "ml", ddi: "+223", name: "Mali" },
208
+ { icon: "mt", ddi: "+356", name: "Malta" },
209
+ { icon: "ma", ddi: "+212", name: "Marrocos" },
210
+ { icon: "mq", ddi: "+596", name: "Martinica" },
211
+ { icon: "mu", ddi: "+230", name: "Maurícia" },
212
+ { icon: "mr", ddi: "+222", name: "Mauritânia" },
213
+ { icon: "yt", ddi: "+269", name: "Mayotte" },
214
+ { icon: "mx", ddi: "+52", name: "México" },
215
+ { icon: "fm", ddi: "+691", name: "Estados Federados da Micronésia" },
216
+ { icon: "mz", ddi: "+258", name: "Moçambique" },
217
+ { icon: "md", ddi: "+373", name: "Moldávia" },
218
+ { icon: "mc", ddi: "+377", name: "Mônaco" },
219
+ { icon: "mn", ddi: "+976", name: "Mongólia" },
220
+ { icon: "me", ddi: "+382", name: "Montenegro" },
221
+ { icon: "ms", ddi: "+1", name: "Montserrat" },
222
+ { icon: "mm", ddi: "+95", name: "Myanmar" },
223
+ { icon: "na", ddi: "+264", name: "Namíbia" },
224
+ { icon: "nr", ddi: "+674", name: "Nauru" },
225
+ { icon: "np", ddi: "+977", name: "Nepal" },
226
+ { icon: "ni", ddi: "+505", name: "Nicarágua" },
227
+ { icon: "ne", ddi: "+227", name: "Níger" },
228
+ { icon: "ng", ddi: "+234", name: "Nigéria" },
229
+ { icon: "nu", ddi: "+683", name: "Niue" },
230
+ { icon: "no", ddi: "+47", name: "Noruega" },
231
+ { icon: "nc", ddi: "+687", name: "Nova Caledônia" },
232
+ { icon: "nz", ddi: "+64", name: "Nova Zelândia" },
233
+ { icon: "om", ddi: "+968", name: "Omã" },
234
+ { icon: "nl", ddi: "+31", name: "Países Baixos" },
235
+ { icon: "pw", ddi: "+680", name: "Palau" },
236
+ { icon: "ps", ddi: "+970", name: "Palestina" },
237
+ { icon: "pa", ddi: "+507", name: "Panamá" },
238
+ { icon: "pg", ddi: "+675", name: "Papua-Nova Guiné" },
239
+ { icon: "pk", ddi: "+92", name: "Paquistão" },
240
+ { icon: "py", ddi: "+595", name: "Paraguai" },
241
+ { icon: "pe", ddi: "+51", name: "Peru" },
242
+ { icon: "pf", ddi: "+689", name: "Polinésia Francesa" },
243
+ { icon: "pl", ddi: "+48", name: "Polônia" },
244
+ { icon: "pr", ddi: "+1", name: "Porto Rico" },
245
+ { icon: "pt", ddi: "+351", name: "Portugal" },
246
+ { icon: "qa", ddi: "+974", name: "Qatar" },
247
+ { icon: "ke", ddi: "+254", name: "Quênia" },
248
+ { icon: "kg", ddi: "+996", name: "Quirguistão" },
249
+ { icon: "gb", ddi: "+44", name: "Reino Unido" },
250
+ { icon: "cf", ddi: "+236", name: "República Centro-Africana" },
251
+ { icon: "do", ddi: "+1", name: "República Dominicana" },
252
+ { icon: "cz", ddi: "+420", name: "República Tcheca" },
253
+ { icon: "re", ddi: "+262", name: "Reunião" },
254
+ { icon: "ro", ddi: "+40", name: "Romênia" },
255
+ { icon: "rw", ddi: "+250", name: "Ruanda" },
256
+ { icon: "ru", ddi: "+7", name: "Rússia" },
257
+ { icon: "eh", ddi: "+212", name: "Saara Ocidental" },
258
+ { icon: "ws", ddi: "+685", name: "Samoa" },
259
+ { icon: "as", ddi: "+1", name: "Samoa Americana" },
260
+ { icon: "sh", ddi: "+290", name: "Santa Helena (território)" },
261
+ { icon: "lc", ddi: "+1", name: "Santa Lúcia" },
262
+ { icon: "kn", ddi: "+1", name: "São Cristóvão e Nevis" },
263
+ { icon: "sm", ddi: "+378", name: "São Marinho" },
264
+ { icon: "pm", ddi: "+508", name: "Saint-Pierre e Miquelon" },
265
+ { icon: "st", ddi: "+239", name: "São Tomé e Príncipe" },
266
+ { icon: "vc", ddi: "+1", name: "São Vicente e Granadinas" },
267
+ { icon: "sc", ddi: "+248", name: "Seicheles" },
268
+ { icon: "sn", ddi: "+221", name: "Senegal" },
269
+ { icon: "sl", ddi: "+232", name: "Serra Leoa" },
270
+ { icon: "rs", ddi: "+381", name: "Sérvia" },
271
+ { icon: "sg", ddi: "+65", name: "Singapura" },
272
+ { icon: "sy", ddi: "+963", name: "Síria" },
273
+ { icon: "so", ddi: "+252", name: "Somália" },
274
+ { icon: "lk", ddi: "+94", name: "Sri Lanka" },
275
+ { icon: "sd", ddi: "+249", name: "Sudão" },
276
+ { icon: "ss", ddi: "+211", name: "Sudão do Sul" },
277
+ { icon: "se", ddi: "+46", name: "Suécia" },
278
+ { icon: "ch", ddi: "+41", name: "Suíça" },
279
+ { icon: "sr", ddi: "+597", name: "Suriname" },
280
+ { icon: "tj", ddi: "+992", name: "Tadjiquistão" },
281
+ { icon: "th", ddi: "+66", name: "Tailândia" },
282
+ { icon: "cn", ddi: "+886", name: "República da China" },
283
+ { icon: "tz", ddi: "+255", name: "Tanzânia" },
284
+ { icon: "io", ddi: "+246", name: "Território Britânico do Oceano Índico" },
285
+ { icon: "tl", ddi: "+670", name: "Timor-Leste" },
286
+ { icon: "tg", ddi: "+228", name: "Togo" },
287
+ { icon: "tk", ddi: "+690", name: "Tokelau" },
288
+ { icon: "to", ddi: "+676", name: "Tonga" },
289
+ { icon: "tt", ddi: "+1", name: "Trinidad e Tobago" },
290
+ { icon: "tn", ddi: "+216", name: "Tunísia" },
291
+ { icon: "tc", ddi: "+1", name: "Turcas e Caicos" },
292
+ { icon: "tm", ddi: "+993", name: "Turquemenistão" },
293
+ { icon: "tr", ddi: "+90", name: "Turquia" },
294
+ { icon: "tv", ddi: "+688", name: "Tuvalu" },
295
+ { icon: "ua", ddi: "+380", name: "Ucrânia" },
296
+ { icon: "ug", ddi: "+256", name: "Uganda" },
297
+ { icon: "uy", ddi: "+598", name: "Uruguai" },
298
+ { icon: "uz", ddi: "+998", name: "Uzbequistão" },
299
+ { icon: "vu", ddi: "+678", name: "Vanuatu" },
300
+ { icon: "va", ddi: "+379", name: "Vaticano" },
301
+ { icon: "ve", ddi: "+58", name: "Venezuela" },
302
+ { icon: "vn", ddi: "+84", name: "Vietnã" },
303
+ { icon: "wf", ddi: "+681", name: "Wallis e Futuna" },
304
+ { icon: "zm", ddi: "+260", name: "Zâmbia" },
305
+ { icon: "zw", ddi: "+263", name: "Zimbábue" },
306
+ ]);
307
+
308
+ // methods
309
+ async function set(ddi: string) {
310
+ const found = ddis.find((DDI) => {
311
+ return DDI.ddi.includes(`+${ddi}`);
312
+ });
313
+
314
+ if (!found) return;
315
+
316
+ Object.assign(selected, found);
317
+ }
318
+ async function selectDDI(ddi: IDDI) {
319
+ Object.assign(selected, ddi);
320
+ search.value = "";
321
+ document.body.click();
322
+ emit("update:modelValue", selected);
323
+ // emit("change");
324
+ }
325
+
326
+ // emits
327
+ const emit = defineEmits(["update:modelValue", "change"]);
328
+
329
+ // expose
330
+ defineExpose({ set });
331
+ </script>
332
+
333
+ <style scoped></style>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div
3
+ :class="{ error }"
4
+ :message="getMessageByState"
5
+ class="field-group"
6
+ @blur.capture="validateAndSetState"
7
+ >
8
+ <div class="input-group">
9
+ <slot />
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { ref, computed, onMounted, watch } from "vue";
16
+ import { IRules } from "./types";
17
+
18
+ // props
19
+ interface IProps {
20
+ rules?: IRules;
21
+ }
22
+ const props = defineProps<IProps>();
23
+
24
+ // computed
25
+ const getMessageByState = computed<string>(() => {
26
+ if (error.value) return message.value;
27
+
28
+ return "";
29
+ });
30
+
31
+ // data
32
+ const message = ref<string>("");
33
+ const error = ref<boolean>(false);
34
+
35
+ // methods
36
+ function validateAndSetState(): boolean {
37
+ const valid = validate();
38
+ error.value = !valid;
39
+ return valid;
40
+ }
41
+ function validate(): boolean {
42
+ if (!props.rules) return true;
43
+
44
+ for (const rule of props.rules) {
45
+ const result = rule();
46
+
47
+ if (typeof result === "string") {
48
+ message.value = result;
49
+ return false;
50
+ }
51
+
52
+ if (!result) {
53
+ message.value = "";
54
+ return false;
55
+ }
56
+ }
57
+
58
+ return true;
59
+ }
60
+
61
+ // mounted
62
+ onMounted(() => {
63
+ validateAndSetState();
64
+ });
65
+
66
+ // watch
67
+ watch(() => props.rules, validateAndSetState, { deep: true });
68
+
69
+ // expose
70
+ defineExpose({ validateAndSetState });
71
+ </script>
72
+
73
+ <style scoped></style>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <label class="field-group">
3
+ <div class="input-group">
4
+ <select
5
+ type="text"
6
+ class="input"
7
+ />
8
+ <div class="addon !border-none !p-0 !rounded-r-md">
9
+ <button class="h-full btn btn-solid-primary rounded-l-none max-h-none">
10
+ Adicionar
11
+ </button>
12
+ </div>
13
+ </div>
14
+ </label>
15
+ </template>
16
+
17
+ <script setup lang="ts"></script>
18
+
19
+ <style scoped></style>
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div :disabled="isLoading">
3
+ <!-- field -->
4
+ <label
5
+ :class="getStatus"
6
+ class="field-group"
7
+ >
8
+ <!-- file -->
9
+ <div
10
+ class="input flex items-center cursor-pointer"
11
+ @click="view"
12
+ >
13
+ <!-- info -->
14
+ <p class="cursor-pointer">
15
+ <span v-text="getName" />
16
+ <b v-text="getExtension" />
17
+ </p>
18
+
19
+ <div
20
+ v-if="isLoading"
21
+ class="spin primary ml-2"
22
+ />
23
+ </div>
24
+
25
+ <!-- actions -->
26
+ <div
27
+ ref="DropdownActionsRef"
28
+ :disabled="!actions"
29
+ :dropdown-trigger="dropdownID"
30
+ class="addon cursor-pointer"
31
+ >
32
+ <i class="bi-three-dots-vertical" />
33
+ </div>
34
+ </label>
35
+
36
+ <AtomDropdown
37
+ :dropdown="dropdownID"
38
+ class="!p-1"
39
+ >
40
+ <slot />
41
+ </AtomDropdown>
42
+ </div>
43
+ </template>
44
+
45
+ <script setup lang="ts">
46
+ import { ref, computed } from "vue";
47
+ import { EFieldStatus, IFieldHints, randomID } from "./types";
48
+
49
+ interface IProps {
50
+ file: File;
51
+ hints?: IFieldHints;
52
+ status?: EFieldStatus;
53
+ actions?: boolean;
54
+ }
55
+ const props = defineProps<IProps>();
56
+
57
+ // computed
58
+ const getStatus = computed<EFieldStatus>(() => {
59
+ if (!props.status) return EFieldStatus.none;
60
+ return props.status;
61
+ });
62
+ const isLoading = computed<boolean>(() => {
63
+ return getStatus.value === EFieldStatus.loading;
64
+ });
65
+ const getName = computed(() => {
66
+ const parts = props.file.name.split(".");
67
+ parts.pop();
68
+ return parts.join(".");
69
+ });
70
+ const getExtension = computed(() => {
71
+ const parts = props.file.name.split(".");
72
+ return `.${parts[parts.length - 1]}`;
73
+ });
74
+
75
+ // data
76
+ const dropdownID = ref<string>(randomID());
77
+
78
+ // methods
79
+ function view(): void {
80
+ window.open(window.URL.createObjectURL(props.file));
81
+ }
82
+ </script>
83
+
84
+ <style scoped></style>
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div class="field-group">
3
+ <div class="input-group">
4
+ <AtomSelectTreeField
5
+ :nodes="nodesSelecteds"
6
+ :dropdown-trigger="dropdownID"
7
+ @delete="del"
8
+ />
9
+
10
+ <div class="addon !border-none !p-0 !rounded-r-md">
11
+ <button
12
+ :disabled="!isLastLevel"
13
+ class="h-full btn btn-solid-primary rounded-l-none max-h-none"
14
+ @click="add"
15
+ >
16
+ Adicionar
17
+ </button>
18
+ </div>
19
+ </div>
20
+
21
+ <div v-show="!isLastLevel">
22
+ <AtomDropdownSearchable
23
+ v-model="search"
24
+ :dropdown="dropdownID"
25
+ static
26
+ >
27
+ <li class="label !text-amber-500 flex">
28
+ <span
29
+ class="w-full"
30
+ v-text="getLabelByLevel"
31
+ />
32
+ <i class="bi-exclamation-triangle-fill" />
33
+ </li>
34
+
35
+ <li
36
+ v-for="(node, i) in getLastNodesFiltered"
37
+ :key="i"
38
+ class="item flex !leading-3"
39
+ @click="push(node)"
40
+ >
41
+ <span
42
+ class="!w-full"
43
+ v-text="node.label"
44
+ />
45
+ <i class="bi-chevron-right ml-3" />
46
+ </li>
47
+ </AtomDropdownSearchable>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ import { ref, reactive, computed } from "vue";
54
+ import { ISelectTree, INodes, INode, sleep } from "./types";
55
+ import { randomID } from "./types";
56
+
57
+ // props
58
+ interface IProps {
59
+ selectTree: ISelectTree;
60
+ }
61
+ const props = defineProps<IProps>();
62
+
63
+ // emits
64
+ interface IEmits {
65
+ (e: "add", nodes: INodes): void;
66
+ }
67
+ const emit = defineEmits<IEmits>();
68
+
69
+ // computed
70
+ const getLabelByLevel = computed<string>(() => {
71
+ const labels = props.selectTree.labels;
72
+
73
+ if (isLastLevel.value) {
74
+ return `Selecione: ${labels.slice(-1)}`;
75
+ }
76
+
77
+ return `Selecione: ${labels[getLevel.value]}`;
78
+ });
79
+ const getLastNodes = computed<INodes | []>(() => {
80
+ if (nodesSelectedsIsEmpty.value) return props.selectTree.nodes;
81
+
82
+ return nodesSelecteds.slice(-1)[0].children ?? [];
83
+ });
84
+ const getLastNodesFiltered = computed<INodes | []>(() => {
85
+ if (!search.value.trim()) return getLastNodes.value;
86
+
87
+ return getLastNodes.value.filter(
88
+ ({ label }) => !!label.match(new RegExp(search.value, "i"))
89
+ );
90
+ });
91
+ const isLastLevel = computed<boolean>(() => {
92
+ return props.selectTree.labels.length === getLevel.value;
93
+ });
94
+ const nodesSelectedsIsEmpty = computed<boolean>(() => !nodesSelecteds.length);
95
+ const getLevel = computed<number>(() => nodesSelecteds.length);
96
+
97
+ // data
98
+ const dropdownID = ref<string>(randomID());
99
+ const search = ref<string>("");
100
+ const nodesSelecteds = reactive<INodes>([]);
101
+
102
+ // methods
103
+ function add(): void {
104
+ emit("add", [...nodesSelecteds]);
105
+ reset();
106
+ }
107
+ async function push(nodeSelected: INode): Promise<void> {
108
+ await sleep(0);
109
+
110
+ if (isLastLevel.value) {
111
+ nodesSelecteds.pop();
112
+ }
113
+
114
+ nodesSelecteds.push(nodeSelected);
115
+
116
+ search.value = "";
117
+ }
118
+ function del(node: INode): void {
119
+ nodesSelecteds.length = nodesSelecteds.indexOf(node);
120
+ }
121
+ function reset(): void {
122
+ nodesSelecteds.length = 0;
123
+ }
124
+ </script>
125
+
126
+ <style scoped></style>