@fctc/sme-widget-ui 1.1.0 → 1.1.2

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.mjs CHANGED
@@ -12264,8 +12264,14 @@ var TableHead = (props) => {
12264
12264
  return /* @__PURE__ */ jsx45("thead", { className: "relative z-10", children: /* @__PURE__ */ jsxs28(
12265
12265
  "tr",
12266
12266
  {
12267
- style: { userSelect: "none", WebkitUserSelect: "none" },
12268
- className: "border-b-[1.5px] border-[rgba(66,66,66,0.12)] sticky top-0 bg-white z-[1]",
12267
+ style: {
12268
+ userSelect: "none",
12269
+ WebkitUserSelect: "none",
12270
+ zIndex: 1,
12271
+ position: "sticky",
12272
+ top: 0
12273
+ },
12274
+ className: "border-b border-[rgba(66,66,66,0.12)] bg-white",
12269
12275
  children: [
12270
12276
  isDisplayCheckbox && /* @__PURE__ */ jsx45(
12271
12277
  "th",
@@ -12286,7 +12292,7 @@ var TableHead = (props) => {
12286
12292
  return /* @__PURE__ */ jsx45(
12287
12293
  "th",
12288
12294
  {
12289
- className: `column whitespace-nowrap text-left p-3 text-sm font-medium capitalize text-[#121212]`,
12295
+ className: `column whitespace-nowrap text-left p-3 text-sm font-semibold capitalize text-[#060606]`,
12290
12296
  children: /* @__PURE__ */ jsx45("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full min-w-max group", children: col.title })
12291
12297
  },
12292
12298
  "table-head-" + index4
@@ -14813,7 +14819,7 @@ var Search = ({
14813
14819
  "input",
14814
14820
  {
14815
14821
  value: searchString,
14816
- className: "min-h-[25px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
14822
+ className: "min-h-[44px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
14817
14823
  placeholder: instance.t("search..."),
14818
14824
  onChange: (e3) => {
14819
14825
  onSearchString(e3.target.value);
@@ -17757,7 +17763,7 @@ var CharField = (props) => {
17757
17763
  disabled: readonly,
17758
17764
  placeholder,
17759
17765
  required: !invisible && required,
17760
- className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border border-[rgba(66,66,66,0.12)] rounded-lg p-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
17766
+ className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border !border-[rgba(66,66,66,0.12)] rounded-lg py-2 px-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
17761
17767
  ${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
17762
17768
  `
17763
17769
  }
@@ -33606,164 +33612,173 @@ var Many2ManyField = (props) => {
33606
33612
  return createPortal5(
33607
33613
  /* @__PURE__ */ jsxs71("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
33608
33614
  /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
33609
- /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71("div", { className: "relative z-[1] p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit", children: [
33610
- /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33611
- /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33612
- /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33613
- ] }),
33614
- /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33615
- /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33616
- Search,
33617
- {
33618
- removeSearchItems,
33619
- selectedTags,
33620
- filterBy,
33621
- setFilterBy,
33622
- searchString,
33623
- onSearchString,
33624
- handleAddTagSearch,
33625
- searchBy,
33626
- groupBy,
33627
- showFiltersGroups: true,
33628
- setGroupBy,
33629
- setDomainList: setDomain,
33630
- setPage: (pages) => {
33631
- setPage?.(pages);
33632
- },
33633
- fieldsList: [
33634
- ...columns?.filter(
33635
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33636
- )?.map((col) => ({ ...col.field })) ?? []
33637
- ],
33638
- setSelectedRowKeys,
33639
- viewData,
33640
- context,
33641
- selectedRowKeys,
33642
- aid,
33643
- domainSearch,
33644
- evalJSONContext,
33645
- clearSearch
33646
- }
33647
- ) }),
33648
- /* @__PURE__ */ jsx102(
33649
- PaginationView,
33650
- {
33651
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33652
- currentPage: page,
33653
- totalCount: totalRows ?? 0,
33654
- pageSize: 10,
33655
- onPageChange: (page2) => {
33656
- if (typeof setPage === "function") {
33657
- setPage(page2);
33615
+ /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
33616
+ "div",
33617
+ {
33618
+ style: {
33619
+ zIndex: 1
33620
+ },
33621
+ className: "relative p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit",
33622
+ children: [
33623
+ /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33624
+ /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33625
+ /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33626
+ ] }),
33627
+ /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33628
+ /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33629
+ Search,
33630
+ {
33631
+ removeSearchItems,
33632
+ selectedTags,
33633
+ filterBy,
33634
+ setFilterBy,
33635
+ searchString,
33636
+ onSearchString,
33637
+ handleAddTagSearch,
33638
+ searchBy,
33639
+ groupBy,
33640
+ showFiltersGroups: true,
33641
+ setGroupBy,
33642
+ setDomainList: setDomain,
33643
+ setPage: (pages) => {
33644
+ setPage?.(pages);
33645
+ },
33646
+ fieldsList: [
33647
+ ...columns?.filter(
33648
+ (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33649
+ )?.map((col) => ({ ...col.field })) ?? []
33650
+ ],
33651
+ setSelectedRowKeys,
33652
+ viewData,
33653
+ context,
33654
+ selectedRowKeys,
33655
+ aid,
33656
+ domainSearch,
33657
+ evalJSONContext,
33658
+ clearSearch
33658
33659
  }
33659
- },
33660
- displayPageNumberDots: false,
33661
- displayRowsNumberOption: false
33662
- }
33663
- )
33664
- ] }),
33665
- !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33666
- "div",
33667
- {
33668
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33669
- children: /* @__PURE__ */ jsx102("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx102("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx102(
33660
+ ) }),
33661
+ /* @__PURE__ */ jsx102(
33662
+ PaginationView,
33663
+ {
33664
+ className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33665
+ currentPage: page,
33666
+ totalCount: totalRows ?? 0,
33667
+ pageSize: 10,
33668
+ onPageChange: (page2) => {
33669
+ if (typeof setPage === "function") {
33670
+ setPage(page2);
33671
+ }
33672
+ },
33673
+ displayPageNumberDots: false,
33674
+ displayRowsNumberOption: false
33675
+ }
33676
+ )
33677
+ ] }),
33678
+ !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33670
33679
  "div",
33671
33680
  {
33672
- className: `flex w-full items-center h-full overflow-auto `,
33673
- children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33674
- "table",
33681
+ className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33682
+ children: /* @__PURE__ */ jsx102("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx102("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx102(
33683
+ "div",
33675
33684
  {
33676
- className: `relative w-full bg-white custom-dropdown `,
33677
- children: [
33678
- /* @__PURE__ */ jsx102(
33679
- TableHead,
33680
- {
33681
- columns,
33682
- onToggleColumnOptional,
33683
- isDisplayCheckbox,
33684
- checkedAll,
33685
- handleCheckBoxAll
33686
- }
33687
- ),
33688
- /* @__PURE__ */ jsx102(
33689
- TableBody,
33690
- {
33691
- columns,
33692
- rows,
33693
- rootField,
33694
- isDisplayCheckbox,
33695
- model: relation,
33696
- renderField: ({
33697
- row,
33698
- col,
33699
- indexRow,
33700
- onChangeData,
33701
- rootField: rootField2
33702
- }) => {
33703
- if (typeof renderField === "function") {
33704
- return renderField({
33685
+ className: `flex w-full items-center h-full overflow-auto `,
33686
+ children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33687
+ "table",
33688
+ {
33689
+ className: `relative w-full bg-white custom-dropdown `,
33690
+ children: [
33691
+ /* @__PURE__ */ jsx102(
33692
+ TableHead,
33693
+ {
33694
+ columns,
33695
+ onToggleColumnOptional,
33696
+ isDisplayCheckbox,
33697
+ checkedAll,
33698
+ handleCheckBoxAll
33699
+ }
33700
+ ),
33701
+ /* @__PURE__ */ jsx102(
33702
+ TableBody,
33703
+ {
33704
+ columns,
33705
+ rows,
33706
+ rootField,
33707
+ isDisplayCheckbox,
33708
+ model: relation,
33709
+ renderField: ({
33705
33710
  row,
33706
33711
  col,
33707
33712
  indexRow,
33708
33713
  onChangeData,
33709
33714
  rootField: rootField2
33710
- });
33715
+ }) => {
33716
+ if (typeof renderField === "function") {
33717
+ return renderField({
33718
+ row,
33719
+ col,
33720
+ indexRow,
33721
+ onChangeData,
33722
+ rootField: rootField2
33723
+ });
33724
+ }
33725
+ },
33726
+ onRemoveRow: null,
33727
+ onAddRow,
33728
+ onClickRow,
33729
+ typeTable,
33730
+ selectedRowKeysRef,
33731
+ selectedRowKeys,
33732
+ setSelectedRowKeys
33711
33733
  }
33712
- },
33713
- onRemoveRow: null,
33714
- onAddRow,
33715
- onClickRow,
33716
- typeTable,
33717
- selectedRowKeysRef,
33718
- selectedRowKeys,
33719
- setSelectedRowKeys
33720
- }
33721
- )
33722
- ]
33734
+ )
33735
+ ]
33736
+ }
33737
+ ) })
33723
33738
  }
33724
- ) })
33739
+ ) }) })
33725
33740
  }
33726
- ) }) })
33727
- }
33728
- ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
33729
- /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
33730
- isDisplayCheckbox && /* @__PURE__ */ jsx102(
33731
- "button",
33732
- {
33733
- disabled: selectedRowKeys?.length === 0,
33734
- type: "button",
33735
- onClick: () => onChoose(selectedRowKeys),
33736
- className: "button-primary",
33737
- children: instance.t("choose")
33738
- }
33739
- ),
33740
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
33741
- "button",
33742
- {
33743
- type: "button",
33744
- onClick: () => {
33745
- if (typeof onAddNew === "function") {
33746
- onAddNew();
33747
- onClose();
33748
- } else {
33749
- handleCreateNewOnPage();
33741
+ ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
33742
+ /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
33743
+ isDisplayCheckbox && /* @__PURE__ */ jsx102(
33744
+ "button",
33745
+ {
33746
+ disabled: selectedRowKeys?.length === 0,
33747
+ type: "button",
33748
+ onClick: () => onChoose(selectedRowKeys),
33749
+ className: "button-primary",
33750
+ children: instance.t("choose")
33750
33751
  }
33751
- },
33752
- className: "button-primary",
33753
- children: instance.t("new")
33754
- }
33755
- ),
33756
- /* @__PURE__ */ jsx102(
33757
- "button",
33758
- {
33759
- type: "button",
33760
- onClick: onClose,
33761
- className: "button-secondary",
33762
- children: instance.t("cancel_button")
33763
- }
33764
- )
33765
- ] })
33766
- ] }) })
33752
+ ),
33753
+ optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
33754
+ "button",
33755
+ {
33756
+ type: "button",
33757
+ onClick: () => {
33758
+ if (typeof onAddNew === "function") {
33759
+ onAddNew();
33760
+ onClose();
33761
+ } else {
33762
+ handleCreateNewOnPage();
33763
+ }
33764
+ },
33765
+ className: "button-primary",
33766
+ children: instance.t("new")
33767
+ }
33768
+ ),
33769
+ /* @__PURE__ */ jsx102(
33770
+ "button",
33771
+ {
33772
+ type: "button",
33773
+ onClick: onClose,
33774
+ className: "button-secondary",
33775
+ children: instance.t("cancel_button")
33776
+ }
33777
+ )
33778
+ ] })
33779
+ ]
33780
+ }
33781
+ ) })
33767
33782
  ] }),
33768
33783
  document.body
33769
33784
  );
@@ -33888,7 +33903,7 @@ var Many2OneField = (props) => {
33888
33903
  menuShouldScrollIntoView: false,
33889
33904
  options: options2,
33890
33905
  classNames: {
33891
- control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] 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 ${isForm && (isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
33906
+ control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "!border-[1px] !border-primary !ring-0 outline-none" : "border !border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
33892
33907
  valueContainer: () => "!m-0 !p-0",
33893
33908
  singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33894
33909
  input: () => "!m-0 !p-0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",