@3sc/common-component 0.0.110 → 0.0.112
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/dist/index.es.js +67 -36
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -26236,19 +26236,19 @@ const P4 = (e, t) => Ed(e) ? new O4(t) : new A4(t, {
|
|
|
26236
26236
|
...y4,
|
|
26237
26237
|
...l4,
|
|
26238
26238
|
...x4
|
|
26239
|
-
}, P4), En = /* @__PURE__ */ bP(N4), ar = ({ styles: e, label: t,
|
|
26240
|
-
const
|
|
26239
|
+
}, P4), En = /* @__PURE__ */ bP(N4), ar = ({ styles: e, label: t, disabled: n, ...o }) => {
|
|
26240
|
+
const r = ot(), s = (t == null ? void 0 : t.length) * ((t == null ? void 0 : t.length) >= 10 ? 6.5 : 7.5) + 38 || 0, [a, c] = Se(!1);
|
|
26241
26241
|
return /* @__PURE__ */ v.jsxs(
|
|
26242
26242
|
En.button,
|
|
26243
26243
|
{
|
|
26244
|
-
onMouseEnter: () => (e == null ? void 0 : e.isAnimate) &&
|
|
26245
|
-
onMouseLeave: () => (e == null ? void 0 : e.isAnimate) &&
|
|
26244
|
+
onMouseEnter: () => (e == null ? void 0 : e.isAnimate) && c(!0),
|
|
26245
|
+
onMouseLeave: () => (e == null ? void 0 : e.isAnimate) && c(!1),
|
|
26246
26246
|
initial: {
|
|
26247
|
-
width: e != null && e.isAnimate || !t ? "3rem" : `${
|
|
26247
|
+
width: e != null && e.isAnimate || !t ? "3rem" : `${s / 10}rem`,
|
|
26248
26248
|
borderRadius: "0.7rem"
|
|
26249
26249
|
},
|
|
26250
26250
|
animate: {
|
|
26251
|
-
width: e != null && e.isAnimate ? `${
|
|
26251
|
+
width: e != null && e.isAnimate ? `${a ? s / 10 : 3}rem` : `${t ? s / 10 : 3}rem`
|
|
26252
26252
|
},
|
|
26253
26253
|
transition: {
|
|
26254
26254
|
duration: 0.2,
|
|
@@ -26258,19 +26258,25 @@ const P4 = (e, t) => Ed(e) ? new O4(t) : new A4(t, {
|
|
|
26258
26258
|
height: "3rem",
|
|
26259
26259
|
outline: "none",
|
|
26260
26260
|
overflow: "hidden",
|
|
26261
|
-
backgroundColor: (e == null ? void 0 : e.variant) !== "outlined" ? (e == null ? void 0 : e.color) === "secondary" ?
|
|
26262
|
-
border: (e == null ? void 0 : e.variant) === "outlined" ? `0.1rem solid ${
|
|
26261
|
+
backgroundColor: (e == null ? void 0 : e.variant) !== "outlined" ? (e == null ? void 0 : e.color) === "secondary" ? r.palette.brandColor.blue : r.palette.brandColor.orange : r.palette.primary.notifyBackground,
|
|
26262
|
+
border: (e == null ? void 0 : e.variant) === "outlined" ? `0.1rem solid ${r.palette.primary.notifyBorderColor}` : "none",
|
|
26263
26263
|
display: "flex",
|
|
26264
26264
|
cursor: "pointer",
|
|
26265
26265
|
alignItems: "center",
|
|
26266
|
-
gap:
|
|
26267
|
-
color: (e == null ? void 0 : e.variant) === "outlined" ?
|
|
26268
|
-
justifyContent:
|
|
26269
|
-
padding:
|
|
26270
|
-
whiteSpace: "nowrap"
|
|
26266
|
+
gap: a || !(e != null && e.isAnimate) ? "0.5rem" : 0,
|
|
26267
|
+
color: (e == null ? void 0 : e.variant) === "outlined" ? r.palette.primary.notifyActiveText : "white",
|
|
26268
|
+
justifyContent: a ? "flex-start" : "center",
|
|
26269
|
+
padding: a || !(e != null && e.isAnimate) ? "1.2rem" : "0.8rem",
|
|
26270
|
+
whiteSpace: "nowrap",
|
|
26271
|
+
...n ? {
|
|
26272
|
+
backgroundColor: r.palette.primary.notifyIconColor,
|
|
26273
|
+
opacity: 0.8,
|
|
26274
|
+
cursor: "auto"
|
|
26275
|
+
} : {}
|
|
26271
26276
|
},
|
|
26272
26277
|
layout: !0,
|
|
26273
|
-
|
|
26278
|
+
disabled: !0,
|
|
26279
|
+
...o,
|
|
26274
26280
|
children: [
|
|
26275
26281
|
(e == null ? void 0 : e.icon) && (!(e != null && e.iconPosition) || (e == null ? void 0 : e.iconPosition) === "start") && /* @__PURE__ */ v.jsx(de, { component: "img", src: e == null ? void 0 : e.icon }),
|
|
26276
26282
|
t && /* @__PURE__ */ v.jsx(
|
|
@@ -26279,13 +26285,13 @@ const P4 = (e, t) => Ed(e) ? new O4(t) : new A4(t, {
|
|
|
26279
26285
|
layout: !0,
|
|
26280
26286
|
initial: { opacity: 0, width: 0 },
|
|
26281
26287
|
animate: {
|
|
26282
|
-
opacity:
|
|
26283
|
-
width:
|
|
26288
|
+
opacity: a || !(e != null && e.isAnimate) ? 1 : 0,
|
|
26289
|
+
width: a || !(e != null && e.isAnimate) ? "auto" : 0
|
|
26284
26290
|
},
|
|
26285
26291
|
transition: {
|
|
26286
26292
|
duration: 0.2,
|
|
26287
26293
|
ease: "easeInOut",
|
|
26288
|
-
delay:
|
|
26294
|
+
delay: a ? 0.1 : 0
|
|
26289
26295
|
},
|
|
26290
26296
|
style: {
|
|
26291
26297
|
overflow: "hidden",
|
|
@@ -28576,18 +28582,31 @@ const sl = {
|
|
|
28576
28582
|
let d = jo.GRID_SETTINGS || { platform: { theme: "light" }, grid: {} };
|
|
28577
28583
|
d.grid = d.grid || {}, d.grid[o] = u, localStorage.setItem(fo.SETTINGS, JSON.stringify(d)), await al({ baseUrl: n, payload: d }), c();
|
|
28578
28584
|
} };
|
|
28579
|
-
}, Uk = ({
|
|
28585
|
+
}, Uk = ({
|
|
28586
|
+
columns: e,
|
|
28587
|
+
gridPath: t,
|
|
28588
|
+
baseUrl: n,
|
|
28589
|
+
isDefaultConfig: o
|
|
28590
|
+
}) => {
|
|
28580
28591
|
var p, f;
|
|
28581
|
-
const o = (f = (p = jo.GRID_SETTINGS) == null ? void 0 : p.grid) == null ? void 0 : f[t];
|
|
28582
28592
|
let { definitions: r, defaultUserSettings: s, labels: a } = e;
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
|
|
28586
|
-
|
|
28587
|
-
|
|
28588
|
-
|
|
28589
|
-
|
|
28590
|
-
|
|
28593
|
+
if (!o) {
|
|
28594
|
+
const m = (f = (p = jo.GRID_SETTINGS) == null ? void 0 : p.grid) == null ? void 0 : f[t];
|
|
28595
|
+
s = m ?? s ?? Yk({ definitions: r }), (!m || !s) && (async () => {
|
|
28596
|
+
try {
|
|
28597
|
+
let g = jo.GRID_SETTINGS || {
|
|
28598
|
+
platform: { theme: "light" },
|
|
28599
|
+
grid: {}
|
|
28600
|
+
};
|
|
28601
|
+
g.grid = g.grid || {}, g.grid[t] = s, localStorage.setItem(
|
|
28602
|
+
fo.SETTINGS,
|
|
28603
|
+
JSON.stringify(g)
|
|
28604
|
+
), await al({ baseUrl: n, payload: g });
|
|
28605
|
+
} catch (g) {
|
|
28606
|
+
console.error(g);
|
|
28607
|
+
}
|
|
28608
|
+
})();
|
|
28609
|
+
}
|
|
28591
28610
|
const c = s.reduce((m, g) => (m[g.id] = g, m), {}), l = a.reduce((m, g) => (m[g.id] = g, m), {}), u = [];
|
|
28592
28611
|
for (const m of r) {
|
|
28593
28612
|
const { id: g } = m, h = c[g], y = l[g];
|
|
@@ -29564,9 +29583,7 @@ wy.propTypes = {
|
|
|
29564
29583
|
};
|
|
29565
29584
|
const Sy = ({ defaultTools: e, isManageable: t, customTools: n, baseUrl: o, gridPath: r }) => {
|
|
29566
29585
|
var d, p, f, m, g, h, y;
|
|
29567
|
-
const s = qe(Ui), { visibleGridColumns: a, triggerApi: c } = qe(Qa)
|
|
29568
|
-
console.log({ triggerApi: c });
|
|
29569
|
-
const l = async (b) => {
|
|
29586
|
+
const s = qe(Ui), { visibleGridColumns: a, triggerApi: c } = qe(Qa), l = async (b) => {
|
|
29570
29587
|
try {
|
|
29571
29588
|
await cM({ baseUrl: o, gridPath: r, gridSetting: b });
|
|
29572
29589
|
} catch (I) {
|
|
@@ -29687,17 +29704,31 @@ Sy.propTypes = {
|
|
|
29687
29704
|
baseUrl: i.string,
|
|
29688
29705
|
gridPath: i.gridPath
|
|
29689
29706
|
};
|
|
29690
|
-
function pM({ tableProps: e, toolbarProps: t }) {
|
|
29691
|
-
var
|
|
29692
|
-
const
|
|
29707
|
+
function pM({ tableProps: e, toolbarProps: t, isDefaultConfig: n }) {
|
|
29708
|
+
var a;
|
|
29709
|
+
const o = (a = e.columns) == null ? void 0 : a.isManageable, { columns: r } = e, s = Uk({
|
|
29710
|
+
columns: r,
|
|
29711
|
+
gridPath: t.gridPath,
|
|
29712
|
+
baseUrl: t.baseUrl,
|
|
29713
|
+
isDefaultConfig: n
|
|
29714
|
+
});
|
|
29693
29715
|
return /* @__PURE__ */ v.jsxs(Hv, { children: [
|
|
29694
|
-
/* @__PURE__ */ v.jsx(Sy, { ...t, isManageable:
|
|
29695
|
-
/* @__PURE__ */ v.jsx(
|
|
29716
|
+
/* @__PURE__ */ v.jsx(Sy, { ...t, isManageable: o }),
|
|
29717
|
+
/* @__PURE__ */ v.jsx(
|
|
29718
|
+
Iy,
|
|
29719
|
+
{
|
|
29720
|
+
tableProps: e,
|
|
29721
|
+
mergedColumns: s,
|
|
29722
|
+
gridPath: t.gridPath,
|
|
29723
|
+
baseUrl: t.baseUrl
|
|
29724
|
+
}
|
|
29725
|
+
)
|
|
29696
29726
|
] });
|
|
29697
29727
|
}
|
|
29698
29728
|
pM.propTypes = {
|
|
29699
29729
|
tableProps: i.object.isRequired,
|
|
29700
|
-
toolbarProps: i.object.isRequired
|
|
29730
|
+
toolbarProps: i.object.isRequired,
|
|
29731
|
+
isDefaultConfig: i.bool
|
|
29701
29732
|
};
|
|
29702
29733
|
const Ry = ({ list: e, handleLinkClick: t }) => {
|
|
29703
29734
|
const n = ot(), o = ({ list: r }) => {
|