fluency-v8-components 1.3.4 → 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 (179) hide show
  1. package/dist/fluency-v8-components.es.js +1 -1
  2. package/dist/fluency-v8-components.umd.js +31 -31
  3. package/dist/{index-Dxs_Gn5T.mjs → index-BBxccHNP.mjs} +53 -47
  4. package/dist/index.css +1 -1
  5. package/dist/{index.es-YeMpD96e.mjs → index.es-D_XhLSeH.mjs} +1 -1
  6. package/package.json +3 -2
  7. package/src/assets/images/ai.svg +1 -0
  8. package/src/assets/images/github-dark.svg +1 -0
  9. package/src/assets/images/github.svg +1 -0
  10. package/src/assets/images/high-priority.svg +1 -0
  11. package/src/assets/images/power-off.svg +1 -0
  12. package/src/assets/images/save.svg +1 -0
  13. package/src/assets/index.ts +15 -0
  14. package/src/assets/main.css +505 -0
  15. package/src/assets/prism-theme.css +290 -0
  16. package/src/components/buttons/ActionButtons.vue +374 -0
  17. package/src/components/buttons/DropdownButton.vue +104 -0
  18. package/src/components/buttons/IconButton.vue +63 -0
  19. package/src/components/buttons/ImageButton.vue +16 -0
  20. package/src/components/buttons/MenuButton.vue +138 -0
  21. package/src/components/buttons/SubmitButtons.vue +51 -0
  22. package/src/components/buttons/TextButton.vue +40 -0
  23. package/src/components/charts/AlertChart.vue +376 -0
  24. package/src/components/charts/BarChart.vue +212 -0
  25. package/src/components/charts/BarChartHorizontal.vue +243 -0
  26. package/src/components/charts/CronChart.vue +146 -0
  27. package/src/components/charts/EmptyChart.vue +76 -0
  28. package/src/components/charts/GradientChart.vue +310 -0
  29. package/src/components/charts/LineChart.test.js +59 -0
  30. package/src/components/charts/LineChart.vue +434 -0
  31. package/src/components/charts/PieChart.vue +293 -0
  32. package/src/components/charts/ProgressChart.vue +106 -0
  33. package/src/components/charts/StackedChart.vue +364 -0
  34. package/src/components/charts/StackedChartClustered.vue +395 -0
  35. package/src/components/charts/TimelineChart.vue +215 -0
  36. package/src/components/charts/WorkflowChart.vue +520 -0
  37. package/src/components/common/AutoCompleteSearchBar.vue +100 -0
  38. package/src/components/common/AutoRefreshButton.vue +53 -0
  39. package/src/components/common/Breadcrumb.vue +45 -0
  40. package/src/components/common/ButtonToggle.vue +24 -0
  41. package/src/components/common/Card.vue +116 -0
  42. package/src/components/common/Carousel.vue +66 -0
  43. package/src/components/common/CategoryCard.vue +28 -0
  44. package/src/components/common/CodeEditor.vue +59 -0
  45. package/src/components/common/DatePicker.vue +21 -0
  46. package/src/components/common/DatePickerInput.vue +109 -0
  47. package/src/components/common/Dialog.vue +103 -0
  48. package/src/components/common/EditorHeading.vue +10 -0
  49. package/src/components/common/EventList.vue +41 -0
  50. package/src/components/common/Facet.vue +206 -0
  51. package/src/components/common/Feed.vue +58 -0
  52. package/src/components/common/Flag.vue +27 -0
  53. package/src/components/common/HomeCard.vue +20 -0
  54. package/src/components/common/ItemBox.vue +49 -0
  55. package/src/components/common/Loading.vue +19 -0
  56. package/src/components/common/LoadingDots.vue +12 -0
  57. package/src/components/common/PageHeading.vue +30 -0
  58. package/src/components/common/Pagination.vue +105 -0
  59. package/src/components/common/Popover.vue +24 -0
  60. package/src/components/common/PowerToggle.vue +130 -0
  61. package/src/components/common/ProgressBar.vue +33 -0
  62. package/src/components/common/RadioButtons.vue +52 -0
  63. package/src/components/common/Schedule.vue +79 -0
  64. package/src/components/common/SearchBar.vue +30 -0
  65. package/src/components/common/Separator.vue +3 -0
  66. package/src/components/common/Slideout.vue +95 -0
  67. package/src/components/common/Sort.vue +83 -0
  68. package/src/components/common/Table.vue +48 -0
  69. package/src/components/common/Tabs.vue +129 -0
  70. package/src/components/common/Tag.vue +53 -0
  71. package/src/components/common/Tooltip.vue +49 -0
  72. package/src/components/common/VerticalTabs.vue +34 -0
  73. package/src/components/common/card/CardItem.vue +27 -0
  74. package/src/components/common/card/CardItemGroup.vue +45 -0
  75. package/src/components/common/facet/Leaf.vue +97 -0
  76. package/src/components/common/facet/TriState.vue +37 -0
  77. package/src/components/common/table/TableData.vue +48 -0
  78. package/src/components/common/table/TableHeader.vue +21 -0
  79. package/src/components/dialogs/ChooseValueDialog.vue +97 -0
  80. package/src/components/dialogs/ConfirmDialog.vue +73 -0
  81. package/src/components/dialogs/CopyDialog.vue +51 -0
  82. package/src/components/dialogs/DownloadDialog.vue +48 -0
  83. package/src/components/dialogs/NameDescDialog.vue +74 -0
  84. package/src/components/dialogs/NameDialog.vue +56 -0
  85. package/src/components/dialogs/PopupEditor.vue +113 -0
  86. package/src/components/dialogs/ProgressDialog.vue +58 -0
  87. package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
  88. package/src/components/dialogs/Wizard.vue +99 -0
  89. package/src/components/dialogs/wizard/Stepper.vue +31 -0
  90. package/src/components/form/CheckBox.vue +26 -0
  91. package/src/components/form/Editor.vue +93 -0
  92. package/src/components/form/FormCol.vue +19 -0
  93. package/src/components/form/FormRow.vue +19 -0
  94. package/src/components/form/FormSection.vue +21 -0
  95. package/src/components/form/GreyForm.vue +7 -0
  96. package/src/components/form/GreyInput.vue +51 -0
  97. package/src/components/form/GreyInputAutocomplete.vue +100 -0
  98. package/src/components/form/GreyInputCopy.vue +66 -0
  99. package/src/components/form/GreyInputGrow.vue +42 -0
  100. package/src/components/form/GreyInputToken.vue +78 -0
  101. package/src/components/form/GreyPassword.vue +36 -0
  102. package/src/components/form/GreySelect.vue +154 -0
  103. package/src/components/form/GreySelectInput.vue +123 -0
  104. package/src/components/form/GreySelectInputMultiple.vue +218 -0
  105. package/src/components/form/GreyTel.vue +58 -0
  106. package/src/components/form/HamburgerItem.vue +95 -0
  107. package/src/components/form/KeyValueEntry.vue +74 -0
  108. package/src/components/form/RadioInput.vue +38 -0
  109. package/src/components/form/UploadFile.vue +99 -0
  110. package/src/components/icons/AiIcon.vue +6 -0
  111. package/src/components/icons/GithubIcon.vue +18 -0
  112. package/src/components/icons/HighPriorityIcon.vue +6 -0
  113. package/src/components/icons/PowerOffIcon.vue +6 -0
  114. package/src/components/icons/SaveIcon.vue +6 -0
  115. package/src/components/index.js +134 -0
  116. package/src/components/menu/DialogMenu.vue +142 -0
  117. package/src/components/menu/GrandChild.vue +39 -0
  118. package/src/components/menu/GridMenu.vue +88 -0
  119. package/src/components/menu/MenuAvatar.vue +66 -0
  120. package/src/components/menu/MenuDesktop.vue +90 -0
  121. package/src/components/notifications/Notify.vue +123 -0
  122. package/src/components/notifications/NotifyList.vue +130 -0
  123. package/src/components/page-structure/FacetPage.vue +77 -0
  124. package/src/components/query/Child.vue +63 -0
  125. package/src/components/query/LVDBQuery.vue +38 -0
  126. package/src/components/status/Active.vue +44 -0
  127. package/src/components/status/ScoreLevel.vue +43 -0
  128. package/src/components/status/Status.vue +51 -0
  129. package/src/components/status/TaskDot.vue +25 -0
  130. package/src/components/status/TaskStatus.vue +26 -0
  131. package/src/components/status/TicketStatus.vue +201 -0
  132. package/src/components/status/Trend.vue +20 -0
  133. package/src/components/tables/ArgumentRunTable.vue +96 -0
  134. package/src/components/tables/ArgumentTable.vue +67 -0
  135. package/src/components/tables/CloudFormationParameters.vue +25 -0
  136. package/src/constants/colors.js +248 -0
  137. package/src/constants/font-map.js +128 -0
  138. package/src/constants/fpl2.js +162 -0
  139. package/src/constants/icon-svg.js +405 -0
  140. package/src/constants/schedule.js +52 -0
  141. package/src/fpl/AddPanel.vue +237 -0
  142. package/src/fpl/Configs/Alert.vue +16 -0
  143. package/src/fpl/Configs/AlertSprite.vue +2 -0
  144. package/src/fpl/Configs/Chart.vue +63 -0
  145. package/src/fpl/Configs/Config.js +154 -0
  146. package/src/fpl/Configs/Counter.vue +35 -0
  147. package/src/fpl/Configs/Histogram.vue +70 -0
  148. package/src/fpl/Configs/IPMap.vue +37 -0
  149. package/src/fpl/Configs/Image.vue +163 -0
  150. package/src/fpl/Configs/MetricChart.vue +20 -0
  151. package/src/fpl/Configs/PieChart.vue +37 -0
  152. package/src/fpl/Configs/SparkChart.vue +41 -0
  153. package/src/fpl/Configs/StackedBarChart.vue +49 -0
  154. package/src/fpl/Configs/Table.vue +211 -0
  155. package/src/fpl/Configs/Text.vue +14 -0
  156. package/src/fpl/Configs/TopNChart.vue +37 -0
  157. package/src/fpl/Outputs/FPLAlert.vue +64 -0
  158. package/src/fpl/Outputs/FPLStream.vue +41 -0
  159. package/src/fpl/Outputs/FPLTable.vue +77 -0
  160. package/src/fpl/Panel.vue +202 -0
  161. package/src/fpl/Panels/Alert.vue +85 -0
  162. package/src/fpl/Panels/AlertSprite.vue +9 -0
  163. package/src/fpl/Panels/Chart.vue +98 -0
  164. package/src/fpl/Panels/Counter.vue +43 -0
  165. package/src/fpl/Panels/Histogram.vue +138 -0
  166. package/src/fpl/Panels/IPMap.vue +48 -0
  167. package/src/fpl/Panels/Image.vue +35 -0
  168. package/src/fpl/Panels/MetricChart.vue +97 -0
  169. package/src/fpl/Panels/PieChart.vue +54 -0
  170. package/src/fpl/Panels/SparkChart.vue +166 -0
  171. package/src/fpl/Panels/StackedBarChart.vue +74 -0
  172. package/src/fpl/Panels/Table.vue +103 -0
  173. package/src/fpl/Panels/Text.vue +24 -0
  174. package/src/fpl/Panels/TopNChart.vue +69 -0
  175. package/src/fpl/index.js +39 -0
  176. package/src/utils/download.js +220 -0
  177. package/src/utils/formatOutput.js +156 -0
  178. package/src/utils/random.js +32 -0
  179. package/src/utils/timeUtils.js +138 -0
