fluency-v8-components 1.3.5 → 1.3.6

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.
Files changed (178) hide show
  1. package/dist/fluency-v8-components.es.js +1 -1
  2. package/dist/fluency-v8-components.umd.js +99 -99
  3. package/dist/{index-q2NbjdVo.mjs → index-BBxccHNP.mjs} +7 -6
  4. package/dist/{index.es-PAPL4E6Y.mjs → index.es-D_XhLSeH.mjs} +1 -1
  5. package/package.json +3 -2
  6. package/src/assets/images/ai.svg +1 -0
  7. package/src/assets/images/github-dark.svg +1 -0
  8. package/src/assets/images/github.svg +1 -0
  9. package/src/assets/images/high-priority.svg +1 -0
  10. package/src/assets/images/power-off.svg +1 -0
  11. package/src/assets/images/save.svg +1 -0
  12. package/src/assets/index.ts +15 -0
  13. package/src/assets/main.css +505 -0
  14. package/src/assets/prism-theme.css +290 -0
  15. package/src/components/buttons/ActionButtons.vue +374 -0
  16. package/src/components/buttons/DropdownButton.vue +104 -0
  17. package/src/components/buttons/IconButton.vue +63 -0
  18. package/src/components/buttons/ImageButton.vue +16 -0
  19. package/src/components/buttons/MenuButton.vue +138 -0
  20. package/src/components/buttons/SubmitButtons.vue +51 -0
  21. package/src/components/buttons/TextButton.vue +40 -0
  22. package/src/components/charts/AlertChart.vue +376 -0
  23. package/src/components/charts/BarChart.vue +212 -0
  24. package/src/components/charts/BarChartHorizontal.vue +243 -0
  25. package/src/components/charts/CronChart.vue +146 -0
  26. package/src/components/charts/EmptyChart.vue +76 -0
  27. package/src/components/charts/GradientChart.vue +310 -0
  28. package/src/components/charts/LineChart.test.js +59 -0
  29. package/src/components/charts/LineChart.vue +434 -0
  30. package/src/components/charts/PieChart.vue +293 -0
  31. package/src/components/charts/ProgressChart.vue +106 -0
  32. package/src/components/charts/StackedChart.vue +364 -0
  33. package/src/components/charts/StackedChartClustered.vue +395 -0
  34. package/src/components/charts/TimelineChart.vue +215 -0
  35. package/src/components/charts/WorkflowChart.vue +520 -0
  36. package/src/components/common/AutoCompleteSearchBar.vue +100 -0
  37. package/src/components/common/AutoRefreshButton.vue +53 -0
  38. package/src/components/common/Breadcrumb.vue +45 -0
  39. package/src/components/common/ButtonToggle.vue +24 -0
  40. package/src/components/common/Card.vue +116 -0
  41. package/src/components/common/Carousel.vue +66 -0
  42. package/src/components/common/CategoryCard.vue +28 -0
  43. package/src/components/common/CodeEditor.vue +59 -0
  44. package/src/components/common/DatePicker.vue +21 -0
  45. package/src/components/common/DatePickerInput.vue +109 -0
  46. package/src/components/common/Dialog.vue +103 -0
  47. package/src/components/common/EditorHeading.vue +10 -0
  48. package/src/components/common/EventList.vue +41 -0
  49. package/src/components/common/Facet.vue +206 -0
  50. package/src/components/common/Feed.vue +58 -0
  51. package/src/components/common/Flag.vue +27 -0
  52. package/src/components/common/HomeCard.vue +20 -0
  53. package/src/components/common/ItemBox.vue +49 -0
  54. package/src/components/common/Loading.vue +19 -0
  55. package/src/components/common/LoadingDots.vue +12 -0
  56. package/src/components/common/PageHeading.vue +30 -0
  57. package/src/components/common/Pagination.vue +105 -0
  58. package/src/components/common/Popover.vue +24 -0
  59. package/src/components/common/PowerToggle.vue +130 -0
  60. package/src/components/common/ProgressBar.vue +33 -0
  61. package/src/components/common/RadioButtons.vue +52 -0
  62. package/src/components/common/Schedule.vue +79 -0
  63. package/src/components/common/SearchBar.vue +30 -0
  64. package/src/components/common/Separator.vue +3 -0
  65. package/src/components/common/Slideout.vue +95 -0
  66. package/src/components/common/Sort.vue +83 -0
  67. package/src/components/common/Table.vue +48 -0
  68. package/src/components/common/Tabs.vue +129 -0
  69. package/src/components/common/Tag.vue +53 -0
  70. package/src/components/common/Tooltip.vue +49 -0
  71. package/src/components/common/VerticalTabs.vue +34 -0
  72. package/src/components/common/card/CardItem.vue +27 -0
  73. package/src/components/common/card/CardItemGroup.vue +45 -0
  74. package/src/components/common/facet/Leaf.vue +97 -0
  75. package/src/components/common/facet/TriState.vue +37 -0
  76. package/src/components/common/table/TableData.vue +48 -0
  77. package/src/components/common/table/TableHeader.vue +21 -0
  78. package/src/components/dialogs/ChooseValueDialog.vue +97 -0
  79. package/src/components/dialogs/ConfirmDialog.vue +73 -0
  80. package/src/components/dialogs/CopyDialog.vue +51 -0
  81. package/src/components/dialogs/DownloadDialog.vue +48 -0
  82. package/src/components/dialogs/NameDescDialog.vue +74 -0
  83. package/src/components/dialogs/NameDialog.vue +56 -0
  84. package/src/components/dialogs/PopupEditor.vue +113 -0
  85. package/src/components/dialogs/ProgressDialog.vue +58 -0
  86. package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
  87. package/src/components/dialogs/Wizard.vue +99 -0
  88. package/src/components/dialogs/wizard/Stepper.vue +31 -0
  89. package/src/components/form/CheckBox.vue +26 -0
  90. package/src/components/form/Editor.vue +93 -0
  91. package/src/components/form/FormCol.vue +19 -0
  92. package/src/components/form/FormRow.vue +19 -0
  93. package/src/components/form/FormSection.vue +21 -0
  94. package/src/components/form/GreyForm.vue +7 -0
  95. package/src/components/form/GreyInput.vue +51 -0
  96. package/src/components/form/GreyInputAutocomplete.vue +100 -0
  97. package/src/components/form/GreyInputCopy.vue +66 -0
  98. package/src/components/form/GreyInputGrow.vue +42 -0
  99. package/src/components/form/GreyInputToken.vue +78 -0
  100. package/src/components/form/GreyPassword.vue +36 -0
  101. package/src/components/form/GreySelect.vue +154 -0
  102. package/src/components/form/GreySelectInput.vue +123 -0
  103. package/src/components/form/GreySelectInputMultiple.vue +218 -0
  104. package/src/components/form/GreyTel.vue +58 -0
  105. package/src/components/form/HamburgerItem.vue +95 -0
  106. package/src/components/form/KeyValueEntry.vue +74 -0
  107. package/src/components/form/RadioInput.vue +38 -0
  108. package/src/components/form/UploadFile.vue +99 -0
  109. package/src/components/icons/AiIcon.vue +6 -0
  110. package/src/components/icons/GithubIcon.vue +18 -0
  111. package/src/components/icons/HighPriorityIcon.vue +6 -0
  112. package/src/components/icons/PowerOffIcon.vue +6 -0
  113. package/src/components/icons/SaveIcon.vue +6 -0
  114. package/src/components/index.js +134 -0
  115. package/src/components/menu/DialogMenu.vue +142 -0
  116. package/src/components/menu/GrandChild.vue +39 -0
  117. package/src/components/menu/GridMenu.vue +88 -0
  118. package/src/components/menu/MenuAvatar.vue +66 -0
  119. package/src/components/menu/MenuDesktop.vue +90 -0
  120. package/src/components/notifications/Notify.vue +123 -0
  121. package/src/components/notifications/NotifyList.vue +130 -0
  122. package/src/components/page-structure/FacetPage.vue +77 -0
  123. package/src/components/query/Child.vue +63 -0
  124. package/src/components/query/LVDBQuery.vue +38 -0
  125. package/src/components/status/Active.vue +44 -0
  126. package/src/components/status/ScoreLevel.vue +43 -0
  127. package/src/components/status/Status.vue +51 -0
  128. package/src/components/status/TaskDot.vue +25 -0
  129. package/src/components/status/TaskStatus.vue +26 -0
  130. package/src/components/status/TicketStatus.vue +201 -0
  131. package/src/components/status/Trend.vue +20 -0
  132. package/src/components/tables/ArgumentRunTable.vue +96 -0
  133. package/src/components/tables/ArgumentTable.vue +67 -0
  134. package/src/components/tables/CloudFormationParameters.vue +25 -0
  135. package/src/constants/colors.js +248 -0
  136. package/src/constants/font-map.js +128 -0
  137. package/src/constants/fpl2.js +162 -0
  138. package/src/constants/icon-svg.js +405 -0
  139. package/src/constants/schedule.js +52 -0
  140. package/src/fpl/AddPanel.vue +237 -0
  141. package/src/fpl/Configs/Alert.vue +16 -0
  142. package/src/fpl/Configs/AlertSprite.vue +2 -0
  143. package/src/fpl/Configs/Chart.vue +63 -0
  144. package/src/fpl/Configs/Config.js +154 -0
  145. package/src/fpl/Configs/Counter.vue +35 -0
  146. package/src/fpl/Configs/Histogram.vue +70 -0
  147. package/src/fpl/Configs/IPMap.vue +37 -0
  148. package/src/fpl/Configs/Image.vue +163 -0
  149. package/src/fpl/Configs/MetricChart.vue +20 -0
  150. package/src/fpl/Configs/PieChart.vue +37 -0
  151. package/src/fpl/Configs/SparkChart.vue +41 -0
  152. package/src/fpl/Configs/StackedBarChart.vue +49 -0
  153. package/src/fpl/Configs/Table.vue +211 -0
  154. package/src/fpl/Configs/Text.vue +14 -0
  155. package/src/fpl/Configs/TopNChart.vue +37 -0
  156. package/src/fpl/Outputs/FPLAlert.vue +64 -0
  157. package/src/fpl/Outputs/FPLStream.vue +41 -0
  158. package/src/fpl/Outputs/FPLTable.vue +77 -0
  159. package/src/fpl/Panel.vue +202 -0
  160. package/src/fpl/Panels/Alert.vue +85 -0
  161. package/src/fpl/Panels/AlertSprite.vue +9 -0
  162. package/src/fpl/Panels/Chart.vue +98 -0
  163. package/src/fpl/Panels/Counter.vue +43 -0
  164. package/src/fpl/Panels/Histogram.vue +138 -0
  165. package/src/fpl/Panels/IPMap.vue +48 -0
  166. package/src/fpl/Panels/Image.vue +35 -0
  167. package/src/fpl/Panels/MetricChart.vue +97 -0
  168. package/src/fpl/Panels/PieChart.vue +54 -0
  169. package/src/fpl/Panels/SparkChart.vue +166 -0
  170. package/src/fpl/Panels/StackedBarChart.vue +74 -0
  171. package/src/fpl/Panels/Table.vue +103 -0
  172. package/src/fpl/Panels/Text.vue +24 -0
  173. package/src/fpl/Panels/TopNChart.vue +69 -0
  174. package/src/fpl/index.js +39 -0
  175. package/src/utils/download.js +220 -0
  176. package/src/utils/formatOutput.js +156 -0
  177. package/src/utils/random.js +32 -0
  178. package/src/utils/timeUtils.js +138 -0
