vueless 0.0.14 → 0.0.16
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/package.json +1 -1
- package/ui.button/index.vue +16 -3
- package/ui.button-link/index.vue +6 -3
- package/ui.container-page/configs/default.config.js +1 -1
- package/ui.data-table/index.vue +1 -1
- package/ui.data-table-cell/configs/default.config.js +2 -2
- package/ui.dropdown-badge/index.vue +11 -1
- package/ui.dropdown-button/index.vue +14 -2
- package/ui.dropdown-link/index.vue +11 -1
- package/ui.form-calendar/configs/default.config.js +1 -1
- package/ui.form-checkbox/index.vue +1 -1
- package/ui.form-color-picker/index.vue +1 -1
- package/ui.form-date-picker-range/configs/default.config.js +4 -4
- package/ui.form-input/configs/default.config.js +1 -1
- package/ui.form-input/index.vue +5 -8
- package/ui.form-input-file/configs/default.config.js +1 -1
- package/ui.form-input-file/index.vue +4 -8
- package/ui.form-input-rating/configs/default.config.js +1 -1
- package/ui.form-input-rating/index.vue +3 -7
- package/ui.form-label/configs/default.config.js +2 -0
- package/ui.form-label/index.vue +3 -3
- package/ui.form-radio/index.vue +5 -3
- package/ui.form-radio-card/composables/attrs.composable.js +3 -1
- package/ui.form-radio-card/configs/default.config.js +8 -2
- package/ui.form-radio-card/index.vue +26 -40
- package/ui.form-select/configs/default.config.js +3 -3
- package/ui.form-select/index.vue +7 -18
- package/ui.form-switch/index.vue +1 -1
- package/ui.form-textarea/index.vue +2 -2
- package/ui.notify/index.vue +3 -3
- package/ui.other-loader-top/composables/attrs.composable.js +32 -0
- package/ui.other-loader-top/configs/default.config.js +20 -0
- package/ui.other-loader-top/constants/index.js +8 -0
- package/ui.other-loader-top/index.vue +230 -0
- package/ui.other-loader-top/services/loaderTop.service.js +31 -0
- package/ui.text-badge/index.vue +7 -0
- package/web-types.json +36 -132
- package/ui.loader-top/components/TopProgress.vue +0 -277
- package/ui.loader-top/index.vue +0 -221
- /package/{ui.loader-top → ui.other-loader-top}/store/index.js +0 -0
package/ui.loader-top/index.vue
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<TopProgress
|
|
3
|
-
ref="topProgress"
|
|
4
|
-
:color="loaderColor"
|
|
5
|
-
class="vueless-top-loader"
|
|
6
|
-
:class="topLoaderClasses"
|
|
7
|
-
/>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
import { mapGetters, mapMutations, mapState } from "vuex";
|
|
12
|
-
import { globalComponentConfig, isMobileApp } from "../service.ui";
|
|
13
|
-
|
|
14
|
-
import TopProgress from "./components/TopProgress.vue";
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
name: "ULoaderTop",
|
|
18
|
-
components: {
|
|
19
|
-
TopProgress,
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
props: {
|
|
23
|
-
/**
|
|
24
|
-
* The name of API resource (endpoint URI).
|
|
25
|
-
*/
|
|
26
|
-
resourceNames: {
|
|
27
|
-
type: [String, Array],
|
|
28
|
-
default: "",
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The z-list of the loader stripe.
|
|
33
|
-
* @values auto, 50, 100
|
|
34
|
-
*/
|
|
35
|
-
zIndex: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "auto",
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Loader position.
|
|
42
|
-
* @values fixed, absolute, relative
|
|
43
|
-
*/
|
|
44
|
-
position: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: "fixed",
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The color of the loader stripe.
|
|
51
|
-
* @values gray, red, orange, yellow, green, blue, violet, fuchsia
|
|
52
|
-
*/
|
|
53
|
-
color: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: globalComponentConfig.ULoaderTop?.color,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
computed: {
|
|
60
|
-
...mapState("loaderTop", ["loaderRequestQueue", "componentLoaderRequestQueue", "isLoading"]),
|
|
61
|
-
...mapGetters({ hexColor: globalComponentConfig.ULoaderTop?.colorGetter }),
|
|
62
|
-
|
|
63
|
-
loaderColor() {
|
|
64
|
-
const isExistHexColorGetter = globalComponentConfig.ULoaderTop?.colorGetter;
|
|
65
|
-
|
|
66
|
-
const color = isExistHexColorGetter ? this.hexColor : this.color;
|
|
67
|
-
//const colorSet = tailwindConfig.theme.colors[this.color];
|
|
68
|
-
//const colorNumber = 500;
|
|
69
|
-
|
|
70
|
-
const colorHexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
71
|
-
const isColorHex = colorHexRegex.test(color);
|
|
72
|
-
|
|
73
|
-
// TODO: Remove comments after refactoring
|
|
74
|
-
// if (!isColorHex && !colorSet) {
|
|
75
|
-
// return "blue";
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
return isColorHex ? color : "RoyalBlue";
|
|
79
|
-
|
|
80
|
-
//return isColorHex ? color : colorSet[colorNumber];
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
resourceNamesArray() {
|
|
84
|
-
return Array.isArray(this.resourceNames) ? [...this.resourceNames] : [this.resourceNames];
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
topLoaderClasses() {
|
|
88
|
-
const zIndex = {
|
|
89
|
-
auto: "vueless-top-loader-z-auto",
|
|
90
|
-
50: "vueless-top-loader-z-50",
|
|
91
|
-
100: "vueless-top-loader-z-100",
|
|
92
|
-
};
|
|
93
|
-
const position = `vueless-top-loader-position-${this.position}`;
|
|
94
|
-
const mobileApp = isMobileApp ? "vueless-top-loader-mobile-app" : "";
|
|
95
|
-
|
|
96
|
-
return [zIndex[this.zIndex], position, mobileApp];
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
watch: {
|
|
101
|
-
loaderRequestQueue: {
|
|
102
|
-
deep: true,
|
|
103
|
-
handler: "onChangeRequestsQuare",
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
isLoading: {
|
|
107
|
-
deep: true,
|
|
108
|
-
handler: "onChangeLoadingState",
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
created() {
|
|
113
|
-
if (this.resourceNames) {
|
|
114
|
-
this.SET_COMPONENT_REQUEST_QUEUE(this.resourceNamesArray);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
beforeUnmount() {
|
|
119
|
-
if (this.resourceNames) {
|
|
120
|
-
this.REMOVE_COMPONENT_REQUEST_QUEUE();
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
methods: {
|
|
125
|
-
...mapMutations("loaderTop", ["SET_COMPONENT_REQUEST_QUEUE", "REMOVE_COMPONENT_REQUEST_QUEUE"]),
|
|
126
|
-
|
|
127
|
-
requestWithoutQuery(request) {
|
|
128
|
-
const [requestWithoutQuery] = request.split("?");
|
|
129
|
-
|
|
130
|
-
return requestWithoutQuery;
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
onChangeLoadingState() {
|
|
134
|
-
if (!this.$refs.topProgress) return;
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
!this.resourceNames &&
|
|
138
|
-
this.$refs.topProgress.isStarted &&
|
|
139
|
-
this.$refs.topProgress.show &&
|
|
140
|
-
!this.isLoading
|
|
141
|
-
) {
|
|
142
|
-
this.$refs.topProgress.done();
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
onChangeRequestsQuare() {
|
|
147
|
-
if (!this.$refs.topProgress) return;
|
|
148
|
-
|
|
149
|
-
let isActiveRequests = false;
|
|
150
|
-
|
|
151
|
-
if (this.resourceNames) {
|
|
152
|
-
this.resourceNamesArray.forEach((item) => {
|
|
153
|
-
if (!isActiveRequests) {
|
|
154
|
-
const activeRequest = this.loaderRequestQueue.find(
|
|
155
|
-
(request) => this.requestWithoutQuery(request) === item,
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
isActiveRequests = !!activeRequest;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
if (isActiveRequests && !this.$refs.topProgress.isStarted) {
|
|
163
|
-
this.$refs.topProgress.start();
|
|
164
|
-
} else if (
|
|
165
|
-
!isActiveRequests &&
|
|
166
|
-
this.$refs.topProgress.isStarted &&
|
|
167
|
-
this.$refs.topProgress.show
|
|
168
|
-
) {
|
|
169
|
-
this.$refs.topProgress.done();
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
this.loaderRequestQueue.forEach((item) => {
|
|
173
|
-
const activeRequest = this.componentLoaderRequestQueue.find(
|
|
174
|
-
(request) => request === this.requestWithoutQuery(item),
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
isActiveRequests = !activeRequest;
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
if (this.isLoading && isActiveRequests && !this.$refs.topProgress.isStarted) {
|
|
181
|
-
this.$refs.topProgress.start();
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
</script>
|
|
188
|
-
|
|
189
|
-
<style lang="postcss" scoped>
|
|
190
|
-
.vueless-top-loader {
|
|
191
|
-
&-position {
|
|
192
|
-
&-fixed {
|
|
193
|
-
@apply !fixed;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&-absolute {
|
|
197
|
-
@apply !absolute;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
&-z-auto {
|
|
202
|
-
@apply !z-auto;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
&-z-50 {
|
|
206
|
-
@apply !z-50;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
&-z-100 {
|
|
210
|
-
@apply !z-[100];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
&-mobile-app {
|
|
214
|
-
@apply mt-safe-top mx-3 rounded max-w-[calc(100%-1.5rem)];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
&:deep(.peg) {
|
|
218
|
-
@apply !hidden;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
</style>
|
|
File without changes
|