tp-react-elements 2.0.1 → 2.0.2
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.
- package/README.md +17 -11
- package/dist/_virtual/index.esm12.js +2 -2
- package/dist/_virtual/index.esm13.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm4.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm6.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/FormComponents/Select/SingleSelectSearchApi.d.ts +20 -15
- package/dist/components/FormComponents/Select/SingleSelectSearchApi.esm.js +45 -37
- package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,18 +9,24 @@ A comprehensive React form library built with Material-UI and React Hook Form, d
|
|
|
9
9
|
> Storybook docs (`*.stories.tsx` → `meta.parameters.docs.description`)
|
|
10
10
|
> so consumers see the same explanation in both places.
|
|
11
11
|
|
|
12
|
-
- **`SingleSelectSearchApi`** —
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
- **`SingleSelectSearchApi`** — The selected-value `Tooltip` is now suppressed
|
|
13
|
+
via `open={false}` (controlled-closed) instead of relying on the Popper
|
|
14
|
+
modifier fix. Background: the tooltip previously rendered pinned to the
|
|
15
|
+
viewport's top-left corner (0,0) instead of near the input when the field
|
|
16
|
+
sat inside an `overflow: hidden` ancestor (e.g. a table cell in
|
|
17
|
+
`material-react-table` / `GenericPaginatedGrid`). Disabling Popper's `hide`
|
|
18
|
+
modifier and using `rootBoundary: 'viewport'` **verifiably fixed this in
|
|
19
|
+
Storybook (MUI v7)**, but the same build still mis-anchored when consumed
|
|
20
|
+
live in apps pinned to MUI v6 (below our `@mui/material >=7.3.1` peer
|
|
21
|
+
requirement) — MUI v6's Popper/Tooltip runtime ignores the modifier
|
|
22
|
+
configuration. Rather than ship a tooltip that only behaves correctly on
|
|
23
|
+
some MUI majors, we now suppress it at the prop level: `open={false}` forces
|
|
24
|
+
MUI's `Tooltip` into fully-controlled mode so it never opens. The `Tooltip`
|
|
25
|
+
element (and its modifier config) is **retained** (not removed) — flipping
|
|
26
|
+
`open` back to the default is a one-line change once the anchoring fix is
|
|
27
|
+
confirmed across all supported MUI majors. See the
|
|
21
28
|
**"Tooltip inside a clipped container"** story in
|
|
22
|
-
`SingleSelectSearchApi.stories.tsx`
|
|
23
|
-
JSDoc for implementation notes.
|
|
29
|
+
`SingleSelectSearchApi.stories.tsx` and the component's JSDoc for details.
|
|
24
30
|
|
|
25
31
|
## 🚀 Features
|
|
26
32
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Month = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Month as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateInput = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateInput as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var InputRangeField = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { InputRangeField as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Calendar = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Calendar as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRangePicker = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRangePicker as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DefinedRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DefinedRange as __exports };
|
|
@@ -22,22 +22,27 @@ export interface SearchOption {
|
|
|
22
22
|
* Searches fire only after `minSearchLength` chars AND after the `debounceMs`
|
|
23
23
|
* debounce delay — preventing a request per keystroke.
|
|
24
24
|
*
|
|
25
|
-
* ### Selected-value tooltip
|
|
26
|
-
* The input is wrapped in a MUI `Tooltip`
|
|
27
|
-
* hover (useful when a narrow column truncates the label).
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `preventOverflow
|
|
25
|
+
* ### Selected-value tooltip — currently suppressed via `open={false}`
|
|
26
|
+
* The input is wrapped in a MUI `Tooltip` that would show `resolvedValue.label`
|
|
27
|
+
* on hover (useful when a narrow column truncates the label). It carries
|
|
28
|
+
* `placement="top-start"`, `arrow`, `disableInteractive`, and a
|
|
29
|
+
* `slotProps.popper` block with Popper.js modifiers (`hide` disabled, `offset`,
|
|
30
|
+
* `preventOverflow`, `flip`) that correctly anchor it to the input even inside
|
|
31
|
+
* an `overflow: hidden` ancestor (e.g. a table cell in `material-react-table` /
|
|
32
|
+
* `GenericPaginatedGrid`) — **verified working in Storybook on MUI v7**.
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
34
|
+
* However, that fix does not reproduce in consumer apps still pinned to
|
|
35
|
+
* MUI v6 (below our `@mui/material >=7.3.1` peer requirement): the v6
|
|
36
|
+
* Popper/Tooltip runtime ignores the modifier configuration and the tooltip
|
|
37
|
+
* still mis-anchors to the viewport's top-left corner (0,0). Rather than ship
|
|
38
|
+
* a tooltip that only behaves correctly on some MUI majors, we suppress it at
|
|
39
|
+
* the prop level — `open={false}` puts MUI's `Tooltip` into fully-controlled
|
|
40
|
+
* mode so it never opens, while the `<Tooltip>` element (and its modifier
|
|
41
|
+
* config) stays in the tree, deliberately *not removed*. Once the anchoring
|
|
42
|
+
* fix is confirmed across all supported MUI majors, removing `open={false}`
|
|
43
|
+
* re-enables the tooltip with no other changes needed. See the
|
|
44
|
+
* "Tooltip inside a clipped container" Storybook story for the anchoring repro
|
|
45
|
+
* and the `open={false}` suppression in context.
|
|
41
46
|
*/
|
|
42
47
|
declare const SingleSelectSearchApi: ({ props, variant, minSearchLength, debounceMs, fetchOptions, }: {
|
|
43
48
|
props: FormRenderProps;
|
|
@@ -50,22 +50,27 @@ function useDebounce(value, delayMs) {
|
|
|
50
50
|
* Searches fire only after `minSearchLength` chars AND after the `debounceMs`
|
|
51
51
|
* debounce delay — preventing a request per keystroke.
|
|
52
52
|
*
|
|
53
|
-
* ### Selected-value tooltip
|
|
54
|
-
* The input is wrapped in a MUI `Tooltip`
|
|
55
|
-
* hover (useful when a narrow column truncates the label).
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `preventOverflow
|
|
53
|
+
* ### Selected-value tooltip — currently suppressed via `open={false}`
|
|
54
|
+
* The input is wrapped in a MUI `Tooltip` that would show `resolvedValue.label`
|
|
55
|
+
* on hover (useful when a narrow column truncates the label). It carries
|
|
56
|
+
* `placement="top-start"`, `arrow`, `disableInteractive`, and a
|
|
57
|
+
* `slotProps.popper` block with Popper.js modifiers (`hide` disabled, `offset`,
|
|
58
|
+
* `preventOverflow`, `flip`) that correctly anchor it to the input even inside
|
|
59
|
+
* an `overflow: hidden` ancestor (e.g. a table cell in `material-react-table` /
|
|
60
|
+
* `GenericPaginatedGrid`) — **verified working in Storybook on MUI v7**.
|
|
59
61
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
62
|
+
* However, that fix does not reproduce in consumer apps still pinned to
|
|
63
|
+
* MUI v6 (below our `@mui/material >=7.3.1` peer requirement): the v6
|
|
64
|
+
* Popper/Tooltip runtime ignores the modifier configuration and the tooltip
|
|
65
|
+
* still mis-anchors to the viewport's top-left corner (0,0). Rather than ship
|
|
66
|
+
* a tooltip that only behaves correctly on some MUI majors, we suppress it at
|
|
67
|
+
* the prop level — `open={false}` puts MUI's `Tooltip` into fully-controlled
|
|
68
|
+
* mode so it never opens, while the `<Tooltip>` element (and its modifier
|
|
69
|
+
* config) stays in the tree, deliberately *not removed*. Once the anchoring
|
|
70
|
+
* fix is confirmed across all supported MUI majors, removing `open={false}`
|
|
71
|
+
* re-enables the tooltip with no other changes needed. See the
|
|
72
|
+
* "Tooltip inside a clipped container" Storybook story for the anchoring repro
|
|
73
|
+
* and the `open={false}` suppression in context.
|
|
69
74
|
*/
|
|
70
75
|
const SingleSelectSearchApi = ({ props, variant, minSearchLength = 3, debounceMs = 300, fetchOptions, }) => {
|
|
71
76
|
// ── Stable references from props ──────────────────────────────────────────
|
|
@@ -206,30 +211,33 @@ const SingleSelectSearchApi = ({ props, variant, minSearchLength = 3, debounceMs
|
|
|
206
211
|
popper: { sx: { zIndex: 20000 } },
|
|
207
212
|
listbox: { sx: { fontSize: '11px' } },
|
|
208
213
|
}, PaperComponent: ({ children, ...paperProps }) => (jsx(Paper, { elevation: 4, ...paperProps, children: children })), renderInput: (params) => (jsx(Tooltip, { title: resolvedValue?.label ?? '', placement: "top-start", arrow: true, disableInteractive: true,
|
|
209
|
-
//
|
|
210
|
-
// pinned to the viewport's top-left corner when this field
|
|
211
|
-
// sits inside an `overflow: hidden` ancestor (e.g. a table
|
|
212
|
-
// cell in material-react-table / GenericPaginatedGrid).
|
|
214
|
+
// ── Tooltip intentionally suppressed via props (kept in the tree) ──
|
|
213
215
|
//
|
|
214
|
-
//
|
|
215
|
-
//
|
|
216
|
-
//
|
|
217
|
-
// `overflow: hidden`
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
//
|
|
216
|
+
// We previously tried to fix a Popper mis-anchoring bug where the
|
|
217
|
+
// tooltip rendered pinned to the viewport's top-left corner
|
|
218
|
+
// (`inset: 0 auto auto 0`) when this field sits inside an
|
|
219
|
+
// `overflow: hidden` ancestor (e.g. a table cell in
|
|
220
|
+
// `material-react-table` / `GenericPaginatedGrid`). The root
|
|
221
|
+
// cause is Popper's built-in `hide` modifier collapsing the
|
|
222
|
+
// popper once it judges the reference element "hidden" relative
|
|
223
|
+
// to the `clippingParents` boundary — and disabling that
|
|
224
|
+
// modifier (`{ name: 'hide', enabled: false }` below) verifiably
|
|
225
|
+
// fixed the anchoring in Storybook (MUI v7), but the SAME build
|
|
226
|
+
// still mis-anchored when consumed live in apps pinned to
|
|
227
|
+
// MUI v6 (`@mui/material@6.x` vs. our `>=7.3.1` peer
|
|
228
|
+
// requirement) — the v6 Popper/Tooltip runtime ignores/overrides
|
|
229
|
+
// the modifier configuration.
|
|
222
230
|
//
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
slotProps: {
|
|
231
|
+
// Rather than ship a tooltip that only works on some MUI majors,
|
|
232
|
+
// we suppress it at the component-prop level: `open={false}`
|
|
233
|
+
// forces MUI's Tooltip into fully-controlled mode and it will
|
|
234
|
+
// NEVER open (hover/focus listeners still attach but have no
|
|
235
|
+
// visual effect), so the broken Popper placement can never be
|
|
236
|
+
// observed. The `<Tooltip>` wrapper is deliberately *retained*
|
|
237
|
+
// (not removed) — flipping `open` back to the default
|
|
238
|
+
// (uncontrolled/hover-driven) is a one-line change once the
|
|
239
|
+
// anchoring is fixed for every supported MUI major.
|
|
240
|
+
open: false, slotProps: {
|
|
233
241
|
popper: {
|
|
234
242
|
sx: { zIndex: 20001 },
|
|
235
243
|
modifiers: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Calendar } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Calendar } from '../../../../../_virtual/index.esm5.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireDayCell } from '../DayCell/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateInput } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateInput } from '../../../../../_virtual/index.esm13.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateRange } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateRange } from '../../../../../_virtual/index.esm4.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireCalendar } from '../Calendar/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateRangePicker } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm6.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireDateRange } from '../DateRange/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DefinedRange } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DefinedRange } from '../../../../../_virtual/index.esm7.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireStyles } from '../../styles.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as InputRangeField } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as InputRangeField } from '../../../../../_virtual/index.esm14.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Month } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Month } from '../../../../../_virtual/index.esm12.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireDayCell } from '../DayCell/index.esm.js';
|