@fctc/sme-widget-ui 2.2.9 → 2.3.1
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 +58 -90
- package/dist/index.mjs +162 -194
- package/dist/widgets.js +383 -417
- package/dist/widgets.mjs +603 -637
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11002,98 +11002,66 @@ var TableBody = (props) => {
|
|
|
11002
11002
|
};
|
|
11003
11003
|
|
|
11004
11004
|
// src/widgets/advanced/table/table-filter.tsx
|
|
11005
|
-
import {
|
|
11006
|
-
import { createPortal } from "react-dom";
|
|
11005
|
+
import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
|
|
11007
11006
|
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11008
11007
|
var TableFilter = ({ columns, onToggleColumnOptional }) => {
|
|
11009
|
-
|
|
11010
|
-
const [filterPosition, setFilterPosition] = useState4(null);
|
|
11011
|
-
const filterPopupRef = useRef5(null);
|
|
11012
|
-
const filterRef = useClickOutside({
|
|
11013
|
-
handler: () => {
|
|
11014
|
-
if (openTableFilter) {
|
|
11015
|
-
setOpenTableFilter(false);
|
|
11016
|
-
}
|
|
11017
|
-
},
|
|
11018
|
-
refs: [filterPopupRef]
|
|
11019
|
-
});
|
|
11020
|
-
useEffect6(() => {
|
|
11021
|
-
const updatePosition = () => {
|
|
11022
|
-
if (filterRef.current && openTableFilter) {
|
|
11023
|
-
const rect = filterRef.current.getBoundingClientRect();
|
|
11024
|
-
setFilterPosition({
|
|
11025
|
-
top: rect.bottom + window.scrollY,
|
|
11026
|
-
left: rect.left + window.scrollX,
|
|
11027
|
-
right: window.innerWidth - rect.right
|
|
11028
|
-
});
|
|
11029
|
-
}
|
|
11030
|
-
};
|
|
11031
|
-
updatePosition();
|
|
11032
|
-
window.addEventListener("scroll", updatePosition);
|
|
11033
|
-
window.addEventListener("resize", updatePosition);
|
|
11034
|
-
return () => {
|
|
11035
|
-
window.removeEventListener("scroll", updatePosition);
|
|
11036
|
-
window.removeEventListener("resize", updatePosition);
|
|
11037
|
-
};
|
|
11038
|
-
}, [filterRef, openTableFilter]);
|
|
11039
|
-
return /* @__PURE__ */ jsxs27(
|
|
11008
|
+
return /* @__PURE__ */ jsx49(
|
|
11040
11009
|
"div",
|
|
11041
11010
|
{
|
|
11042
|
-
ref: filterRef,
|
|
11043
11011
|
style: {
|
|
11044
|
-
transform: "translateY(-50%)"
|
|
11012
|
+
transform: "translateY(-50%)",
|
|
11013
|
+
right: 0
|
|
11045
11014
|
},
|
|
11046
|
-
className: "w-fit absolute top-[50%] translate-y-[-50%] right-[
|
|
11047
|
-
children: [
|
|
11048
|
-
/* @__PURE__ */ jsx49(
|
|
11015
|
+
className: "w-fit absolute top-[50%] translate-y-[-50%] right-[0px] ms-auto z-[32] ",
|
|
11016
|
+
children: /* @__PURE__ */ jsxs27(Popover, { children: [
|
|
11017
|
+
/* @__PURE__ */ jsx49(PopoverButton, { className: "p-2 rounded-lg cursor-pointer outline-none", children: /* @__PURE__ */ jsx49(
|
|
11049
11018
|
"button",
|
|
11050
11019
|
{
|
|
11051
11020
|
type: "button",
|
|
11052
11021
|
className: "bg-white size-8 p-1 rounded-lg cursor-pointer flex items-center justify-center",
|
|
11053
|
-
onClick: () => {
|
|
11054
|
-
setOpenTableFilter(!openTableFilter);
|
|
11055
|
-
},
|
|
11056
11022
|
children: /* @__PURE__ */ jsx49(FilterColumnIcon, {})
|
|
11057
11023
|
}
|
|
11058
|
-
),
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11024
|
+
) }),
|
|
11025
|
+
/* @__PURE__ */ jsx49(
|
|
11026
|
+
PopoverPanel,
|
|
11027
|
+
{
|
|
11028
|
+
transition: true,
|
|
11029
|
+
anchor: "bottom end",
|
|
11030
|
+
className: "shadow-lg z-[99] gap-2 bg-white rounded-lg transition duration-200 ease-in-out border border-stroke-disabled",
|
|
11031
|
+
children: /* @__PURE__ */ jsx49(
|
|
11032
|
+
"div",
|
|
11033
|
+
{
|
|
11034
|
+
style: {
|
|
11035
|
+
zIndex: 9999
|
|
11036
|
+
},
|
|
11037
|
+
className: "flex w-[250px] h-auto overflow-auto flex-col gap-[16px] rounded-[8px] bg-[#fff] px-[24px] py-[16px] shadow-md",
|
|
11038
|
+
children: columns?.filter((val) => val?.optional !== void 0)?.map((item) => {
|
|
11039
|
+
return /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
11040
|
+
/* @__PURE__ */ jsx49(
|
|
11041
|
+
"input",
|
|
11042
|
+
{
|
|
11043
|
+
type: "checkbox",
|
|
11044
|
+
id: `${item.name}`,
|
|
11045
|
+
onChange: () => onToggleColumnOptional(item),
|
|
11046
|
+
checked: item.optional !== "hide",
|
|
11047
|
+
className: "cursor-pointer"
|
|
11048
|
+
}
|
|
11049
|
+
),
|
|
11050
|
+
/* @__PURE__ */ jsx49(
|
|
11051
|
+
"label",
|
|
11052
|
+
{
|
|
11053
|
+
htmlFor: `${item.name}`,
|
|
11054
|
+
className: "flex items-center gap-[8px]",
|
|
11055
|
+
children: item.field.string
|
|
11056
|
+
}
|
|
11057
|
+
)
|
|
11058
|
+
] }, item.name);
|
|
11059
|
+
})
|
|
11060
|
+
}
|
|
11061
|
+
)
|
|
11062
|
+
}
|
|
11095
11063
|
)
|
|
11096
|
-
]
|
|
11064
|
+
] })
|
|
11097
11065
|
}
|
|
11098
11066
|
);
|
|
11099
11067
|
};
|
|
@@ -12956,7 +12924,7 @@ var M = e2.forwardRef(({ id: t3, anchorId: l2, anchorSelect: n4, content: i3, ht
|
|
|
12956
12924
|
});
|
|
12957
12925
|
|
|
12958
12926
|
// src/widgets/advanced/table/table-head.tsx
|
|
12959
|
-
import { createPortal
|
|
12927
|
+
import { createPortal } from "react-dom";
|
|
12960
12928
|
import { Fragment as Fragment4, jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12961
12929
|
var TableHead = (props) => {
|
|
12962
12930
|
const {
|
|
@@ -13004,7 +12972,7 @@ var TableHead = (props) => {
|
|
|
13004
12972
|
children: /* @__PURE__ */ jsxs29("div", { className: "cursor-pointer flex items-center gap-[4px] w-full group relative", children: [
|
|
13005
12973
|
/* @__PURE__ */ jsx51("span", { className: "truncate line-clamp-1 w-fit", children: col.title }),
|
|
13006
12974
|
col?.field?.help && /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
13007
|
-
|
|
12975
|
+
createPortal(
|
|
13008
12976
|
/* @__PURE__ */ jsx51(
|
|
13009
12977
|
M,
|
|
13010
12978
|
{
|
|
@@ -15266,7 +15234,7 @@ var Button = React2.forwardRef(
|
|
|
15266
15234
|
Button.displayName = "Button";
|
|
15267
15235
|
|
|
15268
15236
|
// src/widgets/advanced/login/shared/text-input.tsx
|
|
15269
|
-
import { useState as
|
|
15237
|
+
import { useState as useState4 } from "react";
|
|
15270
15238
|
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
15271
15239
|
function TextInput(props) {
|
|
15272
15240
|
const {
|
|
@@ -15280,7 +15248,7 @@ function TextInput(props) {
|
|
|
15280
15248
|
errors,
|
|
15281
15249
|
required
|
|
15282
15250
|
} = props;
|
|
15283
|
-
const [showPassword, setShowPassword] =
|
|
15251
|
+
const [showPassword, setShowPassword] = useState4(false);
|
|
15284
15252
|
return /* @__PURE__ */ jsxs32("div", { className: `flex justify-center gap-2 flex-col ${className}`, children: [
|
|
15285
15253
|
label && /* @__PURE__ */ jsxs32("label", { className: "text-[#262626] text-sm leading-5 font-semibold", children: [
|
|
15286
15254
|
label,
|
|
@@ -15322,7 +15290,7 @@ function TextInput(props) {
|
|
|
15322
15290
|
}
|
|
15323
15291
|
|
|
15324
15292
|
// src/widgets/advanced/login/provider/credential/form-options/index.tsx
|
|
15325
|
-
import { useEffect as
|
|
15293
|
+
import { useEffect as useEffect6 } from "react";
|
|
15326
15294
|
import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15327
15295
|
var STAY_LOGIN_IN = "stayLoginIn";
|
|
15328
15296
|
function FormOptions({
|
|
@@ -15346,7 +15314,7 @@ function FormOptions({
|
|
|
15346
15314
|
}
|
|
15347
15315
|
}
|
|
15348
15316
|
}
|
|
15349
|
-
|
|
15317
|
+
useEffect6(() => {
|
|
15350
15318
|
localStorage.setItem(STAY_LOGIN_IN, "false");
|
|
15351
15319
|
}, []);
|
|
15352
15320
|
return /* @__PURE__ */ jsxs33("div", { className: "flex justify-between items-center text-[#005aa9] text-sm leading-5 font-medium select-none", children: [
|
|
@@ -15640,7 +15608,7 @@ var PopupFilter = ({
|
|
|
15640
15608
|
};
|
|
15641
15609
|
|
|
15642
15610
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
15643
|
-
import { useEffect as
|
|
15611
|
+
import { useEffect as useEffect7, useState as useState5 } from "react";
|
|
15644
15612
|
|
|
15645
15613
|
// src/widgets/advanced/search/tag-search/index.tsx
|
|
15646
15614
|
import { Fragment as Fragment8 } from "react";
|
|
@@ -15842,13 +15810,13 @@ var Search = ({
|
|
|
15842
15810
|
clearSearch
|
|
15843
15811
|
}) => {
|
|
15844
15812
|
const { t: t3 } = useI18n();
|
|
15845
|
-
const [showPopupFilter, setShowPopupFilter] =
|
|
15813
|
+
const [showPopupFilter, setShowPopupFilter] = useState5(false);
|
|
15846
15814
|
const popupFilterRef = useClickOutside({
|
|
15847
15815
|
handler: () => setShowPopupFilter(false)
|
|
15848
15816
|
});
|
|
15849
|
-
const [isReadyFormatDomain, setIsReadyFormatDomain] =
|
|
15850
|
-
const [didInit, setDidInit] =
|
|
15851
|
-
|
|
15817
|
+
const [isReadyFormatDomain, setIsReadyFormatDomain] = useState5(false);
|
|
15818
|
+
const [didInit, setDidInit] = useState5(false);
|
|
15819
|
+
useEffect7(() => {
|
|
15852
15820
|
if (isReadyFormatDomain) {
|
|
15853
15821
|
setPage(0);
|
|
15854
15822
|
setSelectedRowKeys([]);
|
|
@@ -15861,7 +15829,7 @@ var Search = ({
|
|
|
15861
15829
|
}
|
|
15862
15830
|
}
|
|
15863
15831
|
}, [selectedTags, isReadyFormatDomain]);
|
|
15864
|
-
|
|
15832
|
+
useEffect7(() => {
|
|
15865
15833
|
setDidInit(false);
|
|
15866
15834
|
setIsReadyFormatDomain(false);
|
|
15867
15835
|
return () => {
|
|
@@ -15870,7 +15838,7 @@ var Search = ({
|
|
|
15870
15838
|
setIsReadyFormatDomain(false);
|
|
15871
15839
|
};
|
|
15872
15840
|
}, [aid]);
|
|
15873
|
-
|
|
15841
|
+
useEffect7(() => {
|
|
15874
15842
|
if (!filterBy || !fieldsList || fieldsList?.length === 0) return;
|
|
15875
15843
|
if (didInit) return;
|
|
15876
15844
|
const searchDefaults = Object.entries(context || {}).filter(
|
|
@@ -16169,8 +16137,8 @@ var ModalConfirm = ({
|
|
|
16169
16137
|
};
|
|
16170
16138
|
|
|
16171
16139
|
// src/widgets/common/modal-detail.tsx
|
|
16172
|
-
import { useState as
|
|
16173
|
-
import { createPortal as
|
|
16140
|
+
import { useState as useState6 } from "react";
|
|
16141
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
16174
16142
|
import { Fragment as Fragment13, jsx as jsx69, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
16175
16143
|
var ModalDetail = ({
|
|
16176
16144
|
idToolTip,
|
|
@@ -16183,8 +16151,8 @@ var ModalDetail = ({
|
|
|
16183
16151
|
context
|
|
16184
16152
|
}) => {
|
|
16185
16153
|
const { t: t3 } = useI18n();
|
|
16186
|
-
const [showModalDetail, setShowModalDetail] =
|
|
16187
|
-
const [actionData, setActionData] =
|
|
16154
|
+
const [showModalDetail, setShowModalDetail] = useState6(false);
|
|
16155
|
+
const [actionData, setActionData] = useState6();
|
|
16188
16156
|
const handleToggleModal = (e3) => {
|
|
16189
16157
|
e3.stopPropagation();
|
|
16190
16158
|
setShowModalDetail(!showModalDetail);
|
|
@@ -16193,7 +16161,7 @@ var ModalDetail = ({
|
|
|
16193
16161
|
sessionStorage.setItem("actionData", JSON.stringify(actionData));
|
|
16194
16162
|
window.location.href = `/form/menu?model=${model}&id=${idForm}`;
|
|
16195
16163
|
};
|
|
16196
|
-
return
|
|
16164
|
+
return createPortal2(
|
|
16197
16165
|
/* @__PURE__ */ jsx69(Fragment13, { children: showModalDetail && /* @__PURE__ */ jsxs44("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[100]", children: [
|
|
16198
16166
|
/* @__PURE__ */ jsx69("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
16199
16167
|
/* @__PURE__ */ jsx69("div", { className: "absolute inset-0 overflow-auto flex flex-col justify-center items-center px-5", children: /* @__PURE__ */ jsxs44("div", { className: "relative z-[1] max-w-full p-4 flex flex-col gap-4 w-[1000px] transform rounded-3xl bg-[#FFF] h-[90%]", children: [
|
|
@@ -16232,12 +16200,12 @@ var ModalDetail = ({
|
|
|
16232
16200
|
};
|
|
16233
16201
|
|
|
16234
16202
|
// src/widgets/common/loading-normal.tsx
|
|
16235
|
-
import { useEffect as
|
|
16203
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
16236
16204
|
import { jsx as jsx70, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
16237
16205
|
var LayerLoading = () => {
|
|
16238
16206
|
const { t: t3 } = useI18n();
|
|
16239
|
-
const [activeIndex, setActiveIndex] =
|
|
16240
|
-
|
|
16207
|
+
const [activeIndex, setActiveIndex] = useState7(0);
|
|
16208
|
+
useEffect8(() => {
|
|
16241
16209
|
const interval = setInterval(() => {
|
|
16242
16210
|
setActiveIndex((prevIndex) => (prevIndex + 1) % 6);
|
|
16243
16211
|
}, 200);
|
|
@@ -16256,11 +16224,11 @@ var LayerLoading = () => {
|
|
|
16256
16224
|
};
|
|
16257
16225
|
|
|
16258
16226
|
// src/widgets/common/loading-small.tsx
|
|
16259
|
-
import { useEffect as
|
|
16227
|
+
import { useEffect as useEffect9, useState as useState8 } from "react";
|
|
16260
16228
|
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
16261
16229
|
var LoadingSmall = () => {
|
|
16262
|
-
const [activeIndex, setActiveIndex] =
|
|
16263
|
-
|
|
16230
|
+
const [activeIndex, setActiveIndex] = useState8(0);
|
|
16231
|
+
useEffect9(() => {
|
|
16264
16232
|
const interval = setInterval(() => {
|
|
16265
16233
|
setActiveIndex((prevIndex) => (prevIndex + 1) % 6);
|
|
16266
16234
|
}, 200);
|
|
@@ -16595,11 +16563,11 @@ var ButtonSelectFiles = ({
|
|
|
16595
16563
|
};
|
|
16596
16564
|
|
|
16597
16565
|
// src/widgets/common/video-player.tsx
|
|
16598
|
-
import { useRef as
|
|
16566
|
+
import { useRef as useRef5, useState as useState9 } from "react";
|
|
16599
16567
|
import { jsx as jsx73, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
16600
16568
|
var VideoPlayer = ({ src }) => {
|
|
16601
|
-
const [isPlaying, setIsPlaying] =
|
|
16602
|
-
const videoRef =
|
|
16569
|
+
const [isPlaying, setIsPlaying] = useState9(false);
|
|
16570
|
+
const videoRef = useRef5(null);
|
|
16603
16571
|
const handlePlayPause = () => {
|
|
16604
16572
|
if (videoRef.current) {
|
|
16605
16573
|
if (isPlaying) {
|
|
@@ -16708,7 +16676,7 @@ var AvatarField = (props) => {
|
|
|
16708
16676
|
};
|
|
16709
16677
|
|
|
16710
16678
|
// src/widgets/basic/binary-field/binary.tsx
|
|
16711
|
-
import { useEffect as
|
|
16679
|
+
import { useEffect as useEffect10, useState as useState10 } from "react";
|
|
16712
16680
|
import { Fragment as Fragment16, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
16713
16681
|
var BinaryField = (props) => {
|
|
16714
16682
|
const {
|
|
@@ -16736,12 +16704,12 @@ var BinaryField = (props) => {
|
|
|
16736
16704
|
setInitialFile
|
|
16737
16705
|
} = props;
|
|
16738
16706
|
const { t: t3 } = useI18n();
|
|
16739
|
-
const [fileInfo, setFileInfo] =
|
|
16707
|
+
const [fileInfo, setFileInfo] = useState10(null);
|
|
16740
16708
|
const onlyImage = widget === "image" || widget === "image_url";
|
|
16741
|
-
|
|
16709
|
+
useEffect10(() => {
|
|
16742
16710
|
setInitialFile(value);
|
|
16743
16711
|
}, [value]);
|
|
16744
|
-
|
|
16712
|
+
useEffect10(() => {
|
|
16745
16713
|
const loadFromLink = async () => {
|
|
16746
16714
|
if (!initialFile || !initialFile.startsWith("http")) return;
|
|
16747
16715
|
if (typeof initialFile !== "string") {
|
|
@@ -17114,7 +17082,7 @@ var ButtonField = (props) => {
|
|
|
17114
17082
|
};
|
|
17115
17083
|
|
|
17116
17084
|
// src/widgets/basic/char-field/char.tsx
|
|
17117
|
-
import { useEffect as
|
|
17085
|
+
import { useEffect as useEffect11, useMemo as useMemo4 } from "react";
|
|
17118
17086
|
import { Fragment as Fragment18, jsx as jsx78, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
17119
17087
|
var WIDGET_AUTO_COMPUTE_DEPEND = "auto_compute_depend_field";
|
|
17120
17088
|
var CharField = (props) => {
|
|
@@ -17174,12 +17142,12 @@ var CharField = (props) => {
|
|
|
17174
17142
|
fieldState: { error: error2, isDirty }
|
|
17175
17143
|
}) => {
|
|
17176
17144
|
const { setError, clearErrors } = methods;
|
|
17177
|
-
|
|
17145
|
+
useEffect11(() => {
|
|
17178
17146
|
if (value2) {
|
|
17179
17147
|
clearErrors(name2);
|
|
17180
17148
|
}
|
|
17181
17149
|
}, [value2, clearErrors, name2]);
|
|
17182
|
-
|
|
17150
|
+
useEffect11(() => {
|
|
17183
17151
|
if (widget !== WIDGET_AUTO_COMPUTE_DEPEND) return;
|
|
17184
17152
|
const depValue = formValues?.[options2?.depend_field]?.[options2?.field_name];
|
|
17185
17153
|
const currentValue = methods?.getValues(name2);
|
|
@@ -17343,21 +17311,21 @@ var CheckboxField = (props) => {
|
|
|
17343
17311
|
};
|
|
17344
17312
|
|
|
17345
17313
|
// src/widgets/basic/color-field/color-wrapper.tsx
|
|
17346
|
-
import { useEffect as
|
|
17314
|
+
import { useEffect as useEffect12, useRef as useRef6, useState as useState11 } from "react";
|
|
17347
17315
|
import { Fragment as Fragment19, jsx as jsx80, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
17348
17316
|
var ColorWrapper = (props) => {
|
|
17349
17317
|
const { colors: colors2, defaultColor, savePickColor } = props;
|
|
17350
17318
|
const { t: t3 } = useI18n();
|
|
17351
|
-
const [selectedColor, setSelectedColor] =
|
|
17352
|
-
const [showFullColors, setIsShowFullColor] =
|
|
17353
|
-
const pickColorsRef =
|
|
17354
|
-
|
|
17319
|
+
const [selectedColor, setSelectedColor] = useState11(colors2[defaultColor]);
|
|
17320
|
+
const [showFullColors, setIsShowFullColor] = useState11(false);
|
|
17321
|
+
const pickColorsRef = useRef6(null);
|
|
17322
|
+
useEffect12(() => {
|
|
17355
17323
|
setSelectedColor(colors2[defaultColor]);
|
|
17356
17324
|
}, [defaultColor]);
|
|
17357
17325
|
const handleShowFullColors = () => {
|
|
17358
17326
|
setIsShowFullColor(!showFullColors);
|
|
17359
17327
|
};
|
|
17360
|
-
|
|
17328
|
+
useEffect12(() => {
|
|
17361
17329
|
const handleClickOutside = (event) => {
|
|
17362
17330
|
if (pickColorsRef.current && !pickColorsRef.current.contains(event.target)) {
|
|
17363
17331
|
setIsShowFullColor(false);
|
|
@@ -17448,7 +17416,7 @@ var ColorField = (props) => {
|
|
|
17448
17416
|
};
|
|
17449
17417
|
|
|
17450
17418
|
// src/widgets/basic/copy-link-buttton/copy-link.tsx
|
|
17451
|
-
import { useEffect as
|
|
17419
|
+
import { useEffect as useEffect13 } from "react";
|
|
17452
17420
|
import { jsx as jsx82, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
17453
17421
|
var CopyLinkButtonField = (props) => {
|
|
17454
17422
|
const {
|
|
@@ -17483,7 +17451,7 @@ var CopyLinkButtonField = (props) => {
|
|
|
17483
17451
|
fieldState: { error: error2 }
|
|
17484
17452
|
}) => {
|
|
17485
17453
|
const { setError, clearErrors } = methods;
|
|
17486
|
-
|
|
17454
|
+
useEffect13(() => {
|
|
17487
17455
|
if (value) {
|
|
17488
17456
|
clearErrors(name2);
|
|
17489
17457
|
}
|
|
@@ -17559,10 +17527,10 @@ var CopyLinkButtonField = (props) => {
|
|
|
17559
17527
|
};
|
|
17560
17528
|
|
|
17561
17529
|
// src/widgets/basic/date-field/date.tsx
|
|
17562
|
-
import { forwardRef as forwardRef6, useEffect as
|
|
17530
|
+
import { forwardRef as forwardRef6, useEffect as useEffect17 } from "react";
|
|
17563
17531
|
|
|
17564
17532
|
// node_modules/react-datepicker/dist/index.es.js
|
|
17565
|
-
import React9, { useRef as
|
|
17533
|
+
import React9, { useRef as useRef10, useCallback as useCallback5, useEffect as useEffect15, cloneElement as cloneElement3, Component, createRef, createElement as createElement5 } from "react";
|
|
17566
17534
|
|
|
17567
17535
|
// node_modules/date-fns/constants.js
|
|
17568
17536
|
var daysInYear = 365.2425;
|
|
@@ -22132,8 +22100,8 @@ var CalendarContainer = function(_a2) {
|
|
|
22132
22100
|
return React9.createElement("div", { className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children);
|
|
22133
22101
|
};
|
|
22134
22102
|
var useDetectClickOutside = function(onClickOutside, ignoreClass) {
|
|
22135
|
-
var ref =
|
|
22136
|
-
var onClickOutsideRef =
|
|
22103
|
+
var ref = useRef10(null);
|
|
22104
|
+
var onClickOutsideRef = useRef10(onClickOutside);
|
|
22137
22105
|
onClickOutsideRef.current = onClickOutside;
|
|
22138
22106
|
var handleClickOutside = useCallback5(function(event) {
|
|
22139
22107
|
var _a2;
|
|
@@ -22146,7 +22114,7 @@ var useDetectClickOutside = function(onClickOutside, ignoreClass) {
|
|
|
22146
22114
|
}
|
|
22147
22115
|
}
|
|
22148
22116
|
}, [ignoreClass]);
|
|
22149
|
-
|
|
22117
|
+
useEffect15(function() {
|
|
22150
22118
|
document.addEventListener("mousedown", handleClickOutside);
|
|
22151
22119
|
return function() {
|
|
22152
22120
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
@@ -25387,7 +25355,7 @@ function withFloating(Component3) {
|
|
|
25387
25355
|
var WithFloating = function(props) {
|
|
25388
25356
|
var _a2;
|
|
25389
25357
|
var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true;
|
|
25390
|
-
var arrowRef =
|
|
25358
|
+
var arrowRef = useRef10(null);
|
|
25391
25359
|
var floatingProps = useFloating2(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
|
|
25392
25360
|
flip3({ padding: 15 }),
|
|
25393
25361
|
offset3(10),
|
|
@@ -26399,13 +26367,13 @@ function _objectWithoutProperties(e3, t3) {
|
|
|
26399
26367
|
}
|
|
26400
26368
|
|
|
26401
26369
|
// node_modules/react-select/dist/useStateManager-7e1e8489.esm.js
|
|
26402
|
-
import { useState as
|
|
26370
|
+
import { useState as useState14, useCallback as useCallback6 } from "react";
|
|
26403
26371
|
var _excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|
|
26404
26372
|
function useStateManager(_ref3) {
|
|
26405
26373
|
var _ref$defaultInputValu = _ref3.defaultInputValue, defaultInputValue = _ref$defaultInputValu === void 0 ? "" : _ref$defaultInputValu, _ref$defaultMenuIsOpe = _ref3.defaultMenuIsOpen, defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe, _ref$defaultValue = _ref3.defaultValue, defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue, propsInputValue = _ref3.inputValue, propsMenuIsOpen = _ref3.menuIsOpen, propsOnChange = _ref3.onChange, propsOnInputChange = _ref3.onInputChange, propsOnMenuClose = _ref3.onMenuClose, propsOnMenuOpen = _ref3.onMenuOpen, propsValue = _ref3.value, restSelectProps = _objectWithoutProperties(_ref3, _excluded);
|
|
26406
|
-
var _useState =
|
|
26407
|
-
var _useState3 =
|
|
26408
|
-
var _useState5 =
|
|
26374
|
+
var _useState = useState14(propsInputValue !== void 0 ? propsInputValue : defaultInputValue), _useState2 = _slicedToArray(_useState, 2), stateInputValue = _useState2[0], setStateInputValue = _useState2[1];
|
|
26375
|
+
var _useState3 = useState14(propsMenuIsOpen !== void 0 ? propsMenuIsOpen : defaultMenuIsOpen), _useState4 = _slicedToArray(_useState3, 2), stateMenuIsOpen = _useState4[0], setStateMenuIsOpen = _useState4[1];
|
|
26376
|
+
var _useState5 = useState14(propsValue !== void 0 ? propsValue : defaultValue), _useState6 = _slicedToArray(_useState5, 2), stateValue = _useState6[0], setStateValue = _useState6[1];
|
|
26409
26377
|
var onChange2 = useCallback6(function(value2, actionMeta) {
|
|
26410
26378
|
if (typeof propsOnChange === "function") {
|
|
26411
26379
|
propsOnChange(value2, actionMeta);
|
|
@@ -26566,7 +26534,7 @@ function _toConsumableArray(r4) {
|
|
|
26566
26534
|
|
|
26567
26535
|
// node_modules/react-select/dist/Select-ef7c0426.esm.js
|
|
26568
26536
|
import * as React13 from "react";
|
|
26569
|
-
import { useMemo as useMemo8, Fragment as Fragment23, useRef as
|
|
26537
|
+
import { useMemo as useMemo8, Fragment as Fragment23, useRef as useRef13, useCallback as useCallback8, useEffect as useEffect16, Component as Component2 } from "react";
|
|
26570
26538
|
|
|
26571
26539
|
// node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js
|
|
26572
26540
|
import * as React11 from "react";
|
|
@@ -27898,8 +27866,8 @@ function _taggedTemplateLiteral(e3, t3) {
|
|
|
27898
27866
|
}
|
|
27899
27867
|
|
|
27900
27868
|
// node_modules/react-select/dist/index-641ee5b8.esm.js
|
|
27901
|
-
import { useContext as useContext9, useRef as
|
|
27902
|
-
import { createPortal as
|
|
27869
|
+
import { useContext as useContext9, useRef as useRef12, useState as useState15, useMemo as useMemo7, useCallback as useCallback7, createContext as createContext5 } from "react";
|
|
27870
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
27903
27871
|
|
|
27904
27872
|
// node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js
|
|
27905
27873
|
import { useLayoutEffect as useLayoutEffect4 } from "react";
|
|
@@ -28244,9 +28212,9 @@ var PortalPlacementContext = /* @__PURE__ */ createContext5(null);
|
|
|
28244
28212
|
var MenuPlacer = function MenuPlacer2(props) {
|
|
28245
28213
|
var children = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme;
|
|
28246
28214
|
var _ref3 = useContext9(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement;
|
|
28247
|
-
var ref =
|
|
28248
|
-
var _useState =
|
|
28249
|
-
var _useState3 =
|
|
28215
|
+
var ref = useRef12(null);
|
|
28216
|
+
var _useState = useState15(maxMenuHeight), _useState2 = _slicedToArray(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1];
|
|
28217
|
+
var _useState3 = useState15(null), _useState4 = _slicedToArray(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1];
|
|
28250
28218
|
var controlHeight2 = theme.spacing.controlHeight;
|
|
28251
28219
|
index3(function() {
|
|
28252
28220
|
var menuEl = ref.current;
|
|
@@ -28348,15 +28316,15 @@ var menuPortalCSS = function menuPortalCSS2(_ref8) {
|
|
|
28348
28316
|
};
|
|
28349
28317
|
var MenuPortal = function MenuPortal2(props) {
|
|
28350
28318
|
var appendTo = props.appendTo, children = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition;
|
|
28351
|
-
var menuPortalRef =
|
|
28352
|
-
var cleanupRef =
|
|
28353
|
-
var _useState5 =
|
|
28319
|
+
var menuPortalRef = useRef12(null);
|
|
28320
|
+
var cleanupRef = useRef12(null);
|
|
28321
|
+
var _useState5 = useState15(coercePlacement(menuPlacement)), _useState6 = _slicedToArray(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1];
|
|
28354
28322
|
var portalPlacementContext = useMemo7(function() {
|
|
28355
28323
|
return {
|
|
28356
28324
|
setPortalPlacement
|
|
28357
28325
|
};
|
|
28358
28326
|
}, []);
|
|
28359
|
-
var _useState7 =
|
|
28327
|
+
var _useState7 = useState15(null), _useState8 = _slicedToArray(_useState7, 2), computedPosition = _useState8[0], setComputedPosition = _useState8[1];
|
|
28360
28328
|
var updateComputedPosition = useCallback7(function() {
|
|
28361
28329
|
if (!controlElement) return;
|
|
28362
28330
|
var rect = getBoundingClientObj(controlElement);
|
|
@@ -28402,7 +28370,7 @@ var MenuPortal = function MenuPortal2(props) {
|
|
|
28402
28370
|
}), innerProps), children);
|
|
28403
28371
|
return jsx84(PortalPlacementContext.Provider, {
|
|
28404
28372
|
value: portalPlacementContext
|
|
28405
|
-
}, appendTo ? /* @__PURE__ */
|
|
28373
|
+
}, appendTo ? /* @__PURE__ */ createPortal4(menuWrapper, appendTo) : menuWrapper);
|
|
28406
28374
|
};
|
|
28407
28375
|
var containerCSS = function containerCSS2(_ref3) {
|
|
28408
28376
|
var isDisabled = _ref3.isDisabled, isRtl = _ref3.isRtl;
|
|
@@ -29487,10 +29455,10 @@ var cancelScroll = function cancelScroll2(event) {
|
|
|
29487
29455
|
};
|
|
29488
29456
|
function useScrollCapture(_ref3) {
|
|
29489
29457
|
var isEnabled = _ref3.isEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
|
|
29490
|
-
var isBottom =
|
|
29491
|
-
var isTop =
|
|
29492
|
-
var touchStart =
|
|
29493
|
-
var scrollTarget =
|
|
29458
|
+
var isBottom = useRef13(false);
|
|
29459
|
+
var isTop = useRef13(false);
|
|
29460
|
+
var touchStart = useRef13(0);
|
|
29461
|
+
var scrollTarget = useRef13(null);
|
|
29494
29462
|
var handleEventDelta = useCallback8(function(event, delta) {
|
|
29495
29463
|
if (scrollTarget.current === null) return;
|
|
29496
29464
|
var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight;
|
|
@@ -29550,7 +29518,7 @@ function useScrollCapture(_ref3) {
|
|
|
29550
29518
|
el.removeEventListener("touchstart", onTouchStart, false);
|
|
29551
29519
|
el.removeEventListener("touchmove", onTouchMove, false);
|
|
29552
29520
|
}, [onTouchMove, onTouchStart, onWheel]);
|
|
29553
|
-
|
|
29521
|
+
useEffect16(function() {
|
|
29554
29522
|
if (!isEnabled) return;
|
|
29555
29523
|
var element = scrollTarget.current;
|
|
29556
29524
|
startListening(element);
|
|
@@ -29597,8 +29565,8 @@ var listenerOptions = {
|
|
|
29597
29565
|
};
|
|
29598
29566
|
function useScrollLock(_ref3) {
|
|
29599
29567
|
var isEnabled = _ref3.isEnabled, _ref$accountForScroll = _ref3.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
|
|
29600
|
-
var originalStyles =
|
|
29601
|
-
var scrollTarget =
|
|
29568
|
+
var originalStyles = useRef13({});
|
|
29569
|
+
var scrollTarget = useRef13(null);
|
|
29602
29570
|
var addScrollLock = useCallback8(function(touchScrollTarget) {
|
|
29603
29571
|
if (!canUseDOM) return;
|
|
29604
29572
|
var target = document.body;
|
|
@@ -29653,7 +29621,7 @@ function useScrollLock(_ref3) {
|
|
|
29653
29621
|
}
|
|
29654
29622
|
}
|
|
29655
29623
|
}, [accountForScrollbars]);
|
|
29656
|
-
|
|
29624
|
+
useEffect16(function() {
|
|
29657
29625
|
if (!isEnabled) return;
|
|
29658
29626
|
var element = scrollTarget.current;
|
|
29659
29627
|
addScrollLock(element);
|
|
@@ -31371,7 +31339,7 @@ var DateField = (props) => {
|
|
|
31371
31339
|
},
|
|
31372
31340
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
31373
31341
|
const { setError, clearErrors } = methods;
|
|
31374
|
-
|
|
31342
|
+
useEffect17(() => {
|
|
31375
31343
|
if (value) {
|
|
31376
31344
|
clearErrors(name2);
|
|
31377
31345
|
}
|
|
@@ -31603,7 +31571,7 @@ var DownloadFileField = (props) => {
|
|
|
31603
31571
|
};
|
|
31604
31572
|
|
|
31605
31573
|
// src/widgets/basic/dropdown-field/dropdown.tsx
|
|
31606
|
-
import { useState as
|
|
31574
|
+
import { useState as useState16 } from "react";
|
|
31607
31575
|
import { jsx as jsx89, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
31608
31576
|
var DropdownField = (props) => {
|
|
31609
31577
|
const {
|
|
@@ -31616,7 +31584,7 @@ var DropdownField = (props) => {
|
|
|
31616
31584
|
dropdownClassName = "",
|
|
31617
31585
|
useClickOutside: useClickOutside2
|
|
31618
31586
|
} = props;
|
|
31619
|
-
const [open, setOpen] =
|
|
31587
|
+
const [open, setOpen] = useState16(false);
|
|
31620
31588
|
const dropdownRef = useClickOutside2({ handler: () => setOpen(false) });
|
|
31621
31589
|
return /* @__PURE__ */ jsxs58(
|
|
31622
31590
|
"div",
|
|
@@ -31725,7 +31693,7 @@ var FeeField = (props) => {
|
|
|
31725
31693
|
};
|
|
31726
31694
|
|
|
31727
31695
|
// src/widgets/basic/file-upload-field/file-upload.tsx
|
|
31728
|
-
import { useEffect as
|
|
31696
|
+
import { useEffect as useEffect18, useRef as useRef14, useState as useState17 } from "react";
|
|
31729
31697
|
import { jsx as jsx91, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
31730
31698
|
var RenderFile = ({
|
|
31731
31699
|
file,
|
|
@@ -31790,10 +31758,10 @@ var FileUploadField = (props) => {
|
|
|
31790
31758
|
downloadFunction
|
|
31791
31759
|
} = props;
|
|
31792
31760
|
const { t: t3 } = useI18n();
|
|
31793
|
-
const fileInputRef =
|
|
31794
|
-
const [selectedFiles, setSelectedFiles] =
|
|
31795
|
-
const [uploadError, setUploadError] =
|
|
31796
|
-
|
|
31761
|
+
const fileInputRef = useRef14(null);
|
|
31762
|
+
const [selectedFiles, setSelectedFiles] = useState17([]);
|
|
31763
|
+
const [uploadError, setUploadError] = useState17();
|
|
31764
|
+
useEffect18(() => {
|
|
31797
31765
|
if (selectedFiles?.length === 0 && value) {
|
|
31798
31766
|
setSelectedFiles([
|
|
31799
31767
|
{
|
|
@@ -31811,7 +31779,7 @@ var FileUploadField = (props) => {
|
|
|
31811
31779
|
required: required ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
31812
31780
|
},
|
|
31813
31781
|
render: ({ field: { onChange: onChange2 }, fieldState: { error: error2 } }) => {
|
|
31814
|
-
|
|
31782
|
+
useEffect18(() => {
|
|
31815
31783
|
let data = widget === "many2many_binary" ? selectedFiles : selectedFiles?.[0]?.data;
|
|
31816
31784
|
if (widget !== "many2many_binary" && data && isBase64File(data)) {
|
|
31817
31785
|
data = data.split(",")[1];
|
|
@@ -31867,7 +31835,7 @@ var FileUploadField = (props) => {
|
|
|
31867
31835
|
};
|
|
31868
31836
|
|
|
31869
31837
|
// src/widgets/basic/float-field/float.tsx
|
|
31870
|
-
import { useEffect as
|
|
31838
|
+
import { useEffect as useEffect19, useRef as useRef15, useState as useState18 } from "react";
|
|
31871
31839
|
import { Fragment as Fragment26, jsx as jsx92, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
31872
31840
|
var FloatField = (props) => {
|
|
31873
31841
|
const {
|
|
@@ -31899,10 +31867,10 @@ var FloatField = (props) => {
|
|
|
31899
31867
|
},
|
|
31900
31868
|
render: ({ field: { onChange: onChange2, value }, fieldState: { error: error2 } }) => {
|
|
31901
31869
|
const { setError, clearErrors } = methods;
|
|
31902
|
-
const [inputValue, setInputValue] =
|
|
31870
|
+
const [inputValue, setInputValue] = useState18(
|
|
31903
31871
|
value !== void 0 && value !== null ? formatFloatNumber(value) : ""
|
|
31904
31872
|
);
|
|
31905
|
-
|
|
31873
|
+
useEffect19(() => {
|
|
31906
31874
|
if (isDirtyRef.current) return;
|
|
31907
31875
|
const numericInput = parseFloat(inputValue?.replace(/,/g, ""));
|
|
31908
31876
|
if (propValue !== void 0 && propValue !== null && !Number.isNaN(propValue) && propValue !== numericInput) {
|
|
@@ -31915,9 +31883,9 @@ var FloatField = (props) => {
|
|
|
31915
31883
|
setInputValue("");
|
|
31916
31884
|
}
|
|
31917
31885
|
}, [value, name2, clearErrors, propValue]);
|
|
31918
|
-
const isDirtyRef =
|
|
31919
|
-
const inputRef =
|
|
31920
|
-
const lastCommittedValueRef =
|
|
31886
|
+
const isDirtyRef = useRef15(false);
|
|
31887
|
+
const inputRef = useRef15(null);
|
|
31888
|
+
const lastCommittedValueRef = useRef15(null);
|
|
31921
31889
|
const handleInputChange = (e3) => {
|
|
31922
31890
|
const newValue = e3.target.value;
|
|
31923
31891
|
const valueWithoutCommas = newValue.replace(/,/g, "");
|
|
@@ -32024,7 +31992,7 @@ var FloatField = (props) => {
|
|
|
32024
31992
|
};
|
|
32025
31993
|
|
|
32026
31994
|
// src/widgets/basic/float-time-field/float-time.tsx
|
|
32027
|
-
import { useState as
|
|
31995
|
+
import { useState as useState19 } from "react";
|
|
32028
31996
|
import { Fragment as Fragment27, jsx as jsx93, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
32029
31997
|
var FloatTimeField = (props) => {
|
|
32030
31998
|
const {
|
|
@@ -32056,11 +32024,11 @@ var FloatTimeField = (props) => {
|
|
|
32056
32024
|
field: { onChange: fieldOnChange, onBlur, value: value2 },
|
|
32057
32025
|
fieldState: { error: error2, isDirty }
|
|
32058
32026
|
}) => {
|
|
32059
|
-
const [input, setInput] =
|
|
32027
|
+
const [input, setInput] = useState19(
|
|
32060
32028
|
convertFloatToTime(value2 ?? defaultValue)
|
|
32061
32029
|
);
|
|
32062
|
-
const [formattedTime, setFormattedTime] =
|
|
32063
|
-
const [errors, setErrors] =
|
|
32030
|
+
const [formattedTime, setFormattedTime] = useState19("");
|
|
32031
|
+
const [errors, setErrors] = useState19("");
|
|
32064
32032
|
const handleInputChange = (e3) => {
|
|
32065
32033
|
const raw = e3.target.value.replace(/[^\d:]/g, "");
|
|
32066
32034
|
setInput(raw);
|
|
@@ -32146,7 +32114,7 @@ var FloatTimeField = (props) => {
|
|
|
32146
32114
|
};
|
|
32147
32115
|
|
|
32148
32116
|
// src/widgets/basic/html-field/html.tsx
|
|
32149
|
-
import { useEffect as
|
|
32117
|
+
import { useEffect as useEffect20, useRef as useRef16 } from "react";
|
|
32150
32118
|
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
32151
32119
|
var HtmlField = (props) => {
|
|
32152
32120
|
const {
|
|
@@ -32159,7 +32127,7 @@ var HtmlField = (props) => {
|
|
|
32159
32127
|
value,
|
|
32160
32128
|
isEditTable
|
|
32161
32129
|
} = props;
|
|
32162
|
-
const divRef =
|
|
32130
|
+
const divRef = useRef16(null);
|
|
32163
32131
|
if (!isForm && !isEditTable) {
|
|
32164
32132
|
return /* @__PURE__ */ jsx94("div", { dangerouslySetInnerHTML: { __html: value || defaultValue || "" } });
|
|
32165
32133
|
}
|
|
@@ -32170,7 +32138,7 @@ var HtmlField = (props) => {
|
|
|
32170
32138
|
control: methods?.control,
|
|
32171
32139
|
defaultValue,
|
|
32172
32140
|
render: ({ field: { onChange: fieldOnChange, value: value2 } }) => {
|
|
32173
|
-
|
|
32141
|
+
useEffect20(() => {
|
|
32174
32142
|
if (divRef.current && divRef.current.innerHTML !== value2) {
|
|
32175
32143
|
divRef.current.innerHTML = value2 || "";
|
|
32176
32144
|
}
|
|
@@ -32212,7 +32180,7 @@ var ImageField = (props) => {
|
|
|
32212
32180
|
};
|
|
32213
32181
|
|
|
32214
32182
|
// src/widgets/basic/many2many-tags-field/many2many-tags.tsx
|
|
32215
|
-
import React16, { useEffect as
|
|
32183
|
+
import React16, { useEffect as useEffect21, useMemo as useMemo10 } from "react";
|
|
32216
32184
|
|
|
32217
32185
|
// src/widgets/basic/information-field/information.tsx
|
|
32218
32186
|
import { Fragment as Fragment28, jsx as jsx96, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
@@ -32354,7 +32322,7 @@ var Many2ManyTagField = (props) => {
|
|
|
32354
32322
|
},
|
|
32355
32323
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
32356
32324
|
const { clearErrors } = methods;
|
|
32357
|
-
|
|
32325
|
+
useEffect21(() => {
|
|
32358
32326
|
if (field.value) {
|
|
32359
32327
|
clearErrors(name2);
|
|
32360
32328
|
}
|
|
@@ -32494,7 +32462,7 @@ var Many2ManyTagField = (props) => {
|
|
|
32494
32462
|
};
|
|
32495
32463
|
|
|
32496
32464
|
// src/widgets/basic/monetary-field/monetary.tsx
|
|
32497
|
-
import { useEffect as
|
|
32465
|
+
import { useEffect as useEffect22 } from "react";
|
|
32498
32466
|
import { Fragment as Fragment29, jsx as jsx98, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
32499
32467
|
var MonetaryField = (props) => {
|
|
32500
32468
|
const { t: t3 } = useI18n();
|
|
@@ -32548,7 +32516,7 @@ var MonetaryField = (props) => {
|
|
|
32548
32516
|
fieldState: { error: error2 }
|
|
32549
32517
|
}) => {
|
|
32550
32518
|
const { setError, clearErrors } = methods;
|
|
32551
|
-
|
|
32519
|
+
useEffect22(() => {
|
|
32552
32520
|
if (value2 !== void 0 && value2 !== null && !isNaN(value2)) {
|
|
32553
32521
|
clearErrors(name2);
|
|
32554
32522
|
}
|
|
@@ -32606,7 +32574,7 @@ var PaidBadgedField = () => {
|
|
|
32606
32574
|
};
|
|
32607
32575
|
|
|
32608
32576
|
// src/widgets/basic/priority-field/rating-star.tsx
|
|
32609
|
-
import React17, { useEffect as
|
|
32577
|
+
import React17, { useEffect as useEffect23, useState as useState20 } from "react";
|
|
32610
32578
|
import { jsx as jsx100, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
32611
32579
|
var RatingStarField = (props) => {
|
|
32612
32580
|
const {
|
|
@@ -32616,9 +32584,9 @@ var RatingStarField = (props) => {
|
|
|
32616
32584
|
onSelectPriority,
|
|
32617
32585
|
id
|
|
32618
32586
|
} = props;
|
|
32619
|
-
const [rating, setRating] =
|
|
32620
|
-
const [hover, setHover] =
|
|
32621
|
-
|
|
32587
|
+
const [rating, setRating] = useState20(defaultValue);
|
|
32588
|
+
const [hover, setHover] = useState20(0);
|
|
32589
|
+
useEffect23(() => {
|
|
32622
32590
|
setRating(defaultValue);
|
|
32623
32591
|
}, [defaultValue]);
|
|
32624
32592
|
const handleClick = (value) => {
|
|
@@ -32731,7 +32699,7 @@ var PriorityField = (props) => {
|
|
|
32731
32699
|
};
|
|
32732
32700
|
|
|
32733
32701
|
// src/widgets/basic/radio-group-field/radio-group.tsx
|
|
32734
|
-
import { useEffect as
|
|
32702
|
+
import { useEffect as useEffect24 } from "react";
|
|
32735
32703
|
import { jsx as jsx102, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
32736
32704
|
var RadioGroupField = (props) => {
|
|
32737
32705
|
const {
|
|
@@ -32745,7 +32713,7 @@ var RadioGroupField = (props) => {
|
|
|
32745
32713
|
onChange: onChange2,
|
|
32746
32714
|
setValue
|
|
32747
32715
|
} = props;
|
|
32748
|
-
|
|
32716
|
+
useEffect24(() => {
|
|
32749
32717
|
if (selection?.length > 0) {
|
|
32750
32718
|
if (setValue) setValue(name2, selection?.[0]?.[0]);
|
|
32751
32719
|
}
|
|
@@ -33049,7 +33017,7 @@ var ToggleButtonField = (props) => {
|
|
|
33049
33017
|
};
|
|
33050
33018
|
|
|
33051
33019
|
// src/widgets/basic/integer-field/integer.tsx
|
|
33052
|
-
import { useEffect as
|
|
33020
|
+
import { useEffect as useEffect25, useRef as useRef17, useState as useState21 } from "react";
|
|
33053
33021
|
import { Fragment as Fragment31, jsx as jsx107, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
33054
33022
|
var IntegerField = (props) => {
|
|
33055
33023
|
const {
|
|
@@ -33085,13 +33053,13 @@ var IntegerField = (props) => {
|
|
|
33085
33053
|
fieldState: { error: error2 }
|
|
33086
33054
|
}) => {
|
|
33087
33055
|
const { setError, clearErrors } = methods;
|
|
33088
|
-
const isDirtyRef =
|
|
33089
|
-
const inputRef =
|
|
33090
|
-
const lastCommittedValueRef =
|
|
33091
|
-
const [inputValue, setInputValue] =
|
|
33056
|
+
const isDirtyRef = useRef17(false);
|
|
33057
|
+
const inputRef = useRef17(null);
|
|
33058
|
+
const lastCommittedValueRef = useRef17(null);
|
|
33059
|
+
const [inputValue, setInputValue] = useState21(
|
|
33092
33060
|
value2 !== void 0 && value2 !== null ? String(value2) : ""
|
|
33093
33061
|
);
|
|
33094
|
-
|
|
33062
|
+
useEffect25(() => {
|
|
33095
33063
|
if (value2 !== void 0 && value2 !== null) {
|
|
33096
33064
|
setInputValue(String(value2));
|
|
33097
33065
|
clearErrors(name2);
|
|
@@ -33248,8 +33216,8 @@ var StatusDropdownField = (props) => {
|
|
|
33248
33216
|
};
|
|
33249
33217
|
|
|
33250
33218
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
33251
|
-
import { createPortal as
|
|
33252
|
-
import { useEffect as
|
|
33219
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
33220
|
+
import { useEffect as useEffect26 } from "react";
|
|
33253
33221
|
import { jsx as jsx109, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
33254
33222
|
var Many2ManyField = (props) => {
|
|
33255
33223
|
const { t: t3 } = useI18n();
|
|
@@ -33309,7 +33277,7 @@ var Many2ManyField = (props) => {
|
|
|
33309
33277
|
clearSearch
|
|
33310
33278
|
} = searchController;
|
|
33311
33279
|
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33312
|
-
|
|
33280
|
+
useEffect26(() => {
|
|
33313
33281
|
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33314
33282
|
if (groupItems?.length > 0) {
|
|
33315
33283
|
typeof setPageLimit === "function" && setPageLimit(80);
|
|
@@ -33323,7 +33291,7 @@ var Many2ManyField = (props) => {
|
|
|
33323
33291
|
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33324
33292
|
};
|
|
33325
33293
|
}, [selectedTags]);
|
|
33326
|
-
return
|
|
33294
|
+
return createPortal5(
|
|
33327
33295
|
/* @__PURE__ */ jsxs73(
|
|
33328
33296
|
"div",
|
|
33329
33297
|
{
|
|
@@ -33529,7 +33497,7 @@ var Many2ManyField = (props) => {
|
|
|
33529
33497
|
};
|
|
33530
33498
|
|
|
33531
33499
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
33532
|
-
import React18, { useEffect as
|
|
33500
|
+
import React18, { useEffect as useEffect27 } from "react";
|
|
33533
33501
|
import { Fragment as Fragment32, jsx as jsx110, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
33534
33502
|
var CustomMenuList2 = (props) => {
|
|
33535
33503
|
const { t: t3 } = useI18n();
|
|
@@ -33632,7 +33600,7 @@ var Many2OneField = (props) => {
|
|
|
33632
33600
|
const selectedOption = isForm && options2?.service && options2?.type && options2?.model ? tempSelectedOption : tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
33633
33601
|
(option) => option.value === tempSelectedOption?.value
|
|
33634
33602
|
) : currentValue ? currentValue : null;
|
|
33635
|
-
|
|
33603
|
+
useEffect27(() => {
|
|
33636
33604
|
if (error2 && selectedOption) {
|
|
33637
33605
|
methods?.clearErrors(name2);
|
|
33638
33606
|
}
|