@fctc/sme-widget-ui 1.0.8 → 1.1.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/dist/index.js +143 -115
- package/dist/index.mjs +143 -115
- package/dist/widgets.d.mts +1 -1
- package/dist/widgets.d.ts +1 -1
- package/dist/widgets.js +143 -115
- package/dist/widgets.mjs +143 -115
- package/package.json +2 -2
- package/dist/.babelrc +0 -7
- package/dist/.editorconfig +0 -10
- package/dist/.eslintignore +0 -6
- package/dist/.eslintrc.cjs +0 -66
- package/dist/.gitattributes +0 -4
- package/dist/.prettierrc +0 -4
package/dist/widgets.js
CHANGED
|
@@ -14484,103 +14484,115 @@ var PopupFilter = ({
|
|
|
14484
14484
|
setGroupBy,
|
|
14485
14485
|
fields
|
|
14486
14486
|
}) => {
|
|
14487
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14488
14488
|
"div",
|
|
14489
14489
|
{
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14490
|
+
style: {
|
|
14491
|
+
position: "absolute",
|
|
14492
|
+
top: "calc(100% + 3px)",
|
|
14493
|
+
right: 0,
|
|
14494
|
+
zIndex: 33
|
|
14495
|
+
},
|
|
14496
|
+
className: "popup-filter w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl",
|
|
14497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14498
|
+
"div",
|
|
14499
|
+
{
|
|
14500
|
+
className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
|
|
14501
|
+
children: [
|
|
14502
|
+
filterBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "filter-by w-full px-3", children: [
|
|
14503
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14504
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FilterIcon, { className: "filter-by-icon text-primary" }),
|
|
14505
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
|
|
14506
|
+
] }),
|
|
14507
|
+
filterBy?.reduce((acc, item, index4, array) => {
|
|
14508
|
+
const prevItem = array[index4 - 1];
|
|
14509
|
+
const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
|
|
14510
|
+
const isExist = item?.active;
|
|
14511
|
+
if (isDifferentGroup) {
|
|
14512
|
+
acc.push(/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("hr", { className: "my-2" }, "separator-" + index4));
|
|
14513
|
+
}
|
|
14514
|
+
acc.push(
|
|
14515
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14516
|
+
"button",
|
|
14517
|
+
{
|
|
14518
|
+
className: `filter-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "filter-by-checked font-semibold " : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14519
|
+
onClick: () => {
|
|
14520
|
+
const newFilterBy = filterBy?.map(
|
|
14521
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14522
|
+
);
|
|
14523
|
+
setFilterBy(newFilterBy);
|
|
14524
|
+
if (isExist) {
|
|
14525
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14526
|
+
`${SearchType.FILTER}_${item.group_index}`,
|
|
14527
|
+
item
|
|
14528
|
+
);
|
|
14529
|
+
return;
|
|
14530
|
+
}
|
|
14531
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14532
|
+
name: item?.name,
|
|
14533
|
+
value: item?.string ?? item?.help,
|
|
14534
|
+
domain: item?.domain,
|
|
14535
|
+
groupIndex: item?.group_index,
|
|
14536
|
+
type: SearchType.FILTER
|
|
14537
|
+
});
|
|
14538
|
+
},
|
|
14539
|
+
children: [
|
|
14540
|
+
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14541
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string ?? item?.help })
|
|
14542
|
+
]
|
|
14543
|
+
},
|
|
14544
|
+
"filter-" + index4
|
|
14545
|
+
)
|
|
14546
|
+
);
|
|
14547
|
+
return acc;
|
|
14548
|
+
}, [])
|
|
14549
|
+
] }),
|
|
14550
|
+
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14551
|
+
groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "group-by w-full px-3", children: [
|
|
14552
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14553
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14554
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14555
|
+
] }),
|
|
14556
|
+
groupBy?.map((item, index4) => {
|
|
14557
|
+
const isExist = item?.active;
|
|
14558
|
+
if (!item.string) return;
|
|
14559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14560
|
+
"button",
|
|
14561
|
+
{
|
|
14562
|
+
onClick: () => {
|
|
14563
|
+
const formatArray = groupBy.map(
|
|
14564
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14518
14565
|
);
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14566
|
+
setGroupBy(formatArray);
|
|
14567
|
+
if (isExist) {
|
|
14568
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14569
|
+
return;
|
|
14570
|
+
}
|
|
14571
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14572
|
+
name: item?.name,
|
|
14573
|
+
value: item?.string,
|
|
14574
|
+
type: SearchType.GROUP,
|
|
14575
|
+
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14576
|
+
active: !isExist,
|
|
14577
|
+
dataIndex: index4,
|
|
14578
|
+
fieldsGroup: fields
|
|
14579
|
+
});
|
|
14580
|
+
},
|
|
14581
|
+
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14582
|
+
children: [
|
|
14583
|
+
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14584
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string })
|
|
14585
|
+
]
|
|
14528
14586
|
},
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
);
|
|
14537
|
-
return acc;
|
|
14538
|
-
}, [])
|
|
14539
|
-
] }),
|
|
14540
|
-
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14541
|
-
groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "group-by w-full px-3", children: [
|
|
14542
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14543
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14544
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14545
|
-
] }),
|
|
14546
|
-
groupBy?.map((item, index4) => {
|
|
14547
|
-
const isExist = item?.active;
|
|
14548
|
-
if (!item.string) return;
|
|
14549
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14550
|
-
"button",
|
|
14551
|
-
{
|
|
14552
|
-
onClick: () => {
|
|
14553
|
-
const formatArray = groupBy.map(
|
|
14554
|
-
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14555
|
-
);
|
|
14556
|
-
setGroupBy(formatArray);
|
|
14557
|
-
if (isExist) {
|
|
14558
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14559
|
-
return;
|
|
14560
|
-
}
|
|
14561
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14562
|
-
name: item?.name,
|
|
14563
|
-
value: item?.string,
|
|
14564
|
-
type: SearchType.GROUP,
|
|
14565
|
-
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14566
|
-
active: !isExist,
|
|
14567
|
-
dataIndex: index4,
|
|
14568
|
-
fieldsGroup: fields
|
|
14569
|
-
});
|
|
14570
|
-
},
|
|
14571
|
-
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14572
|
-
children: [
|
|
14573
|
-
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14574
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string })
|
|
14575
|
-
]
|
|
14576
|
-
},
|
|
14577
|
-
"groupby-" + index4 + 1
|
|
14578
|
-
);
|
|
14579
|
-
})
|
|
14580
|
-
] })
|
|
14581
|
-
]
|
|
14587
|
+
"groupby-" + index4 + 1
|
|
14588
|
+
);
|
|
14589
|
+
})
|
|
14590
|
+
] })
|
|
14591
|
+
]
|
|
14592
|
+
}
|
|
14593
|
+
)
|
|
14582
14594
|
}
|
|
14583
|
-
)
|
|
14595
|
+
);
|
|
14584
14596
|
};
|
|
14585
14597
|
|
|
14586
14598
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
@@ -31878,7 +31890,7 @@ var DateField = (props) => {
|
|
|
31878
31890
|
isForm2 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(CalandarIcon, {})
|
|
31879
31891
|
] })
|
|
31880
31892
|
);
|
|
31881
|
-
if (!isForm) {
|
|
31893
|
+
if (!isForm && !isEditTable) {
|
|
31882
31894
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: value && (0, import_moment2.default)(value).isValid() ? (0, import_moment2.default)(value).add(7, "hours").format(formatDate2) : "" });
|
|
31883
31895
|
} else {
|
|
31884
31896
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
@@ -33213,15 +33225,8 @@ var SelectDropdownField = (props) => {
|
|
|
33213
33225
|
value: val[0],
|
|
33214
33226
|
label: val[1]
|
|
33215
33227
|
})) : [];
|
|
33216
|
-
if (!isForm) {
|
|
33217
|
-
|
|
33218
|
-
return value2 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33219
|
-
"span",
|
|
33220
|
-
{
|
|
33221
|
-
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33222
|
-
children: value2
|
|
33223
|
-
}
|
|
33224
|
-
);
|
|
33228
|
+
if (!isForm && !isEditTable) {
|
|
33229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { children: options2?.find((item) => item?.value === value)?.label });
|
|
33225
33230
|
} else {
|
|
33226
33231
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33227
33232
|
Controller,
|
|
@@ -33262,20 +33267,43 @@ var SelectDropdownField = (props) => {
|
|
|
33262
33267
|
StateManagedSelect$1,
|
|
33263
33268
|
{
|
|
33264
33269
|
...commonProps,
|
|
33265
|
-
|
|
33266
|
-
control: () =>
|
|
33267
|
-
|
|
33268
|
-
|
|
33269
|
-
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33274
|
-
|
|
33275
|
-
|
|
33276
|
-
|
|
33277
|
-
|
|
33270
|
+
styles: {
|
|
33271
|
+
control: (base, state) => ({
|
|
33272
|
+
...base,
|
|
33273
|
+
display: "flex",
|
|
33274
|
+
minHeight: "44px",
|
|
33275
|
+
cursor: readonly ? "not-allowed" : "pointer",
|
|
33276
|
+
backgroundColor: "#f7f7f7",
|
|
33277
|
+
borderRadius: isEditTable ? "0px" : "10px",
|
|
33278
|
+
padding: "4px 0px",
|
|
33279
|
+
border: isForm ? state.isFocused ? "1px solid var(--primary)" : "1px solid transparent" : "none",
|
|
33280
|
+
boxShadow: "none",
|
|
33281
|
+
"&:hover": {
|
|
33282
|
+
borderColor: "var(--primary)"
|
|
33283
|
+
},
|
|
33284
|
+
...isEditTable && {
|
|
33285
|
+
minWidth: "300px",
|
|
33286
|
+
maxWidth: "300px",
|
|
33287
|
+
borderBottom: "1px solid transparent",
|
|
33288
|
+
background: "transparent"
|
|
33289
|
+
}
|
|
33290
|
+
}),
|
|
33291
|
+
clearIndicator: (base) => ({
|
|
33292
|
+
...base,
|
|
33293
|
+
padding: "0"
|
|
33294
|
+
}),
|
|
33295
|
+
menuPortal: (base) => ({
|
|
33296
|
+
...base,
|
|
33297
|
+
zIndex: 9999
|
|
33298
|
+
}),
|
|
33299
|
+
menu: (base) => ({
|
|
33300
|
+
...base,
|
|
33301
|
+
zIndex: 9999,
|
|
33302
|
+
width: isEditTable ? "300px" : "100%",
|
|
33303
|
+
minWidth: isEditTable ? "300px" : "100%"
|
|
33304
|
+
})
|
|
33278
33305
|
},
|
|
33306
|
+
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
33279
33307
|
components: {
|
|
33280
33308
|
IndicatorSeparator: () => null,
|
|
33281
33309
|
DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(components.DropdownIndicator, { ...props2 })
|
package/dist/widgets.mjs
CHANGED
|
@@ -14422,103 +14422,115 @@ var PopupFilter = ({
|
|
|
14422
14422
|
setGroupBy,
|
|
14423
14423
|
fields
|
|
14424
14424
|
}) => {
|
|
14425
|
-
return /* @__PURE__ */ jsx54(
|
|
14425
|
+
return /* @__PURE__ */ jsx54(
|
|
14426
14426
|
"div",
|
|
14427
14427
|
{
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14428
|
+
style: {
|
|
14429
|
+
position: "absolute",
|
|
14430
|
+
top: "calc(100% + 3px)",
|
|
14431
|
+
right: 0,
|
|
14432
|
+
zIndex: 33
|
|
14433
|
+
},
|
|
14434
|
+
className: "popup-filter w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl",
|
|
14435
|
+
children: /* @__PURE__ */ jsxs35(
|
|
14436
|
+
"div",
|
|
14437
|
+
{
|
|
14438
|
+
className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
|
|
14439
|
+
children: [
|
|
14440
|
+
filterBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "filter-by w-full px-3", children: [
|
|
14441
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14442
|
+
/* @__PURE__ */ jsx54(FilterIcon, { className: "filter-by-icon text-primary" }),
|
|
14443
|
+
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
|
|
14444
|
+
] }),
|
|
14445
|
+
filterBy?.reduce((acc, item, index4, array) => {
|
|
14446
|
+
const prevItem = array[index4 - 1];
|
|
14447
|
+
const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
|
|
14448
|
+
const isExist = item?.active;
|
|
14449
|
+
if (isDifferentGroup) {
|
|
14450
|
+
acc.push(/* @__PURE__ */ jsx54("hr", { className: "my-2" }, "separator-" + index4));
|
|
14451
|
+
}
|
|
14452
|
+
acc.push(
|
|
14453
|
+
/* @__PURE__ */ jsxs35(
|
|
14454
|
+
"button",
|
|
14455
|
+
{
|
|
14456
|
+
className: `filter-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "filter-by-checked font-semibold " : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14457
|
+
onClick: () => {
|
|
14458
|
+
const newFilterBy = filterBy?.map(
|
|
14459
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14460
|
+
);
|
|
14461
|
+
setFilterBy(newFilterBy);
|
|
14462
|
+
if (isExist) {
|
|
14463
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14464
|
+
`${SearchType.FILTER}_${item.group_index}`,
|
|
14465
|
+
item
|
|
14466
|
+
);
|
|
14467
|
+
return;
|
|
14468
|
+
}
|
|
14469
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14470
|
+
name: item?.name,
|
|
14471
|
+
value: item?.string ?? item?.help,
|
|
14472
|
+
domain: item?.domain,
|
|
14473
|
+
groupIndex: item?.group_index,
|
|
14474
|
+
type: SearchType.FILTER
|
|
14475
|
+
});
|
|
14476
|
+
},
|
|
14477
|
+
children: [
|
|
14478
|
+
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14479
|
+
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string ?? item?.help })
|
|
14480
|
+
]
|
|
14481
|
+
},
|
|
14482
|
+
"filter-" + index4
|
|
14483
|
+
)
|
|
14484
|
+
);
|
|
14485
|
+
return acc;
|
|
14486
|
+
}, [])
|
|
14487
|
+
] }),
|
|
14488
|
+
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ jsx54("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14489
|
+
groupBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "group-by w-full px-3", children: [
|
|
14490
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14491
|
+
/* @__PURE__ */ jsx54(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14492
|
+
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14493
|
+
] }),
|
|
14494
|
+
groupBy?.map((item, index4) => {
|
|
14495
|
+
const isExist = item?.active;
|
|
14496
|
+
if (!item.string) return;
|
|
14497
|
+
return /* @__PURE__ */ jsxs35(
|
|
14498
|
+
"button",
|
|
14499
|
+
{
|
|
14500
|
+
onClick: () => {
|
|
14501
|
+
const formatArray = groupBy.map(
|
|
14502
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14456
14503
|
);
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14504
|
+
setGroupBy(formatArray);
|
|
14505
|
+
if (isExist) {
|
|
14506
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14507
|
+
return;
|
|
14508
|
+
}
|
|
14509
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14510
|
+
name: item?.name,
|
|
14511
|
+
value: item?.string,
|
|
14512
|
+
type: SearchType.GROUP,
|
|
14513
|
+
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14514
|
+
active: !isExist,
|
|
14515
|
+
dataIndex: index4,
|
|
14516
|
+
fieldsGroup: fields
|
|
14517
|
+
});
|
|
14518
|
+
},
|
|
14519
|
+
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14520
|
+
children: [
|
|
14521
|
+
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14522
|
+
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string })
|
|
14523
|
+
]
|
|
14466
14524
|
},
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
);
|
|
14475
|
-
return acc;
|
|
14476
|
-
}, [])
|
|
14477
|
-
] }),
|
|
14478
|
-
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ jsx54("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14479
|
-
groupBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "group-by w-full px-3", children: [
|
|
14480
|
-
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14481
|
-
/* @__PURE__ */ jsx54(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14482
|
-
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14483
|
-
] }),
|
|
14484
|
-
groupBy?.map((item, index4) => {
|
|
14485
|
-
const isExist = item?.active;
|
|
14486
|
-
if (!item.string) return;
|
|
14487
|
-
return /* @__PURE__ */ jsxs35(
|
|
14488
|
-
"button",
|
|
14489
|
-
{
|
|
14490
|
-
onClick: () => {
|
|
14491
|
-
const formatArray = groupBy.map(
|
|
14492
|
-
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14493
|
-
);
|
|
14494
|
-
setGroupBy(formatArray);
|
|
14495
|
-
if (isExist) {
|
|
14496
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14497
|
-
return;
|
|
14498
|
-
}
|
|
14499
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14500
|
-
name: item?.name,
|
|
14501
|
-
value: item?.string,
|
|
14502
|
-
type: SearchType.GROUP,
|
|
14503
|
-
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14504
|
-
active: !isExist,
|
|
14505
|
-
dataIndex: index4,
|
|
14506
|
-
fieldsGroup: fields
|
|
14507
|
-
});
|
|
14508
|
-
},
|
|
14509
|
-
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14510
|
-
children: [
|
|
14511
|
-
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14512
|
-
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string })
|
|
14513
|
-
]
|
|
14514
|
-
},
|
|
14515
|
-
"groupby-" + index4 + 1
|
|
14516
|
-
);
|
|
14517
|
-
})
|
|
14518
|
-
] })
|
|
14519
|
-
]
|
|
14525
|
+
"groupby-" + index4 + 1
|
|
14526
|
+
);
|
|
14527
|
+
})
|
|
14528
|
+
] })
|
|
14529
|
+
]
|
|
14530
|
+
}
|
|
14531
|
+
)
|
|
14520
14532
|
}
|
|
14521
|
-
)
|
|
14533
|
+
);
|
|
14522
14534
|
};
|
|
14523
14535
|
|
|
14524
14536
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
@@ -31816,7 +31828,7 @@ var DateField = (props) => {
|
|
|
31816
31828
|
isForm2 && /* @__PURE__ */ jsx79(CalandarIcon, {})
|
|
31817
31829
|
] })
|
|
31818
31830
|
);
|
|
31819
|
-
if (!isForm) {
|
|
31831
|
+
if (!isForm && !isEditTable) {
|
|
31820
31832
|
return /* @__PURE__ */ jsx79("span", { children: value && (0, import_moment2.default)(value).isValid() ? (0, import_moment2.default)(value).add(7, "hours").format(formatDate2) : "" });
|
|
31821
31833
|
} else {
|
|
31822
31834
|
return /* @__PURE__ */ jsx79(
|
|
@@ -33151,15 +33163,8 @@ var SelectDropdownField = (props) => {
|
|
|
33151
33163
|
value: val[0],
|
|
33152
33164
|
label: val[1]
|
|
33153
33165
|
})) : [];
|
|
33154
|
-
if (!isForm) {
|
|
33155
|
-
|
|
33156
|
-
return value2 && /* @__PURE__ */ jsx97(
|
|
33157
|
-
"span",
|
|
33158
|
-
{
|
|
33159
|
-
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33160
|
-
children: value2
|
|
33161
|
-
}
|
|
33162
|
-
);
|
|
33166
|
+
if (!isForm && !isEditTable) {
|
|
33167
|
+
return /* @__PURE__ */ jsx97("span", { children: options2?.find((item) => item?.value === value)?.label });
|
|
33163
33168
|
} else {
|
|
33164
33169
|
return /* @__PURE__ */ jsx97(
|
|
33165
33170
|
Controller,
|
|
@@ -33200,20 +33205,43 @@ var SelectDropdownField = (props) => {
|
|
|
33200
33205
|
StateManagedSelect$1,
|
|
33201
33206
|
{
|
|
33202
33207
|
...commonProps,
|
|
33203
|
-
|
|
33204
|
-
control: () =>
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
|
|
33210
|
-
|
|
33211
|
-
|
|
33212
|
-
|
|
33213
|
-
|
|
33214
|
-
|
|
33215
|
-
|
|
33208
|
+
styles: {
|
|
33209
|
+
control: (base, state) => ({
|
|
33210
|
+
...base,
|
|
33211
|
+
display: "flex",
|
|
33212
|
+
minHeight: "44px",
|
|
33213
|
+
cursor: readonly ? "not-allowed" : "pointer",
|
|
33214
|
+
backgroundColor: "#f7f7f7",
|
|
33215
|
+
borderRadius: isEditTable ? "0px" : "10px",
|
|
33216
|
+
padding: "4px 0px",
|
|
33217
|
+
border: isForm ? state.isFocused ? "1px solid var(--primary)" : "1px solid transparent" : "none",
|
|
33218
|
+
boxShadow: "none",
|
|
33219
|
+
"&:hover": {
|
|
33220
|
+
borderColor: "var(--primary)"
|
|
33221
|
+
},
|
|
33222
|
+
...isEditTable && {
|
|
33223
|
+
minWidth: "300px",
|
|
33224
|
+
maxWidth: "300px",
|
|
33225
|
+
borderBottom: "1px solid transparent",
|
|
33226
|
+
background: "transparent"
|
|
33227
|
+
}
|
|
33228
|
+
}),
|
|
33229
|
+
clearIndicator: (base) => ({
|
|
33230
|
+
...base,
|
|
33231
|
+
padding: "0"
|
|
33232
|
+
}),
|
|
33233
|
+
menuPortal: (base) => ({
|
|
33234
|
+
...base,
|
|
33235
|
+
zIndex: 9999
|
|
33236
|
+
}),
|
|
33237
|
+
menu: (base) => ({
|
|
33238
|
+
...base,
|
|
33239
|
+
zIndex: 9999,
|
|
33240
|
+
width: isEditTable ? "300px" : "100%",
|
|
33241
|
+
minWidth: isEditTable ? "300px" : "100%"
|
|
33242
|
+
})
|
|
33216
33243
|
},
|
|
33244
|
+
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
33217
33245
|
components: {
|
|
33218
33246
|
IndicatorSeparator: () => null,
|
|
33219
33247
|
DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ jsx97(components.DropdownIndicator, { ...props2 })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fctc/sme-widget-ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react-select": "^5.10.1",
|
|
65
65
|
"react-toastify": "^11.0.5",
|
|
66
66
|
"react-tooltip": "^5.28.0",
|
|
67
|
-
"tailwindcss": "3
|
|
67
|
+
"tailwindcss": "^3",
|
|
68
68
|
"tsup": "^8.0.0",
|
|
69
69
|
"typescript": "^5.8.2"
|
|
70
70
|
}
|
package/dist/.babelrc
DELETED
package/dist/.editorconfig
DELETED