@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/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)("div", { className: "popup-filter absolute right-0 top-[calc(100%_+_3px)] z-[33] w-auto min-w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
14487
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14488
14488
  "div",
14489
14489
  {
14490
- className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
14491
- children: [
14492
- filterBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "filter-by w-full px-3", children: [
14493
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
14494
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FilterIcon, { className: "filter-by-icon text-primary" }),
14495
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
14496
- ] }),
14497
- filterBy?.reduce((acc, item, index4, array) => {
14498
- const prevItem = array[index4 - 1];
14499
- const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
14500
- const isExist = item?.active;
14501
- if (isDifferentGroup) {
14502
- acc.push(/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("hr", { className: "my-2" }, "separator-" + index4));
14503
- }
14504
- acc.push(
14505
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
14506
- "button",
14507
- {
14508
- 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)]"}`,
14509
- onClick: () => {
14510
- const newFilterBy = filterBy?.map(
14511
- (tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
14512
- );
14513
- setFilterBy(newFilterBy);
14514
- if (isExist) {
14515
- typeof removeSearchItems === "function" && removeSearchItems(
14516
- `${SearchType.FILTER}_${item.group_index}`,
14517
- item
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
- return;
14520
- }
14521
- typeof handleAddTagSearch === "function" && handleAddTagSearch({
14522
- name: item?.name,
14523
- value: item?.string ?? item?.help,
14524
- domain: item?.domain,
14525
- groupIndex: item?.group_index,
14526
- type: SearchType.FILTER
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
- children: [
14530
- isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
14531
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string ?? item?.help })
14532
- ]
14533
- },
14534
- "filter-" + index4
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
- const value2 = options2?.find((item) => item?.value === value2)?.label;
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
- classNames: isEditTable ? {
33266
- control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none p-2 pl-3 text-sm text-[#1A1A1B] font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content border border-transparent border-b border-[#f7f7f7] hover:border-b-primary ${readonly ? "!cursor-not-allowed" : ""}`,
33267
- valueContainer: () => "!m-0 !p-0",
33268
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33269
- input: () => "!m-0 !p-0",
33270
- dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
33271
- clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
33272
- } : {
33273
- control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-white !shadow-none !rounded-[8px] p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]"} `,
33274
- valueContainer: () => "!m-0 !p-0",
33275
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33276
- input: () => "!m-0 !p-0",
33277
- dropdownIndicator: () => "!m-0 !p-0"
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("div", { className: "popup-filter absolute right-0 top-[calc(100%_+_3px)] z-[33] w-auto min-w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl", children: /* @__PURE__ */ jsxs35(
14425
+ return /* @__PURE__ */ jsx54(
14426
14426
  "div",
14427
14427
  {
14428
- className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
14429
- children: [
14430
- filterBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "filter-by w-full px-3", children: [
14431
- /* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
14432
- /* @__PURE__ */ jsx54(FilterIcon, { className: "filter-by-icon text-primary" }),
14433
- /* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
14434
- ] }),
14435
- filterBy?.reduce((acc, item, index4, array) => {
14436
- const prevItem = array[index4 - 1];
14437
- const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
14438
- const isExist = item?.active;
14439
- if (isDifferentGroup) {
14440
- acc.push(/* @__PURE__ */ jsx54("hr", { className: "my-2" }, "separator-" + index4));
14441
- }
14442
- acc.push(
14443
- /* @__PURE__ */ jsxs35(
14444
- "button",
14445
- {
14446
- 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)]"}`,
14447
- onClick: () => {
14448
- const newFilterBy = filterBy?.map(
14449
- (tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
14450
- );
14451
- setFilterBy(newFilterBy);
14452
- if (isExist) {
14453
- typeof removeSearchItems === "function" && removeSearchItems(
14454
- `${SearchType.FILTER}_${item.group_index}`,
14455
- item
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
- return;
14458
- }
14459
- typeof handleAddTagSearch === "function" && handleAddTagSearch({
14460
- name: item?.name,
14461
- value: item?.string ?? item?.help,
14462
- domain: item?.domain,
14463
- groupIndex: item?.group_index,
14464
- type: SearchType.FILTER
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
- children: [
14468
- isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
14469
- /* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string ?? item?.help })
14470
- ]
14471
- },
14472
- "filter-" + index4
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
- const value2 = options2?.find((item) => item?.value === value2)?.label;
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
- classNames: isEditTable ? {
33204
- control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none p-2 pl-3 text-sm text-[#1A1A1B] font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content border border-transparent border-b border-[#f7f7f7] hover:border-b-primary ${readonly ? "!cursor-not-allowed" : ""}`,
33205
- valueContainer: () => "!m-0 !p-0",
33206
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33207
- input: () => "!m-0 !p-0",
33208
- dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
33209
- clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
33210
- } : {
33211
- control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-white !shadow-none !rounded-[8px] p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]"} `,
33212
- valueContainer: () => "!m-0 !p-0",
33213
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33214
- input: () => "!m-0 !p-0",
33215
- dropdownIndicator: () => "!m-0 !p-0"
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.8",
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.4.3",
67
+ "tailwindcss": "^3",
68
68
  "tsup": "^8.0.0",
69
69
  "typescript": "^5.8.2"
70
70
  }
package/dist/.babelrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-react",
5
- "@babel/preset-typescript"
6
- ]
7
- }
@@ -1,10 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- end_of_line = lf
5
- insert_final_newline = true
6
-
7
- [*.{js,json,yml}]
8
- charset = utf-8
9
- indent_style = space
10
- indent_size = 2
@@ -1,6 +0,0 @@
1
- dist
2
- .cache
3
- package-lock.json
4
- public
5
- node_modules
6
- yarn.lock