fluency-v8-components 1.5.6 → 1.5.7
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 +120 -119
- package/dist/fluency-v8-components.umd.js +94 -94
- package/dist/{index-DE5ti6O6.mjs → index-Bubjp5rY.mjs} +8298 -8161
- package/dist/{index.es-C2WG_eVQ.mjs → index.es-Ch4i5FrM.mjs} +1 -1
- package/package.json +1 -1
- package/src/components/common/CheckDropdown.vue +112 -0
- package/src/components/form/CheckBox.vue +17 -1
- package/src/components/form/GreyInputGrow.vue +2 -1
- package/src/components/form/GreyPassword.vue +1 -1
- package/src/components/index.js +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Popover as="div" class="relative inline-block text-left">
|
|
3
|
+
<PopoverButton
|
|
4
|
+
:class="[
|
|
5
|
+
`group inline-flex justify-center text-${size} font-medium`,
|
|
6
|
+
{ 'std-btn std-btn-red': color === 'red' },
|
|
7
|
+
{ 'std-btn std-btn-green': color === 'green' },
|
|
8
|
+
{ 'std-btn std-btn-blue': color === 'blue' },
|
|
9
|
+
{ 'px-3! py-1!': dense },
|
|
10
|
+
]"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
>
|
|
13
|
+
<slot name="btn" />
|
|
14
|
+
{{ text }}
|
|
15
|
+
<ChevronDownIcon :class="[iconSize]" />
|
|
16
|
+
</PopoverButton>
|
|
17
|
+
|
|
18
|
+
<transition
|
|
19
|
+
enter-active-class="transition ease-out duration-100"
|
|
20
|
+
enter-from-class="transform opacity-0 scale-95"
|
|
21
|
+
enter-to-class="transform opacity-100 scale-100"
|
|
22
|
+
leave-active-class="transition ease-in duration-75"
|
|
23
|
+
leave-from-class="transform opacity-100 scale-100"
|
|
24
|
+
leave-to-class="transform opacity-0 scale-95"
|
|
25
|
+
>
|
|
26
|
+
<PopoverPanel
|
|
27
|
+
:class="[
|
|
28
|
+
`std-white input-dropdown origin-top-right shadow-lg max-h-96`,
|
|
29
|
+
`w-${optionsSize}`,
|
|
30
|
+
direction === 'right' ? 'left-0 ' : 'right-0',
|
|
31
|
+
{ 'std-red': color === 'red' },
|
|
32
|
+
{ 'std-green': color === 'green' },
|
|
33
|
+
{ 'std-blue': color === 'blue' },
|
|
34
|
+
{ 'std-white': color !== 'red' && color !== 'blue' && color !== 'green' },
|
|
35
|
+
]"
|
|
36
|
+
>
|
|
37
|
+
<div>
|
|
38
|
+
<span
|
|
39
|
+
class="row py-0.5 border-b items-center"
|
|
40
|
+
>
|
|
41
|
+
<CheckBox v-model="selectAll" @update:modelValue="toggleSelectAll" :size="size" />
|
|
42
|
+
<span :class="`ml-1 text-${size}`">Select All</span>
|
|
43
|
+
</span>
|
|
44
|
+
<span
|
|
45
|
+
v-for="(option, i) in options"
|
|
46
|
+
:class="['row py-0.5 items-center', { 'border-b': i < options.length - 1}]"
|
|
47
|
+
>
|
|
48
|
+
<CheckBox v-model="option.checked" :disabled="selectAll" :size="size" />
|
|
49
|
+
<span :class="[`ml-1 text-${size}`, { 'font-thin': selectAll}]">{{ option.label }}</span>
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
</PopoverPanel>
|
|
53
|
+
</transition>
|
|
54
|
+
</Popover>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup>
|
|
58
|
+
import { ref, computed } from 'vue';
|
|
59
|
+
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
|
|
60
|
+
import { ChevronDownIcon } from '@heroicons/vue/20/solid'
|
|
61
|
+
import CheckBox from '../form/CheckBox.vue'
|
|
62
|
+
|
|
63
|
+
// props and emits
|
|
64
|
+
const props = defineProps({
|
|
65
|
+
options: {
|
|
66
|
+
type: Array,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "Filter"
|
|
72
|
+
},
|
|
73
|
+
size: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "sm",
|
|
76
|
+
},
|
|
77
|
+
color: String,
|
|
78
|
+
direction: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "left",
|
|
81
|
+
},
|
|
82
|
+
optionsSize: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "40",
|
|
85
|
+
},
|
|
86
|
+
disabled: Boolean,
|
|
87
|
+
dense: Boolean,
|
|
88
|
+
selectAll: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
const emits = defineEmits([]);
|
|
94
|
+
|
|
95
|
+
// states
|
|
96
|
+
const selectAll = ref(props.selectAll ? true : false);
|
|
97
|
+
// computed
|
|
98
|
+
const iconSize = computed(() => {
|
|
99
|
+
if (props.size === "xs") return "icon";
|
|
100
|
+
if (props.size === "sm") return "icon-md";
|
|
101
|
+
if (props.size === "md") return "icon-lg";
|
|
102
|
+
if (props.size === "lg") return "icon-xl";
|
|
103
|
+
return "icon";
|
|
104
|
+
});
|
|
105
|
+
// function defs
|
|
106
|
+
function toggleSelectAll() {
|
|
107
|
+
const newVal = selectAll.value
|
|
108
|
+
props.options.forEach((option) => {
|
|
109
|
+
option.checked = newVal;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
<input
|
|
5
5
|
type="checkbox"
|
|
6
6
|
:class="[
|
|
7
|
-
'
|
|
7
|
+
'rounded-sm cursor-pointer',
|
|
8
|
+
iconSize,
|
|
8
9
|
{ 'cursor-not-allowed!': $attrs.disabled },
|
|
9
10
|
]"
|
|
10
11
|
:checked="$attrs.modelValue"
|
|
@@ -17,6 +18,21 @@
|
|
|
17
18
|
</template>
|
|
18
19
|
<script>
|
|
19
20
|
export default {
|
|
21
|
+
props: {
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "md",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
iconSize() {
|
|
29
|
+
if (this.size === "xs") return "icon";
|
|
30
|
+
if (this.size === "sm") return "icon-md";
|
|
31
|
+
if (this.size === "md") return "icon-lg";
|
|
32
|
+
if (this.size === "lg") return "icon-xl";
|
|
33
|
+
return "icon";
|
|
34
|
+
},
|
|
35
|
+
},
|
|
20
36
|
methods: {
|
|
21
37
|
onChange() {
|
|
22
38
|
this.$emit("update:modelValue", !this.$attrs.modelValue);
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
<textarea
|
|
7
7
|
ref="textarea"
|
|
8
8
|
:class="[
|
|
9
|
-
'py-2 px-3 w-full resize-none
|
|
9
|
+
'py-2 px-3 w-full resize-none border-0 std-placeholder custom-scrollbar',
|
|
10
|
+
'focus:ring-0 focus:ring-offset-0 focus:border-0 focus:outline-none shadow-none',
|
|
10
11
|
readonly ? 'disabled' : '',
|
|
11
12
|
]"
|
|
12
13
|
:value="$attrs.modelValue || props.value"
|
package/src/components/index.js
CHANGED
|
@@ -102,6 +102,7 @@ export { default as EditorHeading } from "./common/EditorHeading.vue";
|
|
|
102
102
|
export { default as CodeEditor } from "./common/CodeEditor.vue";
|
|
103
103
|
export { default as Select } from "./common/Select.vue";
|
|
104
104
|
export { default as Sort } from "./common/Sort.vue";
|
|
105
|
+
export { default as CheckDropdown } from "./common/CheckDropdown.vue";
|
|
105
106
|
export { default as Flag } from "./common/Flag.vue";
|
|
106
107
|
export { default as ThreeHomePanel } from "./common/ThreeHomePanel.vue";
|
|
107
108
|
export { default as Stepper } from "./common/Stepper.vue";
|