@fctc/sme-widget-ui 2.1.3 → 2.1.4
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 +10 -12
- package/dist/index.mjs +10 -12
- package/dist/widgets.js +10 -13
- package/dist/widgets.mjs +10 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17257,13 +17257,14 @@ var CharField = (props) => {
|
|
|
17257
17257
|
const propValue = value || defaultValue;
|
|
17258
17258
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: propValue && typeof propValue === "object" ? propValue.display_name : propValue });
|
|
17259
17259
|
}
|
|
17260
|
+
const { t: t3 } = useI18n();
|
|
17260
17261
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
17261
17262
|
Controller,
|
|
17262
17263
|
{
|
|
17263
17264
|
name: name2 ?? "",
|
|
17264
17265
|
control: methods.control,
|
|
17265
17266
|
rules: {
|
|
17266
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
17267
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false,
|
|
17267
17268
|
validate: (value2) => {
|
|
17268
17269
|
if (!value2) return true;
|
|
17269
17270
|
if (widget === "custom_passord") {
|
|
@@ -17275,7 +17276,7 @@ var CharField = (props) => {
|
|
|
17275
17276
|
if (!widget) return;
|
|
17276
17277
|
const inputType = widget === "email" ? "email" : widget === "phone" ? "phone" : widget === "text-only" ? "text" : widget === "number" ? "number" : null;
|
|
17277
17278
|
if (!inputType) return;
|
|
17278
|
-
return validateInput(value2, inputType) ||
|
|
17279
|
+
return validateInput(value2, inputType) || t3(
|
|
17279
17280
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
17280
17281
|
);
|
|
17281
17282
|
}
|
|
@@ -17344,7 +17345,7 @@ var CharField = (props) => {
|
|
|
17344
17345
|
if (inputValue && !validateInput(inputValue, inputType)) {
|
|
17345
17346
|
setError(name2, {
|
|
17346
17347
|
type: "pattern",
|
|
17347
|
-
message:
|
|
17348
|
+
message: t3(
|
|
17348
17349
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
17349
17350
|
)
|
|
17350
17351
|
});
|
|
@@ -17356,7 +17357,7 @@ var CharField = (props) => {
|
|
|
17356
17357
|
if (!inputValue && required && !invisible) {
|
|
17357
17358
|
setError(name2, {
|
|
17358
17359
|
type: "required",
|
|
17359
|
-
message: `${string} ${
|
|
17360
|
+
message: `${string} ${t3("must_required")}`
|
|
17360
17361
|
});
|
|
17361
17362
|
} else {
|
|
17362
17363
|
clearErrors(name2);
|
|
@@ -17457,11 +17458,8 @@ var CheckboxField = (props) => {
|
|
|
17457
17458
|
var import_react41 = require("react");
|
|
17458
17459
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
17459
17460
|
var ColorWrapper = (props) => {
|
|
17460
|
-
const {
|
|
17461
|
-
|
|
17462
|
-
defaultColor,
|
|
17463
|
-
savePickColor
|
|
17464
|
-
} = props;
|
|
17461
|
+
const { colors: colors2, defaultColor, savePickColor } = props;
|
|
17462
|
+
const { t: t3 } = useI18n();
|
|
17465
17463
|
const [selectedColor, setSelectedColor] = (0, import_react41.useState)(colors2[defaultColor]);
|
|
17466
17464
|
const [showFullColors, setIsShowFullColor] = (0, import_react41.useState)(false);
|
|
17467
17465
|
const pickColorsRef = (0, import_react41.useRef)(null);
|
|
@@ -17503,7 +17501,7 @@ var ColorWrapper = (props) => {
|
|
|
17503
17501
|
className: "",
|
|
17504
17502
|
place: "top",
|
|
17505
17503
|
id: `${color?.color}${color?.id}`,
|
|
17506
|
-
content:
|
|
17504
|
+
content: t3(color?.name)
|
|
17507
17505
|
}
|
|
17508
17506
|
)
|
|
17509
17507
|
] }, color?.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
@@ -17525,7 +17523,7 @@ var ColorWrapper = (props) => {
|
|
|
17525
17523
|
{
|
|
17526
17524
|
place: "top",
|
|
17527
17525
|
id: `${selectedColor?.id}${selectedColor?.name}`,
|
|
17528
|
-
content:
|
|
17526
|
+
content: t3(selectedColor?.name)
|
|
17529
17527
|
}
|
|
17530
17528
|
)
|
|
17531
17529
|
] }) });
|
|
@@ -32464,7 +32462,7 @@ var Many2ManyTagField = (props) => {
|
|
|
32464
32462
|
name: name2 ?? "",
|
|
32465
32463
|
control: methods.control,
|
|
32466
32464
|
rules: {
|
|
32467
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
32465
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
32468
32466
|
},
|
|
32469
32467
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
32470
32468
|
const { clearErrors } = methods;
|
package/dist/index.mjs
CHANGED
|
@@ -17132,13 +17132,14 @@ var CharField = (props) => {
|
|
|
17132
17132
|
const propValue = value || defaultValue;
|
|
17133
17133
|
return /* @__PURE__ */ jsx77("span", { children: propValue && typeof propValue === "object" ? propValue.display_name : propValue });
|
|
17134
17134
|
}
|
|
17135
|
+
const { t: t3 } = useI18n();
|
|
17135
17136
|
return /* @__PURE__ */ jsx77(
|
|
17136
17137
|
Controller,
|
|
17137
17138
|
{
|
|
17138
17139
|
name: name2 ?? "",
|
|
17139
17140
|
control: methods.control,
|
|
17140
17141
|
rules: {
|
|
17141
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
17142
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false,
|
|
17142
17143
|
validate: (value2) => {
|
|
17143
17144
|
if (!value2) return true;
|
|
17144
17145
|
if (widget === "custom_passord") {
|
|
@@ -17150,7 +17151,7 @@ var CharField = (props) => {
|
|
|
17150
17151
|
if (!widget) return;
|
|
17151
17152
|
const inputType = widget === "email" ? "email" : widget === "phone" ? "phone" : widget === "text-only" ? "text" : widget === "number" ? "number" : null;
|
|
17152
17153
|
if (!inputType) return;
|
|
17153
|
-
return validateInput(value2, inputType) ||
|
|
17154
|
+
return validateInput(value2, inputType) || t3(
|
|
17154
17155
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
17155
17156
|
);
|
|
17156
17157
|
}
|
|
@@ -17219,7 +17220,7 @@ var CharField = (props) => {
|
|
|
17219
17220
|
if (inputValue && !validateInput(inputValue, inputType)) {
|
|
17220
17221
|
setError(name2, {
|
|
17221
17222
|
type: "pattern",
|
|
17222
|
-
message:
|
|
17223
|
+
message: t3(
|
|
17223
17224
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
17224
17225
|
)
|
|
17225
17226
|
});
|
|
@@ -17231,7 +17232,7 @@ var CharField = (props) => {
|
|
|
17231
17232
|
if (!inputValue && required && !invisible) {
|
|
17232
17233
|
setError(name2, {
|
|
17233
17234
|
type: "required",
|
|
17234
|
-
message: `${string} ${
|
|
17235
|
+
message: `${string} ${t3("must_required")}`
|
|
17235
17236
|
});
|
|
17236
17237
|
} else {
|
|
17237
17238
|
clearErrors(name2);
|
|
@@ -17332,11 +17333,8 @@ var CheckboxField = (props) => {
|
|
|
17332
17333
|
import { useEffect as useEffect13, useRef as useRef7, useState as useState12 } from "react";
|
|
17333
17334
|
import { Fragment as Fragment19, jsx as jsx79, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
17334
17335
|
var ColorWrapper = (props) => {
|
|
17335
|
-
const {
|
|
17336
|
-
|
|
17337
|
-
defaultColor,
|
|
17338
|
-
savePickColor
|
|
17339
|
-
} = props;
|
|
17336
|
+
const { colors: colors2, defaultColor, savePickColor } = props;
|
|
17337
|
+
const { t: t3 } = useI18n();
|
|
17340
17338
|
const [selectedColor, setSelectedColor] = useState12(colors2[defaultColor]);
|
|
17341
17339
|
const [showFullColors, setIsShowFullColor] = useState12(false);
|
|
17342
17340
|
const pickColorsRef = useRef7(null);
|
|
@@ -17378,7 +17376,7 @@ var ColorWrapper = (props) => {
|
|
|
17378
17376
|
className: "",
|
|
17379
17377
|
place: "top",
|
|
17380
17378
|
id: `${color?.color}${color?.id}`,
|
|
17381
|
-
content:
|
|
17379
|
+
content: t3(color?.name)
|
|
17382
17380
|
}
|
|
17383
17381
|
)
|
|
17384
17382
|
] }, color?.id)) }) : /* @__PURE__ */ jsxs52(Fragment19, { children: [
|
|
@@ -17400,7 +17398,7 @@ var ColorWrapper = (props) => {
|
|
|
17400
17398
|
{
|
|
17401
17399
|
place: "top",
|
|
17402
17400
|
id: `${selectedColor?.id}${selectedColor?.name}`,
|
|
17403
|
-
content:
|
|
17401
|
+
content: t3(selectedColor?.name)
|
|
17404
17402
|
}
|
|
17405
17403
|
)
|
|
17406
17404
|
] }) });
|
|
@@ -32339,7 +32337,7 @@ var Many2ManyTagField = (props) => {
|
|
|
32339
32337
|
name: name2 ?? "",
|
|
32340
32338
|
control: methods.control,
|
|
32341
32339
|
rules: {
|
|
32342
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
32340
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
32343
32341
|
},
|
|
32344
32342
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
32345
32343
|
const { clearErrors } = methods;
|
package/dist/widgets.js
CHANGED
|
@@ -7846,7 +7846,6 @@ instance.use(Browser).use(initReactI18next).init({
|
|
|
7846
7846
|
caches: ["cookie"]
|
|
7847
7847
|
}
|
|
7848
7848
|
});
|
|
7849
|
-
var i18n_default = instance;
|
|
7850
7849
|
|
|
7851
7850
|
// src/provider/index.tsx
|
|
7852
7851
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -16510,13 +16509,14 @@ var CharField = (props) => {
|
|
|
16510
16509
|
const propValue = value || defaultValue;
|
|
16511
16510
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: propValue && typeof propValue === "object" ? propValue.display_name : propValue });
|
|
16512
16511
|
}
|
|
16512
|
+
const { t: t3 } = useI18n();
|
|
16513
16513
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
16514
16514
|
Controller,
|
|
16515
16515
|
{
|
|
16516
16516
|
name: name2 ?? "",
|
|
16517
16517
|
control: methods.control,
|
|
16518
16518
|
rules: {
|
|
16519
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
16519
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false,
|
|
16520
16520
|
validate: (value2) => {
|
|
16521
16521
|
if (!value2) return true;
|
|
16522
16522
|
if (widget === "custom_passord") {
|
|
@@ -16528,7 +16528,7 @@ var CharField = (props) => {
|
|
|
16528
16528
|
if (!widget) return;
|
|
16529
16529
|
const inputType = widget === "email" ? "email" : widget === "phone" ? "phone" : widget === "text-only" ? "text" : widget === "number" ? "number" : null;
|
|
16530
16530
|
if (!inputType) return;
|
|
16531
|
-
return validateInput(value2, inputType) ||
|
|
16531
|
+
return validateInput(value2, inputType) || t3(
|
|
16532
16532
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
16533
16533
|
);
|
|
16534
16534
|
}
|
|
@@ -16597,7 +16597,7 @@ var CharField = (props) => {
|
|
|
16597
16597
|
if (inputValue && !validateInput(inputValue, inputType)) {
|
|
16598
16598
|
setError(name2, {
|
|
16599
16599
|
type: "pattern",
|
|
16600
|
-
message:
|
|
16600
|
+
message: t3(
|
|
16601
16601
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
16602
16602
|
)
|
|
16603
16603
|
});
|
|
@@ -16609,7 +16609,7 @@ var CharField = (props) => {
|
|
|
16609
16609
|
if (!inputValue && required && !invisible) {
|
|
16610
16610
|
setError(name2, {
|
|
16611
16611
|
type: "required",
|
|
16612
|
-
message: `${string} ${
|
|
16612
|
+
message: `${string} ${t3("must_required")}`
|
|
16613
16613
|
});
|
|
16614
16614
|
} else {
|
|
16615
16615
|
clearErrors(name2);
|
|
@@ -16710,11 +16710,8 @@ var CheckboxField = (props) => {
|
|
|
16710
16710
|
var import_react41 = require("react");
|
|
16711
16711
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
16712
16712
|
var ColorWrapper = (props) => {
|
|
16713
|
-
const {
|
|
16714
|
-
|
|
16715
|
-
defaultColor,
|
|
16716
|
-
savePickColor
|
|
16717
|
-
} = props;
|
|
16713
|
+
const { colors: colors2, defaultColor, savePickColor } = props;
|
|
16714
|
+
const { t: t3 } = useI18n();
|
|
16718
16715
|
const [selectedColor, setSelectedColor] = (0, import_react41.useState)(colors2[defaultColor]);
|
|
16719
16716
|
const [showFullColors, setIsShowFullColor] = (0, import_react41.useState)(false);
|
|
16720
16717
|
const pickColorsRef = (0, import_react41.useRef)(null);
|
|
@@ -16756,7 +16753,7 @@ var ColorWrapper = (props) => {
|
|
|
16756
16753
|
className: "",
|
|
16757
16754
|
place: "top",
|
|
16758
16755
|
id: `${color?.color}${color?.id}`,
|
|
16759
|
-
content:
|
|
16756
|
+
content: t3(color?.name)
|
|
16760
16757
|
}
|
|
16761
16758
|
)
|
|
16762
16759
|
] }, color?.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
@@ -16778,7 +16775,7 @@ var ColorWrapper = (props) => {
|
|
|
16778
16775
|
{
|
|
16779
16776
|
place: "top",
|
|
16780
16777
|
id: `${selectedColor?.id}${selectedColor?.name}`,
|
|
16781
|
-
content:
|
|
16778
|
+
content: t3(selectedColor?.name)
|
|
16782
16779
|
}
|
|
16783
16780
|
)
|
|
16784
16781
|
] }) });
|
|
@@ -31717,7 +31714,7 @@ var Many2ManyTagField = (props) => {
|
|
|
31717
31714
|
name: name2 ?? "",
|
|
31718
31715
|
control: methods.control,
|
|
31719
31716
|
rules: {
|
|
31720
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
31717
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
31721
31718
|
},
|
|
31722
31719
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
31723
31720
|
const { clearErrors } = methods;
|
package/dist/widgets.mjs
CHANGED
|
@@ -7784,7 +7784,6 @@ instance.use(Browser).use(initReactI18next).init({
|
|
|
7784
7784
|
caches: ["cookie"]
|
|
7785
7785
|
}
|
|
7786
7786
|
});
|
|
7787
|
-
var i18n_default = instance;
|
|
7788
7787
|
|
|
7789
7788
|
// src/provider/index.tsx
|
|
7790
7789
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -16448,13 +16447,14 @@ var CharField = (props) => {
|
|
|
16448
16447
|
const propValue = value || defaultValue;
|
|
16449
16448
|
return /* @__PURE__ */ jsx77("span", { children: propValue && typeof propValue === "object" ? propValue.display_name : propValue });
|
|
16450
16449
|
}
|
|
16450
|
+
const { t: t3 } = useI18n();
|
|
16451
16451
|
return /* @__PURE__ */ jsx77(
|
|
16452
16452
|
Controller,
|
|
16453
16453
|
{
|
|
16454
16454
|
name: name2 ?? "",
|
|
16455
16455
|
control: methods.control,
|
|
16456
16456
|
rules: {
|
|
16457
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
16457
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false,
|
|
16458
16458
|
validate: (value2) => {
|
|
16459
16459
|
if (!value2) return true;
|
|
16460
16460
|
if (widget === "custom_passord") {
|
|
@@ -16466,7 +16466,7 @@ var CharField = (props) => {
|
|
|
16466
16466
|
if (!widget) return;
|
|
16467
16467
|
const inputType = widget === "email" ? "email" : widget === "phone" ? "phone" : widget === "text-only" ? "text" : widget === "number" ? "number" : null;
|
|
16468
16468
|
if (!inputType) return;
|
|
16469
|
-
return validateInput(value2, inputType) ||
|
|
16469
|
+
return validateInput(value2, inputType) || t3(
|
|
16470
16470
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
16471
16471
|
);
|
|
16472
16472
|
}
|
|
@@ -16535,7 +16535,7 @@ var CharField = (props) => {
|
|
|
16535
16535
|
if (inputValue && !validateInput(inputValue, inputType)) {
|
|
16536
16536
|
setError(name2, {
|
|
16537
16537
|
type: "pattern",
|
|
16538
|
-
message:
|
|
16538
|
+
message: t3(
|
|
16539
16539
|
widget === "email" ? "email-only" : widget === "phone" ? "phone-only" : widget === "text-only" ? "text-only" : "number-only"
|
|
16540
16540
|
)
|
|
16541
16541
|
});
|
|
@@ -16547,7 +16547,7 @@ var CharField = (props) => {
|
|
|
16547
16547
|
if (!inputValue && required && !invisible) {
|
|
16548
16548
|
setError(name2, {
|
|
16549
16549
|
type: "required",
|
|
16550
|
-
message: `${string} ${
|
|
16550
|
+
message: `${string} ${t3("must_required")}`
|
|
16551
16551
|
});
|
|
16552
16552
|
} else {
|
|
16553
16553
|
clearErrors(name2);
|
|
@@ -16648,11 +16648,8 @@ var CheckboxField = (props) => {
|
|
|
16648
16648
|
import { useEffect as useEffect13, useRef as useRef7, useState as useState12 } from "react";
|
|
16649
16649
|
import { Fragment as Fragment19, jsx as jsx79, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
16650
16650
|
var ColorWrapper = (props) => {
|
|
16651
|
-
const {
|
|
16652
|
-
|
|
16653
|
-
defaultColor,
|
|
16654
|
-
savePickColor
|
|
16655
|
-
} = props;
|
|
16651
|
+
const { colors: colors2, defaultColor, savePickColor } = props;
|
|
16652
|
+
const { t: t3 } = useI18n();
|
|
16656
16653
|
const [selectedColor, setSelectedColor] = useState12(colors2[defaultColor]);
|
|
16657
16654
|
const [showFullColors, setIsShowFullColor] = useState12(false);
|
|
16658
16655
|
const pickColorsRef = useRef7(null);
|
|
@@ -16694,7 +16691,7 @@ var ColorWrapper = (props) => {
|
|
|
16694
16691
|
className: "",
|
|
16695
16692
|
place: "top",
|
|
16696
16693
|
id: `${color?.color}${color?.id}`,
|
|
16697
|
-
content:
|
|
16694
|
+
content: t3(color?.name)
|
|
16698
16695
|
}
|
|
16699
16696
|
)
|
|
16700
16697
|
] }, color?.id)) }) : /* @__PURE__ */ jsxs52(Fragment19, { children: [
|
|
@@ -16716,7 +16713,7 @@ var ColorWrapper = (props) => {
|
|
|
16716
16713
|
{
|
|
16717
16714
|
place: "top",
|
|
16718
16715
|
id: `${selectedColor?.id}${selectedColor?.name}`,
|
|
16719
|
-
content:
|
|
16716
|
+
content: t3(selectedColor?.name)
|
|
16720
16717
|
}
|
|
16721
16718
|
)
|
|
16722
16719
|
] }) });
|
|
@@ -31655,7 +31652,7 @@ var Many2ManyTagField = (props) => {
|
|
|
31655
31652
|
name: name2 ?? "",
|
|
31656
31653
|
control: methods.control,
|
|
31657
31654
|
rules: {
|
|
31658
|
-
required: required && !invisible ? { value: true, message: `${string} ${
|
|
31655
|
+
required: required && !invisible ? { value: true, message: `${string} ${t3("must_required")}` } : false
|
|
31659
31656
|
},
|
|
31660
31657
|
render: ({ field, fieldState: { error: error2 } }) => {
|
|
31661
31658
|
const { clearErrors } = methods;
|