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