fluency-v8-components 1.3.8 → 1.4.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.
- package/dist/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +3 -3
- package/dist/{index-mewQ1Z9n.mjs → index-Br4jyWhU.mjs} +156 -145
- package/dist/{index.es-B_UwL3US.mjs → index.es-jnmHZtX5.mjs} +1 -1
- package/package.json +1 -1
- package/src/assets/main.css +14 -2
- package/src/components/common/AutoCompleteSearchBar.vue +1 -1
- package/src/components/common/CodeEditor.vue +5 -1
- package/src/components/common/DatePickerInput.vue +43 -28
- package/src/components/common/EditorHeading.vue +1 -1
- package/src/components/form/GreyInputAutocomplete.vue +1 -1
- package/src/components/form/GreyPassword.vue +1 -1
- package/src/components/form/GreySelectInput.vue +2 -2
- package/src/components/form/GreySelectInputMultiple.vue +2 -2
package/package.json
CHANGED
package/src/assets/main.css
CHANGED
|
@@ -4,11 +4,23 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
@utility editor-style {
|
|
7
|
+
font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;
|
|
8
|
+
padding: 10px 5px 10px 5px;
|
|
9
|
+
:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@utility editor-style-light {
|
|
15
|
+
scrollbar-color: #94a3b8 #64748b;
|
|
16
|
+
background: #475569;
|
|
17
|
+
color: #f8fafc;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@utility editor-style-dark {
|
|
7
21
|
scrollbar-color: #e0e7ff #303030;
|
|
8
22
|
background: #303030;
|
|
9
23
|
color: #FFFFFF;
|
|
10
|
-
font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;
|
|
11
|
-
padding: 10px 5px 10px 5px;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
@utility report-container {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<PrismEditor
|
|
3
|
-
class="editor-style"
|
|
3
|
+
:class="['editor-style', props.theme === 'dark' ? 'editor-style-dark' : 'editor-style-light']"
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
:style="`fontSize: ${props.fontSize}`"
|
|
6
6
|
:readonly="props.readonly"
|
|
@@ -18,6 +18,10 @@ import "@/assets/prism-theme.css"; // import syntax highlighting styles
|
|
|
18
18
|
|
|
19
19
|
// props and emits
|
|
20
20
|
const props = defineProps({
|
|
21
|
+
theme: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "dark",
|
|
24
|
+
},
|
|
21
25
|
fontSize: {
|
|
22
26
|
type: String,
|
|
23
27
|
default: "12px",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="col">
|
|
3
|
-
<
|
|
3
|
+
<VueTailwindDatepicker :shortcuts="customShortcuts" v-model="dateValue" />
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { ref, watch
|
|
8
|
+
import { ref, watch } from "vue";
|
|
9
9
|
import VueTailwindDatepicker from "vue-tailwind-datepicker";
|
|
10
10
|
import moment from "moment";
|
|
11
11
|
|
|
@@ -14,40 +14,47 @@ const props = defineProps({
|
|
|
14
14
|
to: Number,
|
|
15
15
|
});
|
|
16
16
|
const emits = defineEmits(["selectTime"]);
|
|
17
|
-
const dateValue = ref(
|
|
17
|
+
const dateValue = ref(defaultRange());
|
|
18
18
|
|
|
19
|
-
watch(dateValue, (val) => {
|
|
20
|
-
emits("selectTime", [moment(val[0]).valueOf(), moment(val[1]).valueOf()]);
|
|
21
|
-
});
|
|
22
19
|
watch(
|
|
23
|
-
() => props.from,
|
|
24
|
-
(
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
() => [props.from, props.to],
|
|
21
|
+
([from, to]) => {
|
|
22
|
+
const baseRange = Array.isArray(dateValue.value) ? dateValue.value : [];
|
|
23
|
+
const nextRange = baseRange.length === 2 ? [...baseRange] : defaultRange();
|
|
24
|
+
let updated = false;
|
|
25
|
+
|
|
26
|
+
if (isValidTimestamp(from)) {
|
|
27
|
+
nextRange[0] = formatTime(from);
|
|
28
|
+
updated = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (isValidTimestamp(to)) {
|
|
32
|
+
nextRange[1] = formatTime(to);
|
|
33
|
+
updated = true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (updated) {
|
|
37
|
+
dateValue.value = nextRange;
|
|
27
38
|
} else {
|
|
28
39
|
resetDate();
|
|
29
40
|
}
|
|
30
|
-
}
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true }
|
|
31
43
|
);
|
|
44
|
+
|
|
32
45
|
watch(
|
|
33
|
-
|
|
46
|
+
dateValue,
|
|
34
47
|
(val) => {
|
|
35
|
-
if (val) {
|
|
36
|
-
|
|
48
|
+
if (Array.isArray(val) && val.length === 2 && val[0] && val[1]) {
|
|
49
|
+
emits("selectTime", [
|
|
50
|
+
moment(val[0]).valueOf(),
|
|
51
|
+
moment(val[1]).valueOf(),
|
|
52
|
+
]);
|
|
37
53
|
}
|
|
38
|
-
}
|
|
54
|
+
},
|
|
55
|
+
{ deep: true }
|
|
39
56
|
);
|
|
40
57
|
|
|
41
|
-
onMounted(() => {
|
|
42
|
-
if (props.from && props.to) {
|
|
43
|
-
const fromFormatted = formatTime(props.from);
|
|
44
|
-
const toFormatted = formatTime(props.to);
|
|
45
|
-
dateValue.value = [fromFormatted, toFormatted];
|
|
46
|
-
} else {
|
|
47
|
-
resetDate();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
58
|
function customShortcuts() {
|
|
52
59
|
const date = moment().valueOf();
|
|
53
60
|
return [
|
|
@@ -97,13 +104,21 @@ function customShortcuts() {
|
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
function resetDate() {
|
|
100
|
-
dateValue.value =
|
|
107
|
+
dateValue.value = defaultRange();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function formatTime(time) {
|
|
111
|
+
return moment(time).format("YYYY-MM-DD HH:mm:ss");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function defaultRange() {
|
|
115
|
+
return [
|
|
101
116
|
formatTime(moment().subtract(1, "hours")),
|
|
102
117
|
formatTime(moment()),
|
|
103
118
|
];
|
|
104
119
|
}
|
|
105
120
|
|
|
106
|
-
function
|
|
107
|
-
return
|
|
121
|
+
function isValidTimestamp(value) {
|
|
122
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
108
123
|
}
|
|
109
124
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="bg-
|
|
3
|
+
class="bg-gray-400 pl-3 py-1 sm:flex sm:items-center sm:justify-between content-center dark:bg-neutral-600 dark:text-white"
|
|
4
4
|
>
|
|
5
5
|
<slot name="title" />
|
|
6
6
|
<div class="mt-3 flex sm:mt-0">
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:displayValue="(option) => option"
|
|
16
16
|
/>
|
|
17
17
|
<ComboboxOptions
|
|
18
|
-
class="input-block absolute z-
|
|
18
|
+
class="input-block absolute z-20 mt-1 max-h-56 w-full overflow-auto rounded-md bg-white p-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm"
|
|
19
19
|
>
|
|
20
20
|
<ComboboxOption
|
|
21
21
|
v-if="queryOption && !filteredOptions.some((option) => option.value === queryOption)"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input
|
|
5
5
|
type="text"
|
|
6
6
|
:class="[
|
|
7
|
-
'input-block',
|
|
7
|
+
'pl-3 input-block',
|
|
8
8
|
error ? 'ring-red-600 ' : '',
|
|
9
9
|
readonly ? 'disabled' : '',
|
|
10
10
|
]"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
leave-to-class="opacity-0"
|
|
25
25
|
>
|
|
26
26
|
<ComboboxOptions
|
|
27
|
-
class="input-block absolute z-
|
|
27
|
+
class="input-block absolute z-20 mt-1 max-h-56 w-full overflow-auto rounded-md p-1 text-base sm:text-sm"
|
|
28
28
|
>
|
|
29
29
|
<ComboboxOption
|
|
30
30
|
as="template"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
<div
|
|
26
26
|
v-if="!readonly"
|
|
27
|
-
class="relative z-
|
|
27
|
+
class="relative z-9 flex flex-auto flex-row-reverse"
|
|
28
28
|
>
|
|
29
29
|
<XMarkIcon
|
|
30
30
|
class="icon cursor-pointer hover:opacity-75"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
@after-leave="query = ''"
|
|
65
65
|
>
|
|
66
66
|
<ComboboxOptions
|
|
67
|
-
class="input-block absolute z-20 mt-1 max-h-56 w-full overflow-auto rounded-md
|
|
67
|
+
class="input-block absolute z-20 mt-1 max-h-56 w-full overflow-auto rounded-md p-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm"
|
|
68
68
|
>
|
|
69
69
|
<div
|
|
70
70
|
v-if="filteredOptions.length === 0 && query !== ''"
|