playbook_ui 12.18.0.pre.alpha.PLAY785typeaheadts608 → 12.18.0.pre.alpha.PLAY785typeaheadts632

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78d2755a123ca0414a32cc2b2478f058f5b4fa57f431a34deded1a42618236a0
4
- data.tar.gz: 3845495b122b5c728092f04bddc3f56d967951dff2cc270c3477dd73f9dc6643
3
+ metadata.gz: ebfd5fbf4ef024e0e8d72e0571709edfb8738488a45893fe4cb0ae7ffb43910a
4
+ data.tar.gz: 8dcb7aea81f460389a352c31d6d78ba8ef9525b6220c83979e0865aa2a4a6f38
5
5
  SHA512:
6
- metadata.gz: 26a7ab5c67dc6b6fabfbe2ce30db19a419f25e305e4ccadd4ea73e29e4e0f46b544db0569d52e94897aee2e732231d050af975902057a2bdea6ac38c5376d798
7
- data.tar.gz: 4e0ddb8732d7c7d7dcf2126d95d8a3aaf032e17b9c3b397a48e46a39e838721194848de455afa8583cc09b1415fadf670178bb931c4e0bb82ee635c31fb89999
6
+ metadata.gz: 0b7e9a390686d87fff0212071df2a3a44a468266e28e3d8ab24f968a15775edd01132a74839b3af58e71add8eb6884a3c02999f6198110e75fbfbf5f2bbf7519
7
+ data.tar.gz: 228b4952c368979aacac5e591c5b2b1c91339a6bae8b1731fef3872a7f5f6833d9763d7743772b86f83ccd3f902154355f1a1f662fd41624af4a0989575ca45c
@@ -11,8 +11,12 @@ export default class PbTable extends PbEnhancedElement {
11
11
  // Each Table
12
12
  [].forEach.call(tables, (table: HTMLTableElement) => {
13
13
  // Header Titles
14
- var headers = [].map.call(table.querySelectorAll('th'), (header: Element) => {
15
- return header.textContent.replace(/\r?\n|\r/, '')
14
+ let headers: string[] = [];
15
+ [].forEach.call(table.querySelectorAll('th'), (header: HTMLTableCellElement) => {
16
+ let colSpan = header.colSpan
17
+ for (let i = 0; i < colSpan; i++) {
18
+ headers.push(header.textContent.replace(/\r?\n|\r/, ''));
19
+ }
16
20
  });
17
21
 
18
22
  // for each row in tbody
@@ -6,7 +6,7 @@ import {
6
6
  offset,
7
7
  Placement,
8
8
  safePolygon,
9
- shift,
9
+ shift,
10
10
  useFloating,
11
11
  useHover,
12
12
  useInteractions,
@@ -17,9 +17,6 @@ import { GlobalProps, globalProps } from "../utilities/globalProps"
17
17
  import { buildAriaProps, buildDataProps } from "../utilities/props"
18
18
  import Flex from "../pb_flex/_flex"
19
19
 
20
-
21
-
22
-
23
20
  type TooltipProps = {
24
21
  aria?: { [key: string]: string },
25
22
  className?: string | string[],
@@ -29,8 +26,8 @@ type TooltipProps = {
29
26
  icon?: string,
30
27
  interaction?: boolean,
31
28
  placement?: Placement,
29
+ position?: "absolute" | "fixed";
32
30
  text: string,
33
- zIndex?: Pick<GlobalProps, "ZIndex">,
34
31
  } & GlobalProps
35
32
 
36
33
  const Tooltip = (props: TooltipProps): React.ReactElement => {
@@ -43,6 +40,7 @@ const Tooltip = (props: TooltipProps): React.ReactElement => {
43
40
  icon = null,
44
41
  interaction = false,
45
42
  placement: preferredPlacement = "top",
43
+ position = "absolute",
46
44
  text,
47
45
  zIndex,
48
46
  ...rest
@@ -50,24 +48,26 @@ const Tooltip = (props: TooltipProps): React.ReactElement => {
50
48
 
51
49
  const dataProps: { [key: string]: any } = buildDataProps(data)
52
50
  const ariaProps: { [key: string]: any } = buildAriaProps(aria)
53
-
51
+
54
52
  const css = classnames(
55
53
  globalProps({...rest}),
56
54
  className,
57
55
  )
58
56
  const [open, setOpen] = useState(false)
59
57
  const arrowRef = useRef(null)
60
- const {
61
58
 
59
+
60
+ const {
62
61
  context,
63
62
  floating,
64
- middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },
63
+ middlewareData: { arrow: { x: arrowX, y: arrowY } = {}, },
65
64
  placement,
66
65
  reference,
67
66
  strategy,
68
67
  x,
69
68
  y,
70
69
  } = useFloating({
70
+ strategy: position,
71
71
  middleware: [
72
72
  arrow({
73
73
  element: arrowRef,
@@ -87,6 +87,7 @@ const Tooltip = (props: TooltipProps): React.ReactElement => {
87
87
  placement: preferredPlacement
88
88
  })
89
89
 
90
+
90
91
  const { getFloatingProps } = useInteractions([
91
92
  useHover(context, {
92
93
  delay,
@@ -142,7 +143,7 @@ const Tooltip = (props: TooltipProps): React.ReactElement => {
142
143
  className="arrow_bg"
143
144
  ref={arrowRef}
144
145
  style={{
145
- position: strategy,
146
+ position: "absolute",
146
147
  left: arrowX != null ? `${arrowX}px` : "",
147
148
  top: arrowY != null ? `${arrowY}px` : "",
148
149
  [staticSide]: "-5px",
@@ -154,4 +155,4 @@ const Tooltip = (props: TooltipProps): React.ReactElement => {
154
155
  )
155
156
  }
156
157
 
157
- export default Tooltip
158
+ export default Tooltip
@@ -65,3 +65,32 @@ test("closes on mouseleave", async () => {
65
65
 
66
66
  cleanup();
67
67
  });
68
+
69
+ test("has default position absolute", async () => {
70
+ render(<TooltipTest />);
71
+
72
+ fireEvent.mouseEnter(screen.getByRole("tooltip_trigger"));
73
+ await waitFor(() => {
74
+ expect(screen.queryByRole("tooltip")).toHaveStyle({"position": "absolute"});
75
+ cleanup();
76
+ })
77
+
78
+ cleanup();
79
+ });
80
+
81
+ test("has position fixed", async () => {
82
+ render(
83
+ <Tooltip
84
+ data={{ testid: "fixed-position-test" }}
85
+ position="fixed"
86
+ />
87
+ );
88
+
89
+ fireEvent.mouseEnter(screen.getByRole("tooltip_trigger"));
90
+ await waitFor(() => {
91
+ expect(screen.queryByRole("tooltip")).toHaveStyle({"position": "fixed"});
92
+ cleanup();
93
+ })
94
+
95
+ cleanup();
96
+ });
@@ -78,6 +78,7 @@ const Typeahead = ({
78
78
  Control,
79
79
  ClearIndicator,
80
80
  IndicatorsContainer,
81
+ IndicatorSeparator: null as null,
81
82
  MenuList,
82
83
  MultiValue,
83
84
  Option,
@@ -95,6 +96,7 @@ const Typeahead = ({
95
96
  isSearchable: true,
96
97
  name,
97
98
  multiKit: '',
99
+ onCreateOption: null as null,
98
100
  plusIcon: false,
99
101
  onMultiValueClick: (_option: SelectValueType) => { },
100
102
  ...props,
@@ -68,7 +68,7 @@ $background_colors: (
68
68
 
69
69
  /* Card colors ------------------*/
70
70
  $card_light: $white !default;
71
- $card_dark: rgba($white, $opacity_1) !default;
71
+ $card_dark: mix(white, $bg_dark, 10%) !default;
72
72
  $card_colors: (
73
73
  card_light: $card_light,
74
74
  card_dark: $card_dark
@@ -109,16 +109,18 @@ $focus_input_colors: (
109
109
 
110
110
  /* Border colors ----------------------*/
111
111
  $border_light: #E4E8F0 !default;
112
- $border_dark: rgba($white, $opacity_1) !default;
112
+ $border_dark: mix(white, $bg_dark, 20%) !default;
113
113
  $border_colors: (
114
114
  border_light: $border_light,
115
115
  border_dark: $border_dark
116
116
  );
117
117
 
118
118
  /* Shadow colors ----------------------*/
119
- $shadow: rgba(#3C6AAC, $opacity_2) !default;
119
+ $shadow: rgba(#3C6AAC, $opacity_2) !default;
120
+ $shadow_dark: $bg_dark !default;
120
121
  $shadow_colors: (
121
122
  shadow: $shadow,
123
+ shadow_dark: $shadow_dark,
122
124
  );
123
125
 
124
126
  /* Text colors ------------------------*/
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.18.0"
5
- VERSION = "12.18.0.pre.alpha.PLAY785typeaheadts608"
5
+ VERSION = "12.18.0.pre.alpha.PLAY785typeaheadts632"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.18.0.pre.alpha.PLAY785typeaheadts608
4
+ version: 12.18.0.pre.alpha.PLAY785typeaheadts632
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-04 00:00:00.000000000 Z
12
+ date: 2023-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack