playbook_ui 14.25.0.pre.alpha.PLAY2361datepickerarrownav9708 → 14.25.0.pre.alpha.testingcss9700

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f08b1d994601a8d48e2c7e675e51c754c7a7e3a940533d44ac84f7e8ef81beca
4
- data.tar.gz: '092d0b623dfffaa567266bd1c59ec86273b505f002fe0b606af5560656052cc9'
3
+ metadata.gz: 5a1eeaf2f62d7b4fd094d05bede8f832f9021bf561d33cd0ac02fcd03e8e700f
4
+ data.tar.gz: 251d98bd7c327124c0e179dbcfc37f10d65728418a0b6c6a5bee775cdce5b3ab
5
5
  SHA512:
6
- metadata.gz: 02ecb5228ad404fd6e156d8ab0b1aeb4249ee71c3cad1c0f53b4488f772ca648e2c2dc61ffdb21c925513b0669bd95e1ef333d9b4c55a499599508a61a9ef8cd
7
- data.tar.gz: 9a9f402560b0b038da5907295c0f09fa321da13e9fe4e7f5559ebd6f91444e3364dd07b93ae8e6e08736636f65b4bfc5ec23363ff73f43ef8c870c90388953fb
6
+ metadata.gz: e7d20ec1e7dccd4947ed03b7f50e74809c4e8c18a30fc9fb075c4ede04c6053d86cbc7397fa443fdfb6abdfa62b8ad5a77d65a607fe8b4f9d5bb97dcde98bac3
7
+ data.tar.gz: d2ad121581858362b9250eb43eafb4d30e38b066bb46de721a6a1a6be3746279a2fb5d7f05fa2025cd764c30c938e00700841d74e602a4ea8981bee79e2df297
@@ -89,16 +89,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
89
89
  }
90
90
  }
91
91
 
