@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.js
CHANGED
|
@@ -11128,98 +11128,66 @@ var TableBody = (props) => {
|
|
|
11128
11128
|
};
|
|
11129
11129
|
|
|
11130
11130
|
// src/widgets/advanced/table/table-filter.tsx
|
|
11131
|
-
var import_react15 = require("react");
|
|
11132
|
-
var import_react_dom = require("react-dom");
|
|
11131
|
+
var import_react15 = require("@headlessui/react");
|
|
11133
11132
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11134
11133
|
var TableFilter = ({ columns, onToggleColumnOptional }) => {
|
|
11135
|
-
|
|
11136
|
-
const [filterPosition, setFilterPosition] = (0, import_react15.useState)(null);
|
|
11137
|
-
const filterPopupRef = (0, import_react15.useRef)(null);
|
|
11138
|
-
const filterRef = useClickOutside({
|
|
11139
|
-
handler: () => {
|
|
11140
|
-
if (openTableFilter) {
|
|
11141
|
-
setOpenTableFilter(false);
|
|
11142
|
-
}
|
|
11143
|
-
},
|
|
11144
|
-
refs: [filterPopupRef]
|
|
11145
|
-
});
|
|
11146
|
-
(0, import_react15.useEffect)(() => {
|
|
11147
|
-
const updatePosition = () => {
|
|
11148
|
-
if (filterRef.current && openTableFilter) {
|
|
11149
|
-
const rect = filterRef.current.getBoundingClientRect();
|
|
11150
|
-
setFilterPosition({
|
|
11151
|
-
top: rect.bottom + window.scrollY,
|
|
11152
|
-
left: rect.left + window.scrollX,
|
|
11153
|
-
right: window.innerWidth - rect.right
|
|
11154
|
-
});
|
|
11155
|
-
}
|
|
11156
|
-
};
|
|
11157
|
-
updatePosition();
|
|
11158
|
-
window.addEventListener("scroll", updatePosition);
|
|
11159
|
-
window.addEventListener("resize", updatePosition);
|
|
11160
|
-
return () => {
|
|
11161
|
-
window.removeEventListener("scroll", updatePosition);
|
|
11162
|
-
window.removeEventListener("resize", updatePosition);
|
|
11163
|
-
};
|
|
11164
|
-
}, [filterRef, openTableFilter]);
|
|
11165
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
11134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11166
11135
|
"div",
|
|
11167
11136
|
{
|
|
11168
|
-
ref: filterRef,
|
|
11169
11137
|
style: {
|
|
11170
|
-
transform: "translateY(-50%)"
|
|
11138
|
+
transform: "translateY(-50%)",
|
|
11139
|
+
right: 0
|
|
11171
11140
|
},
|
|
11172
|
-
className: "w-fit absolute top-[50%] translate-y-[-50%] right-[
|
|
11173
|
-
children: [
|
|
11174
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11141
|
+
className: "w-fit absolute top-[50%] translate-y-[-50%] right-[0px] ms-auto z-[32] ",
|
|
11142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react15.Popover, { children: [
|
|
11143
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.PopoverButton, { className: "p-2 rounded-lg cursor-pointer outline-none", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11175
11144
|
"button",
|
|
11176
11145
|
{
|
|
11177
11146
|
type: "button",
|
|
11178
11147
|
className: "bg-white size-8 p-1 rounded-lg cursor-pointer flex items-center justify-center",
|
|
11179
|
-
onClick: () => {
|
|
11180
|
-
setOpenTableFilter(!openTableFilter);
|
|
11181
|
-
},
|
|
11182
11148
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FilterColumnIcon, {})
|
|
11183
11149
|
}
|
|
11184
|
-
),
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11150
|
+
) }),
|
|
11151
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11152
|
+
import_react15.PopoverPanel,
|
|
11153
|
+
{
|
|
11154
|
+
transition: true,
|
|
11155
|
+
anchor: "bottom end",
|
|
11156
|
+
className: "shadow-lg z-[99] gap-2 bg-white rounded-lg transition duration-200 ease-in-out border border-stroke-disabled",
|
|
11157
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11158
|
+
"div",
|
|
11159
|
+
{
|
|
11160
|
+
style: {
|
|
11161
|
+
zIndex: 9999
|
|
11162
|
+
},
|
|
11163
|
+
className: "flex w-[250px] h-auto overflow-auto flex-col gap-[16px] rounded-[8px] bg-[#fff] px-[24px] py-[16px] shadow-md",
|
|
11164
|
+
children: columns?.filter((val) => val?.optional !== void 0)?.map((item) => {
|
|
11165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11166
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11167
|
+
"input",
|
|
11168
|
+
{
|
|
11169
|
+
type: "checkbox",
|
|
11170
|
+
id: `${item.name}`,
|
|
11171
|
+
onChange: () => onToggleColumnOptional(item),
|
|
11172
|
+
checked: item.optional !== "hide",
|
|
11173
|
+
className: "cursor-pointer"
|
|
11174
|
+
}
|
|
11175
|
+
),
|
|
11176
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11177
|
+
"label",
|
|
11178
|
+
{
|
|
11179
|
+
htmlFor: `${item.name}`,
|
|
11180
|
+
className: "flex items-center gap-[8px]",
|
|
11181
|
+
children: item.field.string
|
|
11182
|
+
}
|
|
11183
|
+
)
|
|
11184
|
+
] }, item.name);
|
|
11185
|
+
})
|
|
11186
|
+
}
|
|
11187
|
+
)
|
|
11188
|
+
}
|
|
11221
11189
|
)
|
|
11222
|
-
]
|
|
11190
|
+
] })
|
|
11223
11191
|
}
|
|
11224
11192
|
);
|
|
11225
11193
|
};
|
|
@@ -13082,7 +13050,7 @@ var M = import_react16.default.forwardRef(({ id: t3, anchorId: l2, anchorSelect:
|
|
|
13082
13050
|
});
|
|
13083
13051
|
|
|
13084
13052
|
// src/widgets/advanced/table/table-head.tsx
|
|
13085
|
-
var
|
|
13053
|
+
var import_react_dom = require("react-dom");
|
|
13086
13054
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
13087
13055
|
var TableHead = (props) => {
|
|
13088
13056
|
const {
|
|
@@ -13130,7 +13098,7 @@ var TableHead = (props) => {
|
|
|
13130
13098
|
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "cursor-pointer flex items-center gap-[4px] w-full group relative", children: [
|
|
13131
13099
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate line-clamp-1 w-fit", children: col.title }),
|
|
13132
13100
|
col?.field?.help && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
13133
|
-
(0,
|
|
13101
|
+
(0, import_react_dom.createPortal)(
|
|
13134
13102
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
13135
13103
|
M,
|
|
13136
13104
|
{
|
|
@@ -16296,7 +16264,7 @@ var ModalConfirm = ({
|
|
|
16296
16264
|
|
|
16297
16265
|
// src/widgets/common/modal-detail.tsx
|
|
16298
16266
|
var import_react24 = require("react");
|
|
16299
|
-
var
|
|
16267
|
+
var import_react_dom2 = require("react-dom");
|
|
16300
16268
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
16301
16269
|
var ModalDetail = ({
|
|
16302
16270
|
idToolTip,
|
|
@@ -16319,7 +16287,7 @@ var ModalDetail = ({
|
|
|
16319
16287
|
sessionStorage.setItem("actionData", JSON.stringify(actionData));
|
|
16320
16288
|
window.location.href = `/form/menu?model=${model}&id=${idForm}`;
|
|
16321
16289
|
};
|
|
16322
|
-
return (0,
|
|
16290
|
+
return (0, import_react_dom2.createPortal)(
|
|
16323
16291
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: showModalDetail && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[100]", children: [
|
|
16324
16292
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
16325
16293
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute inset-0 overflow-auto flex flex-col justify-center items-center px-5", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("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: [
|
|
@@ -22214,7 +22182,7 @@ function useFloating2(options2) {
|
|
|
22214
22182
|
}
|
|
22215
22183
|
|
|
22216
22184
|
// node_modules/react-datepicker/dist/index.es.js
|
|
22217
|
-
var
|
|
22185
|
+
var import_react_dom5 = __toESM(require("react-dom"));
|
|
22218
22186
|
var _extendStatics = function extendStatics(d, b2) {
|
|
22219
22187
|
_extendStatics = Object.setPrototypeOf || {
|
|
22220
22188
|
__proto__: []
|
|
@@ -25457,7 +25425,7 @@ var Portal = (
|
|
|
25457
25425
|
}
|
|
25458
25426
|
};
|
|
25459
25427
|
Portal2.prototype.render = function() {
|
|
25460
|
-
return
|
|
25428
|
+
return import_react_dom5.default.createPortal(this.props.children, this.el);
|
|
25461
25429
|
};
|
|
25462
25430
|
return Portal2;
|
|
25463
25431
|
}(import_react45.Component)
|
|
@@ -28025,7 +27993,7 @@ function _taggedTemplateLiteral(e3, t3) {
|
|
|
28025
27993
|
|
|
28026
27994
|
// node_modules/react-select/dist/index-641ee5b8.esm.js
|
|
28027
27995
|
var import_react51 = require("react");
|
|
28028
|
-
var
|
|
27996
|
+
var import_react_dom6 = require("react-dom");
|
|
28029
27997
|
|
|
28030
27998
|
// node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js
|
|
28031
27999
|
var import_react49 = require("react");
|
|
@@ -28528,7 +28496,7 @@ var MenuPortal = function MenuPortal2(props) {
|
|
|
28528
28496
|
}), innerProps), children);
|
|
28529
28497
|
return jsx84(PortalPlacementContext.Provider, {
|
|
28530
28498
|
value: portalPlacementContext
|
|
28531
|
-
}, appendTo ? /* @__PURE__ */ (0,
|
|
28499
|
+
}, appendTo ? /* @__PURE__ */ (0, import_react_dom6.createPortal)(menuWrapper, appendTo) : menuWrapper);
|
|
28532
28500
|
};
|
|
28533
28501
|
var containerCSS = function containerCSS2(_ref3) {
|
|
28534
28502
|
var isDisabled = _ref3.isDisabled, isRtl = _ref3.isRtl;
|
|
@@ -31421,7 +31389,7 @@ var import_toConsumableArray2 = __toESM(require_toConsumableArray());
|
|
|
31421
31389
|
var import_typeof5 = __toESM(require_typeof());
|
|
31422
31390
|
var import_taggedTemplateLiteral2 = __toESM(require_taggedTemplateLiteral());
|
|
31423
31391
|
var import_defineProperty3 = __toESM(require_defineProperty());
|
|
31424
|
-
var
|
|
31392
|
+
var import_react_dom7 = require("react-dom");
|
|
31425
31393
|
var StateManagedSelect = /* @__PURE__ */ (0, import_react54.forwardRef)(function(props, ref) {
|
|
31426
31394
|
var baseSelectProps = useStateManager(props);
|
|
31427
31395
|
return /* @__PURE__ */ React14.createElement(Select, _extends({
|
|
@@ -33374,7 +33342,7 @@ var StatusDropdownField = (props) => {
|
|
|
33374
33342
|
};
|
|
33375
33343
|
|
|
33376
33344
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
33377
|
-
var
|
|
33345
|
+
var import_react_dom8 = require("react-dom");
|
|
33378
33346
|
var import_react66 = require("react");
|
|
33379
33347
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
33380
33348
|
var Many2ManyField = (props) => {
|
|
@@ -33449,7 +33417,7 @@ var Many2ManyField = (props) => {
|
|
|
33449
33417
|
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33450
33418
|
};
|
|
33451
33419
|
}, [selectedTags]);
|
|
33452
|
-
return (0,
|
|
33420
|
+
return (0, import_react_dom8.createPortal)(
|
|
33453
33421
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
33454
33422
|
"div",
|
|
33455
33423
|
{
|