sprintify-ui 0.0.96 → 0.0.99
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.
- package/dist/sprintify-ui.es.js +8035 -7945
- package/dist/style.css +2 -2
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +32 -10
- package/dist/types/src/components/BaseAutocompleteDropdown.vue.d.ts +88 -0
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +20 -5
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +18 -3
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +1 -1
- package/dist/types/src/components/BaseHasMany.vue.d.ts +17 -0
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSwitch.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +66 -6
- package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +19 -2
- package/dist/types/src/composables/clickOutside.d.ts +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +10 -10
- package/src/assets/main.css +0 -1
- package/src/components/BaseAutocomplete.vue +53 -183
- package/src/components/BaseAutocompleteDropdown.vue +344 -0
- package/src/components/BaseAutocompleteFetch.vue +8 -3
- package/src/components/BaseDatePicker.vue +155 -1
- package/src/components/BaseDropdown.stories.js +25 -0
- package/src/components/BaseDropdown.vue +2 -2
- package/src/components/BaseModalSide.stories.js +1 -3
- package/src/components/BaseModalSide.vue +5 -5
- package/src/components/BaseTagAutocomplete.stories.js +46 -1
- package/src/components/BaseTagAutocomplete.vue +184 -253
- package/src/components/BaseTagAutocompleteFetch.stories.js +4 -4
- package/src/components/BaseTagAutocompleteFetch.vue +10 -5
- package/src/composables/clickOutside.ts +13 -8
- package/src/index.ts +3 -1
- package/src/assets/pikaday.css +0 -134
|
@@ -6,11 +6,11 @@ interface UseClickOutsideOptions {
|
|
|
6
6
|
|
|
7
7
|
export function useClickOutside(
|
|
8
8
|
element: MaybeElementRef,
|
|
9
|
-
callback: (
|
|
9
|
+
callback: () => void,
|
|
10
10
|
options: UseClickOutsideOptions = {}
|
|
11
11
|
) {
|
|
12
12
|
function cleanup() {
|
|
13
|
-
window.removeEventListener('mousedown', onClick);
|
|
13
|
+
window.removeEventListener('mousedown', onClick, { capture: true });
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const stopWatch = watch(
|
|
@@ -18,7 +18,7 @@ export function useClickOutside(
|
|
|
18
18
|
(el) => {
|
|
19
19
|
if (el) {
|
|
20
20
|
cleanup();
|
|
21
|
-
window.addEventListener('mousedown', onClick);
|
|
21
|
+
window.addEventListener('mousedown', onClick, { capture: true });
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
{ immediate: true }
|
|
@@ -35,13 +35,18 @@ export function useClickOutside(
|
|
|
35
35
|
|
|
36
36
|
const contains = el.contains(e.target as HTMLElement);
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
let containsIncludes = false;
|
|
39
|
+
if (includeEls.length > 0) {
|
|
40
|
+
containsIncludes = includeEls.some((exceptionEl) =>
|
|
41
|
+
exceptionEl?.contains(e.target as HTMLElement)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
41
44
|
|
|
42
|
-
const outside = !contains && !
|
|
45
|
+
const outside = !contains && !containsIncludes;
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
if (outside) {
|
|
48
|
+
callback();
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
const stop = () => {
|
package/src/index.ts
CHANGED
|
@@ -2,12 +2,13 @@ import axios, { AxiosInstance } from 'axios';
|
|
|
2
2
|
import { App } from 'vue';
|
|
3
3
|
import * as components from './components';
|
|
4
4
|
import QueryString from 'qs';
|
|
5
|
-
import { createI18n, I18n
|
|
5
|
+
import { createI18n, I18n } from 'vue-i18n';
|
|
6
6
|
import en from '@/lang/en.json';
|
|
7
7
|
import fr from '@/lang/fr.json';
|
|
8
8
|
import { useDialogsStore } from './stores/dialogs';
|
|
9
9
|
import { useNotificationsStore } from './stores/notifications';
|
|
10
10
|
import { useSystemAlertStore } from './stores/systemAlerts';
|
|
11
|
+
import { useClickOutside } from './composables/clickOutside';
|
|
11
12
|
|
|
12
13
|
const messages = { en, fr };
|
|
13
14
|
|
|
@@ -91,3 +92,4 @@ export { config };
|
|
|
91
92
|
export { useDialogsStore };
|
|
92
93
|
export { useNotificationsStore };
|
|
93
94
|
export { useSystemAlertStore };
|
|
95
|
+
export { useClickOutside };
|
package/src/assets/pikaday.css
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
@import 'pikaday/css/pikaday.css';
|
|
2
|
-
|
|
3
|
-
.pikaday-white {
|
|
4
|
-
--backgroundColor: #ffffff;
|
|
5
|
-
--textColor: #718096;
|
|
6
|
-
--currentDateTextColor: #3182ce;
|
|
7
|
-
--selectedDateBackgroundColor: #3182ce;
|
|
8
|
-
--selectedDateTextColor: #ffffff;
|
|
9
|
-
|
|
10
|
-
--labelTextColor: #4a5568; /* eg. May 2020 */
|
|
11
|
-
--weekDaysTextColor: #a0aec0; /* eg. Mo Tu We ....*/
|
|
12
|
-
|
|
13
|
-
font-family: inherit;
|
|
14
|
-
background-color: var(--backgroundColor);
|
|
15
|
-
padding: 0.5rem;
|
|
16
|
-
z-index: 2000;
|
|
17
|
-
margin: 6px 0 0 0;
|
|
18
|
-
|
|
19
|
-
@apply shadow;
|
|
20
|
-
@apply rounded-lg;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.pikaday-white .pika-title {
|
|
24
|
-
width: 100%;
|
|
25
|
-
text-align: center;
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: flex-start;
|
|
28
|
-
margin-bottom: 5px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Next/Previous */
|
|
32
|
-
.pikaday-white .pika-prev,
|
|
33
|
-
.pikaday-white .pika-next {
|
|
34
|
-
position: absolute;
|
|
35
|
-
outline: none;
|
|
36
|
-
padding: 0;
|
|
37
|
-
width: 26px;
|
|
38
|
-
height: 26px;
|
|
39
|
-
top: -1px;
|
|
40
|
-
display: inline-block;
|
|
41
|
-
margin-top: 0;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
/* hide text using text-indent trick, using width value (it's enough) */
|
|
44
|
-
text-indent: -9999px;
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
overflow: hidden;
|
|
47
|
-
background-color: transparent;
|
|
48
|
-
background-position: center center;
|
|
49
|
-
background-repeat: no-repeat;
|
|
50
|
-
opacity: 0.7;
|
|
51
|
-
}
|
|
52
|
-
.pikaday-white .pika-prev:hover,
|
|
53
|
-
.pikaday-white .pika-next:hover {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
}
|
|
56
|
-
.pikaday-white .pika-prev {
|
|
57
|
-
right: 30px;
|
|
58
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'%3E%3C/path%3E%3C/svg%3E");
|
|
59
|
-
}
|
|
60
|
-
.pikaday-white .pika-next {
|
|
61
|
-
right: 2px;
|
|
62
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'%3E%3C/path%3E%3C/svg%3E");
|
|
63
|
-
}
|
|
64
|
-
.pika-prev.is-disabled,
|
|
65
|
-
.pika-next.is-disabled {
|
|
66
|
-
cursor: default;
|
|
67
|
-
opacity: 0.2;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.pikaday-white .pika-label {
|
|
71
|
-
@apply mr-1.5 rounded border border-slate-300 py-1 px-2 text-[14px] font-medium leading-none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Show Month & Year select */
|
|
75
|
-
.pikaday-white .pika-label {
|
|
76
|
-
position: relative; /* add this */
|
|
77
|
-
/* some additional code */
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.pikaday-white .pika-select-month,
|
|
81
|
-
.pikaday-white .pika-select-year {
|
|
82
|
-
/*display: none;*/
|
|
83
|
-
width: 100%;
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
position: absolute;
|
|
86
|
-
z-index: 9998;
|
|
87
|
-
margin: 0;
|
|
88
|
-
left: 0;
|
|
89
|
-
top: 0;
|
|
90
|
-
opacity: 0;
|
|
91
|
-
padding: 0px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.pikaday-white table {
|
|
95
|
-
width: 100%;
|
|
96
|
-
border-collapse: collapse;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.pikaday-white table th {
|
|
100
|
-
width: 2em;
|
|
101
|
-
height: 2em;
|
|
102
|
-
font-weight: normal;
|
|
103
|
-
color: var(--weekDaysTextColor);
|
|
104
|
-
text-align: center;
|
|
105
|
-
}
|
|
106
|
-
.pikaday-white table th abbr {
|
|
107
|
-
text-decoration: none;
|
|
108
|
-
}
|
|
109
|
-
.pikaday-white table td {
|
|
110
|
-
padding: 1px;
|
|
111
|
-
}
|
|
112
|
-
.pikaday-white table td button {
|
|
113
|
-
width: 2em;
|
|
114
|
-
height: 2em;
|
|
115
|
-
text-align: center;
|
|
116
|
-
@apply rounded-full;
|
|
117
|
-
background-color: var(--backgroundColor);
|
|
118
|
-
}
|
|
119
|
-
.pikaday-white table td button:hover {
|
|
120
|
-
@apply bg-slate-200;
|
|
121
|
-
@apply text-slate-900;
|
|
122
|
-
}
|
|
123
|
-
.pikaday-white table td.is-today button {
|
|
124
|
-
color: var(--currentDateTextColor);
|
|
125
|
-
}
|
|
126
|
-
.pikaday-white table td.is-selected button {
|
|
127
|
-
@apply bg-primary-500;
|
|
128
|
-
@apply text-white;
|
|
129
|
-
@apply font-normal;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.pikaday-white table td button {
|
|
133
|
-
color: var(--textColor);
|
|
134
|
-
}
|