vueless 0.0.13 → 0.0.15
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/README.md +33 -152
- package/package.json +2 -5
- package/preset.tailwind/index.js +95 -0
- package/service.storybook/index.js +1 -1
- package/service.ui/index.js +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-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.navigation-stepper/index.vue +1 -1
- 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/service.tailwind/index.js +0 -103
- 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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Transition :css="false" @beforeEnter="beforeEnter" @enter="enter" @afterEnter="afterEnter">
|
|
3
|
+
<div v-if="show" v-bind="progressAttrs" :style="barStyle" />
|
|
4
|
+
</Transition>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { computed, onBeforeUnmount, watch, ref } from "vue";
|
|
9
|
+
|
|
10
|
+
import { useStore } from "vuex";
|
|
11
|
+
|
|
12
|
+
import UIService, { isMobileApp } from "../service.ui";
|
|
13
|
+
import { clamp, queue } from "./services/loaderTop.service";
|
|
14
|
+
|
|
15
|
+
import { ULoaderTop, MAXIMUM, SPEED } from "./constants";
|
|
16
|
+
import defaultConfig from "./configs/default.config";
|
|
17
|
+
import { useAttrs } from "./composables/attrs.composable";
|
|
18
|
+
|
|
19
|
+
defineOptions({ name: "ULoaderTop" });
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
/**
|
|
23
|
+
* The name of API resource (endpoint URI).
|
|
24
|
+
*/
|
|
25
|
+
resourceNames: {
|
|
26
|
+
type: [String, Array],
|
|
27
|
+
default: "",
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Loader position.
|
|
32
|
+
* @values fixed, absolute, relative
|
|
33
|
+
*/
|
|
34
|
+
position: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: UIService.get(defaultConfig, ULoaderTop).default.position,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The color of the loader stripe.
|
|
41
|
+
* @values gray, red, orange, yellow, green, blue, violet, fuchsia
|
|
42
|
+
*/
|
|
43
|
+
color: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: UIService.get(defaultConfig, ULoaderTop).default.color,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const store = useStore();
|
|
50
|
+
|
|
51
|
+
const error = ref(false);
|
|
52
|
+
const show = ref(false);
|
|
53
|
+
const progress = ref(0);
|
|
54
|
+
const opacity = ref(1);
|
|
55
|
+
const status = ref(null);
|
|
56
|
+
|
|
57
|
+
const { progressAttrs } = useAttrs(props, { error, isMobileApp });
|
|
58
|
+
|
|
59
|
+
const loaderRequestQueue = computed(() => store.state.loaderTop.loaderRequestQueue);
|
|
60
|
+
const isLoading = computed(() => store.state.loaderTop.isLoading);
|
|
61
|
+
const componentLoaderRequestQueue = computed(
|
|
62
|
+
() => store.state.loaderTop.componentLoaderRequestQueue,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const isStarted = computed(() => {
|
|
66
|
+
return typeof status.value === "number";
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const barStyle = computed(() => {
|
|
70
|
+
return {
|
|
71
|
+
width: `${progress.value}%`,
|
|
72
|
+
opacity: `${opacity.value}`,
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const resourceNamesArray = computed(() => {
|
|
77
|
+
return Array.isArray(props.resourceNames) ? [...props.resourceNames] : [props.resourceNames];
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
watch(loaderRequestQueue, onChangeRequestsQueue, { deep: true });
|
|
81
|
+
watch(isLoading, onChangeLoadingState, { deep: true });
|
|
82
|
+
|
|
83
|
+
if (props.resourceNames) {
|
|
84
|
+
store.commit("loaderTop/SET_COMPONENT_REQUEST_QUEUE", resourceNamesArray.value);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
onBeforeUnmount(() => {
|
|
88
|
+
if (props.resourceNames) {
|
|
89
|
+
store.commit("loaderTop/REMOVE_COMPONENT_REQUEST_QUEUE");
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
function requestWithoutQuery(request) {
|
|
94
|
+
const [requestWithoutQuery] = request.split("?");
|
|
95
|
+
|
|
96
|
+
return requestWithoutQuery;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function onChangeLoadingState() {
|
|
100
|
+
if (!props.resourceNames && isStarted.value && show.value && !isLoading.value) {
|
|
101
|
+
done();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function onChangeRequestsQueue() {
|
|
106
|
+
let isActiveRequests = false;
|
|
107
|
+
|
|
108
|
+
if (props.resourceNames) {
|
|
109
|
+
resourceNamesArray.value.forEach((item) => {
|
|
110
|
+
if (!isActiveRequests) {
|
|
111
|
+
const activeRequest = loaderRequestQueue.value.find(
|
|
112
|
+
(request) => requestWithoutQuery(request) === item,
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
isActiveRequests = !!activeRequest;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (isActiveRequests && !isStarted.value) {
|
|
120
|
+
start();
|
|
121
|
+
} else if (!isActiveRequests && isStarted.value && show.value) {
|
|
122
|
+
done();
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
loaderRequestQueue.value.forEach((item) => {
|
|
126
|
+
const activeRequest = componentLoaderRequestQueue.value.find(
|
|
127
|
+
(request) => request === requestWithoutQuery(item),
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
isActiveRequests = !activeRequest;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (isLoading.value && isActiveRequests && !isStarted.value) {
|
|
134
|
+
start();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function beforeEnter() {
|
|
140
|
+
opacity.value = 0;
|
|
141
|
+
progress.value = 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function enter(el, done) {
|
|
145
|
+
opacity.value = 1;
|
|
146
|
+
done();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function afterEnter() {
|
|
150
|
+
runStart();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function work() {
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
if (!isStarted.value) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
increase();
|
|
160
|
+
work();
|
|
161
|
+
}, 100);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function runStart() {
|
|
165
|
+
status.value = progress.value === 100 ? null : progress.value;
|
|
166
|
+
|
|
167
|
+
work();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function start() {
|
|
171
|
+
if (show.value) {
|
|
172
|
+
runStart();
|
|
173
|
+
} else {
|
|
174
|
+
show.value = true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function set(amount) {
|
|
179
|
+
let currentProgress;
|
|
180
|
+
|
|
181
|
+
if (isStarted.value) {
|
|
182
|
+
currentProgress = amount < progress.value ? clamp(amount, 0, 100) : clamp(amount, 0.8, 100);
|
|
183
|
+
} else {
|
|
184
|
+
currentProgress = 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
status.value = currentProgress === 100 ? null : currentProgress;
|
|
188
|
+
|
|
189
|
+
queue((next) => {
|
|
190
|
+
progress.value = currentProgress;
|
|
191
|
+
|
|
192
|
+
if (currentProgress === 100) {
|
|
193
|
+
setTimeout(() => {
|
|
194
|
+
opacity.value = 0;
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
show.value = false;
|
|
197
|
+
error.value = false;
|
|
198
|
+
next();
|
|
199
|
+
}, SPEED);
|
|
200
|
+
}, SPEED);
|
|
201
|
+
} else {
|
|
202
|
+
setTimeout(next, SPEED);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function increase(amount) {
|
|
208
|
+
const currentProgress = progress.value;
|
|
209
|
+
|
|
210
|
+
if (currentProgress < 100 && typeof amount !== "number") {
|
|
211
|
+
if (currentProgress >= 0 && currentProgress < 25) {
|
|
212
|
+
amount = Math.random() * 3 + 3;
|
|
213
|
+
} else if (currentProgress >= 25 && currentProgress < 50) {
|
|
214
|
+
amount = Math.random() * 3;
|
|
215
|
+
} else if (currentProgress >= 50 && currentProgress < 85) {
|
|
216
|
+
amount = Math.random() * 2;
|
|
217
|
+
} else if (currentProgress >= 85 && currentProgress < 99) {
|
|
218
|
+
amount = 0.5;
|
|
219
|
+
} else {
|
|
220
|
+
amount = 0;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
set(clamp(currentProgress + amount, 0, MAXIMUM));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function done() {
|
|
228
|
+
set(100);
|
|
229
|
+
}
|
|
230
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function clamp(n, min, max) {
|
|
2
|
+
if (n < min) {
|
|
3
|
+
return min;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (n > max) {
|
|
7
|
+
return max;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const queue = (() => {
|
|
14
|
+
let pending = [];
|
|
15
|
+
|
|
16
|
+
function next() {
|
|
17
|
+
let fn = pending.shift();
|
|
18
|
+
|
|
19
|
+
if (fn) {
|
|
20
|
+
fn(next);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (fn) => {
|
|
25
|
+
pending.push(fn);
|
|
26
|
+
|
|
27
|
+
if (pending.length === 1) {
|
|
28
|
+
next();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
})();
|
package/ui.text-badge/index.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
ref="wrapperRef"
|
|
3
4
|
tabindex="1"
|
|
4
5
|
:data-cy="dataCy"
|
|
5
6
|
v-bind="wrapperAttrs"
|
|
@@ -26,6 +27,8 @@
|
|
|
26
27
|
</template>
|
|
27
28
|
|
|
28
29
|
<script setup>
|
|
30
|
+
import { ref } from "vue";
|
|
31
|
+
|
|
29
32
|
import UIService from "../service.ui";
|
|
30
33
|
|
|
31
34
|
import { UBadge } from "./constants";
|
|
@@ -102,6 +105,10 @@ const emit = defineEmits(["focus", "keydown", "blur", "click"]);
|
|
|
102
105
|
|
|
103
106
|
const { bodyAttrs, wrapperAttrs, hasSlotContent } = useAttrs(props);
|
|
104
107
|
|
|
108
|
+
const wrapperRef = ref(null);
|
|
109
|
+
|
|
110
|
+
defineExpose({ wrapperRef });
|
|
111
|
+
|
|
105
112
|
function onFocus() {
|
|
106
113
|
emit("focus");
|
|
107
114
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -966,7 +966,7 @@
|
|
|
966
966
|
"description": "Label placement.",
|
|
967
967
|
"value": {
|
|
968
968
|
"kind": "expression",
|
|
969
|
-
"type": "'left' | 'right'"
|
|
969
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
970
970
|
},
|
|
971
971
|
"default": "left"
|
|
972
972
|
},
|
|
@@ -3225,13 +3225,13 @@
|
|
|
3225
3225
|
"default": "\"\""
|
|
3226
3226
|
},
|
|
3227
3227
|
{
|
|
3228
|
-
"name": "
|
|
3229
|
-
"description": "
|
|
3228
|
+
"name": "labelAlign",
|
|
3229
|
+
"description": "Set label placement related from the default slot.",
|
|
3230
3230
|
"value": {
|
|
3231
3231
|
"kind": "expression",
|
|
3232
|
-
"type": "
|
|
3232
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
3233
3233
|
},
|
|
3234
|
-
"default": "
|
|
3234
|
+
"default": "topInside"
|
|
3235
3235
|
},
|
|
3236
3236
|
{
|
|
3237
3237
|
"name": "placeholder",
|
|
@@ -3425,13 +3425,13 @@
|
|
|
3425
3425
|
"default": "\"\""
|
|
3426
3426
|
},
|
|
3427
3427
|
{
|
|
3428
|
-
"name": "
|
|
3428
|
+
"name": "labelAlign",
|
|
3429
3429
|
"description": "Set label placement related from the default slot.",
|
|
3430
3430
|
"value": {
|
|
3431
3431
|
"kind": "expression",
|
|
3432
|
-
"type": "'topInside' | '
|
|
3432
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
3433
3433
|
},
|
|
3434
|
-
"default": "
|
|
3434
|
+
"default": "topInside"
|
|
3435
3435
|
},
|
|
3436
3436
|
{
|
|
3437
3437
|
"name": "files",
|
|
@@ -3888,13 +3888,13 @@
|
|
|
3888
3888
|
"default": "false"
|
|
3889
3889
|
},
|
|
3890
3890
|
{
|
|
3891
|
-
"name": "
|
|
3891
|
+
"name": "labelAlign",
|
|
3892
3892
|
"description": "Set label placement related from the default slot.",
|
|
3893
3893
|
"value": {
|
|
3894
3894
|
"kind": "expression",
|
|
3895
|
-
"type": "'topInside' | '
|
|
3895
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
3896
3896
|
},
|
|
3897
|
-
"default": "
|
|
3897
|
+
"default": "topInside"
|
|
3898
3898
|
},
|
|
3899
3899
|
{
|
|
3900
3900
|
"name": "error",
|
|
@@ -4137,7 +4137,7 @@
|
|
|
4137
4137
|
"description": "Set label placement related from the default slot.",
|
|
4138
4138
|
"value": {
|
|
4139
4139
|
"kind": "expression",
|
|
4140
|
-
"type": "'
|
|
4140
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
4141
4141
|
},
|
|
4142
4142
|
"default": "top"
|
|
4143
4143
|
},
|
|
@@ -4443,15 +4443,6 @@
|
|
|
4443
4443
|
},
|
|
4444
4444
|
"default": "\"\""
|
|
4445
4445
|
},
|
|
4446
|
-
{
|
|
4447
|
-
"name": "zIndex",
|
|
4448
|
-
"description": "The z-list of the loader stripe.",
|
|
4449
|
-
"value": {
|
|
4450
|
-
"kind": "expression",
|
|
4451
|
-
"type": "'auto' | '50' | '100'"
|
|
4452
|
-
},
|
|
4453
|
-
"default": "\"auto\""
|
|
4454
|
-
},
|
|
4455
4446
|
{
|
|
4456
4447
|
"name": "position",
|
|
4457
4448
|
"description": "Loader position.",
|
|
@@ -4459,7 +4450,7 @@
|
|
|
4459
4450
|
"kind": "expression",
|
|
4460
4451
|
"type": "'fixed' | 'absolute' | 'relative'"
|
|
4461
4452
|
},
|
|
4462
|
-
"default": "
|
|
4453
|
+
"default": "fixed"
|
|
4463
4454
|
},
|
|
4464
4455
|
{
|
|
4465
4456
|
"name": "color",
|
|
@@ -4468,11 +4459,11 @@
|
|
|
4468
4459
|
"kind": "expression",
|
|
4469
4460
|
"type": "'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'violet' | 'fuchsia'"
|
|
4470
4461
|
},
|
|
4471
|
-
"default": "
|
|
4462
|
+
"default": "blue"
|
|
4472
4463
|
}
|
|
4473
4464
|
],
|
|
4474
4465
|
"source": {
|
|
4475
|
-
"module": "/src/ui.loader-top/index.vue",
|
|
4466
|
+
"module": "/src/ui.other-loader-top/index.vue",
|
|
4476
4467
|
"symbol": "default"
|
|
4477
4468
|
}
|
|
4478
4469
|
},
|
|
@@ -5401,7 +5392,7 @@
|
|
|
5401
5392
|
"description": "Set label placement related from the default slot.",
|
|
5402
5393
|
"value": {
|
|
5403
5394
|
"kind": "expression",
|
|
5404
|
-
"type": "'left' | 'right'"
|
|
5395
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
5405
5396
|
},
|
|
5406
5397
|
"default": "UIService.get(defaultConfig, URadio).default.labelAlign"
|
|
5407
5398
|
},
|
|
@@ -5453,10 +5444,13 @@
|
|
|
5453
5444
|
],
|
|
5454
5445
|
"events": [
|
|
5455
5446
|
{
|
|
5456
|
-
"name": "update:
|
|
5447
|
+
"name": "update:modelValue"
|
|
5457
5448
|
}
|
|
5458
5449
|
],
|
|
5459
5450
|
"slots": [
|
|
5451
|
+
{
|
|
5452
|
+
"name": "default"
|
|
5453
|
+
},
|
|
5460
5454
|
{
|
|
5461
5455
|
"name": "footer"
|
|
5462
5456
|
}
|
|
@@ -5534,6 +5528,14 @@
|
|
|
5534
5528
|
},
|
|
5535
5529
|
"default": "() => getRandomId()"
|
|
5536
5530
|
},
|
|
5531
|
+
{
|
|
5532
|
+
"name": "labelAlign",
|
|
5533
|
+
"value": {
|
|
5534
|
+
"kind": "expression",
|
|
5535
|
+
"type": "string"
|
|
5536
|
+
},
|
|
5537
|
+
"default": "top"
|
|
5538
|
+
},
|
|
5537
5539
|
{
|
|
5538
5540
|
"name": "config",
|
|
5539
5541
|
"description": "Sets component ui config object.",
|
|
@@ -5754,13 +5756,13 @@
|
|
|
5754
5756
|
"default": "\"\""
|
|
5755
5757
|
},
|
|
5756
5758
|
{
|
|
5757
|
-
"name": "
|
|
5758
|
-
"description": "
|
|
5759
|
+
"name": "labelAlign",
|
|
5760
|
+
"description": "Set label placement related from the default slot.",
|
|
5759
5761
|
"value": {
|
|
5760
5762
|
"kind": "expression",
|
|
5761
|
-
"type": "
|
|
5763
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
5762
5764
|
},
|
|
5763
|
-
"default": "
|
|
5765
|
+
"default": "topInside"
|
|
5764
5766
|
},
|
|
5765
5767
|
{
|
|
5766
5768
|
"name": "placeholder",
|
|
@@ -6097,7 +6099,7 @@
|
|
|
6097
6099
|
"description": "Label alignment.",
|
|
6098
6100
|
"value": {
|
|
6099
6101
|
"kind": "expression",
|
|
6100
|
-
"type": "'left' | 'right'"
|
|
6102
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
6101
6103
|
},
|
|
6102
6104
|
"default": "left"
|
|
6103
6105
|
},
|
|
@@ -6665,10 +6667,10 @@
|
|
|
6665
6667
|
},
|
|
6666
6668
|
{
|
|
6667
6669
|
"name": "labelAlign",
|
|
6668
|
-
"description": "
|
|
6670
|
+
"description": "Set label placement related from the default slot.",
|
|
6669
6671
|
"value": {
|
|
6670
6672
|
"kind": "expression",
|
|
6671
|
-
"type": "'topInside' | '
|
|
6673
|
+
"type": "'top' | 'topInside' | 'topWithDesc' | 'bottom' | 'left' | 'right'"
|
|
6672
6674
|
},
|
|
6673
6675
|
"default": "topInside"
|
|
6674
6676
|
},
|
|
@@ -7004,104 +7006,6 @@
|
|
|
7004
7006
|
"symbol": "default"
|
|
7005
7007
|
}
|
|
7006
7008
|
},
|
|
7007
|
-
{
|
|
7008
|
-
"name": "VueTopprogress",
|
|
7009
|
-
"description": "",
|
|
7010
|
-
"attributes": [
|
|
7011
|
-
{
|
|
7012
|
-
"name": "speed",
|
|
7013
|
-
"value": {
|
|
7014
|
-
"kind": "expression",
|
|
7015
|
-
"type": "number"
|
|
7016
|
-
},
|
|
7017
|
-
"default": "150"
|
|
7018
|
-
},
|
|
7019
|
-
{
|
|
7020
|
-
"name": "color",
|
|
7021
|
-
"value": {
|
|
7022
|
-
"kind": "expression",
|
|
7023
|
-
"type": "string"
|
|
7024
|
-
},
|
|
7025
|
-
"default": "\"#29d\""
|
|
7026
|
-
},
|
|
7027
|
-
{
|
|
7028
|
-
"name": "colorShadow",
|
|
7029
|
-
"value": {
|
|
7030
|
-
"kind": "expression",
|
|
7031
|
-
"type": "string"
|
|
7032
|
-
},
|
|
7033
|
-
"default": "\"\""
|
|
7034
|
-
},
|
|
7035
|
-
{
|
|
7036
|
-
"name": "errorColor",
|
|
7037
|
-
"value": {
|
|
7038
|
-
"kind": "expression",
|
|
7039
|
-
"type": "string"
|
|
7040
|
-
},
|
|
7041
|
-
"default": "\"#f44336\""
|
|
7042
|
-
},
|
|
7043
|
-
{
|
|
7044
|
-
"name": "trickle",
|
|
7045
|
-
"value": {
|
|
7046
|
-
"kind": "expression",
|
|
7047
|
-
"type": "boolean"
|
|
7048
|
-
},
|
|
7049
|
-
"default": "true"
|
|
7050
|
-
},
|
|
7051
|
-
{
|
|
7052
|
-
"name": "trickleSpeed",
|
|
7053
|
-
"value": {
|
|
7054
|
-
"kind": "expression",
|
|
7055
|
-
"type": "number"
|
|
7056
|
-
},
|
|
7057
|
-
"default": "100"
|
|
7058
|
-
},
|
|
7059
|
-
{
|
|
7060
|
-
"name": "easing",
|
|
7061
|
-
"value": {
|
|
7062
|
-
"kind": "expression",
|
|
7063
|
-
"type": "string"
|
|
7064
|
-
},
|
|
7065
|
-
"default": "\"linear\""
|
|
7066
|
-
},
|
|
7067
|
-
{
|
|
7068
|
-
"name": "height",
|
|
7069
|
-
"value": {
|
|
7070
|
-
"kind": "expression",
|
|
7071
|
-
"type": "number"
|
|
7072
|
-
},
|
|
7073
|
-
"default": "3"
|
|
7074
|
-
},
|
|
7075
|
-
{
|
|
7076
|
-
"name": "minimum",
|
|
7077
|
-
"value": {
|
|
7078
|
-
"kind": "expression",
|
|
7079
|
-
"type": "number"
|
|
7080
|
-
},
|
|
7081
|
-
"default": "0.8"
|
|
7082
|
-
},
|
|
7083
|
-
{
|
|
7084
|
-
"name": "maximum",
|
|
7085
|
-
"value": {
|
|
7086
|
-
"kind": "expression",
|
|
7087
|
-
"type": "number"
|
|
7088
|
-
},
|
|
7089
|
-
"default": "97.5"
|
|
7090
|
-
},
|
|
7091
|
-
{
|
|
7092
|
-
"name": "zIndex",
|
|
7093
|
-
"value": {
|
|
7094
|
-
"kind": "expression",
|
|
7095
|
-
"type": "number"
|
|
7096
|
-
},
|
|
7097
|
-
"default": "9999"
|
|
7098
|
-
}
|
|
7099
|
-
],
|
|
7100
|
-
"source": {
|
|
7101
|
-
"module": "/src/ui.loader-top/components/TopProgress.vue",
|
|
7102
|
-
"symbol": "default"
|
|
7103
|
-
}
|
|
7104
|
-
},
|
|
7105
7009
|
{
|
|
7106
7010
|
"name": "YearView",
|
|
7107
7011
|
"description": "",
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import colors from "tailwindcss/colors.js";
|
|
2
|
-
import forms from "@tailwindcss/forms";
|
|
3
|
-
import vuelessConfig from "../../vueless.config.js";
|
|
4
|
-
|
|
5
|
-
export const grayColors = ["slate", "gray", "zinc", "neutral", "stone"];
|
|
6
|
-
export const brandColors = [
|
|
7
|
-
"brand",
|
|
8
|
-
"red",
|
|
9
|
-
"orange",
|
|
10
|
-
"amber",
|
|
11
|
-
"yellow",
|
|
12
|
-
"lime",
|
|
13
|
-
"green",
|
|
14
|
-
"emerald",
|
|
15
|
-
"teal",
|
|
16
|
-
"cyan",
|
|
17
|
-
"sky",
|
|
18
|
-
"blue",
|
|
19
|
-
"indigo",
|
|
20
|
-
"violet",
|
|
21
|
-
"purple",
|
|
22
|
-
"fuchsia",
|
|
23
|
-
"pink",
|
|
24
|
-
"rose",
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export default class TailwindServiceDefault {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.vuelessPreset = this.get();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Transform CSS variable with RGB numbers into CSS color.
|
|
34
|
-
* @returns {Function}
|
|
35
|
-
*/
|
|
36
|
-
static twColorWithOpacity(variableName) {
|
|
37
|
-
return ({ opacityValue }) => {
|
|
38
|
-
return opacityValue !== undefined
|
|
39
|
-
? `rgba(var(${variableName}), ${opacityValue})`
|
|
40
|
-
: `rgb(var(${variableName}))`;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Convert sting patterns to RegExp.
|
|
46
|
-
* @returns {Array} - TailwindCSS safelist.
|
|
47
|
-
*/
|
|
48
|
-
static getSafelist() {
|
|
49
|
-
return JSON.parse(process.env.SAFELIST_JSON || "[]").map((rule) => ({
|
|
50
|
-
...rule,
|
|
51
|
-
pattern: new RegExp(rule.pattern),
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Generates preset for TailwindCSS base on Vueless config.
|
|
57
|
-
* @returns {Object}
|
|
58
|
-
*/
|
|
59
|
-
get() {
|
|
60
|
-
const isProd = process.env.NODE_ENV === "production";
|
|
61
|
-
const brandColor = TailwindServiceDefault.twColorWithOpacity("--color-brand");
|
|
62
|
-
const { brand, gray } = vuelessConfig;
|
|
63
|
-
|
|
64
|
-
let brandPalette = brandColors.includes(brand) ? colors[brand] : colors.green;
|
|
65
|
-
let grayPalette = grayColors.includes(gray) ? colors[gray] : colors.zinc;
|
|
66
|
-
|
|
67
|
-
if (brand === "grayscale") {
|
|
68
|
-
brandPalette = grayPalette;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const prodSafelist = TailwindServiceDefault.getSafelist();
|
|
72
|
-
const devSafelist = [
|
|
73
|
-
{
|
|
74
|
-
pattern: /(border|bg|text|ring)-(.*)-((50|[1-9]00|950)?)$/,
|
|
75
|
-
variants: ["hover", "focus", "focus-within", "active"],
|
|
76
|
-
},
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
content: [
|
|
81
|
-
"./index.html",
|
|
82
|
-
"./src/**/*.{js,ts,jsx,tsx,vue}",
|
|
83
|
-
"./vueless.config.{js,ts}",
|
|
84
|
-
"./node_modules/vueless/**/*.{js,ts,vue}",
|
|
85
|
-
],
|
|
86
|
-
safelist: isProd ? prodSafelist : devSafelist,
|
|
87
|
-
theme: {
|
|
88
|
-
extend: {
|
|
89
|
-
colors: {
|
|
90
|
-
brand: { ...brandPalette, DEFAULT: brandColor },
|
|
91
|
-
gray: grayPalette,
|
|
92
|
-
},
|
|
93
|
-
fontSize: {
|
|
94
|
-
"2xs": ["0.625rem", "0.875rem"], // 10px
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
plugins: [forms],
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export const { vuelessPreset } = new TailwindServiceDefault();
|