@@ -0,0 +1,123 @@
1
+ <!-- TODO: dark mode -->
2
+ <template>
3
+ <TransitionRoot as="template" :show="open">
4
+ <Dialog
5
+ v-if="isDialog"
6
+ as="div"
7
+ :class="success ? 'bg-green-50' : 'bg-red-50'"
8
+ class="rounded-md p-4 fixed bottom-5 z-50"
9
+ style="min-width: 75%; left: 50%; transform: translateX(-50%)"
10
+ @close="closeModal"
11
+ >
12
+ <div class="flex">
13
+ <div class="flex-shrink-0">
14
+ <CheckCircleIcon
15
+ v-if="success"
16
+ class="icon-md text-green-400"
17
+ aria-hidden="true"
18
+ />
19
+ <XCircleIcon v-else class="icon-md text-red-400" aria-hidden="true" />
20
+ </div>
21
+ <div class="ml-3">
22
+ <h3 v-if="success" class="text-sm font-medium text-green-800">
23
+ {{ title }}
24
+ </h3>
25
+ <h3 v-else class="text-sm font-medium text-red-800">{{ title }}</h3>
26
+ <div v-if="success" class="mt-2 text-sm text-green-700">
27
+ <p>{{ msg }}</p>
28
+ </div>
29
+ <div v-else class="mt-2 text-sm text-red-700">
30
+ <p>{{ msg }}</p>
31
+ </div>
32
+ </div>
33
+ <div class="ml-auto pl-3">
34
+ <div class="-mx-1.5 -my-1.5">
35
+ <IconButton :color="getColor()" @click="closeModal">
36
+ <XMarkIcon class="icon-md" aria-hidden="true" />
37
+ </IconButton>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </Dialog>
42
+ <div
43
+ v-else
44
+ :class="success ? 'bg-green-50' : 'bg-red-50'"
45
+ class="rounded-md p-4 fixed bottom-5 z-50"
46
+ style="min-width: 75%; left: 50%; transform: translateX(-50%)"
47
+ >
48
+ <div class="flex">
49
+ <div class="flex-shrink-0">
50
+ <CheckCircleIcon
51
+ v-if="success"
52
+ class="icon-md text-green-400"
53
+ aria-hidden="true"
54
+ />
55
+ <XCircleIcon v-else class="icon-md text-red-400" aria-hidden="true" />
56
+ </div>
57
+ <div class="ml-3">
58
+ <h3 v-if="success" class="text-sm font-medium text-green-800">
59
+ {{ title }}
60
+ </h3>
61
+ <h3 v-else class="text-sm font-medium text-red-800">{{ title }}</h3>
62
+ <div v-if="success" class="mt-2 text-sm text-green-700">
63
+ <p>{{ msg }}</p>
64
+ </div>
65
+ <div v-else class="mt-2 text-sm text-red-700">
66
+ <p>{{ msg }}</p>
67
+ </div>
68
+ </div>
69
+ <div class="ml-auto pl-3">
70
+ <div class="-mx-1.5 -my-1.5">
71
+ <IconButton :color="getColor()" @click="closeModal">
72
+ <XMarkIcon class="icon-md" aria-hidden="true" />
73
+ </IconButton>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </TransitionRoot>
79
+ </template>
80
+
81
+ <script lang="ts" setup>
82
+ import { ref } from "vue";
83
+ import { TransitionRoot, Dialog } from "@headlessui/vue";
84
+ import { CheckCircleIcon, XCircleIcon } from "@heroicons/vue/24/outline";
85
+ import { XMarkIcon } from "@heroicons/vue/20/solid";
86
+ import { IconButton } from "..";
87
+
88
+ const open = ref(false);
89
+ const msg = ref("");
90
+ const success = ref(false);
91
+ const title = ref("");
92
+ const refresh = ref();
93
+ const isDialog = ref(false);
94
+
95
+ // function defs
96
+ function openModal(t: string, m: string, s: boolean) {
97
+ clearTimeout(refresh.value);
98
+ title.value = t;
99
+ msg.value = m;
100
+ success.value = s;
101
+ open.value = true;
102
+ // check if dialog is open
103
+ const dialogs = window.document.querySelectorAll("#headlessui-portal-root");
104
+ isDialog.value =
105
+ dialogs && dialogs.length > 0 && dialogs[0].childElementCount > 1;
106
+ // auto close the notification after 5 seconds
107
+ refresh.value = setTimeout(() => {
108
+ closeModal();
109
+ }, 3000);
110
+ }
111
+
112
+ function closeModal() {
113
+ open.value = false;
114
+ }
115
+
116
+ function getColor() {
117
+ return success.value ? "green" : "red";
118
+ }
119
+
120
+ defineExpose({
121
+ openModal,
122
+ });
123
+ </script>
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <TransitionRoot as="template" :show="open">
3
+ <Dialog
4
+ v-if="isDialog"
5
+ as="div"
6
+ :class="success ? 'bg-green-50' : 'bg-red-50'"
7
+ class="rounded-md p-4 fixed bottom-5 z-50"
8
+ style="min-width: 75%; left: 50%; transform: translateX(-50%)"
9
+ @close="closeModal"
10
+ >
11
+ <div class="flex">
12
+ <div class="flex-shrink-0">
13
+ <CheckCircleIcon
14
+ v-if="success"
15
+ class="icon-md text-green-400"
16
+ aria-hidden="true"
17
+ />
18
+ <XCircleIcon v-else class="icon-md text-red-400" aria-hidden="true" />
19
+ </div>
20
+ <div class="ml-3">
21
+ <h3 v-if="success" class="text-sm font-medium text-green-800">
22
+ {{ title }}
23
+ </h3>
24
+ <h3 v-else class="text-sm font-medium text-red-800">{{ title }}</h3>
25
+ <div v-if="success" class="mt-2 text-sm text-green-700">
26
+ <ul role="list" class="list-disc space-y-1 pl-5">
27
+ <li v-for="item in list" :key="item">{{ item }}</li>
28
+ </ul>
29
+ </div>
30
+ <div v-else class="mt-2 text-sm text-red-700">
31
+ <ul role="list" class="list-disc space-y-1 pl-5">
32
+ <li v-for="item in list" :key="item">{{ item }}</li>
33
+ </ul>
34
+ </div>
35
+ </div>
36
+ <div class="ml-auto pl-3">
37
+ <div class="-mx-1.5 -my-1.5">
38
+ <IconButton :color="getColor()" @click="closeModal">
39
+ <XMarkIcon class="icon-md" aria-hidden="true" />
40
+ </IconButton>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </Dialog>
45
+ <div
46
+ v-else
47
+ :class="success ? 'bg-green-50' : 'bg-red-50'"
48
+ class="rounded-md p-4 fixed bottom-5 z-50"
49
+ style="min-width: 75%; left: 50%; transform: translateX(-50%)"
50
+ >
51
+ <div class="flex">
52
+ <div class="flex-shrink-0">
53
+ <CheckCircleIcon
54
+ v-if="success"
55
+ class="icon-md text-green-400"
56
+ aria-hidden="true"
57
+ />
58
+ <XCircleIcon v-else class="icon-md text-red-400" aria-hidden="true" />
59
+ </div>
60
+ <div class="ml-3">
61
+ <h3 v-if="success" class="text-sm font-medium text-green-800">
62
+ {{ title }}
63
+ </h3>
64
+ <h3 v-else class="text-sm font-medium text-red-800">{{ title }}</h3>
65
+ <div v-if="success" class="mt-2 text-sm text-green-700">
66
+ <ul role="list" class="list-disc space-y-1 pl-5">
67
+ <li v-for="item in list" :key="item">{{ item }}</li>
68
+ </ul>
69
+ </div>
70
+ <div v-else class="mt-2 text-sm text-red-700">
71
+ <ul role="list" class="list-disc space-y-1 pl-5">
72
+ <li v-for="item in list" :key="item">{{ item }}</li>
73
+ </ul>
74
+ </div>
75
+ </div>
76
+ <div class="ml-auto pl-3">
77
+ <div class="-mx-1.5 -my-1.5">
78
+ <IconButton :color="getColor()" @click="closeModal">
79
+ <XMarkIcon class="icon-md" aria-hidden="true" />
80
+ </IconButton>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </TransitionRoot>
86
+ </template>
87
+
88
+ <script lang="ts" setup>
89
+ import { ref } from "vue";
90
+ import { TransitionRoot, Dialog } from "@headlessui/vue";
91
+ import { CheckCircleIcon, XCircleIcon } from "@heroicons/vue/24/outline";
92
+ import { XMarkIcon } from "@heroicons/vue/20/solid";
93
+ import { IconButton } from "..";
94
+
95
+ const open = ref(false);
96
+ const list = ref();
97
+ const success = ref(false);
98
+ const title = ref("");
99
+ const refresh = ref();
100
+ const isDialog = ref(false);
101
+
102
+ // function defs
103
+ function openModal(t: string, l: string, s: boolean) {
104
+ clearTimeout(refresh.value);
105
+ title.value = t;
106
+ list.value = l;
107
+ success.value = s;
108
+ open.value = true;
109
+ // check if dialog is open
110
+ const dialogs = window.document.querySelectorAll("#headlessui-portal-root");
111
+ isDialog.value =
112
+ dialogs && dialogs.length > 0 && dialogs[0].childElementCount > 1;
113
+ // auto close the notification after 5 seconds
114
+ refresh.value = setTimeout(() => {
115
+ closeModal();
116
+ }, 5000);
117
+ }
118
+
119
+ function closeModal() {
120
+ open.value = false;
121
+ }
122
+
123
+ function getColor() {
124
+ return success.value ? "green" : "red";
125
+ }
126
+
127
+ defineExpose({
128
+ openModal,
129
+ });
130
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <div>
3
+ <AutoCompleteSearchBar
4
+ v-if="searchBar && !hideSearch"
5
+ :str="facetOptions.searchStr"
6
+ :dict="dict"
7
+ class="my-2 pb-2"
8
+ @search="emits('search', $event)"
9
+ >
10
+ <template #right>
11
+ <Sort
12
+ v-if="sortable"
13
+ class="ml-2"
14
+ :options="sortBy"
15
+ :current="currentSort"
16
+ @sort="emits('sort', $event)"
17
+ />
18
+ </template>
19
+ </AutoCompleteSearchBar>
20
+ <div class="grid grid-cols-3 md:grid-cols-4">
21
+ <div
22
+ :class="[
23
+ 'w-full col-span-3 md:col md:col-span-1 md:overflow-auto',
24
+ { 'md:page-height-search': searchBar },
25
+ { 'md:page-height': !searchBar },
26
+ ]"
27
+ >
28
+ <slot name="facet" />
29
+ </div>
30
+ <div
31
+ :class="[
32
+ 'col-span-3 md:ml-5 md:overflow-auto',
33
+ { 'md:page-height-search': searchBar },
34
+ { 'md:page-height': !searchBar },
35
+ ]"
36
+ >
37
+ <slot name="content" />
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </template>
42
+ <script setup>
43
+ import Sort from "@/components/common/Sort.vue";
44
+ import AutoCompleteSearchBar from "@/components/common/AutoCompleteSearchBar.vue";
45
+
46
+ const props = defineProps({
47
+ searchBar: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ hideSearch: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ facetOptions: {
56
+ type: Object,
57
+ default: () => ({}),
58
+ },
59
+ dict: {
60
+ type: Array,
61
+ default: () => [],
62
+ },
63
+ sortable: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ sortBy: {
68
+ type: Array,
69
+ default: () => [],
70
+ },
71
+ currentSort: {
72
+ type: Object,
73
+ default: () => ({}),
74
+ },
75
+ });
76
+ const emits = defineEmits(["search", "sort"]);
77
+ </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <ul v-for="child in sortedChildren">
3
+ <li
4
+ class="w-full hover:white-bg-hover dark:hover:dark-bg-hover p-2 flex items-center justify-between"
5
+ >
6
+ <div :style="`padding-left: ${level * 12}px`">
7
+ {{ child.exclude ? "NOT " : "" }}
8
+ {{ child.type !== "bool" ? `${child.type} ` : child.boolType }}{{ child.label }}
9
+ </div>
10
+ <div class="flex ml-4">
11
+ <ActionButtons
12
+ v-if="!props.readonly"
13
+ :add="child.type === 'bool'"
14
+ edit
15
+ delete
16
+ @add="clickAdd(false, child)"
17
+ @edit="clickAdd(true, parent, child)"
18
+ @delete="parent.children.splice(parent.children.indexOf(child), 1)"
19
+ />
20
+ </div>
21
+ </li>
22
+ <li>
23
+ <Child
24
+ v-if="child.children && child.children.length"
25
+ :parent="child"
26
+ :level="level + 2"
27
+ :readonly="props.readonly"
28
+ @add="clickAdd"
29
+ />
30
+ </li>
31
+ </ul>
32
+ </template>
33
+ <script setup>
34
+ import { ActionButtons } from "@/components";
35
+ import { computed } from "vue";
36
+ const props = defineProps({
37
+ parent: Object,
38
+ level: Number,
39
+ readonly: {
40
+ type: [Boolean, Number],
41
+ default: false,
42
+ },
43
+ });
44
+ const emits = defineEmits(["add"]);
45
+ const sortedChildren = computed(() => {
46
+ if (!props.parent.children) {
47
+ return [];
48
+ }
49
+ return props.parent.children.sort((a, b) => {
50
+ if (a.type === "bool" && b.type !== "bool") {
51
+ return 1;
52
+ }
53
+ if (a.type !== "bool" && b.type === "bool") {
54
+ return -1;
55
+ }
56
+ return 0;
57
+ });
58
+ });
59
+
60
+ function clickAdd(isEdit, parent, item = {}) {
61
+ emits("add", isEdit, parent, item);
62
+ }
63
+ </script>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <ul class="w-full px-2">
3
+ <li
4
+ class="w-full hover:white-bg-hover dark:hover:dark-bg-hover p-2 flex items-center justify-between"
5
+ >
6
+ <div>{{ local.type }}</div>
7
+ <div class="flex">
8
+ <ActionButtons
9
+ v-if="!local.children?.length && !props.readonly"
10
+ add
11
+ @add="clickAdd(false, local)"
12
+ />
13
+ </div>
14
+ </li>
15
+ <Child :parent="local" :readonly="readonly" :level="2" @add="clickAdd" />
16
+ </ul>
17
+ </template>
18
+ <script setup>
19
+ import { ref } from "vue";
20
+ import { ActionButtons } from "@/components";
21
+ import Child from "./Child.vue";
22
+
23
+ // props and emits
24
+ const props = defineProps({
25
+ query: Object,
26
+ readonly: {
27
+ type: [Boolean, Number],
28
+ default: false,
29
+ },
30
+ });
31
+ const emits = defineEmits(["add", "delete"]);
32
+ // states
33
+ const local = ref(props.query);
34
+
35
+ function clickAdd(isEdit, parent, item = {}) {
36
+ emits("add", isEdit, parent, item);
37
+ }
38
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div class="relative flex items-center justify-center gap-x-2">
3
+ <div
4
+ :class="[
5
+ 'flex-none rounded-full p-1',
6
+ { 'status-positive': active === true },
7
+ { 'status-negative': !active },
8
+ { 'status-neutral': active === 'neutral' },
9
+ { 'status-warning': active === 'warning' },
10
+ ]"
11
+ @mouseover="showingTooltip = true"
12
+ @mouseout="showingTooltip = false"
13
+ >
14
+ <div class="icon-xs rounded-full bg-current" />
15
+ </div>
16
+ <Tooltip
17
+ v-if="tooltip"
18
+ :tooltip="tooltip"
19
+ :showingTooltip="showingTooltip"
20
+ :direction="tooltipPosition"
21
+ />
22
+ </div>
23
+ </template>
24
+ <script setup>
25
+ import { ref } from "vue";
26
+ import { Tooltip } from "@/components";
27
+
28
+ const props = defineProps({
29
+ active: {
30
+ type: [Boolean, String],
31
+ default: true,
32
+ },
33
+ tooltip: {
34
+ type: String,
35
+ default: "",
36
+ },
37
+ tooltipPosition: {
38
+ type: String,
39
+ default: "top",
40
+ },
41
+ });
42
+ const active = props.active;
43
+ const showingTooltip = ref(false);
44
+ </script>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'text-left justify-start inline-flex items-center rounded-sm mx-2 px-2 py-0.5 text-xs font-medium bg-slate-200 dark:bg-slate-700',
5
+ { 'score-none': scoreLevel === 'none' },
6
+ { 'score-low': scoreLevel === 'low' },
7
+ { 'score-medium': scoreLevel === 'medium' },
8
+ { 'score-serious': scoreLevel === 'serious' },
9
+ { 'score-high': scoreLevel === 'high' },
10
+ { 'score-critical': scoreLevel === 'critical' },
11
+ { 'score-warn': scoreLevel === 'warn' },
12
+ ]"
13
+ >
14
+ <ExclamationTriangleIcon class="icon mr-1" />
15
+ {{ scoreLevel }}
16
+ </div>
17
+ </template>
18
+ <script setup>
19
+ import { computed } from "vue";
20
+ import { ExclamationTriangleIcon } from "@heroicons/vue/20/solid";
21
+ const props = defineProps({
22
+ score: String | Number,
23
+ });
24
+
25
+ const scoreLevel = computed(() => {
26
+ if (typeof props.score === "string") {
27
+ return props.score;
28
+ }
29
+ if (props.score === 0) {
30
+ return "none";
31
+ } else if (props.score < 1000) {
32
+ return "low";
33
+ } else if (props.score < 2000) {
34
+ return "medium";
35
+ } else if (props.score < 4000) {
36
+ return "serious";
37
+ } else if (props.score < 8000) {
38
+ return "high";
39
+ } else {
40
+ return "critical";
41
+ }
42
+ });
43
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="relative flex items-center justify-center gap-x-2">
3
+ <div
4
+ :class="[
5
+ 'flex-none rounded-full p-1',
6
+ { 'status-positive': props.active },
7
+ { 'status-negative': props.inactive },
8
+ { 'status-warning': props.warning },
9
+ ]"
10
+ @mouseover="showingTooltip = true"
11
+ @mouseout="showingTooltip = false"
12
+ >
13
+ <div class="icon-xs rounded-full bg-current" />
14
+ </div>
15
+ <Tooltip
16
+ v-if="tooltip"
17
+ :tooltip="tooltip"
18
+ :showingTooltip="showingTooltip"
19
+ :direction="tooltipPosition"
20
+ />
21
+ </div>
22
+ </template>
23
+ <script setup>
24
+ import { ref } from "vue";
25
+ import { Tooltip } from "@/components";
26
+
27
+ const props = defineProps({
28
+ active: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ inactive: {
33
+ type: Boolean,
34
+ default: false,
35
+ },
36
+ warning: {
37
+ type: Boolean,
38
+ default: false,
39
+ },
40
+ tooltip: {
41
+ type: String,
42
+ default: "",
43
+ },
44
+ tooltipPosition: {
45
+ type: String,
46
+ default: "top",
47
+ },
48
+ });
49
+ const active = props.active;
50
+ const showingTooltip = ref(false);
51
+ </script>
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'status-dot',
5
+ status === completeStatus
6
+ ? 'status-positive'
7
+ : status === 'error' || status === 'aborted' || status === 'Aborted'
8
+ ? 'status-negative'
9
+ : status === 'warning'
10
+ ? 'status-warning'
11
+ : 'status-neutral',
12
+ ]"
13
+ >
14
+ <div class="icon-xs rounded-full bg-current" />
15
+ </div>
16
+ </template>
17
+ <script setup>
18
+ const props = defineProps({
19
+ status: String,
20
+ completeStatus: {
21
+ type: String,
22
+ default: "completed",
23
+ },
24
+ });
25
+ </script>
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'status-dot text-xs',
5
+ status === completeStatus
6
+ ? 'status-positive'
7
+ : status === 'error' ||
8
+ status === 'Error' ||
9
+ status === 'aborted' ||
10
+ status === 'Aborted'
11
+ ? 'status-negative'
12
+ : 'status-neutral',
13
+ ]"
14
+ >
15
+ {{ status }}
16
+ </div>
17
+ </template>
18
+ <script setup>
19
+ const props = defineProps({
20
+ status: String,
21
+ completeStatus: {
22
+ type: String,
23
+ default: "completed",
24
+ },
25
+ });
26
+ </script>