@skyservice-developers/vue-dev-kit 1.5.11 → 2.0.0

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 (57) hide show
  1. package/README.md +96 -15
  2. package/dist/api-BOvdjB3h.js +266 -0
  3. package/dist/api-D5C6FvTr.cjs +1 -0
  4. package/dist/components/BaseTeleport.vue.d.ts +14 -0
  5. package/dist/components/Dialog.vue.d.ts +28 -0
  6. package/dist/components/DialogModal.vue.d.ts +28 -0
  7. package/dist/components/DialogNext.vue.d.ts +28 -0
  8. package/dist/components/Header.vue.d.ts +37 -0
  9. package/dist/components/Modal.vue.d.ts +30 -0
  10. package/dist/components/SkyButton.vue.d.ts +22 -0
  11. package/dist/components/SkySelect.vue.d.ts +16 -0
  12. package/dist/components/index.d.ts +8 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/sdk/api.d.ts +54 -0
  15. package/dist/sdk/bridge.d.ts +43 -0
  16. package/dist/sdk/index.d.ts +6 -0
  17. package/dist/sdk/types.d.ts +73 -0
  18. package/dist/sdk/webview.d.ts +16 -0
  19. package/dist/sdk.cjs +1 -0
  20. package/dist/sdk.js +33 -0
  21. package/dist/style.css +1 -0
  22. package/dist/vue-dev-kit.cjs +1 -0
  23. package/dist/vue-dev-kit.js +903 -0
  24. package/package.json +32 -43
  25. package/dist/vue2/style.css +0 -1
  26. package/dist/vue2/vue-dev-kit.cjs +0 -1
  27. package/dist/vue2/vue-dev-kit.js +0 -2622
  28. package/dist/vue3/style.css +0 -1
  29. package/dist/vue3/vue-dev-kit.cjs +0 -1
  30. package/dist/vue3/vue-dev-kit.js +0 -2338
  31. package/src/index.js +0 -9
  32. package/src/shared/index.js +0 -1
  33. package/src/shared/types/index.d.ts +0 -72
  34. package/src/shared/utils/index.js +0 -2
  35. package/src/shared/utils/parentBridge.js +0 -84
  36. package/src/shared/utils/webviewCheck.js +0 -54
  37. package/src/styles/scrollbar.css +0 -17
  38. package/src/vue2/components/BaseTeleport.vue +0 -16
  39. package/src/vue2/components/Dialog.vue +0 -106
  40. package/src/vue2/components/DialogModal.vue +0 -439
  41. package/src/vue2/components/DialogNext.vue +0 -379
  42. package/src/vue2/components/Header.vue +0 -466
  43. package/src/vue2/components/Modal.vue +0 -252
  44. package/src/vue2/components/SkyButton.vue +0 -144
  45. package/src/vue2/components/SkySelect.vue +0 -327
  46. package/src/vue2/components/index.js +0 -6
  47. package/src/vue2/index.js +0 -2
  48. package/src/vue3/components/BaseTeleport.vue +0 -16
  49. package/src/vue3/components/Dialog.vue +0 -97
  50. package/src/vue3/components/DialogModal.vue +0 -458
  51. package/src/vue3/components/DialogNext.vue +0 -427
  52. package/src/vue3/components/Header.vue +0 -505
  53. package/src/vue3/components/Modal.vue +0 -253
  54. package/src/vue3/components/SkyButton.vue +0 -140
  55. package/src/vue3/components/SkySelect.vue +0 -379
  56. package/src/vue3/components/index.js +0 -8
  57. package/src/vue3/index.js +0 -2
