@fctc/sme-widget-ui 3.10.5 → 3.10.7
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 +171 -131
- package/dist/index.mjs +165 -125
- package/dist/widgets.js +171 -131
- package/dist/widgets.mjs +165 -125
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17734,8 +17734,8 @@ var CopyLinkButtonField = (props) => {
|
|
|
17734
17734
|
baseClassName
|
|
17735
17735
|
} = props;
|
|
17736
17736
|
const { t: t3 } = useI18n();
|
|
17737
|
-
if (!isForm) {
|
|
17738
|
-
return /* @__PURE__ */ jsx84("div", { className: "truncate max-w-[300px]", children: propValue && typeof propValue === "object" ? propValue.display_name : propValue });
|
|
17737
|
+
if (!isForm && !isEditTable) {
|
|
17738
|
+
return /* @__PURE__ */ jsx84("div", { className: "truncate max-w-[300px]", children: maskingValue || (propValue && typeof propValue === "object" ? propValue.display_name : propValue) });
|
|
17739
17739
|
}
|
|
17740
17740
|
return /* @__PURE__ */ jsx84(
|
|
17741
17741
|
Controller,
|
|
@@ -32466,7 +32466,7 @@ var ImageField = (props) => {
|
|
|
32466
32466
|
};
|
|
32467
32467
|
|
|
32468
32468
|
// src/widgets/basic/many2many-tags-field/many2many-tags.tsx
|
|
32469
|
-
import React17, { useEffect as useEffect21, useMemo as useMemo11 } from "react";
|
|
32469
|
+
import React17, { useEffect as useEffect21, useMemo as useMemo11, useState as useState21 } from "react";
|
|
32470
32470
|
|
|
32471
32471
|
// src/widgets/basic/information-field/information.tsx
|
|
32472
32472
|
import { Fragment as Fragment28, jsx as jsx98, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
@@ -32609,6 +32609,8 @@ var Many2ManyTagField = (props) => {
|
|
|
32609
32609
|
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
32610
32610
|
},
|
|
32611
32611
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
32612
|
+
const [menuOpen, setMenuOpen] = useState21(false);
|
|
32613
|
+
const [hover, setHover] = useState21(false);
|
|
32612
32614
|
const { clearErrors } = methods;
|
|
32613
32615
|
useEffect21(() => {
|
|
32614
32616
|
if (field.value) {
|
|
@@ -32643,118 +32645,138 @@ var Many2ManyTagField = (props) => {
|
|
|
32643
32645
|
});
|
|
32644
32646
|
});
|
|
32645
32647
|
};
|
|
32646
|
-
return /* @__PURE__ */ jsxs65(
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32677
|
-
|
|
32678
|
-
|
|
32679
|
-
|
|
32680
|
-
|
|
32681
|
-
|
|
32682
|
-
|
|
32683
|
-
|
|
32684
|
-
|
|
32685
|
-
|
|
32686
|
-
|
|
32687
|
-
|
|
32688
|
-
|
|
32689
|
-
|
|
32690
|
-
|
|
32691
|
-
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
32695
|
-
|
|
32696
|
-
|
|
32697
|
-
|
|
32698
|
-
|
|
32699
|
-
|
|
32700
|
-
|
|
32701
|
-
|
|
32702
|
-
|
|
32703
|
-
|
|
32704
|
-
|
|
32705
|
-
|
|
32706
|
-
|
|
32707
|
-
|
|
32708
|
-
|
|
32709
|
-
|
|
32710
|
-
|
|
32711
|
-
|
|
32712
|
-
|
|
32713
|
-
|
|
32714
|
-
|
|
32715
|
-
|
|
32716
|
-
|
|
32717
|
-
|
|
32718
|
-
|
|
32719
|
-
|
|
32720
|
-
|
|
32721
|
-
|
|
32722
|
-
|
|
32723
|
-
|
|
32724
|
-
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32734
|
-
|
|
32735
|
-
|
|
32736
|
-
|
|
32737
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32740
|
-
|
|
32741
|
-
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
|
|
32745
|
-
|
|
32746
|
-
|
|
32747
|
-
|
|
32748
|
-
|
|
32749
|
-
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32648
|
+
return /* @__PURE__ */ jsxs65(
|
|
32649
|
+
"div",
|
|
32650
|
+
{
|
|
32651
|
+
className: "group h-full",
|
|
32652
|
+
onMouseEnter: () => setHover(true),
|
|
32653
|
+
onMouseLeave: () => setHover(false),
|
|
32654
|
+
children: [
|
|
32655
|
+
/* @__PURE__ */ jsx99(
|
|
32656
|
+
StateManagedSelect$1,
|
|
32657
|
+
{
|
|
32658
|
+
options: options2,
|
|
32659
|
+
noOptionsMessage: () => t3(isFetching ? "loading" : "no-available"),
|
|
32660
|
+
isMulti: true,
|
|
32661
|
+
isDisabled: readonly,
|
|
32662
|
+
isSearchable: true,
|
|
32663
|
+
isClearable: menuOpen,
|
|
32664
|
+
menuShouldScrollIntoView: false,
|
|
32665
|
+
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
32666
|
+
value: filteredValue,
|
|
32667
|
+
onChange: handleChange,
|
|
32668
|
+
onMenuClose: () => {
|
|
32669
|
+
const filteredDomain = [...domainObject ?? []]?.filter(
|
|
32670
|
+
(d) => !(Array.isArray(d) && d[0] === "name" && d[1] === "ilike")
|
|
32671
|
+
) || [];
|
|
32672
|
+
setInputValue("");
|
|
32673
|
+
setDomainObject(filteredDomain);
|
|
32674
|
+
setMenuOpen(false);
|
|
32675
|
+
},
|
|
32676
|
+
onMenuOpen: () => {
|
|
32677
|
+
fetchMoreOptions();
|
|
32678
|
+
setMenuOpen(true);
|
|
32679
|
+
},
|
|
32680
|
+
onBlur: () => {
|
|
32681
|
+
setHover(false);
|
|
32682
|
+
},
|
|
32683
|
+
menuPlacement: "auto",
|
|
32684
|
+
placeholder,
|
|
32685
|
+
classNames: isEditTable ? {
|
|
32686
|
+
valueContainer: () => "overflow-unset !px-0",
|
|
32687
|
+
control: ({ isFocused }) => `widget many2many-tags-widget ${baseClassName} ${isFocused ? "focused" : ""} ${filteredValue?.length === 0 && "no-values"}`,
|
|
32688
|
+
dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
|
|
32689
|
+
clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
|
|
32690
|
+
} : {
|
|
32691
|
+
valueContainer: () => "overflow-unset !m-0 !p-0 flex gap-1",
|
|
32692
|
+
control: ({ isFocused }) => `widget many2many-tags-widget ${baseClassName} ${isFocused ? "focused" : ""} ${filteredValue?.length === 0 && "no-values"}`,
|
|
32693
|
+
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
32694
|
+
input: () => "!m-0 !p-0",
|
|
32695
|
+
dropdownIndicator: () => "!m-0 !p-0"
|
|
32696
|
+
},
|
|
32697
|
+
styles: {
|
|
32698
|
+
container: (base) => ({
|
|
32699
|
+
...base,
|
|
32700
|
+
height: "100%"
|
|
32701
|
+
}),
|
|
32702
|
+
control: () => ({
|
|
32703
|
+
maxWidth: isEditTable ? "max-content" : "100%",
|
|
32704
|
+
minWidth: isEditTable ? "max-content" : "100%",
|
|
32705
|
+
background: isEditTable ? "transparent" : "initial"
|
|
32706
|
+
}),
|
|
32707
|
+
multiValue: (provided, state) => {
|
|
32708
|
+
const { color, id } = state?.data ?? {};
|
|
32709
|
+
const bgColor = color !== null ? COLORS[color]?.color : COLORS[id]?.color;
|
|
32710
|
+
return {
|
|
32711
|
+
...provided,
|
|
32712
|
+
display: "flex",
|
|
32713
|
+
backgroundColor: bgColor || "rgba(230.1375, 221.3625, 221.3625, 1)",
|
|
32714
|
+
borderRadius: "16px",
|
|
32715
|
+
color: "black",
|
|
32716
|
+
fontWeight: "600"
|
|
32717
|
+
};
|
|
32718
|
+
},
|
|
32719
|
+
multiValueRemove: (provided) => ({
|
|
32720
|
+
...provided,
|
|
32721
|
+
backgroundColor: "transparent !important",
|
|
32722
|
+
color: "black !important"
|
|
32723
|
+
}),
|
|
32724
|
+
option: (provided, { isFocused, isSelected }) => ({
|
|
32725
|
+
...provided,
|
|
32726
|
+
backgroundColor: isSelected || isFocused ? "rgba(66,66,66,0.08)" : "#FFF",
|
|
32727
|
+
color: isSelected ? "white" : "",
|
|
32728
|
+
cursor: "pointer",
|
|
32729
|
+
transition: "all 0.2s ease",
|
|
32730
|
+
borderRadius: "8px"
|
|
32731
|
+
}),
|
|
32732
|
+
menu: (base) => ({
|
|
32733
|
+
...base,
|
|
32734
|
+
zIndex: 9999,
|
|
32735
|
+
width: "100%",
|
|
32736
|
+
minWidth: "max-content",
|
|
32737
|
+
borderRadius: "10px"
|
|
32738
|
+
}),
|
|
32739
|
+
menuList: (base) => ({
|
|
32740
|
+
...base,
|
|
32741
|
+
padding: "4px"
|
|
32742
|
+
}),
|
|
32743
|
+
dropdownIndicator: (base) => ({
|
|
32744
|
+
...base,
|
|
32745
|
+
padding: "0",
|
|
32746
|
+
display: hover ? "flex" : "none"
|
|
32747
|
+
})
|
|
32748
|
+
},
|
|
32749
|
+
components: isUser ? {
|
|
32750
|
+
MultiValue: (multiValueProps) => /* @__PURE__ */ jsx99(
|
|
32751
|
+
CustomMultiValue,
|
|
32752
|
+
{
|
|
32753
|
+
...multiValueProps,
|
|
32754
|
+
stringToColor
|
|
32755
|
+
}
|
|
32756
|
+
),
|
|
32757
|
+
IndicatorSeparator: () => null
|
|
32758
|
+
} : {
|
|
32759
|
+
MenuList: (menuListProps) => /* @__PURE__ */ jsx99(
|
|
32760
|
+
CustomMenuList,
|
|
32761
|
+
{
|
|
32762
|
+
...menuListProps,
|
|
32763
|
+
selectProps: {
|
|
32764
|
+
...menuListProps.selectProps,
|
|
32765
|
+
setIsShowModalMany2Many
|
|
32766
|
+
}
|
|
32767
|
+
}
|
|
32768
|
+
),
|
|
32769
|
+
IndicatorSeparator: () => null,
|
|
32770
|
+
DropdownIndicator: (props2) => readonly || menuOpen ? null : /* @__PURE__ */ jsx99(components.DropdownIndicator, { ...props2 }),
|
|
32771
|
+
ClearIndicator: (props2) => readonly ? null : /* @__PURE__ */ jsx99(components.ClearIndicator, { ...props2 })
|
|
32772
|
+
},
|
|
32773
|
+
required: !invisible && required
|
|
32774
|
+
}
|
|
32775
|
+
),
|
|
32776
|
+
!isEditTable && error2 && /* @__PURE__ */ jsx99("p", { className: "text-[#de4747] text-sm mt-1", children: error2.message })
|
|
32777
|
+
]
|
|
32778
|
+
}
|
|
32779
|
+
);
|
|
32758
32780
|
}
|
|
32759
32781
|
}
|
|
32760
32782
|
);
|
|
@@ -32867,7 +32889,7 @@ var PaidBadgedField = () => {
|
|
|
32867
32889
|
};
|
|
32868
32890
|
|
|
32869
32891
|
// src/widgets/basic/priority-field/rating-star.tsx
|
|
32870
|
-
import React18, { useEffect as useEffect23, useState as
|
|
32892
|
+
import React18, { useEffect as useEffect23, useState as useState22 } from "react";
|
|
32871
32893
|
import { jsx as jsx102, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
32872
32894
|
var RatingStarField = (props) => {
|
|
32873
32895
|
const {
|
|
@@ -32877,8 +32899,8 @@ var RatingStarField = (props) => {
|
|
|
32877
32899
|
onSelectPriority,
|
|
32878
32900
|
id
|
|
32879
32901
|
} = props;
|
|
32880
|
-
const [rating, setRating] =
|
|
32881
|
-
const [hover, setHover] =
|
|
32902
|
+
const [rating, setRating] = useState22(defaultValue);
|
|
32903
|
+
const [hover, setHover] = useState22(0);
|
|
32882
32904
|
useEffect23(() => {
|
|
32883
32905
|
setRating(defaultValue);
|
|
32884
32906
|
}, [defaultValue]);
|
|
@@ -33078,6 +33100,7 @@ var RemainingDaysField = (props) => {
|
|
|
33078
33100
|
};
|
|
33079
33101
|
|
|
33080
33102
|
// src/widgets/basic/select-dropdown-field/select-dropdown.tsx
|
|
33103
|
+
import { useState as useState23 } from "react";
|
|
33081
33104
|
import { Fragment as Fragment30, jsx as jsx106, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
33082
33105
|
var SelectDropdownField = (props) => {
|
|
33083
33106
|
const { t: t3 } = useI18n();
|
|
@@ -33112,6 +33135,8 @@ var SelectDropdownField = (props) => {
|
|
|
33112
33135
|
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
33113
33136
|
},
|
|
33114
33137
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
33138
|
+
const [menuOpen, setMenuOpen] = useState23(false);
|
|
33139
|
+
const [hover, setHover] = useState23(false);
|
|
33115
33140
|
const defaultValue = options2.find(
|
|
33116
33141
|
(option) => option.value === value
|
|
33117
33142
|
);
|
|
@@ -33122,13 +33147,23 @@ var SelectDropdownField = (props) => {
|
|
|
33122
33147
|
placeholder: readonly ? "" : placeholder || t3("choose_place"),
|
|
33123
33148
|
isSearchable: !readonly,
|
|
33124
33149
|
isDisabled: readonly,
|
|
33150
|
+
isClearable: menuOpen,
|
|
33125
33151
|
menuPlacement: "auto",
|
|
33126
33152
|
onChange: (selectedOption) => {
|
|
33127
33153
|
field.onChange(selectedOption.value);
|
|
33128
33154
|
onChange2 && onChange2(name ?? "", selectedOption.value);
|
|
33129
33155
|
},
|
|
33130
33156
|
value: defaultValue || null,
|
|
33131
|
-
required: !invisible && required
|
|
33157
|
+
required: !invisible && required,
|
|
33158
|
+
onMenuOpen: () => {
|
|
33159
|
+
setMenuOpen(true);
|
|
33160
|
+
},
|
|
33161
|
+
onMenuClose: () => {
|
|
33162
|
+
setMenuOpen(false);
|
|
33163
|
+
},
|
|
33164
|
+
onBlur: () => {
|
|
33165
|
+
setHover(false);
|
|
33166
|
+
}
|
|
33132
33167
|
};
|
|
33133
33168
|
return /* @__PURE__ */ jsxs70(Fragment30, { children: [
|
|
33134
33169
|
/* @__PURE__ */ jsx106("div", { className: `group ${isEditTable ? "h-full" : ""}`, children: /* @__PURE__ */ jsx106(
|
|
@@ -33183,12 +33218,17 @@ var SelectDropdownField = (props) => {
|
|
|
33183
33218
|
menuList: (base) => ({
|
|
33184
33219
|
...base,
|
|
33185
33220
|
padding: "4px"
|
|
33221
|
+
}),
|
|
33222
|
+
dropdownIndicator: (base) => ({
|
|
33223
|
+
...base,
|
|
33224
|
+
padding: "0",
|
|
33225
|
+
display: hover ? "flex" : "none"
|
|
33186
33226
|
})
|
|
33187
33227
|
},
|
|
33188
33228
|
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
33189
33229
|
components: {
|
|
33190
33230
|
IndicatorSeparator: () => null,
|
|
33191
|
-
DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ jsx106(components.DropdownIndicator, { ...props2 })
|
|
33231
|
+
DropdownIndicator: (props2) => readonly || !isEditTable || menuOpen ? null : /* @__PURE__ */ jsx106(components.DropdownIndicator, { ...props2 })
|
|
33192
33232
|
},
|
|
33193
33233
|
noOptionsMessage: () => t3("no-available")
|
|
33194
33234
|
}
|
|
@@ -33314,7 +33354,7 @@ var ToggleButtonField = (props) => {
|
|
|
33314
33354
|
};
|
|
33315
33355
|
|
|
33316
33356
|
// src/widgets/basic/integer-field/integer.tsx
|
|
33317
|
-
import { useEffect as useEffect25, useRef as useRef18, useState as
|
|
33357
|
+
import { useEffect as useEffect25, useRef as useRef18, useState as useState24 } from "react";
|
|
33318
33358
|
import { Fragment as Fragment31, jsx as jsx109, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
33319
33359
|
var IntegerField = (props) => {
|
|
33320
33360
|
const {
|
|
@@ -33354,7 +33394,7 @@ var IntegerField = (props) => {
|
|
|
33354
33394
|
const isDirtyRef = useRef18(false);
|
|
33355
33395
|
const inputRef = useRef18(null);
|
|
33356
33396
|
const lastCommittedValueRef = useRef18(null);
|
|
33357
|
-
const [inputValue, setInputValue] =
|
|
33397
|
+
const [inputValue, setInputValue] = useState24(
|
|
33358
33398
|
value2 !== void 0 && value2 !== null ? String(value2) : ""
|
|
33359
33399
|
);
|
|
33360
33400
|
useEffect25(() => {
|
|
@@ -33723,7 +33763,7 @@ var Many2ManyField = (props) => {
|
|
|
33723
33763
|
};
|
|
33724
33764
|
|
|
33725
33765
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
33726
|
-
import React19, { useEffect as useEffect27, useState as
|
|
33766
|
+
import React19, { useEffect as useEffect27, useState as useState25 } from "react";
|
|
33727
33767
|
import { Fragment as Fragment32, jsx as jsx112, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
33728
33768
|
var CustomMenuList2 = (props) => {
|
|
33729
33769
|
const { t: t3 } = useI18n();
|
|
@@ -33820,8 +33860,8 @@ var Many2OneField = (props) => {
|
|
|
33820
33860
|
} : false
|
|
33821
33861
|
},
|
|
33822
33862
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
33823
|
-
const [menuOpen, setMenuOpen] =
|
|
33824
|
-
const [hover, setHover] =
|
|
33863
|
+
const [menuOpen, setMenuOpen] = useState25(false);
|
|
33864
|
+
const [hover, setHover] = useState25(false);
|
|
33825
33865
|
const currentValue = field?.value ? {
|
|
33826
33866
|
value: field?.value?.id,
|
|
33827
33867
|
label: field?.value?.display_name,
|