playbook_ui 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8781 → 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8856
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 +4 -4
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +36 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +71 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -16
- data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors.md → _circle_chart_colors_rails.md} +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +2 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +28 -16
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +4 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +23 -15
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +81 -51
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +103 -75
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +3 -6
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +19 -13
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -17
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +34 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +29 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +28 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.test.js +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +16 -20
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +3 -3
- data/dist/chunks/_circle_chart-DVSbcau1.js +1 -0
- data/dist/chunks/_typeahead-Dw_aUsLL.js +22 -0
- data/dist/chunks/_weekday_stacked-BNHzzslr.js +21 -0
- data/dist/chunks/{lib-BTYFzEXV.js → lib-Ca_BDmX1.js} +1 -1
- data/dist/chunks/{pb_form_validation-Cn7GCWm0.js → pb_form_validation-DczEjrcc.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -19
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +10 -12
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_popover/popover.test.js +0 -220
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_advanced.test.js +0 -47
- data/dist/chunks/_bar_graph-B9HqVkQv.js +0 -1
- data/dist/chunks/_typeahead-CiAYz-Py.js +0 -22
- data/dist/chunks/_weekday_stacked-_I9XNGZe.js +0 -45
@@ -1,13 +1,13 @@
|
|
1
1
|
/* eslint-disable react/no-multi-comp */
|
2
2
|
import React, { useEffect, useState } from "react";
|
3
3
|
import ReactDOM from "react-dom";
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
} from "react-popper";
|
4
|
+
// import {
|
5
|
+
// Popper,
|
6
|
+
// Manager as PopperManager,
|
7
|
+
// Modifier,
|
8
|
+
// PopperProps,
|
9
|
+
// Reference as PopperReference,
|
10
|
+
// } from "react-popper";
|
11
11
|
|
12
12
|
import {
|
13
13
|
buildAriaProps,
|
@@ -31,10 +31,10 @@ type PbPopoverProps = {
|
|
31
31
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
32
32
|
id?: string;
|
33
33
|
offset?: boolean;
|
34
|
-
reference:
|
34
|
+
reference: any;
|
35
35
|
show?: boolean;
|
36
36
|
shouldClosePopover?: (arg0: boolean) => void;
|
37
|
-
} & ModifiedGlobalProps & Omit<
|
37
|
+
} & ModifiedGlobalProps & Omit<any, 'children'>
|
38
38
|
& { children?: React.ReactChild[] | React.ReactChild }
|
39
39
|
|
40
40
|
// Prop enabled default modifiers here
|
@@ -56,7 +56,7 @@ const popoverModifiers = ({
|
|
56
56
|
modifiers,
|
57
57
|
offset,
|
58
58
|
}: {
|
59
|
-
modifiers:
|
59
|
+
modifiers: any;
|
60
60
|
offset: boolean;
|
61
61
|
}) => {
|
62
62
|
return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers;
|
@@ -112,11 +112,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
112
112
|
);
|
113
113
|
|
114
114
|
return (
|
115
|
-
|
116
|
-
modifiers={popoverModifiers({ modifiers, offset })}
|
117
|
-
placement={placement}
|
118
|
-
referenceElement={referenceElement}
|
119
|
-
>
|
115
|
+
<>
|
120
116
|
{({ placement, ref, style }) => {
|
121
117
|
return (
|
122
118
|
<div
|
@@ -147,7 +143,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
147
143
|
</div>
|
148
144
|
);
|
149
145
|
}}
|
150
|
-
|
146
|
+
</>
|
151
147
|
);
|
152
148
|
};
|
153
149
|
|
@@ -228,9 +224,9 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
228
224
|
);
|
229
225
|
|
230
226
|
return (
|
231
|
-
<PopperManager>
|
227
|
+
// <PopperManager>
|
232
228
|
<>
|
233
|
-
{reference && !referenceElement && (
|
229
|
+
{/* {reference && !referenceElement && (
|
234
230
|
<PopperReference>
|
235
231
|
{({ ref }) => (
|
236
232
|
<span
|
@@ -253,9 +249,9 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
253
249
|
</>
|
254
250
|
) : (
|
255
251
|
{ popoverComponent }
|
256
|
-
))}
|
252
|
+
))} */}
|
257
253
|
</>
|
258
|
-
</PopperManager>
|
254
|
+
// </PopperManager>
|
259
255
|
);
|
260
256
|
};
|
261
257
|
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
6
|
import { globalProps } from '../utilities/globalProps'
|
7
|
-
import Joyride, { TooltipRenderProps } from 'react-joyride'
|
7
|
+
// import Joyride, { TooltipRenderProps } from 'react-joyride'
|
8
8
|
import Button from '../pb_button/_button'
|
9
9
|
import Flex from '../pb_flex/_flex'
|
10
10
|
import SectionSeparator from '../pb_section_separator/_section_separator'
|
@@ -181,7 +181,7 @@ const Walkthrough = (props: WalkthroughProps): React.ReactElement => {
|
|
181
181
|
className={classes}
|
182
182
|
id={id}
|
183
183
|
>
|
184
|
-
<Joyride
|
184
|
+
{/* <Joyride
|
185
185
|
callback={callback}
|
186
186
|
continuous={continuous}
|
187
187
|
disableOverlay={disableOverlay}
|
@@ -193,7 +193,7 @@ const Walkthrough = (props: WalkthroughProps): React.ReactElement => {
|
|
193
193
|
styles={styles}
|
194
194
|
tooltipComponent={Tooltip}
|
195
195
|
{...props}
|
196
|
-
/>
|
196
|
+
/> */}
|
197
197
|
</div>
|
198
198
|
|
199
199
|
)
|
@@ -0,0 +1 @@
|
|
1
|
+
import{jsx,Fragment,jsxs}from"react/jsx-runtime";import{useState,useEffect}from"react";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,m as mapColors,H as HighchartsReact,d as Highcharts,e as classnames,g as globalProps,f as HighchartsMore}from"./_typeahead-Dw_aUsLL.js";import{h as highchartsTheme,m as merge,a as highchartsDarkTheme}from"./lib-Ca_BDmX1.js";const BarGraph=({aria:aria={},data:data={},align:align="center",axisTitle:axisTitle,dark:dark=false,chartData:chartData,className:className="pb_bar_graph",colors:colors,htmlOptions:htmlOptions={},customOptions:customOptions={},axisFormat:axisFormat,id:id,pointStart:pointStart,stacking:stacking,subTitle:subTitle,type:type="column",title:title="Title",xAxisCategories:xAxisCategories,yAxisMin:yAxisMin,yAxisMax:yAxisMax,legend:legend=false,toggleLegendClick:toggleLegendClick=true,height:height,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();const staticOptions={title:{text:title},chart:{height:height,type:type},subtitle:{text:subTitle},yAxis:[{labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat&&axisFormat[0]?axisFormat[0].format:""},min:yAxisMin,max:yAxisMax,opposite:false,title:{text:Array.isArray(axisTitle)?axisTitle.length>0?axisTitle[0].name:null:axisTitle},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]}],xAxis:{categories:xAxisCategories},legend:{enabled:legend,align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},colors:colors!==void 0&&colors.length>0?mapColors(colors):highchartsTheme.colors,plotOptions:{series:{stacking:stacking,pointStart:pointStart,borderWidth:stacking?0:"",events:{},dataLabels:{enabled:false}}},series:chartData,credits:false};if(Array.isArray(axisTitle)&&axisTitle.length>1&&axisTitle[1].name){staticOptions.yAxis.push({labels:{format:typeof axisFormat==="string"?axisFormat:axisFormat[1].format},min:yAxisMin,max:yAxisMax,opposite:true,title:{text:axisTitle[1].name},plotLines:typeof yAxisMin!=="undefined"&&yAxisMin!==null?[]:[{value:0,zIndex:10,color:"#E4E8F0"}]})}if(!toggleLegendClick){staticOptions.plotOptions.series.events={legendItemClick:()=>false}}const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(HighchartsReact,{containerProps:{className:classnames(globalProps(filteredProps),className),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})};const alignBlockElement=event=>{const itemToMove=document.querySelector(`#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`);const chartContainer=document.querySelector(`#${event.target.renderTo.id}`);if(itemToMove!==null&&chartContainer!==null){itemToMove.style.height=`${event.target.chartHeight}px`;itemToMove.style.width=`${event.target.chartWidth}px`;if(chartContainer.firstChild!==null){chartContainer.firstChild.before(itemToMove)}}};const CircleChart=({align:align="center",aria:aria={},rounded:rounded=false,borderColor:borderColor=(rounded?null:""),borderWidth:borderWidth=(rounded?20:null),chartData:chartData,children:children,className:className,colors:colors=[],customOptions:customOptions={},dark:dark=false,data:data={},dataLabelHtml:dataLabelHtml="<div>{point.name}</div>",dataLabels:dataLabels=false,height:height,htmlOptions:htmlOptions={},id:id,innerSize:innerSize="md",legend:legend=false,maxPointSize:maxPointSize=null,minPointSize:minPointSize=null,startAngle:startAngle=null,style:style="pie",title:title,tooltipHtml:tooltipHtml,useHtml:useHtml=false,zMin:zMin=null,layout:layout="horizontal",verticalAlign:verticalAlign="bottom",x:x=0,y:y=0,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);HighchartsMore(Highcharts);const setupTheme=()=>{dark?Highcharts.setOptions(highchartsDarkTheme):Highcharts.setOptions(highchartsTheme)};setupTheme();Highcharts.setOptions({tooltip:{headerFormat:null,pointFormat:tooltipHtml?tooltipHtml:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',useHTML:useHtml}});const innerSizes={sm:"35%",md:"50%",lg:"85%",none:"0%"};const innerSizeFormat=size=>innerSizes[size];const filteredProps={...props};delete filteredProps.verticalAlign;const[options,setOptions]=useState({});useEffect((()=>{const formattedChartData=chartData.map((obj=>{obj.y=obj.value;delete obj.value;return obj}));const staticOptions={title:{text:title},chart:{height:height,type:style,events:{render:event=>alignBlockElement(event),redraw:event=>alignBlockElement(event)}},legend:{align:align,verticalAlign:verticalAlign,layout:layout,x:x,y:y},plotOptions:{pie:{colors:colors.length>0?mapColors(colors):highchartsTheme.colors,dataLabels:{enabled:dataLabels,connectorShape:"straight",connectorWidth:3,format:dataLabelHtml},showInLegend:legend}},series:[{minPointSize:minPointSize,maxPointSize:maxPointSize,innerSize:borderWidth==20?"100%":innerSizeFormat(innerSize),data:formattedChartData,zMin:zMin,startAngle:startAngle,borderWidth:borderWidth,borderColor:borderColor}],credits:false};setOptions(merge(staticOptions,customOptions))}),[chartData]);return jsx(Fragment,{children:children?jsxs("div",{id:`wrapper-circle-chart-${id}`,children:[jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options}),jsx("div",{className:"pb-circle-chart-block",children:children})]}):jsx(HighchartsReact,{containerProps:{className:classnames("pb_circle_chart",globalProps(filteredProps)),id:id,...ariaProps,...dataProps,...htmlProps},highcharts:Highcharts,options:options})})};export{BarGraph as B,CircleChart as C};
|