@fctc/sme-widget-ui 1.0.1 → 1.0.3
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 +70 -36
- package/dist/index.mjs +103 -69
- package/dist/widgets.d.mts +8 -4
- package/dist/widgets.d.ts +8 -4
- package/dist/widgets.js +70 -36
- package/dist/widgets.mjs +105 -71
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12366,13 +12366,13 @@ var TableBody = (props) => {
|
|
|
12366
12366
|
};
|
|
12367
12367
|
|
|
12368
12368
|
// src/widgets/advanced/table/table-filter.tsx
|
|
12369
|
-
import { useEffect as useEffect4, useRef as
|
|
12369
|
+
import { useEffect as useEffect4, useRef as useRef4, useState as useState3 } from "react";
|
|
12370
12370
|
import { createPortal } from "react-dom";
|
|
12371
12371
|
import { jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12372
12372
|
var TableFilter = ({ columns, onToggleColumnOptional }) => {
|
|
12373
12373
|
const [openTableFilter, setOpenTableFilter] = useState3();
|
|
12374
12374
|
const [filterPosition, setFilterPosition] = useState3(null);
|
|
12375
|
-
const filterPopupRef =
|
|
12375
|
+
const filterPopupRef = useRef4(null);
|
|
12376
12376
|
const filterRef = useClickOutside({
|
|
12377
12377
|
handler: () => {
|
|
12378
12378
|
if (openTableFilter) {
|
|
@@ -12404,7 +12404,10 @@ var TableFilter = ({ columns, onToggleColumnOptional }) => {
|
|
|
12404
12404
|
"div",
|
|
12405
12405
|
{
|
|
12406
12406
|
ref: filterRef,
|
|
12407
|
-
|
|
12407
|
+
style: {
|
|
12408
|
+
transform: "translateY(-50%)"
|
|
12409
|
+
},
|
|
12410
|
+
className: "w-fit absolute top-[50%] translate-y-[-50%] right-[10px] ms-auto z-[32] bg-[#eff1f2]",
|
|
12408
12411
|
children: [
|
|
12409
12412
|
/* @__PURE__ */ jsx43(
|
|
12410
12413
|
"button",
|
|
@@ -12610,7 +12613,11 @@ var TableHead = (props) => {
|
|
|
12610
12613
|
columns && Array.isArray(columns) && columns?.some((column2) => column2?.optional) && /* @__PURE__ */ jsx45(
|
|
12611
12614
|
"th",
|
|
12612
12615
|
{
|
|
12613
|
-
|
|
12616
|
+
style: {
|
|
12617
|
+
minWidth: "40px",
|
|
12618
|
+
right: 0
|
|
12619
|
+
},
|
|
12620
|
+
className: `column whitespace-nowrap text-left p-3 text-sm font-medium capitalize text-[#121212] min-w-[40px] sticky right-[0px] bg-[#eff1f2]`,
|
|
12614
12621
|
children: /* @__PURE__ */ jsx45(
|
|
12615
12622
|
TableFilter,
|
|
12616
12623
|
{
|
|
@@ -14756,10 +14763,8 @@ var PopupFilter = ({
|
|
|
14756
14763
|
return;
|
|
14757
14764
|
}
|
|
14758
14765
|
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14759
|
-
title: /* @__PURE__ */ jsx54(FilterIcon, {}),
|
|
14760
14766
|
name: item?.name,
|
|
14761
14767
|
value: item?.string ?? item?.help,
|
|
14762
|
-
icon: /* @__PURE__ */ jsx54(FilterIcon, {}),
|
|
14763
14768
|
domain: item?.domain,
|
|
14764
14769
|
groupIndex: item?.group_index,
|
|
14765
14770
|
type: SearchType.FILTER
|
|
@@ -14798,10 +14803,8 @@ var PopupFilter = ({
|
|
|
14798
14803
|
return;
|
|
14799
14804
|
}
|
|
14800
14805
|
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14801
|
-
title: /* @__PURE__ */ jsx54(GroupByIcon, {}),
|
|
14802
14806
|
name: item?.name,
|
|
14803
14807
|
value: item?.string,
|
|
14804
|
-
icon: /* @__PURE__ */ jsx54(GroupByIcon, {}),
|
|
14805
14808
|
type: SearchType.GROUP,
|
|
14806
14809
|
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14807
14810
|
active: !isExist,
|
|
@@ -14844,7 +14847,7 @@ var TagSearch = ({
|
|
|
14844
14847
|
{
|
|
14845
14848
|
className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14846
14849
|
children: [
|
|
14847
|
-
/* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.title }),
|
|
14850
|
+
/* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.type === SearchType.SEARCH ? tag?.title : /* @__PURE__ */ jsx55(FilterIcon, {}) }),
|
|
14848
14851
|
/* @__PURE__ */ jsx55("div", { className: "pl-2 align-middle text-[#495057] text-[14px]", children: tag.values.map((value, idx) => {
|
|
14849
14852
|
return /* @__PURE__ */ jsxs37(Fragment7, { children: [
|
|
14850
14853
|
/* @__PURE__ */ jsx55("span", { children: value }),
|
|
@@ -14890,7 +14893,7 @@ var TagSearch = ({
|
|
|
14890
14893
|
{
|
|
14891
14894
|
className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14892
14895
|
children: [
|
|
14893
|
-
/* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children:
|
|
14896
|
+
/* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ jsx55(GroupByIcon, {}) }),
|
|
14894
14897
|
value?.strings?.map((string, idx) => /* @__PURE__ */ jsxs37(Fragment8, { children: [
|
|
14895
14898
|
/* @__PURE__ */ jsx55("span", { children: string }),
|
|
14896
14899
|
idx < value?.strings.length - 1 && /* @__PURE__ */ jsxs37("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
@@ -15003,7 +15006,8 @@ var Search = ({
|
|
|
15003
15006
|
aid,
|
|
15004
15007
|
selectedRowKeys,
|
|
15005
15008
|
domainSearch,
|
|
15006
|
-
evalJSONContext
|
|
15009
|
+
evalJSONContext,
|
|
15010
|
+
clearSearch
|
|
15007
15011
|
}) => {
|
|
15008
15012
|
const [showPopupFilter, setShowPopupFilter] = useState5(false);
|
|
15009
15013
|
const popupFilterRef = useClickOutside({
|
|
@@ -15023,6 +15027,13 @@ var Search = ({
|
|
|
15023
15027
|
}
|
|
15024
15028
|
}
|
|
15025
15029
|
}, [selectedTags, isReadyFormatDomain]);
|
|
15030
|
+
useEffect6(() => {
|
|
15031
|
+
return () => {
|
|
15032
|
+
clearSearch();
|
|
15033
|
+
setDidInit(false);
|
|
15034
|
+
setIsReadyFormatDomain(false);
|
|
15035
|
+
};
|
|
15036
|
+
}, [viewData]);
|
|
15026
15037
|
useEffect6(() => {
|
|
15027
15038
|
if (didInit || selectedTags?.length > 0) return;
|
|
15028
15039
|
const searchDefaults = Object.entries(context || {}).filter(
|
|
@@ -17211,11 +17222,11 @@ var LoadingSmall = () => {
|
|
|
17211
17222
|
};
|
|
17212
17223
|
|
|
17213
17224
|
// src/widgets/common/video-player.tsx
|
|
17214
|
-
import { useRef as
|
|
17225
|
+
import { useRef as useRef5, useState as useState9 } from "react";
|
|
17215
17226
|
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
17216
17227
|
var VideoPlayer = ({ src }) => {
|
|
17217
17228
|
const [isPlaying, setIsPlaying] = useState9(false);
|
|
17218
|
-
const videoRef =
|
|
17229
|
+
const videoRef = useRef5(null);
|
|
17219
17230
|
const handlePlayPause = () => {
|
|
17220
17231
|
if (videoRef.current) {
|
|
17221
17232
|
if (isPlaying) {
|
|
@@ -17594,13 +17605,14 @@ var ButtonSelectFiles = ({
|
|
|
17594
17605
|
const MAX_TOTAL_SIZE = 50 * 1024 * 1024;
|
|
17595
17606
|
const { mutate: onUploadImage, isPending } = useUploadImage();
|
|
17596
17607
|
const { mutate: onUploadFile } = useUploadFile();
|
|
17597
|
-
const handleUploadImage = async ({
|
|
17608
|
+
const handleUploadImage = async ({ formData }) => {
|
|
17609
|
+
console.log("data", formData);
|
|
17598
17610
|
if (widget !== "many2many_binary") {
|
|
17599
17611
|
onUploadImage(
|
|
17600
|
-
{
|
|
17612
|
+
{ formData },
|
|
17601
17613
|
{
|
|
17602
|
-
onSuccess: (
|
|
17603
|
-
const formatData =
|
|
17614
|
+
onSuccess: (data) => {
|
|
17615
|
+
const formatData = data?.data?.["ir.attachment"]?.[0];
|
|
17604
17616
|
const files = [...selectedFiles, formatData];
|
|
17605
17617
|
setSelectedFiles(files);
|
|
17606
17618
|
y2.success(instance.t("upload_success"));
|
|
@@ -17612,10 +17624,10 @@ var ButtonSelectFiles = ({
|
|
|
17612
17624
|
);
|
|
17613
17625
|
} else {
|
|
17614
17626
|
onUploadFile(
|
|
17615
|
-
{
|
|
17627
|
+
{ formData },
|
|
17616
17628
|
{
|
|
17617
|
-
onSuccess: (
|
|
17618
|
-
const formatData =
|
|
17629
|
+
onSuccess: (data) => {
|
|
17630
|
+
const formatData = data?.data?.["ir.attachment"]?.[0];
|
|
17619
17631
|
const files = [...selectedFiles, formatData];
|
|
17620
17632
|
setSelectedFiles(files);
|
|
17621
17633
|
y2.success(i18n_default.t("upload_success"));
|
|
@@ -17658,10 +17670,10 @@ var ButtonSelectFiles = ({
|
|
|
17658
17670
|
setUploadError(false);
|
|
17659
17671
|
const formData = new FormData();
|
|
17660
17672
|
formData.append("ufile", file);
|
|
17661
|
-
formData.append("thread_model", model);
|
|
17673
|
+
formData.append("thread_model", String(model));
|
|
17662
17674
|
formData.append("thread_id", Number(id));
|
|
17663
17675
|
formData.append("is_pending", true);
|
|
17664
|
-
await handleUploadImage({
|
|
17676
|
+
await handleUploadImage({ formData });
|
|
17665
17677
|
}
|
|
17666
17678
|
};
|
|
17667
17679
|
return /* @__PURE__ */ jsxs46(Fragment13, { children: [
|
|
@@ -18107,7 +18119,7 @@ var CheckboxField = (props) => {
|
|
|
18107
18119
|
};
|
|
18108
18120
|
|
|
18109
18121
|
// src/widgets/basic/color-field/color-wrapper.tsx
|
|
18110
|
-
import { useEffect as useEffect10, useRef as
|
|
18122
|
+
import { useEffect as useEffect10, useRef as useRef6, useState as useState10 } from "react";
|
|
18111
18123
|
import { Fragment as Fragment17, jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18112
18124
|
var ColorWrapper = (props) => {
|
|
18113
18125
|
const {
|
|
@@ -18117,7 +18129,7 @@ var ColorWrapper = (props) => {
|
|
|
18117
18129
|
} = props;
|
|
18118
18130
|
const [selectedColor, setSelectedColor] = useState10(colors2[defaultColor]);
|
|
18119
18131
|
const [showFullColors, setIsShowFullColor] = useState10(false);
|
|
18120
|
-
const pickColorsRef =
|
|
18132
|
+
const pickColorsRef = useRef6(null);
|
|
18121
18133
|
useEffect10(() => {
|
|
18122
18134
|
setSelectedColor(colors2[defaultColor]);
|
|
18123
18135
|
}, [defaultColor]);
|
|
@@ -18318,7 +18330,7 @@ var CopyLinkButtonField = (props) => {
|
|
|
18318
18330
|
import { forwardRef as forwardRef6, useEffect as useEffect15 } from "react";
|
|
18319
18331
|
|
|
18320
18332
|
// node_modules/react-datepicker/dist/index.es.js
|
|
18321
|
-
import React9, { useRef as
|
|
18333
|
+
import React9, { useRef as useRef10, useCallback as useCallback5, useEffect as useEffect13, cloneElement as cloneElement3, Component, createRef, createElement as createElement5 } from "react";
|
|
18322
18334
|
|
|
18323
18335
|
// node_modules/date-fns/constants.js
|
|
18324
18336
|
var daysInYear = 365.2425;
|
|
@@ -22888,8 +22900,8 @@ var CalendarContainer = function(_a2) {
|
|
|
22888
22900
|
return React9.createElement("div", { className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children);
|
|
22889
22901
|
};
|
|
22890
22902
|
var useDetectClickOutside = function(onClickOutside, ignoreClass) {
|
|
22891
|
-
var ref =
|
|
22892
|
-
var onClickOutsideRef =
|
|
22903
|
+
var ref = useRef10(null);
|
|
22904
|
+
var onClickOutsideRef = useRef10(onClickOutside);
|
|
22893
22905
|
onClickOutsideRef.current = onClickOutside;
|
|
22894
22906
|
var handleClickOutside = useCallback5(function(event) {
|
|
22895
22907
|
var _a2;
|
|
@@ -26143,7 +26155,7 @@ function withFloating(Component3) {
|
|
|
26143
26155
|
var WithFloating = function(props) {
|
|
26144
26156
|
var _a2;
|
|
26145
26157
|
var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true;
|
|
26146
|
-
var arrowRef =
|
|
26158
|
+
var arrowRef = useRef10(null);
|
|
26147
26159
|
var floatingProps = useFloating2(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
|
|
26148
26160
|
flip3({ padding: 15 }),
|
|
26149
26161
|
offset3(10),
|
|
@@ -27322,7 +27334,7 @@ function _toConsumableArray(r4) {
|
|
|
27322
27334
|
|
|
27323
27335
|
// node_modules/react-select/dist/Select-ef7c0426.esm.js
|
|
27324
27336
|
import * as React13 from "react";
|
|
27325
|
-
import { useMemo as useMemo7, Fragment as Fragment21, useRef as
|
|
27337
|
+
import { useMemo as useMemo7, Fragment as Fragment21, useRef as useRef13, useCallback as useCallback8, useEffect as useEffect14, Component as Component2 } from "react";
|
|
27326
27338
|
|
|
27327
27339
|
// node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js
|
|
27328
27340
|
import * as React11 from "react";
|
|
@@ -28654,7 +28666,7 @@ function _taggedTemplateLiteral(e3, t3) {
|
|
|
28654
28666
|
}
|
|
28655
28667
|
|
|
28656
28668
|
// node_modules/react-select/dist/index-641ee5b8.esm.js
|
|
28657
|
-
import { useContext as useContext8, useRef as
|
|
28669
|
+
import { useContext as useContext8, useRef as useRef12, useState as useState14, useMemo as useMemo6, useCallback as useCallback7, createContext as createContext4 } from "react";
|
|
28658
28670
|
import { createPortal as createPortal4 } from "react-dom";
|
|
28659
28671
|
|
|
28660
28672
|
// node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js
|
|
@@ -29000,7 +29012,7 @@ var PortalPlacementContext = /* @__PURE__ */ createContext4(null);
|
|
|
29000
29012
|
var MenuPlacer = function MenuPlacer2(props) {
|
|
29001
29013
|
var children = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme;
|
|
29002
29014
|
var _ref3 = useContext8(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement;
|
|
29003
|
-
var ref =
|
|
29015
|
+
var ref = useRef12(null);
|
|
29004
29016
|
var _useState = useState14(maxMenuHeight), _useState2 = _slicedToArray(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1];
|
|
29005
29017
|
var _useState3 = useState14(null), _useState4 = _slicedToArray(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1];
|
|
29006
29018
|
var controlHeight2 = theme.spacing.controlHeight;
|
|
@@ -29104,8 +29116,8 @@ var menuPortalCSS = function menuPortalCSS2(_ref8) {
|
|
|
29104
29116
|
};
|
|
29105
29117
|
var MenuPortal = function MenuPortal2(props) {
|
|
29106
29118
|
var appendTo = props.appendTo, children = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition;
|
|
29107
|
-
var menuPortalRef =
|
|
29108
|
-
var cleanupRef =
|
|
29119
|
+
var menuPortalRef = useRef12(null);
|
|
29120
|
+
var cleanupRef = useRef12(null);
|
|
29109
29121
|
var _useState5 = useState14(coercePlacement(menuPlacement)), _useState6 = _slicedToArray(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1];
|
|
29110
29122
|
var portalPlacementContext = useMemo6(function() {
|
|
29111
29123
|
return {
|
|
@@ -30243,10 +30255,10 @@ var cancelScroll = function cancelScroll2(event) {
|
|
|
30243
30255
|
};
|
|
30244
30256
|
function useScrollCapture(_ref3) {
|
|
30245
30257
|
var isEnabled = _ref3.isEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
|
|
30246
|
-
var isBottom =
|
|
30247
|
-
var isTop =
|
|
30248
|
-
var touchStart =
|
|
30249
|
-
var scrollTarget =
|
|
30258
|
+
var isBottom = useRef13(false);
|
|
30259
|
+
var isTop = useRef13(false);
|
|
30260
|
+
var touchStart = useRef13(0);
|
|
30261
|
+
var scrollTarget = useRef13(null);
|
|
30250
30262
|
var handleEventDelta = useCallback8(function(event, delta) {
|
|
30251
30263
|
if (scrollTarget.current === null) return;
|
|
30252
30264
|
var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight;
|
|
@@ -30353,8 +30365,8 @@ var listenerOptions = {
|
|
|
30353
30365
|
};
|
|
30354
30366
|
function useScrollLock(_ref3) {
|
|
30355
30367
|
var isEnabled = _ref3.isEnabled, _ref$accountForScroll = _ref3.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
|
|
30356
|
-
var originalStyles =
|
|
30357
|
-
var scrollTarget =
|
|
30368
|
+
var originalStyles = useRef13({});
|
|
30369
|
+
var scrollTarget = useRef13(null);
|
|
30358
30370
|
var addScrollLock = useCallback8(function(touchScrollTarget) {
|
|
30359
30371
|
if (!canUseDOM) return;
|
|
30360
30372
|
var target = document.body;
|
|
@@ -32478,11 +32490,11 @@ var FeeField = (props) => {
|
|
|
32478
32490
|
};
|
|
32479
32491
|
|
|
32480
32492
|
// src/widgets/basic/file-upload-field/file-upload.tsx
|
|
32481
|
-
import { useEffect as useEffect16, useRef as
|
|
32493
|
+
import { useEffect as useEffect16, useRef as useRef14, useState as useState16 } from "react";
|
|
32482
32494
|
import { jsx as jsx84, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
32483
32495
|
var FileUploadField = (props) => {
|
|
32484
32496
|
const { name: name2, methods, isForm, model, required, idForm, widget, useUploadImage, useUploadFile, useGetImage, isBase64File } = props;
|
|
32485
|
-
const fileInputRef =
|
|
32497
|
+
const fileInputRef = useRef14(null);
|
|
32486
32498
|
const [selectedFiles, setSelectedFiles] = useState16([]);
|
|
32487
32499
|
const [uploadError, setUploadError] = useState16();
|
|
32488
32500
|
return /* @__PURE__ */ jsx84(
|
|
@@ -32543,7 +32555,7 @@ var FileUploadField = (props) => {
|
|
|
32543
32555
|
};
|
|
32544
32556
|
|
|
32545
32557
|
// src/widgets/basic/float-field/float.tsx
|
|
32546
|
-
import { useEffect as useEffect17, useRef as
|
|
32558
|
+
import { useEffect as useEffect17, useRef as useRef15, useState as useState17 } from "react";
|
|
32547
32559
|
import { Fragment as Fragment24, jsx as jsx85, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
32548
32560
|
var FloatField = (props) => {
|
|
32549
32561
|
const {
|
|
@@ -32584,9 +32596,9 @@ var FloatField = (props) => {
|
|
|
32584
32596
|
setInputValue("");
|
|
32585
32597
|
}
|
|
32586
32598
|
}, [value, name2, clearErrors]);
|
|
32587
|
-
const isDirtyRef =
|
|
32588
|
-
const inputRef =
|
|
32589
|
-
const lastCommittedValueRef =
|
|
32599
|
+
const isDirtyRef = useRef15(false);
|
|
32600
|
+
const inputRef = useRef15(null);
|
|
32601
|
+
const lastCommittedValueRef = useRef15(null);
|
|
32590
32602
|
const handleInputChange = (e3) => {
|
|
32591
32603
|
const newValue = e3.target.value;
|
|
32592
32604
|
const valueWithoutCommas = newValue.replace(/,/g, "");
|
|
@@ -32816,7 +32828,7 @@ var FloatTimeField = (props) => {
|
|
|
32816
32828
|
};
|
|
32817
32829
|
|
|
32818
32830
|
// src/widgets/basic/html-field/html.tsx
|
|
32819
|
-
import { useEffect as useEffect18, useRef as
|
|
32831
|
+
import { useEffect as useEffect18, useRef as useRef16 } from "react";
|
|
32820
32832
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
32821
32833
|
var HtmlField = (props) => {
|
|
32822
32834
|
const {
|
|
@@ -32828,7 +32840,7 @@ var HtmlField = (props) => {
|
|
|
32828
32840
|
onChange: onChange2,
|
|
32829
32841
|
value
|
|
32830
32842
|
} = props;
|
|
32831
|
-
const divRef =
|
|
32843
|
+
const divRef = useRef16(null);
|
|
32832
32844
|
if (!isForm) {
|
|
32833
32845
|
return /* @__PURE__ */ jsx87("div", { dangerouslySetInnerHTML: { __html: value || defaultValue || "" } });
|
|
32834
32846
|
}
|
|
@@ -32895,9 +32907,6 @@ import { useEffect as useEffect19 } from "react";
|
|
|
32895
32907
|
import { Fragment as Fragment26, jsx as jsx89, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
32896
32908
|
var InfomationField = (props) => {
|
|
32897
32909
|
const { value, isForm = false, showName = true, stringToColor } = props;
|
|
32898
|
-
if (isForm) {
|
|
32899
|
-
return /* @__PURE__ */ jsx89("div", { children: "abc" });
|
|
32900
|
-
}
|
|
32901
32910
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
32902
32911
|
return /* @__PURE__ */ jsx89(Fragment26, {});
|
|
32903
32912
|
}
|
|
@@ -32928,7 +32937,7 @@ var InfomationField = (props) => {
|
|
|
32928
32937
|
|
|
32929
32938
|
// src/widgets/basic/many2many-tags-field/many2many-tags.tsx
|
|
32930
32939
|
import { jsx as jsx90, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
32931
|
-
var CustomMultiValue = (props) => {
|
|
32940
|
+
var CustomMultiValue = ({ stringToColor, ...props }) => {
|
|
32932
32941
|
const { selectProps, data, menuList } = props;
|
|
32933
32942
|
const { relation } = selectProps;
|
|
32934
32943
|
const actionId = menuList?.flatMap(
|
|
@@ -32945,7 +32954,8 @@ var CustomMultiValue = (props) => {
|
|
|
32945
32954
|
relation,
|
|
32946
32955
|
isForm: false,
|
|
32947
32956
|
aid: actionId?.id,
|
|
32948
|
-
avatarSrc: data?.image_256
|
|
32957
|
+
avatarSrc: data?.image_256,
|
|
32958
|
+
stringToColor
|
|
32949
32959
|
}
|
|
32950
32960
|
),
|
|
32951
32961
|
/* @__PURE__ */ jsx90("span", { className: "capitalize", children: data?.label ?? data?.display_name }),
|
|
@@ -32990,7 +33000,14 @@ var Many2ManyTagField = (props) => {
|
|
|
32990
33000
|
value: item.id,
|
|
32991
33001
|
label: item.name ?? item.display_name
|
|
32992
33002
|
})) : [];
|
|
32993
|
-
return /* @__PURE__ */ jsx90(
|
|
33003
|
+
return /* @__PURE__ */ jsx90(
|
|
33004
|
+
InfomationField,
|
|
33005
|
+
{
|
|
33006
|
+
value: optionValue || null,
|
|
33007
|
+
isForm,
|
|
33008
|
+
stringToColor
|
|
33009
|
+
}
|
|
33010
|
+
);
|
|
32994
33011
|
}
|
|
32995
33012
|
return /* @__PURE__ */ jsx90(
|
|
32996
33013
|
Controller,
|
|
@@ -33075,7 +33092,13 @@ var Many2ManyTagField = (props) => {
|
|
|
33075
33092
|
})
|
|
33076
33093
|
},
|
|
33077
33094
|
components: isUser ? {
|
|
33078
|
-
MultiValue:
|
|
33095
|
+
MultiValue: (multiValueProps) => /* @__PURE__ */ jsx90(
|
|
33096
|
+
CustomMultiValue,
|
|
33097
|
+
{
|
|
33098
|
+
...multiValueProps,
|
|
33099
|
+
stringToColor
|
|
33100
|
+
}
|
|
33101
|
+
),
|
|
33079
33102
|
IndicatorSeparator: () => null
|
|
33080
33103
|
} : {
|
|
33081
33104
|
IndicatorSeparator: () => null
|
|
@@ -33599,7 +33622,7 @@ var ToggleButtonField = (props) => {
|
|
|
33599
33622
|
};
|
|
33600
33623
|
|
|
33601
33624
|
// src/widgets/basic/integer-field/integer.tsx
|
|
33602
|
-
import { useEffect as useEffect23, useRef as
|
|
33625
|
+
import { useEffect as useEffect23, useRef as useRef17, useState as useState20 } from "react";
|
|
33603
33626
|
import { Fragment as Fragment29, jsx as jsx100, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
33604
33627
|
var IntegerField = (props) => {
|
|
33605
33628
|
const {
|
|
@@ -33634,9 +33657,9 @@ var IntegerField = (props) => {
|
|
|
33634
33657
|
fieldState: { error: error2 }
|
|
33635
33658
|
}) => {
|
|
33636
33659
|
const { setError, clearErrors } = methods;
|
|
33637
|
-
const isDirtyRef =
|
|
33638
|
-
const inputRef =
|
|
33639
|
-
const lastCommittedValueRef =
|
|
33660
|
+
const isDirtyRef = useRef17(false);
|
|
33661
|
+
const inputRef = useRef17(null);
|
|
33662
|
+
const lastCommittedValueRef = useRef17(null);
|
|
33640
33663
|
const [inputValue, setInputValue] = useState20(
|
|
33641
33664
|
value2 !== void 0 && value2 !== null ? String(value2) : ""
|
|
33642
33665
|
);
|
|
@@ -33806,14 +33829,12 @@ var Many2ManyField = (props) => {
|
|
|
33806
33829
|
page,
|
|
33807
33830
|
rows,
|
|
33808
33831
|
columns,
|
|
33809
|
-
typeTable,
|
|
33810
33832
|
renderField,
|
|
33811
33833
|
isDataLoading,
|
|
33812
33834
|
relation,
|
|
33813
33835
|
onToggleColumnOptional,
|
|
33814
33836
|
isDataFetched,
|
|
33815
33837
|
isPlaceholderData,
|
|
33816
|
-
isCheckBox,
|
|
33817
33838
|
optionsObject,
|
|
33818
33839
|
onChoose,
|
|
33819
33840
|
onAddNew,
|
|
@@ -33827,7 +33848,13 @@ var Many2ManyField = (props) => {
|
|
|
33827
33848
|
evalJSONContext,
|
|
33828
33849
|
searchController,
|
|
33829
33850
|
viewData,
|
|
33830
|
-
setDomain
|
|
33851
|
+
setDomain,
|
|
33852
|
+
isDisplayCheckbox,
|
|
33853
|
+
checkedAll,
|
|
33854
|
+
handleCheckBoxAll,
|
|
33855
|
+
selectedRowKeysRef,
|
|
33856
|
+
typeTable,
|
|
33857
|
+
setSelectedRowKeys
|
|
33831
33858
|
} = props;
|
|
33832
33859
|
const {
|
|
33833
33860
|
context,
|
|
@@ -33841,7 +33868,8 @@ var Many2ManyField = (props) => {
|
|
|
33841
33868
|
searchString,
|
|
33842
33869
|
selectedTags,
|
|
33843
33870
|
setFilterBy,
|
|
33844
|
-
setGroupBy
|
|
33871
|
+
setGroupBy,
|
|
33872
|
+
clearSearch
|
|
33845
33873
|
} = searchController;
|
|
33846
33874
|
return createPortal5(
|
|
33847
33875
|
/* @__PURE__ */ jsxs72("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
|
|
@@ -33866,8 +33894,6 @@ var Many2ManyField = (props) => {
|
|
|
33866
33894
|
groupBy,
|
|
33867
33895
|
showFiltersGroups: true,
|
|
33868
33896
|
setGroupBy,
|
|
33869
|
-
setSelectedRowKeys: (keys) => {
|
|
33870
|
-
},
|
|
33871
33897
|
setDomainList: setDomain,
|
|
33872
33898
|
setPage: (pages) => {
|
|
33873
33899
|
setPage?.(pages);
|
|
@@ -33877,12 +33903,14 @@ var Many2ManyField = (props) => {
|
|
|
33877
33903
|
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33878
33904
|
)?.map((col) => ({ ...col.field })) ?? []
|
|
33879
33905
|
],
|
|
33906
|
+
setSelectedRowKeys,
|
|
33880
33907
|
viewData,
|
|
33881
33908
|
context,
|
|
33882
33909
|
selectedRowKeys,
|
|
33883
33910
|
aid,
|
|
33884
33911
|
domainSearch,
|
|
33885
|
-
evalJSONContext
|
|
33912
|
+
evalJSONContext,
|
|
33913
|
+
clearSearch
|
|
33886
33914
|
}
|
|
33887
33915
|
) }),
|
|
33888
33916
|
/* @__PURE__ */ jsx102(
|
|
@@ -33920,7 +33948,9 @@ var Many2ManyField = (props) => {
|
|
|
33920
33948
|
{
|
|
33921
33949
|
columns,
|
|
33922
33950
|
onToggleColumnOptional,
|
|
33923
|
-
isDisplayCheckbox
|
|
33951
|
+
isDisplayCheckbox,
|
|
33952
|
+
checkedAll,
|
|
33953
|
+
handleCheckBoxAll
|
|
33924
33954
|
}
|
|
33925
33955
|
),
|
|
33926
33956
|
/* @__PURE__ */ jsx102(
|
|
@@ -33929,7 +33959,7 @@ var Many2ManyField = (props) => {
|
|
|
33929
33959
|
columns,
|
|
33930
33960
|
rows,
|
|
33931
33961
|
rootField,
|
|
33932
|
-
isDisplayCheckbox
|
|
33962
|
+
isDisplayCheckbox,
|
|
33933
33963
|
model: relation,
|
|
33934
33964
|
renderField: ({
|
|
33935
33965
|
row,
|
|
@@ -33950,7 +33980,11 @@ var Many2ManyField = (props) => {
|
|
|
33950
33980
|
},
|
|
33951
33981
|
onRemoveRow: null,
|
|
33952
33982
|
onAddRow,
|
|
33953
|
-
onClickRow
|
|
33983
|
+
onClickRow,
|
|
33984
|
+
typeTable,
|
|
33985
|
+
selectedRowKeysRef,
|
|
33986
|
+
selectedRowKeys,
|
|
33987
|
+
setSelectedRowKeys
|
|
33954
33988
|
}
|
|
33955
33989
|
)
|
|
33956
33990
|
]
|
|
@@ -33961,7 +33995,7 @@ var Many2ManyField = (props) => {
|
|
|
33961
33995
|
}
|
|
33962
33996
|
) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
|
|
33963
33997
|
/* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33964
|
-
|
|
33998
|
+
isDisplayCheckbox && /* @__PURE__ */ jsx102(
|
|
33965
33999
|
"button",
|
|
33966
34000
|
{
|
|
33967
34001
|
disabled: selectedRowKeys?.length === 0,
|
package/dist/widgets.d.mts
CHANGED
|
@@ -66,7 +66,7 @@ declare const Row: (props: any) => JSX.Element;
|
|
|
66
66
|
|
|
67
67
|
declare const Login: React__default.FC<LoginProps>;
|
|
68
68
|
|
|
69
|
-
declare const Search: ({ removeSearchItems, selectedTags, filterBy, setFilterBy, searchString, onSearchString, handleAddTagSearch, searchBy, groupBy, showFiltersGroups, setGroupBy, setSelectedRowKeys, setDomainList, setPage, fieldsList, viewData, context, aid, selectedRowKeys, domainSearch, evalJSONContext, }: any) => JSX.Element;
|
|
69
|
+
declare const Search: ({ removeSearchItems, selectedTags, filterBy, setFilterBy, searchString, onSearchString, handleAddTagSearch, searchBy, groupBy, showFiltersGroups, setGroupBy, setSelectedRowKeys, setDomainList, setPage, fieldsList, viewData, context, aid, selectedRowKeys, domainSearch, evalJSONContext, clearSearch, }: any) => JSX.Element;
|
|
70
70
|
|
|
71
71
|
interface IActiveBadgeProps extends IInputFieldProps {
|
|
72
72
|
type: any;
|
|
@@ -326,13 +326,13 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
326
326
|
isDataLoading?: any;
|
|
327
327
|
isDataFetched?: any;
|
|
328
328
|
isPlaceholderData?: any;
|
|
329
|
-
|
|
329
|
+
isDisplayCheckbox?: boolean;
|
|
330
330
|
optionsObject?: any;
|
|
331
331
|
selectedRowKeys?: any;
|
|
332
332
|
handleCreateNewOnPage?: any;
|
|
333
|
+
typeTable?: any;
|
|
333
334
|
rows: any;
|
|
334
335
|
columns: any;
|
|
335
|
-
typeTable?: string;
|
|
336
336
|
page?: any;
|
|
337
337
|
totalRows?: number;
|
|
338
338
|
rootField?: any;
|
|
@@ -343,6 +343,7 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
343
343
|
onAddRow?: Function;
|
|
344
344
|
onClickRow?: Function;
|
|
345
345
|
onToggleColumnOptional?: any;
|
|
346
|
+
setSelectedRowKeys?: any;
|
|
346
347
|
renderField?: ({ row, col, indexRow, onChangeData, rootField, }: {
|
|
347
348
|
row: any;
|
|
348
349
|
col: any;
|
|
@@ -354,6 +355,9 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
354
355
|
setDomain?: Dispatch<SetStateAction<any>>;
|
|
355
356
|
searchController: SearchController;
|
|
356
357
|
evalJSONContext?: any;
|
|
358
|
+
checkedAll?: any;
|
|
359
|
+
handleCheckBoxAll?: any;
|
|
360
|
+
selectedRowKeysRef?: any;
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
|
@@ -425,7 +429,7 @@ declare const LoadingSmall: () => JSX.Element;
|
|
|
425
429
|
|
|
426
430
|
declare const RenderFiles: ({ selectedFiles, setSelectedFiles, useGetImage }: any) => JSX.Element;
|
|
427
431
|
|
|
428
|
-
declare const ButtonSelectFiles: ({ fileInputRef, selectedFiles, setSelectedFiles, setUploadError, model, id, widget, useUploadImage, useUploadFile }: any) => JSX.Element;
|
|
432
|
+
declare const ButtonSelectFiles: ({ fileInputRef, selectedFiles, setSelectedFiles, setUploadError, model, id, widget, useUploadImage, useUploadFile, }: any) => JSX.Element;
|
|
429
433
|
|
|
430
434
|
interface VideoPlayerProps {
|
|
431
435
|
src: string;
|
package/dist/widgets.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare const Row: (props: any) => JSX.Element;
|
|
|
66
66
|
|
|
67
67
|
declare const Login: React__default.FC<LoginProps>;
|
|
68
68
|
|
|
69
|
-
declare const Search: ({ removeSearchItems, selectedTags, filterBy, setFilterBy, searchString, onSearchString, handleAddTagSearch, searchBy, groupBy, showFiltersGroups, setGroupBy, setSelectedRowKeys, setDomainList, setPage, fieldsList, viewData, context, aid, selectedRowKeys, domainSearch, evalJSONContext, }: any) => JSX.Element;
|
|
69
|
+
declare const Search: ({ removeSearchItems, selectedTags, filterBy, setFilterBy, searchString, onSearchString, handleAddTagSearch, searchBy, groupBy, showFiltersGroups, setGroupBy, setSelectedRowKeys, setDomainList, setPage, fieldsList, viewData, context, aid, selectedRowKeys, domainSearch, evalJSONContext, clearSearch, }: any) => JSX.Element;
|
|
70
70
|
|
|
71
71
|
interface IActiveBadgeProps extends IInputFieldProps {
|
|
72
72
|
type: any;
|
|
@@ -326,13 +326,13 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
326
326
|
isDataLoading?: any;
|
|
327
327
|
isDataFetched?: any;
|
|
328
328
|
isPlaceholderData?: any;
|
|
329
|
-
|
|
329
|
+
isDisplayCheckbox?: boolean;
|
|
330
330
|
optionsObject?: any;
|
|
331
331
|
selectedRowKeys?: any;
|
|
332
332
|
handleCreateNewOnPage?: any;
|
|
333
|
+
typeTable?: any;
|
|
333
334
|
rows: any;
|
|
334
335
|
columns: any;
|
|
335
|
-
typeTable?: string;
|
|
336
336
|
page?: any;
|
|
337
337
|
totalRows?: number;
|
|
338
338
|
rootField?: any;
|
|
@@ -343,6 +343,7 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
343
343
|
onAddRow?: Function;
|
|
344
344
|
onClickRow?: Function;
|
|
345
345
|
onToggleColumnOptional?: any;
|
|
346
|
+
setSelectedRowKeys?: any;
|
|
346
347
|
renderField?: ({ row, col, indexRow, onChangeData, rootField, }: {
|
|
347
348
|
row: any;
|
|
348
349
|
col: any;
|
|
@@ -354,6 +355,9 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
354
355
|
setDomain?: Dispatch<SetStateAction<any>>;
|
|
355
356
|
searchController: SearchController;
|
|
356
357
|
evalJSONContext?: any;
|
|
358
|
+
checkedAll?: any;
|
|
359
|
+
handleCheckBoxAll?: any;
|
|
360
|
+
selectedRowKeysRef?: any;
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
|
@@ -425,7 +429,7 @@ declare const LoadingSmall: () => JSX.Element;
|
|
|
425
429
|
|
|
426
430
|
declare const RenderFiles: ({ selectedFiles, setSelectedFiles, useGetImage }: any) => JSX.Element;
|
|
427
431
|
|
|
428
|
-
declare const ButtonSelectFiles: ({ fileInputRef, selectedFiles, setSelectedFiles, setUploadError, model, id, widget, useUploadImage, useUploadFile }: any) => JSX.Element;
|
|
432
|
+
declare const ButtonSelectFiles: ({ fileInputRef, selectedFiles, setSelectedFiles, setUploadError, model, id, widget, useUploadImage, useUploadFile, }: any) => JSX.Element;
|
|
429
433
|
|
|
430
434
|
interface VideoPlayerProps {
|
|
431
435
|
src: string;
|