@timeax/form-palette 0.0.21 → 0.0.23
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 +428 -0
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -4414,7 +4414,12 @@ function useField(options) {
|
|
|
4414
4414
|
ok = false;
|
|
4415
4415
|
message2 = "This field is required.";
|
|
4416
4416
|
} else if (validate) {
|
|
4417
|
-
const result = validate(
|
|
4417
|
+
const result = validate(
|
|
4418
|
+
current,
|
|
4419
|
+
fieldRef.current,
|
|
4420
|
+
form,
|
|
4421
|
+
!!report
|
|
4422
|
+
);
|
|
4418
4423
|
if (typeof result === "string") {
|
|
4419
4424
|
ok = false;
|
|
4420
4425
|
message2 = result;
|
|
@@ -4675,7 +4680,7 @@ function useOptionalField(options) {
|
|
|
4675
4680
|
ok = false;
|
|
4676
4681
|
message2 = "This field is required.";
|
|
4677
4682
|
} else if (validate) {
|
|
4678
|
-
const result = validate(current, !!report);
|
|
4683
|
+
const result = validate(current, void 0, void 0, !!report);
|
|
4679
4684
|
if (typeof result === "string") {
|
|
4680
4685
|
ok = false;
|
|
4681
4686
|
message2 = result;
|
|
@@ -15742,6 +15747,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
15742
15747
|
groupClassName,
|
|
15743
15748
|
optionClassName,
|
|
15744
15749
|
labelClassName,
|
|
15750
|
+
optionLabelClassName,
|
|
15745
15751
|
descriptionClassName,
|
|
15746
15752
|
className,
|
|
15747
15753
|
// alias for groupClassName
|
|
@@ -16049,7 +16055,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
16049
16055
|
children: [
|
|
16050
16056
|
checkboxNode,
|
|
16051
16057
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
16052
|
-
/* @__PURE__ */ jsx("span", { className: labelClassesBase, children: displayItem.label }),
|
|
16058
|
+
/* @__PURE__ */ jsx("span", { className: cn(labelClassesBase, optionLabelClassName), children: displayItem.label }),
|
|
16053
16059
|
displayItem.description != null && /* @__PURE__ */ jsx(
|
|
16054
16060
|
"span",
|
|
16055
16061
|
{
|
|
@@ -21110,24 +21116,20 @@ function InputField(props) {
|
|
|
21110
21116
|
const effectiveSize = (_c = size != null ? size : (_b = (_a = module.defaults) == null ? void 0 : _a.layout) == null ? void 0 : _b.defaultSize) != null ? _c : void 0;
|
|
21111
21117
|
const effectiveDensity = (_f = density != null ? density : (_e = (_d = module.defaults) == null ? void 0 : _d.layout) == null ? void 0 : _e.defaultDensity) != null ? _f : void 0;
|
|
21112
21118
|
const validate = React10.useCallback(
|
|
21113
|
-
(value2, _report) => {
|
|
21119
|
+
(value2, field2, form, _report) => {
|
|
21114
21120
|
var _a2;
|
|
21115
21121
|
const messages = [];
|
|
21116
21122
|
if (module.validate) {
|
|
21117
21123
|
const res = module.validate(value2, {
|
|
21118
21124
|
required: !!required,
|
|
21119
21125
|
props,
|
|
21120
|
-
field:
|
|
21121
|
-
form
|
|
21126
|
+
field: field2,
|
|
21127
|
+
form
|
|
21122
21128
|
});
|
|
21123
21129
|
messages.push(...normalizeValidateResult(res));
|
|
21124
21130
|
}
|
|
21125
21131
|
if (onValidate) {
|
|
21126
|
-
const res = onValidate(
|
|
21127
|
-
value2,
|
|
21128
|
-
void 0,
|
|
21129
|
-
void 0
|
|
21130
|
-
);
|
|
21132
|
+
const res = onValidate(value2, field2, form);
|
|
21131
21133
|
messages.push(...normalizeValidateResult(res));
|
|
21132
21134
|
}
|
|
21133
21135
|
if (!messages.length) return true;
|
|
@@ -21351,7 +21353,11 @@ function InputField(props) {
|
|
|
21351
21353
|
)
|
|
21352
21354
|
)
|
|
21353
21355
|
] });
|
|
21354
|
-
const inlineRowClassName = cn(
|
|
21356
|
+
const inlineRowClassName = cn(
|
|
21357
|
+
"flex gap-2",
|
|
21358
|
+
hasLabelAboveSlots || hasLabelBelowSlots ? "items-start" : "items-center",
|
|
21359
|
+
classes == null ? void 0 : classes.inlineRow
|
|
21360
|
+
);
|
|
21355
21361
|
const hasStackedLabelBlock = lp !== "hidden" && hasAnyLabelBlockContent;
|
|
21356
21362
|
const stackedGroupClassName = cn(
|
|
21357
21363
|
hasStackedLabelBlock && hasLabelRowContent && "mt-0.5",
|