fluency-v8-components 1.3.5 → 1.3.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.
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-ChEFiXF5.mjs} +12 -11
  4. package/dist/{index.es-PAPL4E6Y.mjs → index.es-CjjN70eV.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 +495 -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,45 @@
1
+ <template>
2
+ <nav class="flex" aria-label="Breadcrumb">
3
+ <ol role="list" class="flex items-center space-x-4">
4
+ <li>
5
+ <div>
6
+ <span
7
+ class="hover:text-gray-400 cursor-pointer"
8
+ @click="emits('home')"
9
+ >
10
+ <HomeIcon class="icon-md flex-shrink-0" aria-hidden="true" />
11
+ </span>
12
+ </div>
13
+ </li>
14
+ <li v-for="(page, i) in pages" :key="page.name">
15
+ <div class="flex items-center">
16
+ <svg
17
+ class="icon-md flex-shrink-0 dark:text-gray-300"
18
+ fill="currentColor"
19
+ viewBox="0 0 20 20"
20
+ aria-hidden="true"
21
+ >
22
+ <path d="M5.555 17.776l8-16 .894.448-8 16-.894-.448z" />
23
+ </svg>
24
+ <span
25
+ :href="page.path"
26
+ class="ml-4 text-sm font-medium hover:text-gray-400 cursor-pointer"
27
+ @click="emits('navigate', page, i)"
28
+ >
29
+ {{ page.name }}
30
+ </span>
31
+ </div>
32
+ </li>
33
+ </ol>
34
+ </nav>
35
+ </template>
36
+
37
+ <script setup>
38
+ import { HomeIcon } from "@heroicons/vue/20/solid";
39
+
40
+ const props = defineProps({
41
+ pages: Array,
42
+ homeURL: String,
43
+ });
44
+ const emits = defineEmits(["navigate", "home"]);
45
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <span class="isolate inline-flex rounded-md shadow-xs rounded-md">
3
+ <button
4
+ v-for="(option, i) in options"
5
+ type="button"
6
+ :class="[
7
+ 'button-toggle bg-gray-200 text-black',
8
+ { 'text-gray-500 opacity-75': option.value !== inputValue },
9
+ { 'rounded-l-lg': i === 0 },
10
+ { 'rounded-r-lg': i === options.length - 1 },
11
+ ]"
12
+ @click="emits('toggle', option.value)"
13
+ >
14
+ {{ option.label }}
15
+ </button>
16
+ </span>
17
+ </template>
18
+ <script setup>
19
+ const props = defineProps({
20
+ options: Array,
21
+ inputValue: String,
22
+ });
23
+ const emits = defineEmits(["toggle"]);
24
+ </script>
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <li
3
+ :class="[
4
+ 'overflow-hidden rounded-xl border border-gray-300 dark:border-neutral-600',
5
+ {
6
+ 'bg-green-300 dark:bg-green-900 ': color === 'green',
7
+ },
8
+ {
9
+ 'bg-red-400 dark:bg-red-800 ': color === 'red',
10
+ },
11
+ {
12
+ 'bg-sky-200 dark:bg-sky-800': color === 'blue',
13
+ },
14
+ {
15
+ 'bg-white dark:dark-bg': color === 'default',
16
+ },
17
+ {
18
+ 'cursor-pointer': clickable,
19
+ },
20
+ {
21
+ 'hover:bg-green-500 dark:hover:bg-green-700':
22
+ clickable && color === 'green',
23
+ },
24
+ {
25
+ 'hover:bg-red-600 dark:hover:bg-red-700': clickable && color === 'red',
26
+ },
27
+ {
28
+ 'hover:bg-sky-300 dark:hover:bg-sky-700': clickable && color === 'blue',
29
+ },
30
+ {
31
+ 'hover:white-bg-hover hover:dark:dark-bg-hover':
32
+ clickable && color === 'default',
33
+ },
34
+ ]"
35
+ @click="emits('boxClick')"
36
+ >
37
+ <div
38
+ v-if="title || description"
39
+ class="flex items-center gap-x-4 border-b border-gray-200 dark:border-neutral-600 px-6 py-5"
40
+ >
41
+ <div class="font-medium leading-6 max-w-full">
42
+ <div class="row gap-x-3 items-center truncate">
43
+ <slot name="title" />
44
+ {{ title }}
45
+ </div>
46
+ <div class="text-sm leading-6 font-extralight">
47
+ {{ description }}
48
+ </div>
49
+ </div>
50
+ <Menu
51
+ v-if="menuItems && menuItems.length > 0"
52
+ as="div"
53
+ class="relative ml-auto"
54
+ >
55
+ <MenuButton
56
+ class="-m-2.5 block p-2.5 text-gray-400 hover:text-gray-500"
57
+ @click="($event) => $event.stopPropagation()"
58
+ >
59
+ <span class="sr-only">Open options</span>
60
+ <EllipsisHorizontalIcon class="icon-md" aria-hidden="true" />
61
+ </MenuButton>
62
+ <transition
63
+ enter-active-class="transition ease-out duration-100"
64
+ enter-from-class="transform opacity-0 scale-95"
65
+ enter-to-class="transform opacity-100 scale-100"
66
+ leave-active-class="transition ease-in duration-75"
67
+ leave-from-class="transform opacity-100 scale-100"
68
+ leave-to-class="transform opacity-0 scale-95"
69
+ >
70
+ <MenuItems
71
+ class="absolute right-0 z-10 mt-0.5 w-32 origin-top-right rounded-md py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-hidden bg-white dark:bg-black"
72
+ >
73
+ <MenuItem v-for="menuItem in menuItems" v-slot="{ active }">
74
+ <div
75
+ :class="[
76
+ active ? 'cursor-pointer bg-gray-50 dark:bg-gray-800' : '',
77
+ 'block px-3 py-1 text-sm leading-6',
78
+ ]"
79
+ @click.stop="emits('menuClick', menuItem)"
80
+ >
81
+ {{ menuItem }}
82
+ </div>
83
+ </MenuItem>
84
+ </MenuItems>
85
+ </transition>
86
+ </Menu>
87
+ </div>
88
+ <dl
89
+ class="-my-3 divide-y divide-gray-200 dark:divide-neutral-600 px-6 py-4 text-sm leading-6"
90
+ >
91
+ <slot name="content" />
92
+ </dl>
93
+ </li>
94
+ </template>
95
+ <script setup>
96
+ import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
97
+ import { EllipsisHorizontalIcon } from "@heroicons/vue/20/solid";
98
+
99
+ const props = defineProps({
100
+ title: String,
101
+ description: {
102
+ type: String,
103
+ default: "",
104
+ },
105
+ menuItems: Array,
106
+ color: {
107
+ type: String,
108
+ default: "default",
109
+ },
110
+ clickable: {
111
+ type: Boolean,
112
+ default: false,
113
+ },
114
+ });
115
+ const emits = defineEmits(["boxClick", "menuClick"]);
116
+ </script>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div class="relative">
3
+ <slot name="content" />
4
+ <!-- slider buttons -->
5
+ <button
6
+ v-if="size > 1"
7
+ type="button"
8
+ class="absolute top-0 start-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-hidden"
9
+ @click="slideLeft"
10
+ >
11
+ <ChevronLeftIcon class="icon-lg" />
12
+ </button>
13
+ <button
14
+ v-if="size > 1"
15
+ type="button"
16
+ class="absolute top-0 end-0 z-30 flex items-center justify-center h-full cursor-pointer group focus:outline-hidden"
17
+ @click="slideRight"
18
+ >
19
+ <ChevronRightIcon class="icon-lg" />
20
+ </button>
21
+ <!-- sliders -->
22
+ <div
23
+ class="absolute z-30 flex -translate-x-1/2 space-x-3 bottom-2 left-1/2"
24
+ >
25
+ <button
26
+ v-for="(a, i) in sizeArray"
27
+ type="button"
28
+ :class="[
29
+ 'w-3 h-3 rounded-full',
30
+ current === i
31
+ ? 'bg-gray-400 dark:bg-gray-300'
32
+ : 'bg-gray-200 dark:bg-gray-600',
33
+ ]"
34
+ @click="emits('update', i)"
35
+ />
36
+ </div>
37
+ </div>
38
+ </template>
39
+ <script setup>
40
+ import { computed } from "vue";
41
+ import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/vue/20/solid";
42
+
43
+ // props and emits
44
+ const props = defineProps({
45
+ current: Number,
46
+ size: Number,
47
+ });
48
+ const emits = defineEmits(["update"]);
49
+ // computed
50
+ const sizeArray = computed(() => Array.from({ length: props.size }));
51
+ // function defs
52
+ function slideLeft() {
53
+ if (props.current === 0) {
54
+ emits("update", props.size - 1);
55
+ } else {
56
+ emits("update", props.current - 1);
57
+ }
58
+ }
59
+ function slideRight() {
60
+ if (props.current === props.size - 1) {
61
+ emits("update", 0);
62
+ } else {
63
+ emits("update", props.current + 1);
64
+ }
65
+ }
66
+ </script>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <GreyForm>
3
+ <div class="mb-3 flex items-center justify-between relative">
4
+ <slot name="icon" />
5
+ <div class="min-w-0 flex-1">
6
+ <h3 class="row truncate font-medium">
7
+ {{ category.name || category }}
8
+ <slot name="title" />
9
+ </h3>
10
+ </div>
11
+ <div class="flex mt-0 ml-4">
12
+ <slot name="header" />
13
+ </div>
14
+ </div>
15
+ <slot />
16
+ </GreyForm>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { GreyForm } from "@/components";
21
+
22
+ const props = defineProps({
23
+ category: {
24
+ type: [Object, String],
25
+ required: true,
26
+ },
27
+ });
28
+ </script>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <PrismEditor
3
+ class="editor-style"
4
+ v-bind="$attrs"
5
+ :style="`fontSize: ${props.fontSize}`"
6
+ :readonly="props.readonly"
7
+ :tab-size="props.tabSize"
8
+ :highlight="highlighter"
9
+ :line-numbers="props.lineNumbers"
10
+ />
11
+ </template>
12
+ <script setup>
13
+ import { PrismEditor } from "vue-prism-editor";
14
+ import { fpl2, fpl2Traces } from "@/constants/fpl2";
15
+ import "vue-prism-editor/dist/prismeditor.min.css"; // import the styles somewhere
16
+ import { highlight } from "prismjs/components/prism-core";
17
+ import "@/assets/prism-theme.css"; // import syntax highlighting styles
18
+
19
+ // props and emits
20
+ const props = defineProps({
21
+ fontSize: {
22
+ type: String,
23
+ default: "12px",
24
+ },
25
+ isFPL: {
26
+ type: Boolean,
27
+ default: true,
28
+ },
29
+ readonly: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ lineNumbers: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ tabSize: {
38
+ type: Number,
39
+ default: 4,
40
+ },
41
+ noHighlight: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ });
46
+
47
+ // function defs
48
+ function highlighter(code) {
49
+ if (code.length > 100000) {
50
+ return highlight(code, {});
51
+ }
52
+ if (props.noHighlight) {
53
+ return highlight(code, {});
54
+ } else if (props.isFPL) {
55
+ return highlight(code, fpl2);
56
+ }
57
+ return highlight(code, fpl2Traces); // languages.<insert language> to return html with markup
58
+ }
59
+ </script>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div class="flex justify-center">
3
+ <vue-tailwind-datepicker
4
+ v-model="dateValue"
5
+ no-input
6
+ :disable-date="(date) => date > new Date()"
7
+ as-single
8
+ use-range
9
+ :shortcuts="false"
10
+ @update:model-value="emits('setTime', dateValue)"
11
+ />
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+ import { ref } from "vue";
17
+ import VueTailwindDatepicker from "vue-tailwind-datepicker";
18
+
19
+ const emits = defineEmits(["setTime"]);
20
+ const dateValue = ref([]);
21
+ </script>
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <div class="col">
3
+ <vue-tailwind-datepicker :shortcuts="customShortcuts" v-model="dateValue" />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { ref, watch, onMounted } from "vue";
9
+ import VueTailwindDatepicker from "vue-tailwind-datepicker";
10
+ import moment from "moment";
11
+
12
+ const props = defineProps({
13
+ from: Number,
14
+ to: Number,
15
+ });
16
+ const emits = defineEmits(["selectTime"]);
17
+ const dateValue = ref([]);
18
+
19
+ watch(dateValue, (val) => {
20
+ emits("selectTime", [moment(val[0]).valueOf(), moment(val[1]).valueOf()]);
21
+ });
22
+ watch(
23
+ () => props.from,
24
+ (val) => {
25
+ if (val) {
26
+ dateValue.value[0] = formatTime(val);
27
+ } else {
28
+ resetDate();
29
+ }
30
+ }
31
+ );
32
+ watch(
33
+ () => props.to,
34
+ (val) => {
35
+ if (val) {
36
+ dateValue.value[1] = formatTime(val);
37
+ }
38
+ }
39
+ );
40
+
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
+ function customShortcuts() {
52
+ const date = moment().valueOf();
53
+ return [
54
+ {
55
+ label: "Last Hour",
56
+ atClick: () => {
57
+ return [moment().subtract(1, "hours").valueOf(), date];
58
+ },
59
+ },
60
+ {
61
+ label: "Last Three Hours",
62
+ atClick: () => {
63
+ return [moment().subtract(3, "hours").valueOf(), date];
64
+ },
65
+ },
66
+ {
67
+ label: "Last Six Hours",
68
+ atClick: () => {
69
+ return [moment().subtract(6, "hours").valueOf(), date];
70
+ },
71
+ },
72
+ {
73
+ label: "Last Twelve Hours",
74
+ atClick: () => {
75
+ return [moment().subtract(12, "hours").valueOf(), date];
76
+ },
77
+ },
78
+ {
79
+ label: "Last Day",
80
+ atClick: () => {
81
+ return [moment().subtract(1, "days").valueOf(), date];
82
+ },
83
+ },
84
+ {
85
+ label: "Last Three Days",
86
+ atClick: () => {
87
+ return [moment().subtract(3, "days").valueOf(), date];
88
+ },
89
+ },
90
+ {
91
+ label: "Last Week",
92
+ atClick: () => {
93
+ return [moment().subtract(7, "days").valueOf(), date];
94
+ },
95
+ },
96
+ ];
97
+ }
98
+
99
+ function resetDate() {
100
+ dateValue.value = [
101
+ formatTime(moment().subtract(1, "hours")),
102
+ formatTime(moment()),
103
+ ];
104
+ }
105
+
106
+ function formatTime(time) {
107
+ return moment(time).format("YYYY-MM-DD HH:mm:ss");
108
+ }
109
+ </script>
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <TransitionRoot appear :show="open" as="template">
3
+ <Dialog as="div" @close="emits('close')" class="relative z-40">
4
+ <TransitionChild
5
+ as="template"
6
+ enter="duration-300 ease-out"
7
+ enter-from="opacity-0"
8
+ enter-to="opacity-100"
9
+ leave="duration-200 ease-in"
10
+ leave-from="opacity-100"
11
+ leave-to="opacity-0"
12
+ >
13
+ <div
14
+ class="fixed inset-0 bg-gray-500/75 transition-opacity"
15
+ />
16
+ </TransitionChild>
17
+
18
+ <div class="fixed inset-0 overflow-y-auto">
19
+ <div
20
+ class="flex min-h-full items-center justify-center p-4 text-center"
21
+ >
22
+ <TransitionChild
23
+ as="template"
24
+ enter="duration-300 ease-out"
25
+ enter-from="opacity-0 scale-95"
26
+ enter-to="opacity-100 scale-100"
27
+ leave="duration-200 ease-in"
28
+ leave-from="opacity-100 scale-100"
29
+ leave-to="opacity-0 scale-95"
30
+ >
31
+ <DialogPanel
32
+ :class="[
33
+ 'white-bg dark:dark-bg transform rounded-2xl p-6 text-left align-middle shadow-xl transition-all',
34
+ { 'w-full max-w-md': size === 'small' },
35
+ {
36
+ 'min-w-150 px-4 pb-4 pt-5 sm:my-8 w-full sm:max-w-lg sm:p-6':
37
+ size === 'medium',
38
+ },
39
+ {
40
+ 'px-4 pb-4 pt-5 sm:my-8 w-full sm:max-w-4xl sm:p-6':
41
+ size === 'large',
42
+ },
43
+ {
44
+ 'px-4 pb-4 pt-5 sm:my-8 w-full sm:max-w-7xl sm:p-6':
45
+ size === 'xlarge',
46
+ },
47
+ ]"
48
+ >
49
+ <DialogTitle
50
+ as="h3"
51
+ class="relative text-lg font-medium leading-6"
52
+ >
53
+ {{ title }}
54
+ <div v-if="loading" class="mx-2 inline-block spinner"></div>
55
+ <div class="absolute right-2 top-0">
56
+ <slot name="header" />
57
+ </div>
58
+ </DialogTitle>
59
+ <p class="text-xs">{{ description }}</p>
60
+ <div class="pt-4">
61
+ <slot name="content" />
62
+ </div>
63
+ <div class="mt-4 space-x-3">
64
+ <slot name="footer" />
65
+ </div>
66
+ </DialogPanel>
67
+ </TransitionChild>
68
+ </div>
69
+ </div>
70
+ </Dialog>
71
+ </TransitionRoot>
72
+ </template>
73
+
74
+ <script lang="ts" setup>
75
+ import { computed } from "vue";
76
+ import {
77
+ TransitionRoot,
78
+ TransitionChild,
79
+ Dialog,
80
+ DialogPanel,
81
+ DialogTitle,
82
+ } from "@headlessui/vue";
83
+
84
+ const props = defineProps({
85
+ open: Boolean,
86
+ title: String,
87
+ description: {
88
+ type: String,
89
+ default: "",
90
+ },
91
+ size: {
92
+ type: String,
93
+ default: "small",
94
+ },
95
+ loading: {
96
+ type: Boolean,
97
+ default: false,
98
+ },
99
+ });
100
+ const emits = defineEmits(["close"]);
101
+ const open = computed(() => props.open);
102
+ const title = computed(() => props.title);
103
+ </script>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div
3
+ class="bg-neutral-600 text-white pl-3 py-1 sm:flex sm:items-center sm:justify-between content-center"
4
+ >
5
+ <slot name="title" />
6
+ <div class="mt-3 flex sm:mt-0">
7
+ <slot name="buttons" />
8
+ </div>
9
+ </div>
10
+ </template>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <ul
3
+ role="list"
4
+ class="divide-y divide-gray-300 h-full list-style overflow-auto p-2"
5
+ >
6
+ <li
7
+ v-for="event in events"
8
+ class="relative flex justify-between hover:bg-gray-500 cursor-pointer"
9
+ @click="emits('copy', event)"
10
+ >
11
+ <p class="font-light leading-5 truncate">
12
+ {{ event.substring(0, 100) }}
13
+ </p>
14
+ <div class="flex items-center">
15
+ <ClipboardIcon
16
+ class="icon-md flex-none text-gray-400"
17
+ aria-hidden="true"
18
+ />
19
+ </div>
20
+ </li>
21
+ <li v-if="events.length === 0" class="px-2">
22
+ <p class="font-light leading-5">No events found</p>
23
+ </li>
24
+ </ul>
25
+ </template>
26
+
27
+ <script setup>
28
+ import { ClipboardIcon } from "@heroicons/vue/20/solid";
29
+ const props = defineProps({
30
+ events: Array,
31
+ });
32
+ const emits = defineEmits(["copy"]);
33
+ </script>
34
+
35
+ <style scoped>
36
+ .list-style {
37
+ background: #303030;
38
+ color: #ffffff;
39
+ font-size: 14px;
40
+ }
41
+ </style>