@telefonica/mistica 15.15.0 → 15.16.0
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/css/mistica.css +1 -1
- package/dist/callout.css-mistica.js +10 -3
- package/dist/callout.css.d.ts +2 -0
- package/dist/callout.d.ts +1 -0
- package/dist/callout.js +60 -55
- package/dist/community/advanced-data-card.d.ts +2 -1
- package/dist/community/advanced-data-card.js +28 -27
- package/dist/community/blocks.d.ts +11 -1
- package/dist/community/blocks.js +69 -51
- package/dist/fixed-footer-layout.js +29 -29
- package/dist/grid.css.d.ts +6 -6
- package/dist/hooks.d.ts +3 -1
- package/dist/hooks.js +85 -79
- package/dist/package-version.js +1 -1
- package/dist/table.css-mistica.js +15 -12
- package/dist/table.css.d.ts +1 -0
- package/dist/table.d.ts +1 -0
- package/dist/table.js +81 -75
- package/dist-es/callout.css-mistica.js +3 -2
- package/dist-es/callout.js +84 -79
- package/dist-es/community/advanced-data-card.js +62 -61
- package/dist-es/community/blocks.js +99 -81
- package/dist-es/fixed-footer-layout.js +53 -53
- package/dist-es/hooks.js +91 -85
- package/dist-es/package-version.js +1 -1
- package/dist-es/style.css +1 -1
- package/dist-es/table.css-mistica.js +2 -2
- package/dist-es/table.js +116 -110
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function() {
|
|
9
|
-
return
|
|
9
|
+
return Se;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -68,72 +68,72 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
68
68
|
}
|
|
69
69
|
return newObj;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const ie = (e)=>e === document.documentElement ? window : e, ne = (e)=>{
|
|
72
72
|
const l = setTimeout(e, 0);
|
|
73
73
|
return {
|
|
74
74
|
cancel: ()=>clearTimeout(l)
|
|
75
75
|
};
|
|
76
|
-
},
|
|
76
|
+
}, ce = 200, le = (param)=>{
|
|
77
77
|
let { isFooterVisible: e = !0, footer: l, footerHeight: k = "auto", footerBgColor: i = _skincontractcssmistica.vars.colors.background, containerBgColor: F = _skincontractcssmistica.vars.colors.background, children: L, onChangeFooterHeight: n } = param;
|
|
78
|
-
const [
|
|
78
|
+
const [$, g] = _react.useState(!1), d = _react.useRef(null), { height: m } = (0, _hooks.useBoundingRect)(d) || {
|
|
79
79
|
height: 0
|
|
80
|
-
}, { isTabletOrSmaller: u } = (0, _hooks.useScreenSize)(), { platformOverrides:
|
|
80
|
+
}, { isTabletOrSmaller: u } = (0, _hooks.useScreenSize)(), { platformOverrides: h } = (0, _hooks.useTheme)(), { height: r, ref: w } = (0, _hooks.useElementDimensions)({
|
|
81
|
+
includeMargins: !0
|
|
82
|
+
}), { visualHeight: D } = (0, _hooks.useWindowSize)(), s = (0, _fixedtotop.useFixedToTopHeight)(), t = D - s - r > ce, { topColor: I = i } = (0, _overscrollcolorcontext.useOverScrollColor)(), { height: x, ref: N } = (0, _hooks.useElementDimensions)();
|
|
81
83
|
(0, _hooks.useIsomorphicLayoutEffect)(()=>{
|
|
82
84
|
n == null || n(r);
|
|
83
85
|
}, [
|
|
84
86
|
n,
|
|
85
87
|
r
|
|
86
|
-
])
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (!u || (0, _platform.isRunningAcceptanceTest)(x) || !t) {
|
|
90
|
-
h(!1);
|
|
88
|
+
]), _react.useEffect(()=>{
|
|
89
|
+
if (!u || (0, _platform.isRunningAcceptanceTest)(h) || !t) {
|
|
90
|
+
g(!1);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
const f = (0, _dom.getScrollableParentElement)(
|
|
94
|
-
|
|
93
|
+
const f = (0, _dom.getScrollableParentElement)(d.current), A = ()=>(0, _dom.hasScroll)(f) && (0, _dom.getScrollDistanceToBottom)(f) > s + 1, o = (0, _helpers.debounce)(()=>{
|
|
94
|
+
g(A());
|
|
95
95
|
}, 50, {
|
|
96
96
|
leading: !0,
|
|
97
97
|
maxWait: 100
|
|
98
|
-
}),
|
|
98
|
+
}), B = ne(o), c = ie(f);
|
|
99
99
|
return (0, _dom.addPassiveEventListener)(c, "resize", o), (0, _dom.addPassiveEventListener)(c, "scroll", o), ()=>{
|
|
100
|
-
o.cancel(), (0, _dom.removePassiveEventListener)(c, "scroll", o), (0, _dom.removePassiveEventListener)(c, "resize", o),
|
|
100
|
+
o.cancel(), (0, _dom.removePassiveEventListener)(c, "scroll", o), (0, _dom.removePassiveEventListener)(c, "resize", o), B.cancel();
|
|
101
101
|
};
|
|
102
102
|
}, [
|
|
103
|
-
|
|
103
|
+
h,
|
|
104
104
|
u,
|
|
105
105
|
t,
|
|
106
106
|
// `topDistance` and `contentHeight` dependencies are needed to recalculate the elevation state
|
|
107
107
|
s,
|
|
108
|
-
|
|
108
|
+
m
|
|
109
109
|
]);
|
|
110
|
-
const
|
|
110
|
+
const R = ()=>/* @__PURE__ */ (0, _jsxruntime.jsxs)(_portal.Portal, {
|
|
111
111
|
className: _fixedfooterlayoutcssmistica.portal,
|
|
112
112
|
children: [
|
|
113
113
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
114
114
|
className: _fixedfooterlayoutcssmistica.fixedBackgroundLayer,
|
|
115
115
|
style: {
|
|
116
|
-
background: `linear-gradient(180deg, ${
|
|
116
|
+
background: `linear-gradient(180deg, ${I} 50%, ${i} 50% 100%)`
|
|
117
117
|
}
|
|
118
118
|
}),
|
|
119
119
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
120
|
-
ref:
|
|
120
|
+
ref: N,
|
|
121
121
|
className: _fixedfooterlayoutcssmistica.absoluteBackgroundLayer,
|
|
122
122
|
style: {
|
|
123
123
|
background: F,
|
|
124
124
|
// this color could be a gradient
|
|
125
125
|
top: s - 1,
|
|
126
126
|
// -1 because the navigationbar could have a 1px transparent background
|
|
127
|
-
bottom: t ?
|
|
128
|
-
height: t ? "unset" :
|
|
127
|
+
bottom: t ? r : "unset",
|
|
128
|
+
height: t ? "unset" : m
|
|
129
129
|
}
|
|
130
130
|
}),
|
|
131
131
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
132
132
|
className: _fixedfooterlayoutcssmistica.absoluteBackgroundLayer,
|
|
133
133
|
style: {
|
|
134
134
|
background: i,
|
|
135
|
-
top:
|
|
136
|
-
height: `calc(${
|
|
135
|
+
top: x + s - 1,
|
|
136
|
+
height: `calc(${m}px - ${x}px)`
|
|
137
137
|
}
|
|
138
138
|
})
|
|
139
139
|
]
|
|
@@ -141,20 +141,20 @@ const ne = (e)=>e === document.documentElement ? window : e, ce = (e)=>{
|
|
|
141
141
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
142
142
|
children: [
|
|
143
143
|
/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
144
|
-
ref:
|
|
144
|
+
ref: d,
|
|
145
145
|
className: _fixedfooterlayoutcssmistica.container,
|
|
146
146
|
style: (0, _css.applyCssVars)({
|
|
147
|
-
[_fixedfooterlayoutcssmistica.vars.footerHeight]: t ?
|
|
147
|
+
[_fixedfooterlayoutcssmistica.vars.footerHeight]: t ? `${r}px` : "0px"
|
|
148
148
|
}),
|
|
149
149
|
children: [
|
|
150
|
-
|
|
150
|
+
R(),
|
|
151
151
|
L
|
|
152
152
|
]
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
155
155
|
className: (0, _classnames.default)(_fixedfooterlayoutcssmistica.footer, {
|
|
156
156
|
[_fixedfooterlayoutcssmistica.withoutFooter]: !e,
|
|
157
|
-
[_fixedfooterlayoutcssmistica.elevated]:
|
|
157
|
+
[_fixedfooterlayoutcssmistica.elevated]: $,
|
|
158
158
|
[_fixedfooterlayoutcssmistica.fixedFooter]: t
|
|
159
159
|
}),
|
|
160
160
|
style: {
|
|
@@ -163,7 +163,7 @@ const ne = (e)=>e === document.documentElement ? window : e, ce = (e)=>{
|
|
|
163
163
|
"data-testid": `fixed-footer${e ? "-visible" : "-hidden"}`,
|
|
164
164
|
"data-position-fixed": "bottom",
|
|
165
165
|
children: e && /* @__PURE__ */ (0, _jsxruntime.jsx)("aside", {
|
|
166
|
-
ref:
|
|
166
|
+
ref: w,
|
|
167
167
|
"data-component-name": "FixedFooter",
|
|
168
168
|
style: {
|
|
169
169
|
height: k,
|
|
@@ -174,4 +174,4 @@ const ne = (e)=>e === document.documentElement ? window : e, ce = (e)=>{
|
|
|
174
174
|
})
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
|
-
},
|
|
177
|
+
}, Se = le;
|
package/dist/grid.css.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare const vars: {
|
|
|
7
7
|
export declare const grid: string;
|
|
8
8
|
export declare const gridTemplateColumnsAutoRepeat: string;
|
|
9
9
|
export declare const gridTemplateRowsAutoRepeat: string;
|
|
10
|
-
export declare const gridTemplateColumns: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
11
|
-
export declare const gridTemplateRows: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
10
|
+
export declare const gridTemplateColumns: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
11
|
+
export declare const gridTemplateRows: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
12
12
|
export declare const gridAutoFlow: Record<"column" | "row" | "row dense" | "column dense", string>;
|
|
13
13
|
export declare const gridJustifyItems: Record<"stretch" | "center" | "end" | "start", string>;
|
|
14
14
|
export declare const gridAlignItems: Record<"stretch" | "center" | "end" | "start" | "baseline", string>;
|
|
@@ -16,9 +16,9 @@ export declare const gridJustifyContent: Record<"space-around" | "space-between"
|
|
|
16
16
|
export declare const gridAlignContent: Record<"space-around" | "space-between" | "space-evenly" | "stretch" | "center" | "end" | "start", string>;
|
|
17
17
|
export declare const fullColumns: string;
|
|
18
18
|
export declare const fullRows: string;
|
|
19
|
-
export declare const spanColumns: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
20
|
-
export declare const spanRows: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
21
|
-
export declare const columnStart: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
22
|
-
export declare const rowStart: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 |
|
|
19
|
+
export declare const spanColumns: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
20
|
+
export declare const spanRows: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
21
|
+
export declare const columnStart: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
22
|
+
export declare const rowStart: Record<1 | 2 | 4 | 8 | 12 | 5 | 6 | 3 | 10 | 9 | 7 | 11, string>;
|
|
23
23
|
export declare const justifySelf: Record<"stretch" | "center" | "end" | "start", string>;
|
|
24
24
|
export declare const alignSelf: Record<"stretch" | "center" | "end" | "start" | "baseline", string>;
|
package/dist/hooks.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ import type { ScreenSizeContextType } from './screen-size-context';
|
|
|
4
4
|
export declare const useTheme: () => Theme;
|
|
5
5
|
export declare const useDisableBodyScroll: (disable: boolean) => void;
|
|
6
6
|
export declare const useScreenSize: () => ScreenSizeContextType;
|
|
7
|
-
export declare const useElementDimensions: (
|
|
7
|
+
export declare const useElementDimensions: ({ includeMargins }?: {
|
|
8
|
+
includeMargins?: boolean;
|
|
9
|
+
}) => {
|
|
8
10
|
width: number;
|
|
9
11
|
height: number;
|
|
10
12
|
ref: (node: HTMLElement | null) => void;
|
package/dist/hooks.js
CHANGED
|
@@ -10,37 +10,37 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
useAriaId: function() {
|
|
13
|
-
return
|
|
13
|
+
return $;
|
|
14
14
|
},
|
|
15
15
|
useBoundingRect: function() {
|
|
16
|
-
return
|
|
16
|
+
return P;
|
|
17
17
|
},
|
|
18
18
|
useDisableBodyScroll: function() {
|
|
19
|
-
return
|
|
19
|
+
return M;
|
|
20
20
|
},
|
|
21
21
|
useElementDimensions: function() {
|
|
22
|
-
return
|
|
22
|
+
return F;
|
|
23
23
|
},
|
|
24
24
|
useIsInViewport: function() {
|
|
25
|
-
return
|
|
25
|
+
return B;
|
|
26
26
|
},
|
|
27
27
|
useIsomorphicLayoutEffect: function() {
|
|
28
|
-
return
|
|
28
|
+
return O;
|
|
29
29
|
},
|
|
30
30
|
useScreenSize: function() {
|
|
31
|
-
return
|
|
31
|
+
return k;
|
|
32
32
|
},
|
|
33
33
|
useTheme: function() {
|
|
34
|
-
return
|
|
34
|
+
return C;
|
|
35
35
|
},
|
|
36
36
|
useWindowHeight: function() {
|
|
37
|
-
return
|
|
37
|
+
return j;
|
|
38
38
|
},
|
|
39
39
|
useWindowSize: function() {
|
|
40
|
-
return
|
|
40
|
+
return y;
|
|
41
41
|
},
|
|
42
42
|
useWindowWidth: function() {
|
|
43
|
-
return
|
|
43
|
+
return G;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
@@ -96,157 +96,163 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
96
96
|
}
|
|
97
97
|
return newObj;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const C = ()=>{
|
|
100
100
|
const t = _react.useContext(_themecontext.default);
|
|
101
101
|
if (!t) throw Error("To use @telefonica/mistica components you must instantiate <ThemeContextProvider> as their parent.");
|
|
102
102
|
return t;
|
|
103
103
|
};
|
|
104
|
-
let
|
|
105
|
-
const
|
|
104
|
+
let f = "", S = 0, g = 0;
|
|
105
|
+
const M = (t)=>{
|
|
106
106
|
_react.useEffect(()=>{
|
|
107
107
|
if (t) {
|
|
108
|
-
const
|
|
108
|
+
const r = document.scrollingElement || document.documentElement, e = ()=>{
|
|
109
109
|
var i;
|
|
110
110
|
var _ref, _ref1;
|
|
111
|
-
if (
|
|
111
|
+
if (g++, !(g > 1) && (S = (_ref = r == null ? void 0 : r.scrollTop) !== null && _ref !== void 0 ? _ref : 0, f = (_ref1 = (i = document.body) == null ? void 0 : i.style.cssText) !== null && _ref1 !== void 0 ? _ref1 : "", document.body)) {
|
|
112
112
|
var _ref2;
|
|
113
|
-
const o = window.innerWidth > ((_ref2 =
|
|
114
|
-
document.body.style.cssText =
|
|
113
|
+
const o = window.innerWidth > ((_ref2 = r == null ? void 0 : r.clientWidth) !== null && _ref2 !== void 0 ? _ref2 : window.innerWidth) ? "scroll" : "hidden";
|
|
114
|
+
document.body.style.cssText = f + (f.endsWith(";") ? "" : ";") + [
|
|
115
115
|
"overflow: hidden;",
|
|
116
116
|
`overflow-y: ${o};`,
|
|
117
117
|
"position: fixed;",
|
|
118
|
-
`top: ${-
|
|
118
|
+
`top: ${-S}px;`,
|
|
119
119
|
"left: 0px;",
|
|
120
120
|
"right: 0px;",
|
|
121
121
|
"bottom: 0px;",
|
|
122
122
|
"overscroll-behavior-y: contain;"
|
|
123
123
|
].join("");
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
|
|
125
|
+
}, c = ()=>{
|
|
126
|
+
g--, !(g > 0) && (document.body && (document.body.style.cssText = f), r && (r.scrollTop = S));
|
|
127
127
|
};
|
|
128
|
-
return e(),
|
|
128
|
+
return e(), c;
|
|
129
129
|
}
|
|
130
130
|
return ()=>{};
|
|
131
131
|
}, [
|
|
132
132
|
t
|
|
133
133
|
]);
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
}, k = ()=>_react.useContext(_screensizecontext.default), F = function() {
|
|
135
|
+
let { includeMargins: t = !1 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
136
|
+
const [r, e] = _react.useState(0), [c, i] = _react.useState(0), [s, o] = _react.useState(null), d = _react.useCallback((a)=>{
|
|
137
|
+
if (!a) {
|
|
138
|
+
e(0), i(0);
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
|
-
const { width:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
const { width: w, height: m } = a[0].contentRect;
|
|
142
|
+
if (t) {
|
|
143
|
+
const h = window.getComputedStyle(a[0].target), v = parseInt(h.marginTop, 10), b = parseInt(h.marginBottom, 10), W = parseInt(h.marginLeft, 10), x = parseInt(h.marginRight, 10);
|
|
144
|
+
e(w + W + x), i(m + v + b);
|
|
145
|
+
} else e(w), i(m);
|
|
146
|
+
}, [
|
|
147
|
+
t
|
|
148
|
+
]), u = _react.useCallback((a)=>{
|
|
149
|
+
o(a);
|
|
144
150
|
}, []);
|
|
145
151
|
return _react.useEffect(()=>{
|
|
146
|
-
if (!
|
|
147
|
-
|
|
152
|
+
if (!s) {
|
|
153
|
+
e(0), i(0);
|
|
148
154
|
return;
|
|
149
155
|
}
|
|
150
|
-
return (0, _dom.listenResize)(
|
|
156
|
+
return (0, _dom.listenResize)(s, d);
|
|
151
157
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
158
|
+
s,
|
|
159
|
+
d
|
|
154
160
|
]), {
|
|
155
|
-
width:
|
|
156
|
-
height:
|
|
161
|
+
width: r,
|
|
162
|
+
height: c,
|
|
157
163
|
ref: u
|
|
158
164
|
};
|
|
159
|
-
},
|
|
160
|
-
const { useId:
|
|
161
|
-
if (
|
|
162
|
-
const e =
|
|
165
|
+
}, $ = (t)=>{
|
|
166
|
+
const { useId: r } = C();
|
|
167
|
+
if (r) {
|
|
168
|
+
const e = r();
|
|
163
169
|
return t || e;
|
|
164
170
|
} else {
|
|
165
171
|
const e = _react.useContext(_ariaidgettercontext.default);
|
|
166
172
|
return _react.useRef(t || e()).current;
|
|
167
173
|
}
|
|
168
|
-
},
|
|
169
|
-
var
|
|
170
|
-
const [t,
|
|
174
|
+
}, y = ()=>{
|
|
175
|
+
var w;
|
|
176
|
+
const [t, r] = _react.useState((0, _environment.isClientSide)() ? window.innerHeight : 1200), [e, c] = _react.useState((0, _environment.isClientSide)() ? window.innerWidth : 800), [i, s] = _react.useState((0, _environment.isClientSide)() ? window.screen.availHeight : 1200), [o, d] = _react.useState((0, _environment.isClientSide)() ? window.screen.availWidth : 800), [u, a] = _react.useState((0, _environment.isClientSide)() ? ((w = window.visualViewport) == null ? void 0 : w.height) || window.screen.availHeight : 1200);
|
|
171
177
|
return _react.useEffect(()=>{
|
|
172
|
-
const
|
|
173
|
-
var
|
|
174
|
-
|
|
178
|
+
const m = ()=>{
|
|
179
|
+
var h;
|
|
180
|
+
r(window.innerHeight), c(window.innerWidth), s(window.screen.availHeight), d(window.screen.availWidth), a(((h = window.visualViewport) == null ? void 0 : h.height) || window.screen.availHeight);
|
|
175
181
|
};
|
|
176
|
-
return window.addEventListener("resize",
|
|
177
|
-
window.removeEventListener("resize",
|
|
182
|
+
return window.addEventListener("resize", m), ()=>{
|
|
183
|
+
window.removeEventListener("resize", m);
|
|
178
184
|
};
|
|
179
185
|
}, []), _react.useMemo(()=>({
|
|
180
186
|
height: t,
|
|
181
187
|
width: e,
|
|
182
188
|
screenHeight: i,
|
|
183
189
|
screenWidth: o,
|
|
184
|
-
visualHeight:
|
|
190
|
+
visualHeight: u
|
|
185
191
|
}), [
|
|
186
192
|
t,
|
|
187
193
|
e,
|
|
188
194
|
i,
|
|
189
195
|
o,
|
|
190
|
-
|
|
196
|
+
u
|
|
191
197
|
]);
|
|
192
|
-
},
|
|
193
|
-
const { height: t } =
|
|
198
|
+
}, j = ()=>{
|
|
199
|
+
const { height: t } = y();
|
|
194
200
|
return t;
|
|
195
|
-
},
|
|
196
|
-
const { width: t } =
|
|
201
|
+
}, G = ()=>{
|
|
202
|
+
const { width: t } = y();
|
|
197
203
|
return t;
|
|
198
|
-
},
|
|
199
|
-
const [
|
|
204
|
+
}, O = (0, _environment.isClientSide)() ? _react.useLayoutEffect : _react.useEffect, B = (t, r, e)=>{
|
|
205
|
+
const [c, i] = _react.useState(r);
|
|
200
206
|
return _react.useEffect(()=>{
|
|
201
207
|
if (!t.current) return;
|
|
202
208
|
if (typeof window.IntersectionObserver > "u") return ()=>{};
|
|
203
|
-
const
|
|
209
|
+
const s = new IntersectionObserver((o)=>{
|
|
204
210
|
i(o[0].isIntersecting);
|
|
205
211
|
}, {
|
|
206
212
|
root: e == null ? void 0 : e.root,
|
|
207
213
|
rootMargin: e == null ? void 0 : e.rootMargin,
|
|
208
214
|
threshold: e == null ? void 0 : e.threshold
|
|
209
215
|
});
|
|
210
|
-
return
|
|
211
|
-
|
|
216
|
+
return s.observe(t.current), ()=>{
|
|
217
|
+
s.disconnect();
|
|
212
218
|
};
|
|
213
219
|
}, [
|
|
214
220
|
t,
|
|
215
221
|
e == null ? void 0 : e.root,
|
|
216
222
|
e == null ? void 0 : e.rootMargin,
|
|
217
223
|
e == null ? void 0 : e.threshold
|
|
218
|
-
]),
|
|
219
|
-
},
|
|
220
|
-
const { top:
|
|
224
|
+
]), c;
|
|
225
|
+
}, z = (t)=>{
|
|
226
|
+
const { top: r, right: e, bottom: c, left: i, width: s, height: o, x: d, y: u } = t.getBoundingClientRect();
|
|
221
227
|
return {
|
|
222
|
-
top:
|
|
228
|
+
top: r,
|
|
223
229
|
right: e,
|
|
224
|
-
bottom:
|
|
230
|
+
bottom: c,
|
|
225
231
|
left: i,
|
|
226
|
-
width:
|
|
232
|
+
width: s,
|
|
227
233
|
height: o,
|
|
228
|
-
x:
|
|
229
|
-
y:
|
|
234
|
+
x: d,
|
|
235
|
+
y: u
|
|
230
236
|
};
|
|
231
|
-
},
|
|
232
|
-
let
|
|
233
|
-
const [
|
|
237
|
+
}, P = function(t) {
|
|
238
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
239
|
+
const [c, i] = _react.useState(), s = B(t, !1);
|
|
234
240
|
return _react.useEffect(()=>{
|
|
235
241
|
let o;
|
|
236
|
-
const
|
|
237
|
-
if (t.current && (
|
|
238
|
-
const
|
|
239
|
-
(0, _helpers.isEqual)(
|
|
242
|
+
const d = ()=>{
|
|
243
|
+
if (t.current && (s || e)) {
|
|
244
|
+
const u = z(t.current);
|
|
245
|
+
(0, _helpers.isEqual)(c, u) || i(u), r && (o = requestAnimationFrame(d));
|
|
240
246
|
} else i(void 0);
|
|
241
247
|
};
|
|
242
|
-
return o = requestAnimationFrame(
|
|
248
|
+
return o = requestAnimationFrame(d), ()=>{
|
|
243
249
|
cancelAnimationFrame(o);
|
|
244
250
|
};
|
|
245
251
|
}, [
|
|
246
252
|
t,
|
|
247
|
-
s,
|
|
248
253
|
c,
|
|
249
|
-
|
|
254
|
+
s,
|
|
255
|
+
r,
|
|
250
256
|
e
|
|
251
|
-
]),
|
|
257
|
+
]), c;
|
|
252
258
|
};
|
package/dist/package-version.js
CHANGED
|
@@ -21,35 +21,38 @@ _export(exports, {
|
|
|
21
21
|
cellTextAlign: function() {
|
|
22
22
|
return k;
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
collapsedRowHeaderItem: function() {
|
|
25
25
|
return _;
|
|
26
26
|
},
|
|
27
|
+
collapsedRowTitle: function() {
|
|
28
|
+
return v;
|
|
29
|
+
},
|
|
27
30
|
collapsedRowsInMobile: function() {
|
|
28
31
|
return i;
|
|
29
32
|
},
|
|
30
33
|
fullWidth: function() {
|
|
31
|
-
return
|
|
34
|
+
return s;
|
|
32
35
|
},
|
|
33
36
|
hiddenHeadersInDesktop: function() {
|
|
34
|
-
return
|
|
37
|
+
return d;
|
|
35
38
|
},
|
|
36
39
|
hiddenHeadersInMobile: function() {
|
|
37
|
-
return
|
|
40
|
+
return n;
|
|
38
41
|
},
|
|
39
42
|
mobileCellHeading: function() {
|
|
40
|
-
return
|
|
43
|
+
return c;
|
|
41
44
|
},
|
|
42
45
|
rowFirstItem: function() {
|
|
43
|
-
return
|
|
46
|
+
return p;
|
|
44
47
|
},
|
|
45
48
|
rowLastCollapsedItem: function() {
|
|
46
|
-
return
|
|
49
|
+
return m;
|
|
47
50
|
},
|
|
48
51
|
rowLastItem: function() {
|
|
49
|
-
return
|
|
52
|
+
return b;
|
|
50
53
|
},
|
|
51
54
|
scrollContainer: function() {
|
|
52
|
-
return
|
|
55
|
+
return I;
|
|
53
56
|
},
|
|
54
57
|
scrollOverResponsiveLayout: function() {
|
|
55
58
|
return g;
|
|
@@ -58,10 +61,10 @@ _export(exports, {
|
|
|
58
61
|
return h;
|
|
59
62
|
},
|
|
60
63
|
topActions: function() {
|
|
61
|
-
return
|
|
64
|
+
return w;
|
|
62
65
|
},
|
|
63
66
|
vars: function() {
|
|
64
|
-
return
|
|
67
|
+
return H;
|
|
65
68
|
},
|
|
66
69
|
verticalAlign: function() {
|
|
67
70
|
return x;
|
|
@@ -74,7 +77,7 @@ var r = "_107ok88f", l = "_107ok88g", t = "_107ok886", k = {
|
|
|
74
77
|
left: "_107ok888 _107ok887",
|
|
75
78
|
right: "_107ok889 _107ok887",
|
|
76
79
|
center: "_107ok88a _107ok887"
|
|
77
|
-
}, _ = "
|
|
80
|
+
}, _ = "_107ok88i", v = "_107ok88k", i = "_107ok883", s = "_107ok882", d = "_107ok885", n = "_107ok884", c = "_107ok88j", p = "_107ok88l", m = "_107ok88n", b = "_107ok88m", I = "_107ok88b", g = "_107ok88c", h = "_107ok881", w = "_107ok88h", H = {
|
|
78
81
|
maxHeight: "var(--_107ok880)"
|
|
79
82
|
}, x = {
|
|
80
83
|
top: "_107ok88d",
|
package/dist/table.css.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const verticalAlign: Record<"top" | "middle", string>;
|
|
|
14
14
|
export declare const actionsHeaderText: string;
|
|
15
15
|
export declare const actionsTableCell: string;
|
|
16
16
|
export declare const topActions: string;
|
|
17
|
+
export declare const collapsedRowHeaderItem: string;
|
|
17
18
|
export declare const mobileCellHeading: string;
|
|
18
19
|
export declare const collapsedRowTitle: string;
|
|
19
20
|
export declare const rowFirstItem: string;
|
package/dist/table.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ type TableProps = {
|
|
|
39
39
|
hideHeaders?: boolean | 'desktop' | 'mobile';
|
|
40
40
|
/** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
|
|
41
41
|
dataAttributes?: DataAttributes;
|
|
42
|
+
rowHeaderIndex?: number;
|
|
42
43
|
'aria-label'?: string;
|
|
43
44
|
'aria-labelledby'?: string;
|
|
44
45
|
'aria-describedby'?: string;
|