92
- // Helper function to get min/max dates based on yearRange
93
- const getMinMaxDates = () => {
94
- const [minYear, maxYear] = yearRange
95
-
96
- const setMinDate = minDate || `01/01/${minYear}`
97
- const setMaxDate = maxDate || `12/31/${maxYear}`
98
-
99
- return { setMinDate, setMaxDate }
100
- }
101
-
102
92
  const disabledWeekDays = () => {
103
93
  return (
104
94
  [
@@ -211,8 +201,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
211
201
  // | Flatpickr initializer w/ config |
212
202
  // ===========================================================
213
203
 
214
- const { setMinDate, setMaxDate } = getMinMaxDates()
215
-
216
204
  flatpickr(`#${pickerId}`, {
217
205
  allowInput,
218
206
  closeOnSelect,
@@ -224,8 +212,8 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
224
212
  locale: {
225
213
  rangeSeparator: ' to '
226
214
  },
227
- maxDate: setMaxDate,
228
- minDate: setMinDate,
215
+ maxDate,
216
+ minDate,
229
217
  mode,
230
218
  nextArrow: '<i class="far fa-angle-right"></i>',
231
219
  onOpen: [() => {
@@ -335,7 +323,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
335
323
  }
336
324
  // === End of Automatic Sync Logic ===
337
325
 
338
-
326
+
339
327
  // Adding dropdown icons to year and month select
340
328
  dropdown.insertAdjacentHTML('afterend', `<i class="year-dropdown-icon">${angleDown}</i>`)
341
329
  if (picker.monthElements[0].parentElement) {
@@ -0,0 +1,544 @@
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { b as buildAriaProps, c as buildDataProps, d as buildHtmlProps, H as HighchartsReact, e as Highcharts, f as classnames, g as globalProps, h as HighchartsMore, S as SolidGauge, i as buildCss } from "./_typeahead-CEqlHw0H.js";
4
+ import { c as colors, h as highchartsTheme, m as merge, a as highchartsDarkTheme, t as typography } from "./lib-CIetbXpr.js";
5
+ const mapColors = (array) => {
6
+ const regex = /(data)\-[1-8]/;
7
+ const newArray = array.map((item) => {
8
+ return regex.test(item) ? `${colors[`data_${item[item.length - 1]}`]}` : item;
9
+ });
10
+ return newArray;
11
+ };
12
+ const BarGraph = ({
13
+ aria = {},
14
+ data = {},
15
+ align = "center",
16
+ axisTitle,
17
+ dark = false,
18
+ chartData,
19
+ className = "pb_bar_graph",
20
+ colors: colors2,
21
+ htmlOptions = {},
22
+ customOptions = {},
23
+ axisFormat,
24
+ id,
25
+ pointStart,
26
+ stacking,
27
+ subTitle,
28
+ type = "column",
29
+ title = "Title",
30
+ xAxisCategories,
31
+ yAxisMin,
32
+ yAxisMax,
33
+ legend = false,
34
+ toggleLegendClick = true,
35
+ height,
36
+ layout = "horizontal",
37
+ verticalAlign = "bottom",
38
+ x = 0,
39
+ y = 0,
40
+ ...props
41
+ }) => {
42
+ const ariaProps = buildAriaProps(aria);
43
+ const dataProps = buildDataProps(data);
44
+ const htmlProps = buildHtmlProps(htmlOptions);
45
+ const setupTheme = () => {
46
+ dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
47
+ };
48
+ setupTheme();
49
+ const staticOptions = {
50
+ title: {
51
+ text: title
52
+ },
53
+ chart: {
54
+ height,
55
+ type
56
+ },
57
+ subtitle: {
58
+ text: subTitle
59
+ },
60
+ yAxis: [{
61
+ labels: {
62
+ format: typeof axisFormat === "string" ? axisFormat : axisFormat && axisFormat[0] ? axisFormat[0].format : ""
63
+ },
64
+ min: yAxisMin,
65
+ max: yAxisMax,
66
+ opposite: false,
67
+ title: {
68
+ text: Array.isArray(axisTitle) ? axisTitle.length > 0 ? axisTitle[0].name : null : axisTitle
69
+ },
70
+ plotLines: typeof yAxisMin !== "undefined" && yAxisMin !== null ? [] : [{
71
+ value: 0,
72
+ zIndex: 10,
73
+ color: "#E4E8F0"
74
+ }]
75
+ }],
76
+ xAxis: {
77
+ categories: xAxisCategories
78
+ },
79
+ legend: {
80
+ enabled: legend,
81
+ align,
82
+ verticalAlign,
83
+ layout,
84
+ x,
85
+ y
86
+ },
87
+ colors: colors2 !== void 0 && colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
88
+ plotOptions: {
89
+ series: {
90
+ stacking,
91
+ pointStart,
92
+ borderWidth: stacking ? 0 : "",
93
+ events: {},
94
+ dataLabels: {
95
+ enabled: false
96
+ }
97
+ }
98
+ },
99
+ series: chartData,
100
+ credits: false
101
+ };
102
+ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
103
+ staticOptions.yAxis.push({
104
+ labels: {
105
+ format: typeof axisFormat === "string" ? axisFormat : axisFormat[1].format
106
+ },
107
+ min: yAxisMin,
108
+ max: yAxisMax,
109
+ opposite: true,
110
+ title: {
111
+ text: axisTitle[1].name
112
+ },
113
+ plotLines: typeof yAxisMin !== "undefined" && yAxisMin !== null ? [] : [{
114
+ value: 0,
115
+ zIndex: 10,
116
+ color: "#E4E8F0"
117
+ }]
118
+ });
119
+ }
120
+ if (!toggleLegendClick) {
121
+ staticOptions.plotOptions.series.events = { legendItemClick: () => false };
122
+ }
123
+ const filteredProps = { ...props };
124
+ delete filteredProps.verticalAlign;
125
+ const [options, setOptions] = useState({});
126
+ useEffect(() => {
127
+ setOptions(merge(staticOptions, customOptions));
128
+ }, [chartData]);
129
+ return /* @__PURE__ */ jsx(
130
+ HighchartsReact,
131
+ {
132
+ containerProps: {
133
+ className: classnames(globalProps(filteredProps), className),
134
+ id,
135
+ ...ariaProps,
136
+ ...dataProps,
137
+ ...htmlProps
138
+ },
139
+ highcharts: Highcharts,
140
+ options
141
+ }
142
+ );
143
+ };
144
+ const alignBlockElement = (event) => {
145
+ const itemToMove = document.querySelector(
146
+ `#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`
147
+ );
148
+ const chartContainer = document.querySelector(`#${event.target.renderTo.id}`);
149
+ if (itemToMove !== null && chartContainer !== null) {
150
+ itemToMove.style.height = `${event.target.chartHeight}px`;
151
+ itemToMove.style.width = `${event.target.chartWidth}px`;
152
+ if (chartContainer.firstChild !== null) {
153
+ chartContainer.firstChild.before(itemToMove);
154
+ }
155
+ }
156
+ };
157
+ const CircleChart = ({
158
+ align = "center",
159
+ aria = {},
160
+ rounded = false,
161
+ borderColor = rounded ? null : "",
162
+ borderWidth = rounded ? 20 : null,
163
+ chartData,
164
+ children,
165
+ className,
166
+ colors: colors2 = [],
167
+ customOptions = {},
168
+ dark = false,
169
+ data = {},
170
+ dataLabelHtml = "<div>{point.name}</div>",
171
+ dataLabels = false,
172
+ height,
173
+ htmlOptions = {},
174
+ id,
175
+ innerSize = "md",
176
+ legend = false,
177
+ maxPointSize = null,
178
+ minPointSize = null,
179
+ startAngle = null,
180
+ style = "pie",
181
+ title,
182
+ tooltipHtml,
183
+ useHtml = false,
184
+ zMin = null,
185
+ layout = "horizontal",
186
+ verticalAlign = "bottom",
187
+ x = 0,
188
+ y = 0,
189
+ ...props
190
+ }) => {
191
+ const ariaProps = buildAriaProps(aria);
192
+ const dataProps = buildDataProps(data);
193
+ const htmlProps = buildHtmlProps(htmlOptions);
194
+ HighchartsMore(Highcharts);
195
+ const setupTheme = () => {
196
+ dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
197
+ };
198
+ setupTheme();
199
+ Highcharts.setOptions({
200
+ tooltip: {
201
+ headerFormat: null,
202
+ pointFormat: tooltipHtml ? tooltipHtml : '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',
203
+ useHTML: useHtml
204
+ }
205
+ });
206
+ const innerSizes = { sm: "35%", md: "50%", lg: "85%", none: "0%" };
207
+ const innerSizeFormat = (size) => innerSizes[size];
208
+ const filteredProps = { ...props };
209
+ delete filteredProps.verticalAlign;
210
+ const [options, setOptions] = useState({});
211
+ useEffect(() => {
212
+ const formattedChartData = chartData.map((obj) => {
213
+ obj.y = obj.value;
214
+ delete obj.value;
215
+ return obj;
216
+ });
217
+ const staticOptions = {
218
+ title: {
219
+ text: title
220
+ },
221
+ chart: {
222
+ height,
223
+ type: style,
224
+ events: {
225
+ render: (event) => alignBlockElement(event),
226
+ redraw: (event) => alignBlockElement(event)
227
+ }
228
+ },
229
+ legend: {
230
+ align,
231
+ verticalAlign,
232
+ layout,
233
+ x,
234
+ y
235
+ },
236
+ plotOptions: {
237
+ pie: {
238
+ colors: colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
239
+ dataLabels: {
240
+ enabled: dataLabels,
241
+ connectorShape: "straight",
242
+ connectorWidth: 3,
243
+ format: dataLabelHtml
244
+ },
245
+ showInLegend: legend
246
+ }
247
+ },
248
+ series: [
249
+ {
250
+ minPointSize,
251
+ maxPointSize,
252
+ innerSize: borderWidth == 20 ? "100%" : innerSizeFormat(innerSize),
253
+ data: formattedChartData,
254
+ zMin,
255
+ startAngle,
256
+ borderWidth,
257
+ borderColor
258
+ }
259
+ ],
260
+ credits: false
261
+ };
262
+ setOptions(merge(staticOptions, customOptions));
263
+ }, [chartData]);
264
+ return /* @__PURE__ */ jsx(Fragment, { children: children ? /* @__PURE__ */ jsxs("div", { id: `wrapper-circle-chart-${id}`, children: [
265
+ /* @__PURE__ */ jsx(
266
+ HighchartsReact,
267
+ {
268
+ containerProps: {
269
+ className: classnames("pb_circle_chart", globalProps(filteredProps)),
270
+ id,
271
+ ...ariaProps,
272
+ ...dataProps,
273
+ ...htmlProps
274
+ },
275
+ highcharts: Highcharts,
276
+ options
277
+ }
278
+ ),
279
+ /* @__PURE__ */ jsx("div", { className: "pb-circle-chart-block", children })
280
+ ] }) : /* @__PURE__ */ jsx(
281
+ HighchartsReact,
282
+ {
283
+ containerProps: {
284
+ className: classnames("pb_circle_chart", globalProps(filteredProps)),
285
+ id,
286
+ ...ariaProps,
287
+ ...dataProps,
288
+ ...htmlProps
289
+ },
290
+ highcharts: Highcharts,
291
+ options
292
+ }
293
+ ) });
294
+ };
295
+ const Gauge = ({
296
+ aria = {},
297
+ chartData,
298
+ customOptions = {},
299
+ dark = false,
300
+ data = {},
301
+ disableAnimation = false,
302
+ fullCircle = false,
303
+ height = null,
304
+ htmlOptions = {},
305
+ id,
306
+ max = 100,
307
+ min = 0,
308
+ prefix = "",
309
+ showLabels = false,
310
+ style = "solidgauge",
311
+ suffix = "",
312
+ title = "",
313
+ tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',
314
+ colors: colors$1 = [],
315
+ minorTickInterval = null,
316
+ circumference = fullCircle ? [0, 360] : [-100, 100],
317
+ ...props
318
+ }) => {
319
+ const ariaProps = buildAriaProps(aria);
320
+ const dataProps = buildDataProps(data);
321
+ const htmlProps = buildHtmlProps(htmlOptions);
322
+ HighchartsMore(Highcharts);
323
+ SolidGauge(Highcharts);
324
+ const setupTheme = () => {
325
+ dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
326
+ };
327
+ setupTheme();
328
+ Highcharts.setOptions({
329
+ tooltip: {
330
+ pointFormat: tooltipHtml,
331
+ followPointer: true
332
+ }
333
+ });
334
+ const css = buildCss({
335
+ pb_gauge_kit: true
336
+ });
337
+ const [options, setOptions] = useState({});
338
+ useEffect(() => {
339
+ const formattedChartData = chartData.map((obj) => {
340
+ obj.y = obj.value;
341
+ delete obj.value;
342
+ return obj;
343
+ });
344
+ const staticOptions = {
345
+ chart: {
346
+ events: {
347
+ load() {
348
+ setTimeout(this.reflow.bind(this), 0);
349
+ }
350
+ },
351
+ type: style,
352
+ height
353
+ },
354
+ title: {
355
+ text: title
356
+ },
357
+ yAxis: {
358
+ min,
359
+ max,
360
+ lineWidth: 0,
361
+ tickWidth: 0,
362
+ minorTickInterval,
363
+ tickAmount: 2,
364
+ tickPositions: [min, max],
365
+ labels: {
366
+ y: 26,
367
+ enabled: showLabels
368
+ }
369
+ },
370
+ credits: false,
371
+ series: [
372
+ {
373
+ data: formattedChartData
374
+ }
375
+ ],
376
+ pane: {
377
+ center: ["50%", "50%"],
378
+ size: "90%",
379
+ startAngle: circumference[0],
380
+ endAngle: circumference[1],
381
+ background: {
382
+ borderWidth: 20,
383
+ innerRadius: "90%",
384
+ outerRadius: "90%",
385
+ shape: "arc",
386
+ className: "gauge-pane"
387
+ }
388
+ },
389
+ colors: colors$1 !== void 0 && colors$1.length > 0 ? mapColors(colors$1) : highchartsTheme.colors,
390
+ plotOptions: {
391
+ series: {
392
+ animation: !disableAnimation
393
+ },
394
+ solidgauge: {
395
+ borderColor: colors$1 !== void 0 && colors$1.length === 1 ? mapColors(colors$1).join() : highchartsTheme.colors[0],
396
+ borderWidth: 20,
397
+ radius: 90,
398
+ innerRadius: "90%",
399
+ dataLabels: {
400
+ borderWidth: 0,
401
+ color: colors.text_lt_default,
402
+ enabled: true,
403
+ format: `<span class="prefix${dark ? " dark" : ""}">${prefix}</span><span class="fix${dark ? " dark" : ""}">{y:,f}</span><span class="suffix${dark ? " dark" : ""}">${suffix}</span>`,
404
+ style: {
405
+ fontFamily: typography.font_family_base,
406
+ fontWeight: typography.regular,
407
+ fontSize: typography.heading_2
408
+ },
409
+ y: -26
410
+ }
411
+ }
412
+ }
413
+ };
414
+ setOptions(merge(staticOptions, customOptions));
415
+ if (document.querySelector(".prefix")) {
416
+ document.querySelectorAll(".prefix").forEach((prefix2) => {
417
+ prefix2.setAttribute("y", "28");
418
+ });
419
+ document.querySelectorAll(".fix").forEach((fix) => fix.setAttribute("y", "38"));
420
+ }
421
+ }, [chartData]);
422
+ return /* @__PURE__ */ jsx(
423
+ HighchartsReact,
424
+ {
425
+ containerProps: {
426
+ className: classnames(css, globalProps(props)),
427
+ id,
428
+ ...ariaProps,
429
+ ...dataProps,
430
+ ...htmlProps
431
+ },
432
+ highcharts: Highcharts,
433
+ options
434
+ }
435
+ );
436
+ };
437
+ const LineGraph = ({
438
+ aria = {},
439
+ data = {},
440
+ align = "center",
441
+ className = "pb_bar_graph",
442
+ customOptions = {},
443
+ dark = false,
444
+ gradient = false,
445
+ type = "line",
446
+ htmlOptions = {},
447
+ id,
448
+ legend = false,
449
+ toggleLegendClick = true,
450
+ layout = "horizontal",
451
+ verticalAlign = "bottom",
452
+ x = 0,
453
+ y = 0,
454
+ axisTitle,
455
+ xAxisCategories,
456
+ yAxisMin,
457
+ yAxisMax,
458
+ chartData,
459
+ pointStart,
460
+ subTitle,
461
+ title,
462
+ height,
463
+ colors: colors2 = [],
464
+ ...props
465
+ }) => {
466
+ const ariaProps = buildAriaProps(aria);
467
+ const dataProps = buildDataProps(data);
468
+ const htmlProps = buildHtmlProps(htmlOptions);
469
+ const setupTheme = () => {
470
+ dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme);
471
+ };
472
+ setupTheme();
473
+ const staticOptions = {
474
+ title: {
475
+ text: title
476
+ },
477
+ chart: {
478
+ height,
479
+ type
480
+ },
481
+ subtitle: {
482
+ text: subTitle
483
+ },
484
+ yAxis: {
485
+ min: yAxisMin,
486
+ max: yAxisMax,
487
+ title: {
488
+ text: axisTitle
489
+ }
490
+ },
491
+ xAxis: {
492
+ categories: xAxisCategories
493
+ },
494
+ legend: {
495
+ enabled: legend,
496
+ align,
497
+ verticalAlign,
498
+ layout,
499
+ x,
500
+ y
501
+ },
502
+ colors: colors2 !== void 0 && colors2.length > 0 ? mapColors(colors2) : highchartsTheme.colors,
503
+ plotOptions: {
504
+ series: {
505
+ pointStart,
506
+ events: {},
507
+ dataLabels: {
508
+ enabled: false
509
+ }
510
+ }
511
+ },
512
+ series: chartData,
513
+ credits: false
514
+ };
515
+ if (!toggleLegendClick) {
516
+ staticOptions.plotOptions.series.events = { legendItemClick: () => false };
517
+ }
518
+ const filteredProps = { ...props };
519
+ delete filteredProps.verticalAlign;
520
+ const [options, setOptions] = useState({});
521
+ useEffect(() => {
522
+ setOptions(merge(staticOptions, customOptions));
523
+ }, [chartData]);
524
+ return /* @__PURE__ */ jsx(
525
+ HighchartsReact,
526
+ {
527
+ containerProps: {
528
+ className: classnames(globalProps(filteredProps), className),
529
+ id,
530
+ ...ariaProps,
531
+ ...dataProps,
532
+ ...htmlProps
533
+ },
534
+ highcharts: Highcharts,
535
+ options
536
+ }
537
+ );
538
+ };
539
+ export {
540
+ BarGraph as B,
541
+ CircleChart as C,
542
+ Gauge as G,
543
+ LineGraph as L
544
+ };