@telefonica/mistica 15.15.0 → 15.16.1
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 +83 -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 +118 -110
- package/package.json +1 -1
package/dist-es/table.js
CHANGED
|
@@ -77,30 +77,30 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
import { jsxs as
|
|
81
|
-
import * as
|
|
82
|
-
import { getPrefixedDataAttributes as
|
|
83
|
-
import { table as
|
|
84
|
-
import { vars as
|
|
85
|
-
import
|
|
86
|
-
import { InternalBoxed as
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import { applyCssVars as
|
|
90
|
-
import
|
|
91
|
-
import { IconButton as
|
|
92
|
-
import { iconContainerSize as
|
|
93
|
-
import { TableActionsHeader as
|
|
94
|
-
const
|
|
80
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
81
|
+
import * as O from "react";
|
|
82
|
+
import { getPrefixedDataAttributes as X } from "./utils/dom.js";
|
|
83
|
+
import { table as V, boxed as W, collapsedRowsInMobile as M, fullWidth as E, hiddenHeadersInDesktop as ee, hiddenHeadersInMobile as te, cellTextAlign as H, verticalAlign as L, rowFirstItem as N, rowLastItem as R, rowLastCollapsedItem as Y, collapsedRowHeaderItem as le, mobileCellHeading as re, collapsedRowTitle as ae, actionsTableCell as _, topActions as oe, scrollContainer as se, scrollOverResponsiveLayout as ne, vars as ie } from "./table.css-mistica.js";
|
|
84
|
+
import { vars as j } from "./skins/skin-contract.css-mistica.js";
|
|
85
|
+
import ce, { Text1 as F, textProps as h, Text2 as me } from "./text.js";
|
|
86
|
+
import { InternalBoxed as pe } from "./boxed.js";
|
|
87
|
+
import c from "classnames";
|
|
88
|
+
import de from "./box.js";
|
|
89
|
+
import { applyCssVars as he } from "./utils/css.js";
|
|
90
|
+
import be from "./inline.js";
|
|
91
|
+
import { IconButton as ue, ToggleIconButton as ge } from "./icon-button.js";
|
|
92
|
+
import { iconContainerSize as G, iconSize as ye } from "./icon-button.css-mistica.js";
|
|
93
|
+
import { TableActionsHeader as fe } from "./table-actions-header.js";
|
|
94
|
+
const P = {
|
|
95
95
|
default: "8px",
|
|
96
96
|
boxed: "16px"
|
|
97
|
-
},
|
|
97
|
+
}, Z = "1px", ke = (a)=>a.Icon ? /* @__PURE__ */ e(ue, _object_spread_props(_object_spread({}, a), {
|
|
98
98
|
"aria-label": a.label,
|
|
99
99
|
small: !0,
|
|
100
100
|
type: "neutral",
|
|
101
101
|
backgroundType: "transparent",
|
|
102
102
|
bleedY: !0
|
|
103
|
-
})) : /* @__PURE__ */ e(
|
|
103
|
+
})) : /* @__PURE__ */ e(ge, _object_spread_props(_object_spread({}, a), {
|
|
104
104
|
checkedProps: _object_spread_props(_object_spread({}, a.checkedProps), {
|
|
105
105
|
"aria-label": a.checkedProps.label,
|
|
106
106
|
type: "brand",
|
|
@@ -113,8 +113,8 @@ const C = {
|
|
|
113
113
|
}),
|
|
114
114
|
small: !0,
|
|
115
115
|
bleedY: !0
|
|
116
|
-
})),
|
|
117
|
-
var { dataAttributes: a, heading:
|
|
116
|
+
})), q = "left", xe = /*#__PURE__*/ O.forwardRef((_param, $)=>{
|
|
117
|
+
var { dataAttributes: a, heading: m = [], content: k = [], boxed: b, responsive: J, fullWidth: u = !0, maxHeight: v, emptyCase: A, columnTextAlign: T = q, rowVerticalAlign: C = "middle", columnWidth: p, hideHeaders: g, scrollOverResponsiveLayout: K, rowHeaderIndex: s } = _param, S = _object_without_properties(_param, [
|
|
118
118
|
"dataAttributes",
|
|
119
119
|
"heading",
|
|
120
120
|
"content",
|
|
@@ -127,177 +127,185 @@ const C = {
|
|
|
127
127
|
"rowVerticalAlign",
|
|
128
128
|
"columnWidth",
|
|
129
129
|
"hideHeaders",
|
|
130
|
-
"scrollOverResponsiveLayout"
|
|
130
|
+
"scrollOverResponsiveLayout",
|
|
131
|
+
"rowHeaderIndex"
|
|
131
132
|
]);
|
|
132
|
-
const
|
|
133
|
-
var
|
|
134
|
-
return Array.isArray(
|
|
135
|
-
},
|
|
136
|
-
className:
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
133
|
+
const z = (l)=>{
|
|
134
|
+
var _T_l;
|
|
135
|
+
return Array.isArray(T) ? (_T_l = T[l]) !== null && _T_l !== void 0 ? _T_l : q : T;
|
|
136
|
+
}, r = J === "collapse-rows", B = g === !0 || g === "mobile", Q = g === !0 || g === "desktop", y = k.some((l)=>!Array.isArray(l) && l.actions.length > 0), w = /* @__PURE__ */ f("table", {
|
|
137
|
+
className: c(V, {
|
|
138
|
+
[W]: b,
|
|
139
|
+
[M]: r,
|
|
140
|
+
[E]: u,
|
|
141
|
+
[ee]: Q,
|
|
142
|
+
[te]: B || r
|
|
142
143
|
}),
|
|
143
|
-
"aria-label":
|
|
144
|
-
"aria-labelledby":
|
|
145
|
-
"aria-describedby":
|
|
144
|
+
"aria-label": S["aria-label"],
|
|
145
|
+
"aria-labelledby": S["aria-labelledby"],
|
|
146
|
+
"aria-describedby": S["aria-describedby"],
|
|
146
147
|
children: [
|
|
147
|
-
|
|
148
|
-
children: /* @__PURE__ */
|
|
148
|
+
m.length > 0 && /* @__PURE__ */ e("thead", {
|
|
149
|
+
children: /* @__PURE__ */ f(F, {
|
|
149
150
|
as: "tr",
|
|
150
151
|
medium: !0,
|
|
151
152
|
transform: "uppercase",
|
|
152
|
-
color:
|
|
153
|
+
color: j.colors.textSecondary,
|
|
153
154
|
wordBreak: !1,
|
|
154
155
|
children: [
|
|
155
|
-
|
|
156
|
+
m.map((l, o)=>/* @__PURE__ */ e("th", {
|
|
156
157
|
scope: "col",
|
|
157
|
-
className:
|
|
158
|
+
className: c(H[z(o)], L[C], {
|
|
158
159
|
[N]: o === 0,
|
|
159
|
-
[
|
|
160
|
+
[R]: o === m.length - 1 && !y
|
|
160
161
|
}),
|
|
161
162
|
style: {
|
|
162
|
-
minWidth:
|
|
163
|
-
width:
|
|
163
|
+
minWidth: p == null ? void 0 : p[o],
|
|
164
|
+
width: p == null ? void 0 : p[o]
|
|
164
165
|
},
|
|
165
|
-
children:
|
|
166
|
+
children: l
|
|
166
167
|
}, o)),
|
|
167
|
-
|
|
168
|
+
y && /* @__PURE__ */ e(fe, {})
|
|
168
169
|
]
|
|
169
170
|
})
|
|
170
171
|
}),
|
|
171
172
|
/* @__PURE__ */ e("tbody", {
|
|
172
|
-
children:
|
|
173
|
-
var
|
|
174
|
-
const
|
|
173
|
+
children: k.length > 0 ? k.map((l, o)=>{
|
|
174
|
+
var _l_actions;
|
|
175
|
+
const n = Array.isArray(l) ? l : l.cells, i = Array.isArray(l) ? [] : (_l_actions = l.actions) !== null && _l_actions !== void 0 ? _l_actions : [], D = /* @__PURE__ */ e(be, {
|
|
175
176
|
space: 16,
|
|
176
|
-
children:
|
|
177
|
-
|
|
177
|
+
children: i.map((d, t)=>"Icon" in d || "checkedProps" in d ? /* @__PURE__ */ e(ke, _object_spread({}, d), t) : /* @__PURE__ */ e(O.Fragment, {
|
|
178
|
+
children: d
|
|
179
|
+
}, t))
|
|
180
|
+
}), I = i.length ? `calc(${G.small} * ${i.length} + 16px * ${i.length - 1})` : "0px";
|
|
178
181
|
return(// Add position relative because in collapse-rows mode, actions are positioned absolutely in the row
|
|
179
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ f("tr", {
|
|
180
183
|
style: {
|
|
181
184
|
position: "relative"
|
|
182
185
|
},
|
|
183
186
|
children: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
[
|
|
187
|
+
n.map((d, t)=>{
|
|
188
|
+
const U = s === n.length - 1 ? t === n.length - 2 || n.length === 1 : t === n.length - 1;
|
|
189
|
+
return /* @__PURE__ */ f(t === s ? "th" : "td", {
|
|
190
|
+
className: c(L[C], {
|
|
191
|
+
[N]: t === 0,
|
|
192
|
+
[R]: t === n.length - 1 && !y,
|
|
193
|
+
[Y]: U && r,
|
|
194
|
+
[le]: t === s && r
|
|
189
195
|
}),
|
|
190
196
|
style: {
|
|
191
197
|
// add space between top actions and content
|
|
192
|
-
marginRight:
|
|
198
|
+
marginRight: r && i.length ? `calc(${I} + 8px)` : void 0
|
|
193
199
|
},
|
|
200
|
+
scope: t === s ? "row" : void 0,
|
|
194
201
|
children: [
|
|
195
|
-
|
|
202
|
+
t !== s && r && m[t] && !B && // this is aria-hidden because screen readers already read the column heading from the th
|
|
196
203
|
/* @__PURE__ */ e("div", {
|
|
197
|
-
className:
|
|
204
|
+
className: re,
|
|
198
205
|
"aria-hidden": !0,
|
|
199
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
children: /* @__PURE__ */ e(F, {
|
|
200
207
|
medium: !0,
|
|
201
|
-
color:
|
|
202
|
-
children:
|
|
208
|
+
color: j.colors.textSecondary,
|
|
209
|
+
children: m[t]
|
|
203
210
|
})
|
|
204
211
|
}),
|
|
205
|
-
/* @__PURE__ */ e(
|
|
206
|
-
desktopSize:
|
|
207
|
-
desktopLineHeight:
|
|
208
|
-
},
|
|
209
|
-
mobileSize:
|
|
210
|
-
mobileLineHeight:
|
|
212
|
+
/* @__PURE__ */ e(ce, _object_spread_props(_object_spread({
|
|
213
|
+
desktopSize: h.text2.desktopSize,
|
|
214
|
+
desktopLineHeight: h.text2.desktopLineHeight
|
|
215
|
+
}, t === s && r ? {
|
|
216
|
+
mobileSize: h.text4.mobileSize,
|
|
217
|
+
mobileLineHeight: h.text4.mobileLineHeight
|
|
211
218
|
} : {
|
|
212
|
-
mobileSize:
|
|
213
|
-
mobileLineHeight:
|
|
219
|
+
mobileSize: h.text2.mobileSize,
|
|
220
|
+
mobileLineHeight: h.text2.mobileLineHeight
|
|
214
221
|
}), {
|
|
215
222
|
as: "div",
|
|
216
223
|
wordBreak: !1,
|
|
217
224
|
children: /* @__PURE__ */ e("div", {
|
|
218
|
-
className:
|
|
219
|
-
[
|
|
225
|
+
className: c(H[z(t)], {
|
|
226
|
+
[ae]: t === s && r
|
|
220
227
|
}),
|
|
221
228
|
children: d
|
|
222
229
|
})
|
|
223
230
|
}))
|
|
224
231
|
]
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
232
|
+
}, t);
|
|
233
|
+
}),
|
|
234
|
+
i.length > 0 ? /* @__PURE__ */ e("td", {
|
|
235
|
+
className: c(L[C], _, R, {
|
|
236
|
+
[N]: n.length === 0
|
|
229
237
|
}),
|
|
230
238
|
align: "right",
|
|
231
239
|
style: {
|
|
232
|
-
width: `calc(${
|
|
240
|
+
width: `calc(${I} + 12px)`
|
|
233
241
|
},
|
|
234
|
-
children:
|
|
235
|
-
}) :
|
|
236
|
-
className:
|
|
242
|
+
children: D
|
|
243
|
+
}) : y && /* @__PURE__ */ e("td", {
|
|
244
|
+
className: _
|
|
237
245
|
}),
|
|
238
|
-
|
|
239
|
-
className:
|
|
246
|
+
r && i.length > 0 && /* @__PURE__ */ e("td", {
|
|
247
|
+
className: oe,
|
|
240
248
|
style: {
|
|
241
249
|
position: "absolute",
|
|
242
|
-
top: `calc(${
|
|
243
|
-
right:
|
|
244
|
-
width:
|
|
250
|
+
top: `calc(${b ? P.boxed : P.default} - ${Z} + (${G.small} - ${ye.small}) / 2)`,
|
|
251
|
+
right: b ? `calc(${P.boxed} - ${Z})` : 0,
|
|
252
|
+
width: I
|
|
245
253
|
},
|
|
246
|
-
children:
|
|
254
|
+
children: D
|
|
247
255
|
})
|
|
248
256
|
]
|
|
249
257
|
}, o));
|
|
250
258
|
}) : /* @__PURE__ */ e("tr", {
|
|
251
259
|
children: /* @__PURE__ */ e("td", {
|
|
252
|
-
colSpan:
|
|
253
|
-
className:
|
|
254
|
-
[
|
|
260
|
+
colSpan: m.length,
|
|
261
|
+
className: c({
|
|
262
|
+
[Y]: r
|
|
255
263
|
}),
|
|
256
|
-
children: typeof
|
|
264
|
+
children: typeof A == "string" ? /* @__PURE__ */ e(de, {
|
|
257
265
|
paddingY: 56,
|
|
258
|
-
children: /* @__PURE__ */ e(
|
|
266
|
+
children: /* @__PURE__ */ e(me, {
|
|
259
267
|
regular: !0,
|
|
260
268
|
textAlign: "center",
|
|
261
269
|
as: "div",
|
|
262
|
-
children:
|
|
270
|
+
children: A
|
|
263
271
|
})
|
|
264
|
-
}) :
|
|
272
|
+
}) : A
|
|
265
273
|
})
|
|
266
274
|
})
|
|
267
275
|
})
|
|
268
276
|
]
|
|
269
|
-
}),
|
|
270
|
-
let
|
|
277
|
+
}), x = function() {
|
|
278
|
+
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
271
279
|
return {
|
|
272
|
-
className:
|
|
273
|
-
[
|
|
274
|
-
[
|
|
275
|
-
[
|
|
280
|
+
className: c(se, {
|
|
281
|
+
[ne]: l,
|
|
282
|
+
[M]: r,
|
|
283
|
+
[E]: u
|
|
276
284
|
}),
|
|
277
|
-
style:
|
|
278
|
-
[
|
|
285
|
+
style: he({
|
|
286
|
+
[ie.maxHeight]: typeof v == "number" ? `${v}px` : v !== null && v !== void 0 ? v : "auto"
|
|
279
287
|
})
|
|
280
288
|
};
|
|
281
289
|
};
|
|
282
|
-
return
|
|
283
|
-
desktopOnly:
|
|
290
|
+
return b ? /* @__PURE__ */ e(pe, {
|
|
291
|
+
desktopOnly: r,
|
|
284
292
|
width: "fit-content",
|
|
285
293
|
maxWidth: "100%",
|
|
286
294
|
minWidth: {
|
|
287
|
-
desktop:
|
|
288
|
-
mobile:
|
|
295
|
+
desktop: u ? "100%" : "auto",
|
|
296
|
+
mobile: r || u ? "100%" : "auto"
|
|
289
297
|
},
|
|
290
|
-
ref:
|
|
298
|
+
ref: $,
|
|
291
299
|
dataAttributes: _object_spread({
|
|
292
300
|
"component-name": "Table"
|
|
293
301
|
}, a),
|
|
294
|
-
children: /* @__PURE__ */ e("div", _object_spread_props(_object_spread({},
|
|
295
|
-
children:
|
|
302
|
+
children: /* @__PURE__ */ e("div", _object_spread_props(_object_spread({}, x()), {
|
|
303
|
+
children: w
|
|
296
304
|
}))
|
|
297
305
|
}) : /* @__PURE__ */ e("div", _object_spread_props(_object_spread({
|
|
298
|
-
ref:
|
|
299
|
-
},
|
|
300
|
-
children:
|
|
306
|
+
ref: $
|
|
307
|
+
}, X(a, "Table"), x(K)), {
|
|
308
|
+
children: w
|
|
301
309
|
}));
|
|
302
310
|
});
|
|
303
|
-
export {
|
|
311
|
+
export { xe as Table };
|