@@ -0,0 +1,364 @@
1
+ <template>
2
+ <div :id="id">
3
+ <div :id="id + 'tooltip'" role="tooltip" class="tooltip"></div>
4
+ </div>
5
+ <div class="overflow-auto" :style="`width: ${width}px; overflow: auto`">
6
+ <div :id="id + 'legend'"></div>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import * as d3 from "d3";
11
+ import { costLabels, chartColors } from "@/constants/colors";
12
+ import { humanCount, dataCount, costCount } from "@/utils/formatOutput";
13
+ import { adjustText } from "@/constants/font-map";
14
+
15
+ export default {
16
+ props: {
17
+ id: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ data: {
22
+ type: Object,
23
+ required: true,
24
+ },
25
+ unit: {
26
+ type: String,
27
+ default: "Cost ($)",
28
+ },
29
+ width: {
30
+ type: Number,
31
+ default: 575,
32
+ },
33
+ height: {
34
+ type: Number,
35
+ default: 350,
36
+ },
37
+ title: {
38
+ type: String,
39
+ default: "",
40
+ },
41
+ names: {
42
+ type: Object,
43
+ default: () => {},
44
+ },
45
+ isTime: {
46
+ type: Boolean,
47
+ default: true,
48
+ },
49
+ tooltipOffset: {
50
+ type: String,
51
+ default: "layer",
52
+ },
53
+ slotName: {
54
+ type: String,
55
+ default: "Field",
56
+ },
57
+ valueName: {
58
+ type: String,
59
+ default: "Value",
60
+ },
61
+ theme: {
62
+ type: String,
63
+ default: "light",
64
+ },
65
+ },
66
+ data() {
67
+ return {
68
+ svg: null,
69
+ legend: null,
70
+ };
71
+ },
72
+ mounted() {
73
+ this.initializeChart();
74
+ this.createChart(this.data);
75
+ },
76
+ methods: {
77
+ initializeChart() {
78
+ this.svg = d3
79
+ .select("#" + this.id)
80
+ .append("svg")
81
+ .attr("width", this.width)
82
+ .attr("height", this.title ? this.height + 30 : this.height);
83
+ },
84
+ createChart(data) {
85
+ // Declare the chart dimensions and margins.
86
+ const width = this.width;
87
+ const height = this.title ? this.height + 30 : this.height;
88
+ const marginTop = 20;
89
+ const marginRight = 15;
90
+ const marginBottom = 30;
91
+ const marginLeft = 50;
92
+
93
+ const hidden = [];
94
+ const namesIndex = Object.keys(this.names);
95
+
96
+ // Declare the tooltip mouseover functions
97
+ const mouseover = (event, d) => {
98
+ const slot = this.isTime
99
+ ? new Date(d.data[0]).toUTCString()
100
+ : d.data[0];
101
+ const val = d[1] - d[0];
102
+ const title = this.names[d.key] || d.key;
103
+ const value =
104
+ this.unit === "Bytes (B)"
105
+ ? dataCount(val) + "B"
106
+ : this.unit === "Percent (%)"
107
+ ? val.toFixed(2) + "%"
108
+ : this.unit === "Cost ($)"
109
+ ? "$" + val.toFixed(2)
110
+ : humanCount(val);
111
+ event.target.style.opacity = 0.7;
112
+ d3.select("#" + this.id + "tooltip")
113
+ .html(
114
+ `${title}<br>${this.isTime ? "Time" : this.slotName}: ${slot}<br>${
115
+ this.valueName
116
+ }: ${value}`
117
+ )
118
+ .style("opacity", 1)
119
+ .style("left", event[this.tooltipOffset + "X"] + 10 + "px")
120
+ .style("top", event[this.tooltipOffset + "Y"] + "px");
121
+ };
122
+ const mouseout = (event, d) => {
123
+ event.target.style.opacity = 1;
124
+ d3.select("#" + this.id + "tooltip")
125
+ .style("opacity", 0)
126
+ .style("left", "0px")
127
+ .style("top", "0px");
128
+ };
129
+
130
+ // Declare the legend mouseover functions
131
+ const legendMouseover = (event, d) => {
132
+ const action = namesIndex.indexOf(d.key);
133
+ d3.selectAll("." + this.id + "bar").style("opacity", 0.7);
134
+ d3.selectAll("." + this.id + action + "bar").style("opacity", 1);
135
+ d3.selectAll("#" + this.id + action + "dots").attr("r", 6);
136
+ d3.selectAll("." + this.id + action + "labels").attr(
137
+ "font-weight",
138
+ 1000
139
+ );
140
+ };
141
+ const legendMouseout = (event, d) => {
142
+ const action = namesIndex.indexOf(d.key);
143
+ d3.selectAll("." + this.id + "bar").style("opacity", 1);
144
+ d3.selectAll("#" + this.id + action + "dots").attr("r", 5);
145
+ d3.selectAll("." + this.id + action + "labels").attr(
146
+ "font-weight",
147
+ 500
148
+ );
149
+ };
150
+ const legendClick = (event, d) => {
151
+ const action = namesIndex.indexOf(d.key);
152
+ // redraw the axis and the series
153
+ d3.select("." + this.id + "xaxis").remove();
154
+ d3.select("." + this.id + "yaxis").remove();
155
+ d3.selectAll("#" + this.id + " rect").remove();
156
+ if (event.target.classList.contains("show")) {
157
+ hidden.push(d.key);
158
+ event.target.classList.remove("show");
159
+ event.target.classList.add("hide");
160
+ d3.selectAll("#" + this.id + action + "dots").attr("opacity", "0.5");
161
+ } else {
162
+ hidden.splice(hidden.indexOf(d.key), 1);
163
+ event.target.classList.remove("hide");
164
+ event.target.classList.add("show");
165
+ d3.selectAll("#" + this.id + action + "dots").attr("opacity", "1");
166
+ }
167
+ drawChart();
168
+ };
169
+
170
+ const drawChart = () => {
171
+ const seriesVals = data.series.filter((d) => !hidden.includes(d.name));
172
+ const series = d3
173
+ .stack()
174
+ .keys(d3.union(seriesVals.map((d) => d.name)))
175
+ .value((d, key) => {
176
+ if (d[1].get(key) === undefined) {
177
+ return 0;
178
+ }
179
+ return d[1].get(key).value;
180
+ })(
181
+ d3.index(
182
+ seriesVals,
183
+ (d) => d.slot,
184
+ (d) => d.name
185
+ )
186
+ );
187
+
188
+ // Declare the x (horizontal position) scale.
189
+ const x = this.isTime
190
+ ? d3.scaleUtc(d3.extent(data.slots), [
191
+ marginLeft,
192
+ width - marginRight,
193
+ ])
194
+ : d3.scaleBand(data.slots, [marginLeft, width - marginRight]);
195
+
196
+ // Declare the y (vertical position) scale.
197
+ const yScale = this.title
198
+ ? [height - marginBottom, marginTop + 30]
199
+ : [height - marginBottom, marginTop];
200
+ const y = d3.scaleLinear(
201
+ [0, d3.max(series, (d) => d3.max(d, (d) => d[1]))],
202
+ yScale
203
+ );
204
+
205
+ // Add the x-axis.
206
+ this.svg
207
+ .append("g")
208
+ .attr("transform", `translate(0,${height - marginBottom})`)
209
+ .attr("class", this.id + "xaxis")
210
+ .call(
211
+ this.isTime
212
+ ? d3
213
+ .axisBottom(x)
214
+ .ticks(width / 80)
215
+ .tickSizeOuter(0)
216
+ : d3
217
+ .axisBottom(x)
218
+ .ticks(width / 20)
219
+ .tickSizeOuter(0)
220
+ .tickFormat((d) => {
221
+ if (!this.isTime) {
222
+ return adjustText(
223
+ d,
224
+ ((width - marginRight) / data.slots.length) * 8
225
+ );
226
+ }
227
+ })
228
+ );
229
+
230
+ // Add the y-axis, remove the domain line, add grid lines and a label.
231
+ this.svg
232
+ .append("g")
233
+ .attr("transform", `translate(${marginLeft},0)`)
234
+ .attr("class", this.id + "yaxis")
235
+ .call(
236
+ d3
237
+ .axisLeft(y)
238
+ .ticks(height / 40)
239
+ .tickFormat((d) => {
240
+ return this.unit === "Bytes (B)"
241
+ ? dataCount(d)
242
+ : this.unit === "Cost ($)"
243
+ ? costCount(d)
244
+ : humanCount(d);
245
+ })
246
+ )
247
+ .call((g) => g.select(".domain").remove())
248
+ .call((g) =>
249
+ g
250
+ .selectAll(".tick line")
251
+ .clone()
252
+ .attr("x2", width - marginLeft - marginRight)
253
+ .attr("stroke-opacity", 0.1)
254
+ )
255
+ .call((g) =>
256
+ g
257
+ .append("text")
258
+ .attr("x", -marginLeft)
259
+ .attr("y", this.title ? 40 : 10)
260
+ .attr("fill", "currentColor")
261
+ .attr("text-anchor", "start")
262
+ .text(this.unit)
263
+ );
264
+
265
+ this.svg
266
+ .append("g")
267
+ .selectAll()
268
+ .data(series)
269
+ .join("g")
270
+ .attr(
271
+ "fill",
272
+ (d) =>
273
+ costLabels[this.theme][d.key] ||
274
+ chartColors[namesIndex.indexOf(d.key) % chartColors.length]
275
+ )
276
+ .selectAll("rect")
277
+ .data((D) => D.map((d) => ((d.key = D.key), d)))
278
+ .join("rect")
279
+ .attr("class", (d) => {
280
+ const i = namesIndex.indexOf(d.key);
281
+ return `${this.id}${i}bar ${this.id}bar`;
282
+ })
283
+ .attr("x", (d) => x(d.data[0]))
284
+ .attr("y", (d) => y(d[1]))
285
+ .attr("height", (d) => y(d[0]) - y(d[1]))
286
+ .attr("width", this.isTime ? 15 : Math.max(x.step() - 5, 15))
287
+ .on("mouseover", mouseover)
288
+ .on("mouseout", mouseout);
289
+ return series;
290
+ };
291
+
292
+ const series = drawChart(data);
293
+ this.svg
294
+ .append("g")
295
+ .call((g) =>
296
+ g
297
+ .append("text")
298
+ .attr("x", 0)
299
+ .attr("y", 20)
300
+ .attr("fill", "currentColor")
301
+ .attr("text-anchor", "start")
302
+ .attr("font-weight", "bold")
303
+ .attr("font-size", "20px")
304
+ .text(this.title)
305
+ );
306
+ if (data.series.length === 0) {
307
+ this.svg
308
+ .append("text")
309
+ .attr("x", width / 2)
310
+ .attr("y", height / 2)
311
+ .attr("text-anchor", "middle")
312
+ .text("No data available")
313
+ .attr("fill", "currentColor");
314
+ }
315
+ // Add a legend
316
+ this.legend = d3
317
+ .select("#" + this.id + "legend")
318
+ .append("svg")
319
+ .attr("width", Math.max(this.width, series.length * 125))
320
+ .attr("height", 20);
321
+
322
+ // Add one dot in the legend for each name.
323
+ this.legend
324
+ .selectAll("legendDots")
325
+ .data(series)
326
+ .enter()
327
+ .append("circle")
328
+ .attr("id", (d) => this.id + namesIndex.indexOf(d.key) + "dots")
329
+ .attr("class", "show")
330
+ .attr("cx", (d, i) => width / (series.length + 1) + i * 120 - 10)
331
+ .attr("cy", 15)
332
+ .attr("r", 5)
333
+ .attr(
334
+ "fill",
335
+ (d, i) =>
336
+ costLabels[this.theme][d.key] || chartColors[i % chartColors.length]
337
+ )
338
+ .on("mouseover", legendMouseover)
339
+ .on("mouseout", legendMouseout)
340
+ .on("click", legendClick);
341
+
342
+ // Add one dot in the legend for each name.
343
+ this.legend
344
+ .selectAll("legendLabels")
345
+ .data(series)
346
+ .enter()
347
+ .append("text")
348
+ .attr("class", (d) => this.id + namesIndex.indexOf(d.key) + "labels")
349
+ .attr("x", (d, i) => width / (series.length + 1) + i * 120)
350
+ .attr("y", 15)
351
+ .attr(
352
+ "fill",
353
+ (d, i) =>
354
+ costLabels[this.theme][d.key] || chartColors[i % chartColors.length]
355
+ )
356
+ .text((d, i) => adjustText(this.names[d[0].key], 700))
357
+ .attr("font-weight", 500)
358
+ .attr("text-anchor", "left")
359
+ .attr("font-size", "11px")
360
+ .style("alignment-baseline", "middle");
361
+ },
362
+ },
363
+ };
364
+ </script>