@@ -1,379 +0,0 @@
1
- <template>
2
- <div
3
- ref="root"
4
- class="sky-select"
5
- :class="{
6
- 'sky-select-block': block,
7
- 'sky-select-open': open,
8
- 'sky-select-disabled': disabled,
9
- }"
10
- >
11
- <button
12
- type="button"
13
- class="sky-select-trigger"
14
- :disabled="disabled"
15
- @click="toggle"
16
- @keydown="onKeydown"
17
- >
18
- <span
19
- class="sky-select-value"
20
- :class="{ 'sky-select-placeholder': selectedOption === null }"
21
- >
22
- {{ selectedOption ? selectedOption.label : placeholder }}
23
- </span>
24
- <svg
25
- class="sky-select-chevron"
26
- viewBox="0 0 16 16"
27
- fill="none"
28
- aria-hidden="true"
29
- >
30
- <path
31
- d="M4 6l4 4 4-4"
32
- stroke="currentColor"
33
- stroke-width="1.5"
34
- stroke-linecap="round"
35
- stroke-linejoin="round"
36
- />
37
- </svg>
38
- </button>
39
-
40
- <template v-if="open">
41
- <Teleport v-if="teleport" to="body">
42
- <div
43
- ref="dropdownEl"
44
- class="sky-select-dropdown-teleported"
45
- :style="dropdownStyle"
46
- >
47
- <div
48
- v-for="(option, idx) in normalizedOptions"
49
- :key="option.value"
50
- class="sky-select-option"
51
- :class="{
52
- 'sky-select-option-selected': option.value === modelValue,
53
- 'sky-select-option-focused': idx === focusedIdx,
54
- }"
55
- @click="select(option)"
56
- @mouseenter="focusedIdx = idx"
57
- >
58
- <span>{{ option.label }}</span>
59
- <svg
60
- v-if="option.value === modelValue"
61
- class="sky-select-check"
62
- viewBox="0 0 16 16"
63
- fill="none"
64
- aria-hidden="true"
65
- >
66
- <path
67
- d="M3 8l4 4 6-6"
68
- stroke="currentColor"
69
- stroke-width="1.5"
70
- stroke-linecap="round"
71
- stroke-linejoin="round"
72
- />
73
- </svg>
74
- </div>
75
- </div>
76
- </Teleport>
77
- <div v-else class="sky-select-dropdown">
78
- <div
79
- v-for="(option, idx) in normalizedOptions"
80
- :key="option.value"
81
- class="sky-select-option"
82
- :class="{
83
- 'sky-select-option-selected': option.value === modelValue,
84
- 'sky-select-option-focused': idx === focusedIdx,
85
- }"
86
- @click="select(option)"
87
- @mouseenter="focusedIdx = idx"
88
- >
89
- <span>{{ option.label }}</span>
90
- <svg
91
- v-if="option.value === modelValue"
92
- class="sky-select-check"
93
- viewBox="0 0 16 16"
94
- fill="none"
95
- aria-hidden="true"
96
- >
97
- <path
98
- d="M3 8l4 4 6-6"
99
- stroke="currentColor"
100
- stroke-width="1.5"
101
- stroke-linecap="round"
102
- stroke-linejoin="round"
103
- />
104
- </svg>
105
- </div>
106
- </div>
107
- </template>
108
- </div>
109
- </template>
110
-
111
- <script setup>
112
- import { ref, computed, onBeforeUnmount } from "vue";
113
-
114
- const props = defineProps({
115
- modelValue: {
116
- default: null,
117
- },
118
- options: {
119
- type: Array,
120
- default: () => [],
121
- },
122
- placeholder: {
123
- type: String,
124
- default: "",
125
- },
126
- disabled: {
127
- type: Boolean,
128
- default: false,
129
- },
130
- block: {
131
- type: Boolean,
132
- default: false,
133
- },
134
- teleport: {
135
- type: Boolean,
136
- default: false,
137
- },
138
- });
139
-
140
- const emit = defineEmits(["update:modelValue"]);
141
-
142
- const root = ref(null);
143
- const dropdownEl = ref(null);
144
- const open = ref(false);
145
- const focusedIdx = ref(-1);
146
- const dropdownStyle = ref({});
147
-
148
- const normalizedOptions = computed(() =>
149
- props.options.map((opt) =>
150
- typeof opt === "string" ? { label: opt, value: opt } : opt,
151
- ),
152
- );
153
-
154
- const selectedOption = computed(
155
- () =>
156
- normalizedOptions.value.find((o) => o.value === props.modelValue) ?? null,
157
- );
158
-
159
- function calcDropdownStyle() {
160
- if (!props.teleport || !root.value) return;
161
- const rect = root.value.getBoundingClientRect();
162
- dropdownStyle.value = {
163
- top: `${rect.bottom + 4}px`,
164
- left: `${rect.left}px`,
165
- width: `${rect.width}px`,
166
- };
167
- }
168
-
169
- function toggle() {
170
- if (props.disabled) return;
171
- open.value ? close() : openDropdown();
172
- }
173
-
174
- function openDropdown() {
175
- open.value = true;
176
- focusedIdx.value = normalizedOptions.value.findIndex(
177
- (o) => o.value === props.modelValue,
178
- );
179
- calcDropdownStyle();
180
- document.addEventListener("mousedown", onOutsideClick);
181
- if (props.teleport) {
182
- window.addEventListener("scroll", onScrollOrResize, true);
183
- window.addEventListener("resize", onScrollOrResize);
184
- }
185
- }
186
-
187
- function close() {
188
- open.value = false;
189
- document.removeEventListener("mousedown", onOutsideClick);
190
- window.removeEventListener("scroll", onScrollOrResize, true);
191
- window.removeEventListener("resize", onScrollOrResize);
192
- }
193
-
194
- function select(option) {
195
- emit("update:modelValue", option.value);
196
- close();
197
- }
198
-
199
- function onOutsideClick(e) {
200
- if (root.value?.contains(e.target)) return;
201
- if (dropdownEl.value?.contains(e.target)) return;
202
- close();
203
- }
204
-
205
- function onScrollOrResize() {
206
- calcDropdownStyle();
207
- }
208
-
209
- function onKeydown(e) {
210
- if (!open.value) {
211
- if (e.key === "Enter" || e.key === " ") {
212
- e.preventDefault();
213
- openDropdown();
214
- }
215
- return;
216
- }
217
- if (e.key === "Escape") {
218
- close();
219
- } else if (e.key === "ArrowDown") {
220
- e.preventDefault();
221
- focusedIdx.value = Math.min(
222
- focusedIdx.value + 1,
223
- normalizedOptions.value.length - 1,
224
- );
225
- } else if (e.key === "ArrowUp") {
226
- e.preventDefault();
227
- focusedIdx.value = Math.max(focusedIdx.value - 1, 0);
228
- } else if (e.key === "Enter") {
229
- e.preventDefault();
230
- if (focusedIdx.value >= 0)
231
- select(normalizedOptions.value[focusedIdx.value]);
232
- }
233
- }
234
-
235
- onBeforeUnmount(() => {
236
- document.removeEventListener("mousedown", onOutsideClick);
237
- window.removeEventListener("scroll", onScrollOrResize, true);
238
- window.removeEventListener("resize", onScrollOrResize);
239
- });
240
- </script>
241
-
242
- <style>
243
- .sky-select-dropdown-teleported {
244
- position: fixed;
245
- z-index: var(--sky-select-dropdown-z-index, 9999);
246
- background: var(--sky-select-dropdown-bg, #fff);
247
- border: var(--sky-select-dropdown-border, 1px solid #d1d5db);
248
- border-radius: var(--sky-select-dropdown-radius, 6px);
249
- box-shadow: var(--sky-select-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
250
- max-height: var(--sky-select-dropdown-max-height, 220px);
251
- overflow-y: auto;
252
- padding: 4px;
253
- }
254
- </style>
255
-
256
- <style scoped>
257
- .sky-select {
258
- position: relative;
259
- display: inline-block;
260
- font-size: var(--sky-select-font-size, 14px);
261
- }
262
-
263
- .sky-select-block {
264
- display: block;
265
- width: 100%;
266
- }
267
-
268
- .sky-select-block .sky-select-trigger {
269
- width: 100%;
270
- }
271
-
272
- /* Trigger */
273
- .sky-select-trigger {
274
- display: inline-flex;
275
- align-items: center;
276
- justify-content: space-between;
277
- gap: 8px;
278
- width: 100%;
279
- padding: var(--sky-select-padding, 10px 14px);
280
- background: var(--sky-select-bg, #fff);
281
- border: var(--sky-select-border, 1px solid #d1d5db);
282
- border-radius: var(--sky-select-radius, 6px);
283
- font-size: inherit;
284
- font-weight: var(--sky-select-font-weight, 400);
285
- color: var(--sky-select-color, #374151);
286
- cursor: pointer;
287
- user-select: none;
288
- text-align: left;
289
- white-space: nowrap;
290
- }
291
-
292
- .sky-select-trigger:hover:not(:disabled) {
293
- border-color: var(--sky-select-border-hover, #9ca3af);
294
- }
295
-
296
- .sky-select-open .sky-select-trigger {
297
- border-color: var(--sky-select-border-focus, #6b7280);
298
- outline: none;
299
- }
300
-
301
- .sky-select-trigger:focus-visible {
302
- outline: 2px solid var(--sky-select-focus-ring, #24973f);
303
- outline-offset: 2px;
304
- }
305
-
306
- .sky-select-disabled .sky-select-trigger {
307
- opacity: 0.6;
308
- cursor: not-allowed;
309
- }
310
-
311
- /* Value / Placeholder */
312
- .sky-select-value {
313
- overflow: hidden;
314
- text-overflow: ellipsis;
315
- flex: 1;
316
- min-width: 0;
317
- }
318
-
319
- .sky-select-placeholder {
320
- color: var(--sky-select-placeholder-color, #9ca3af);
321
- }
322
-
323
- /* Chevron */
324
- .sky-select-chevron {
325
- width: 16px;
326
- height: 16px;
327
- flex-shrink: 0;
328
- color: var(--sky-select-chevron-color, #6b7280);
329
- transition: transform 0.15s ease;
330
- }
331
-
332
- .sky-select-open .sky-select-chevron {
333
- transform: rotate(180deg);
334
- }
335
-
336
- /* Dropdown */
337
- .sky-select-dropdown {
338
- position: absolute;
339
- top: calc(100% + 4px);
340
- left: 0;
341
- right: 0;
342
- z-index: var(--sky-select-dropdown-z-index, 100);
343
- background: var(--sky-select-dropdown-bg, #fff);
344
- border: var(--sky-select-dropdown-border, 1px solid #d1d5db);
345
- border-radius: var(--sky-select-dropdown-radius, 6px);
346
- box-shadow: var(--sky-select-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
347
- max-height: var(--sky-select-dropdown-max-height, 220px);
348
- overflow-y: auto;
349
- padding: 4px;
350
- }
351
-
352
- /* Option */
353
- .sky-select-option {
354
- display: flex;
355
- align-items: center;
356
- justify-content: space-between;
357
- padding: var(--sky-select-option-padding, 9px 10px);
358
- border-radius: var(--sky-select-option-radius, 4px);
359
- cursor: pointer;
360
- color: var(--sky-select-option-color, #374151);
361
- }
362
-
363
- .sky-select-option-focused,
364
- .sky-select-option:hover {
365
- background: var(--sky-select-option-hover-bg, #f3f4f6);
366
- }
367
-
368
- .sky-select-option-selected {
369
- color: var(--sky-select-option-selected-color, #24973f);
370
- font-weight: 500;
371
- }
372
-
373
- .sky-select-check {
374
- width: 14px;
375
- height: 14px;
376
- flex-shrink: 0;
377
- color: var(--sky-select-check-color, #24973f);
378
- }
379
- </style>
@@ -1,8 +0,0 @@
1
- export { default as Header } from './Header.vue'
2
- export { default as Dialog } from './Dialog.vue'
3
- export { default as Modal } from './Modal.vue'
4
- export { default as SkyButton } from './SkyButton.vue'
5
- export { default as SkySelect } from './SkySelect.vue'
6
- export { default as BaseTeleport } from './BaseTeleport.vue'
7
-
8
-
package/src/vue3/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './components'
2
- import '../styles/scrollbar.css'