@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/index.js
CHANGED
|
@@ -6152,7 +6152,7 @@ var ResetIcon = () => {
|
|
|
6152
6152
|
// src/icons/search-icon.tsx
|
|
6153
6153
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6154
6154
|
var SearchIcon = () => {
|
|
6155
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
6155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6156
6156
|
"svg",
|
|
6157
6157
|
{
|
|
6158
6158
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6160,22 +6160,13 @@ var SearchIcon = () => {
|
|
|
6160
6160
|
height: "20",
|
|
6161
6161
|
viewBox: "0 0 20 20",
|
|
6162
6162
|
fill: "none",
|
|
6163
|
-
children:
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
),
|
|
6171
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6172
|
-
"path",
|
|
6173
|
-
{
|
|
6174
|
-
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",
|
|
6175
|
-
fill: "#525252"
|
|
6176
|
-
}
|
|
6177
|
-
)
|
|
6178
|
-
]
|
|
6163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6164
|
+
"path",
|
|
6165
|
+
{
|
|
6166
|
+
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",
|
|
6167
|
+
fill: "#AEAEAE"
|
|
6168
|
+
}
|
|
6169
|
+
)
|
|
6179
6170
|
}
|
|
6180
6171
|
);
|
|
6181
6172
|
};
|
|
@@ -12418,7 +12409,8 @@ var TableBodyRow = (props) => {
|
|
|
12418
12409
|
checked,
|
|
12419
12410
|
isForm,
|
|
12420
12411
|
typeCo,
|
|
12421
|
-
selectedRowKeys
|
|
12412
|
+
selectedRowKeys,
|
|
12413
|
+
isEditTable
|
|
12422
12414
|
} = props;
|
|
12423
12415
|
const [isAutoSelect, setIsAutoSelect] = (0, import_react12.useState)(false);
|
|
12424
12416
|
const rootStyle = getComputedStyle(document.documentElement);
|
|
@@ -12463,16 +12455,16 @@ var TableBodyRow = (props) => {
|
|
|
12463
12455
|
checkedAll,
|
|
12464
12456
|
setIsAutoSelect,
|
|
12465
12457
|
isAutoSelect,
|
|
12466
|
-
s: true,
|
|
12467
12458
|
selectedRowKeysRef,
|
|
12468
|
-
setSelectedRowKeys
|
|
12459
|
+
setSelectedRowKeys,
|
|
12460
|
+
isEditTable
|
|
12469
12461
|
},
|
|
12470
12462
|
`record-${index4}`
|
|
12471
12463
|
);
|
|
12472
12464
|
}) : !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)(
|
|
12473
12465
|
"div",
|
|
12474
12466
|
{
|
|
12475
|
-
className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-
|
|
12467
|
+
className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-2"}`,
|
|
12476
12468
|
children: [
|
|
12477
12469
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EmptyData, { className: colorPrimary }),
|
|
12478
12470
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "text-xl font-extrabold", children: i18n_default.t("empty_data") })
|
|
@@ -12481,7 +12473,7 @@ var TableBodyRow = (props) => {
|
|
|
12481
12473
|
) }) });
|
|
12482
12474
|
};
|
|
12483
12475
|
var TableBody = (props) => {
|
|
12484
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
|
|
12476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden z-0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
|
|
12485
12477
|
};
|
|
12486
12478
|
|
|
12487
12479
|
// src/widgets/advanced/table/table-filter.tsx
|
|
@@ -12697,11 +12689,11 @@ var TableHead = (props) => {
|
|
|
12697
12689
|
onRemoveRow,
|
|
12698
12690
|
onToggleColumnOptional
|
|
12699
12691
|
} = props;
|
|
12700
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-
|
|
12692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12701
12693
|
"tr",
|
|
12702
12694
|
{
|
|
12703
12695
|
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
12704
|
-
className: "border-b-[1.5px] border-[
|
|
12696
|
+
className: "border-b-[1.5px] border-[rgba(66,66,66,0.12)] sticky top-0 bg-white z-[1]",
|
|
12705
12697
|
children: [
|
|
12706
12698
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12707
12699
|
"th",
|
|
@@ -18170,8 +18162,8 @@ var CharField = (props) => {
|
|
|
18170
18162
|
disabled: readonly,
|
|
18171
18163
|
placeholder,
|
|
18172
18164
|
required: !invisible && required,
|
|
18173
|
-
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-
|
|
18174
|
-
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer
|
|
18165
|
+
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
|
|
18166
|
+
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
|
|
18175
18167
|
`
|
|
18176
18168
|
}
|
|
18177
18169
|
),
|
|
@@ -32816,8 +32808,8 @@ var FloatField = (props) => {
|
|
|
32816
32808
|
placeholder,
|
|
32817
32809
|
required: !invisible && required,
|
|
32818
32810
|
style: invisible ? { display: "none" } : {},
|
|
32819
|
-
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-
|
|
32820
|
-
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer
|
|
32811
|
+
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
|
|
32812
|
+
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
|
|
32821
32813
|
`
|
|
32822
32814
|
}
|
|
32823
32815
|
),
|
|
@@ -32991,8 +32983,8 @@ var HtmlField = (props) => {
|
|
|
32991
32983
|
ref: divRef,
|
|
32992
32984
|
contentEditable: !readonly,
|
|
32993
32985
|
onInput: handleInput,
|
|
32994
|
-
className: `${!isForm ? "!bg-transparent focus-within:!border-none" : `rounded-
|
|
32995
|
-
|
|
32986
|
+
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
|
|
32987
|
+
p-2 pl-3 font-normal text-sm gap-2 leading-5
|
|
32996
32988
|
resize-none opacity-100 overflow-hidden
|
|
32997
32989
|
|
|
32998
32990
|
`}`
|
|
@@ -33170,12 +33162,12 @@ var Many2ManyTagField = (props) => {
|
|
|
33170
33162
|
onChange: handleChange,
|
|
33171
33163
|
classNames: isEditTable ? {
|
|
33172
33164
|
valueContainer: () => "overflow-unset !px-0",
|
|
33173
|
-
control: () => `w-full flex ring-0 cursor-pointer outline-0 md:!min-w-[300px] max-w-[300px] !shadow-none
|
|
33165
|
+
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" : ""}`,
|
|
33174
33166
|
dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
|
|
33175
33167
|
clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
|
|
33176
33168
|
} : {
|
|
33177
33169
|
valueContainer: () => "overflow-unset !m-0 !p-0",
|
|
33178
|
-
control: ({ isFocused }) => `w-full flex ring-0 cursor-pointer outline-0 bg-
|
|
33170
|
+
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"}`,
|
|
33179
33171
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33180
33172
|
input: () => "!m-0 !p-0",
|
|
33181
33173
|
dropdownIndicator: () => "!m-0 !p-0"
|
|
@@ -33577,7 +33569,14 @@ var SelectDropdownField = (props) => {
|
|
|
33577
33569
|
label: val[1]
|
|
33578
33570
|
})) : [];
|
|
33579
33571
|
if (!isForm) {
|
|
33580
|
-
|
|
33572
|
+
const value2 = options2?.find((item) => item?.value === value2)?.label;
|
|
33573
|
+
return value2 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33574
|
+
"span",
|
|
33575
|
+
{
|
|
33576
|
+
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33577
|
+
children: value2
|
|
33578
|
+
}
|
|
33579
|
+
);
|
|
33581
33580
|
} else {
|
|
33582
33581
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33583
33582
|
Controller,
|
|
@@ -33619,14 +33618,14 @@ var SelectDropdownField = (props) => {
|
|
|
33619
33618
|
{
|
|
33620
33619
|
...commonProps,
|
|
33621
33620
|
classNames: isEditTable ? {
|
|
33622
|
-
control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none
|
|
33621
|
+
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" : ""}`,
|
|
33623
33622
|
valueContainer: () => "!m-0 !p-0",
|
|
33624
33623
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33625
33624
|
input: () => "!m-0 !p-0",
|
|
33626
33625
|
dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
|
|
33627
33626
|
clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
|
|
33628
33627
|
} : {
|
|
33629
|
-
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-
|
|
33628
|
+
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)]"} `,
|
|
33630
33629
|
valueContainer: () => "!m-0 !p-0",
|
|
33631
33630
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33632
33631
|
input: () => "!m-0 !p-0",
|
|
@@ -34195,15 +34194,10 @@ var Many2OneField = (props) => {
|
|
|
34195
34194
|
string,
|
|
34196
34195
|
//return
|
|
34197
34196
|
menuList,
|
|
34198
|
-
handleChooseRecord,
|
|
34199
|
-
handleClose,
|
|
34200
|
-
selectedRowKeys,
|
|
34201
34197
|
allowShowDetail,
|
|
34202
34198
|
index: index4,
|
|
34203
34199
|
contextObject,
|
|
34204
34200
|
renderDetail,
|
|
34205
|
-
isShowModalMany2Many,
|
|
34206
|
-
initValue,
|
|
34207
34201
|
tempSelectedOption,
|
|
34208
34202
|
options: options2,
|
|
34209
34203
|
fetchMoreOptions,
|
|
@@ -34261,7 +34255,10 @@ var Many2OneField = (props) => {
|
|
|
34261
34255
|
name: name2 ?? "",
|
|
34262
34256
|
control: methods?.control,
|
|
34263
34257
|
rules: {
|
|
34264
|
-
required: required ? {
|
|
34258
|
+
required: required ? {
|
|
34259
|
+
value: true,
|
|
34260
|
+
message: `${string} ${instance.t("must_required")}`
|
|
34261
|
+
} : false
|
|
34265
34262
|
},
|
|
34266
34263
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
34267
34264
|
const currentValue = field?.value ? { value: field?.value?.id, label: field?.value?.display_name } : null;
|
|
@@ -34280,7 +34277,7 @@ var Many2OneField = (props) => {
|
|
|
34280
34277
|
menuShouldScrollIntoView: false,
|
|
34281
34278
|
options: options2,
|
|
34282
34279
|
classNames: {
|
|
34283
|
-
control: ({ isFocused }) => `w-full flex min-h-[44px]
|
|
34280
|
+
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"}`,
|
|
34284
34281
|
valueContainer: () => "!m-0 !p-0",
|
|
34285
34282
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
34286
34283
|
input: () => "!m-0 !p-0",
|