@fctc/sme-widget-ui 1.0.6 → 1.0.8
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/README.md +93 -93
- package/dist/.babelrc +7 -0
- package/dist/.editorconfig +10 -0
- package/dist/.eslintignore +6 -0
- package/dist/.eslintrc.cjs +66 -0
- package/dist/.gitattributes +4 -0
- package/dist/.prettierrc +4 -0
- package/dist/icons.js +8 -17
- package/dist/icons.mjs +39 -48
- package/dist/index.js +39 -42
- package/dist/index.mjs +251 -254
- package/dist/widgets.d.mts +2 -1
- package/dist/widgets.d.ts +2 -1
- package/dist/widgets.js +39 -42
- package/dist/widgets.mjs +246 -249
- package/package.json +71 -71
package/dist/widgets.d.mts
CHANGED
|
@@ -39,6 +39,7 @@ interface TableBodyProps {
|
|
|
39
39
|
typeCo?: any;
|
|
40
40
|
setSelectedRowKeys?: any;
|
|
41
41
|
selectedRowKeys?: any;
|
|
42
|
+
isEditTable?: boolean;
|
|
42
43
|
}
|
|
43
44
|
declare const TableBody: (props: TableBodyProps) => JSX.Element;
|
|
44
45
|
|
|
@@ -276,7 +277,7 @@ interface ISelectDropdownProps extends IInputFieldProps {
|
|
|
276
277
|
selection?: [string | number, string][] | any;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
declare const SelectDropdownField: (props: ISelectDropdownProps) =>
|
|
280
|
+
declare const SelectDropdownField: (props: ISelectDropdownProps) => any;
|
|
280
281
|
|
|
281
282
|
declare const TextAreaField: (props: IInputFieldProps) => JSX.Element;
|
|
282
283
|
|
package/dist/widgets.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ interface TableBodyProps {
|
|
|
39
39
|
typeCo?: any;
|
|
40
40
|
setSelectedRowKeys?: any;
|
|
41
41
|
selectedRowKeys?: any;
|
|
42
|
+
isEditTable?: boolean;
|
|
42
43
|
}
|
|
43
44
|
declare const TableBody: (props: TableBodyProps) => JSX.Element;
|
|
44
45
|
|
|
@@ -276,7 +277,7 @@ interface ISelectDropdownProps extends IInputFieldProps {
|
|
|
276
277
|
selection?: [string | number, string][] | any;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
declare const SelectDropdownField: (props: ISelectDropdownProps) =>
|
|
280
|
+
declare const SelectDropdownField: (props: ISelectDropdownProps) => any;
|
|
280
281
|
|
|
281
282
|
declare const TextAreaField: (props: IInputFieldProps) => JSX.Element;
|
|
282
283
|
|
package/dist/widgets.js
CHANGED
|
@@ -6771,7 +6771,7 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
6771
6771
|
// src/icons/search-icon.tsx
|
|
6772
6772
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
6773
6773
|
var SearchIcon = () => {
|
|
6774
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.
|
|
6774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6775
6775
|
"svg",
|
|
6776
6776
|
{
|
|
6777
6777
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6779,22 +6779,13 @@ var SearchIcon = () => {
|
|
|
6779
6779
|
height: "20",
|
|
6780
6780
|
viewBox: "0 0 20 20",
|
|
6781
6781
|
fill: "none",
|
|
6782
|
-
children:
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
),
|
|
6790
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6791
|
-
"path",
|
|
6792
|
-
{
|
|
6793
|
-
d: "M18.3333 18.9585C18.175 18.9585 18.0167 18.9002 17.8917 18.7752L16.225 17.1085C15.9833 16.8669 15.9833 16.4669 16.225 16.2252C16.4667 15.9835 16.8667 15.9835 17.1083 16.2252L18.775 17.8919C19.0167 18.1335 19.0167 18.5335 18.775 18.7752C18.65 18.9002 18.4917 18.9585 18.3333 18.9585Z",
|
|
6794
|
-
fill: "#525252"
|
|
6795
|
-
}
|
|
6796
|
-
)
|
|
6797
|
-
]
|
|
6782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6783
|
+
"path",
|
|
6784
|
+
{
|
|
6785
|
+
d: "M14.5232 13.4627L17.7355 16.6742L16.6742 17.7355L13.4627 14.5232C12.2678 15.4812 10.7815 16.0022 9.25 16C5.524 16 2.5 12.976 2.5 9.25C2.5 5.524 5.524 2.5 9.25 2.5C12.976 2.5 16 5.524 16 9.25C16.0022 10.7815 15.4812 12.2678 14.5232 13.4627ZM13.0187 12.9062C13.9706 11.9274 14.5021 10.6153 14.5 9.25C14.5 6.349 12.1502 4 9.25 4C6.349 4 4 6.349 4 9.25C4 12.1502 6.349 14.5 9.25 14.5C10.6153 14.5021 11.9274 13.9706 12.9062 13.0187L13.0187 12.9062Z",
|
|
6786
|
+
fill: "#AEAEAE"
|
|
6787
|
+
}
|
|
6788
|
+
)
|
|
6798
6789
|
}
|
|
6799
6790
|
);
|
|
6800
6791
|
};
|
|
@@ -12018,7 +12009,8 @@ var TableBodyRow = (props) => {
|
|
|
12018
12009
|
checked,
|
|
12019
12010
|
isForm,
|
|
12020
12011
|
typeCo,
|
|
12021
|
-
selectedRowKeys
|
|
12012
|
+
selectedRowKeys,
|
|
12013
|
+
isEditTable
|
|
12022
12014
|
} = props;
|
|
12023
12015
|
const [isAutoSelect, setIsAutoSelect] = (0, import_react11.useState)(false);
|
|
12024
12016
|
const rootStyle = getComputedStyle(document.documentElement);
|
|
@@ -12063,16 +12055,16 @@ var TableBodyRow = (props) => {
|
|
|
12063
12055
|
checkedAll,
|
|
12064
12056
|
setIsAutoSelect,
|
|
12065
12057
|
isAutoSelect,
|
|
12066
|
-
s: true,
|
|
12067
12058
|
selectedRowKeysRef,
|
|
12068
|
-
setSelectedRowKeys
|
|
12059
|
+
setSelectedRowKeys,
|
|
12060
|
+
isEditTable
|
|
12069
12061
|
},
|
|
12070
12062
|
`record-${index4}`
|
|
12071
12063
|
);
|
|
12072
12064
|
}) : !isForm && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "w-full", colSpan: columns?.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
12073
12065
|
"div",
|
|
12074
12066
|
{
|
|
12075
|
-
className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-
|
|
12067
|
+
className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-2"}`,
|
|
12076
12068
|
children: [
|
|
12077
12069
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EmptyData, { className: colorPrimary }),
|
|
12078
12070
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "text-xl font-extrabold", children: i18n_default.t("empty_data") })
|
|
@@ -12081,7 +12073,7 @@ var TableBodyRow = (props) => {
|
|
|
12081
12073
|
) }) });
|
|
12082
12074
|
};
|
|
12083
12075
|
var TableBody = (props) => {
|
|
12084
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
|
|
12076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden z-0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
|
|
12085
12077
|
};
|
|
12086
12078
|
|
|
12087
12079
|
// src/widgets/advanced/table/table-filter.tsx
|
|
@@ -12331,11 +12323,11 @@ var TableHead = (props) => {
|
|
|
12331
12323
|
onRemoveRow,
|
|
12332
12324
|
onToggleColumnOptional
|
|
12333
12325
|
} = props;
|
|
12334
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-
|
|
12326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12335
12327
|
"tr",
|
|
12336
12328
|
{
|
|
12337
12329
|
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
12338
|
-
className: "border-b-[1.5px] border-[
|
|
12330
|
+
className: "border-b-[1.5px] border-[rgba(66,66,66,0.12)] sticky top-0 bg-white z-[1]",
|
|
12339
12331
|
children: [
|
|
12340
12332
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12341
12333
|
"th",
|
|
@@ -17815,8 +17807,8 @@ var CharField = (props) => {
|
|
|
17815
17807
|
disabled: readonly,
|
|
17816
17808
|
placeholder,
|
|
17817
17809
|
required: !invisible && required,
|
|
17818
|
-
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-
|
|
17819
|
-
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer
|
|
17810
|
+
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border border-[rgba(66,66,66,0.12)] rounded-lg p-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
|
|
17811
|
+
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
|
|
17820
17812
|
`
|
|
17821
17813
|
}
|
|
17822
17814
|
),
|
|
@@ -32461,8 +32453,8 @@ var FloatField = (props) => {
|
|
|
32461
32453
|
placeholder,
|
|
32462
32454
|
required: !invisible && required,
|
|
32463
32455
|
style: invisible ? { display: "none" } : {},
|
|
32464
|
-
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-
|
|
32465
|
-
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer
|
|
32456
|
+
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border border-[rgba(66,66,66,0.12)] rounded-lg p-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
|
|
32457
|
+
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
|
|
32466
32458
|
`
|
|
32467
32459
|
}
|
|
32468
32460
|
),
|
|
@@ -32636,8 +32628,8 @@ var HtmlField = (props) => {
|
|
|
32636
32628
|
ref: divRef,
|
|
32637
32629
|
contentEditable: !readonly,
|
|
32638
32630
|
onInput: handleInput,
|
|
32639
|
-
className: `${!isForm ? "!bg-transparent focus-within:!border-none" : `rounded-
|
|
32640
|
-
|
|
32631
|
+
className: `${!isForm ? "!bg-transparent focus-within:!border-none" : `rounded-lg border min-h-[44px] w-full ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 border-[rgba(66,66,66,0.12)] bg-white
|
|
32632
|
+
p-2 pl-3 font-normal text-sm gap-2 leading-5
|
|
32641
32633
|
resize-none opacity-100 overflow-hidden
|
|
32642
32634
|
|
|
32643
32635
|
`}`
|
|
@@ -32815,12 +32807,12 @@ var Many2ManyTagField = (props) => {
|
|
|
32815
32807
|
onChange: handleChange,
|
|
32816
32808
|
classNames: isEditTable ? {
|
|
32817
32809
|
valueContainer: () => "overflow-unset !px-0",
|
|
32818
|
-
control: () => `w-full flex ring-0 cursor-pointer outline-0 md:!min-w-[300px] max-w-[300px] !shadow-none
|
|
32810
|
+
control: () => `w-full flex ring-0 cursor-pointer outline-0 md:!min-w-[300px] max-w-[300px] !shadow-none p-2 pl-3 text-sm text-[#1A1A1B] font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden border border-transparent border-b border-[#f7f7f7] hover:border-b-primary ${readonly ? "!cursor-not-allowed" : ""}`,
|
|
32819
32811
|
dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
|
|
32820
32812
|
clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
|
|
32821
32813
|
} : {
|
|
32822
32814
|
valueContainer: () => "overflow-unset !m-0 !p-0",
|
|
32823
|
-
control: ({ isFocused }) => `w-full flex ring-0 cursor-pointer outline-0 bg-
|
|
32815
|
+
control: ({ isFocused }) => `w-full flex ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-lg p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]"} ${readonly && "!cursor-not-allowed"}`,
|
|
32824
32816
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
32825
32817
|
input: () => "!m-0 !p-0",
|
|
32826
32818
|
dropdownIndicator: () => "!m-0 !p-0"
|
|
@@ -33222,7 +33214,14 @@ var SelectDropdownField = (props) => {
|
|
|
33222
33214
|
label: val[1]
|
|
33223
33215
|
})) : [];
|
|
33224
33216
|
if (!isForm) {
|
|
33225
|
-
|
|
33217
|
+
const value2 = options2?.find((item) => item?.value === value2)?.label;
|
|
33218
|
+
return value2 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33219
|
+
"span",
|
|
33220
|
+
{
|
|
33221
|
+
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33222
|
+
children: value2
|
|
33223
|
+
}
|
|
33224
|
+
);
|
|
33226
33225
|
} else {
|
|
33227
33226
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33228
33227
|
Controller,
|
|
@@ -33264,14 +33263,14 @@ var SelectDropdownField = (props) => {
|
|
|
33264
33263
|
{
|
|
33265
33264
|
...commonProps,
|
|
33266
33265
|
classNames: isEditTable ? {
|
|
33267
|
-
control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none
|
|
33266
|
+
control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none p-2 pl-3 text-sm text-[#1A1A1B] font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content border border-transparent border-b border-[#f7f7f7] hover:border-b-primary ${readonly ? "!cursor-not-allowed" : ""}`,
|
|
33268
33267
|
valueContainer: () => "!m-0 !p-0",
|
|
33269
33268
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33270
33269
|
input: () => "!m-0 !p-0",
|
|
33271
33270
|
dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
|
|
33272
33271
|
clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
|
|
33273
33272
|
} : {
|
|
33274
|
-
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-
|
|
33273
|
+
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-white !shadow-none !rounded-[8px] p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]"} `,
|
|
33275
33274
|
valueContainer: () => "!m-0 !p-0",
|
|
33276
33275
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33277
33276
|
input: () => "!m-0 !p-0",
|
|
@@ -33840,15 +33839,10 @@ var Many2OneField = (props) => {
|
|
|
33840
33839
|
string,
|
|
33841
33840
|
//return
|
|
33842
33841
|
menuList,
|
|
33843
|
-
handleChooseRecord,
|
|
33844
|
-
handleClose,
|
|
33845
|
-
selectedRowKeys,
|
|
33846
33842
|
allowShowDetail,
|
|
33847
33843
|
index: index4,
|
|
33848
33844
|
contextObject,
|
|
33849
33845
|
renderDetail,
|
|
33850
|
-
isShowModalMany2Many,
|
|
33851
|
-
initValue,
|
|
33852
33846
|
tempSelectedOption,
|
|
33853
33847
|
options: options2,
|
|
33854
33848
|
fetchMoreOptions,
|
|
@@ -33906,7 +33900,10 @@ var Many2OneField = (props) => {
|
|
|
33906
33900
|
name: name2 ?? "",
|
|
33907
33901
|
control: methods?.control,
|
|
33908
33902
|
rules: {
|
|
33909
|
-
required: required ? {
|
|
33903
|
+
required: required ? {
|
|
33904
|
+
value: true,
|
|
33905
|
+
message: `${string} ${instance.t("must_required")}`
|
|
33906
|
+
} : false
|
|
33910
33907
|
},
|
|
33911
33908
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
33912
33909
|
const currentValue = field?.value ? { value: field?.value?.id, label: field?.value?.display_name } : null;
|
|
@@ -33925,7 +33922,7 @@ var Many2OneField = (props) => {
|
|
|
33925
33922
|
menuShouldScrollIntoView: false,
|
|
33926
33923
|
options: options2,
|
|
33927
33924
|
classNames: {
|
|
33928
|
-
control: ({ isFocused }) => `w-full flex min-h-[44px]
|
|
33925
|
+
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
33929
33926
|
valueContainer: () => "!m-0 !p-0",
|
|
33930
33927
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33931
33928
|
input: () => "!m-0 !p-0",
|