@edifice.io/react 2.4.0-develop-pedago.20251104152516 → 2.4.0-develop-pedago.20251105110423
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/components/Input/Input.js +4 -10
- package/dist/components/TextArea/TextArea.js +6 -12
- package/dist/components/TextCounter/TextCounter.d.ts +15 -0
- package/dist/components/TextCounter/TextCounter.js +16 -0
- package/dist/components/TextCounter/index.d.ts +2 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -3
- package/package.json +6 -6
|
@@ -2,13 +2,14 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useFormControl } from "../Form/FormContext.js";
|
|
5
|
+
import Textcounter from "../TextCounter/TextCounter.js";
|
|
5
6
|
const Input = /* @__PURE__ */ forwardRef(({
|
|
6
7
|
noValidationIcon,
|
|
7
8
|
placeholder,
|
|
8
9
|
size = "md",
|
|
9
10
|
type = "text",
|
|
10
11
|
className,
|
|
11
|
-
showCounter,
|
|
12
|
+
showCounter = !1,
|
|
12
13
|
autoComplete = "off",
|
|
13
14
|
...restProps
|
|
14
15
|
}, ref) => {
|
|
@@ -18,7 +19,7 @@ const Input = /* @__PURE__ */ forwardRef(({
|
|
|
18
19
|
isRequired,
|
|
19
20
|
isReadOnly,
|
|
20
21
|
status
|
|
21
|
-
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.
|
|
22
|
+
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.defaultValue) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
|
|
22
23
|
"form-control": !isReadOnly,
|
|
23
24
|
"form-control-lg": size === "lg",
|
|
24
25
|
"form-control-sm": size === "sm",
|
|
@@ -33,14 +34,7 @@ const Input = /* @__PURE__ */ forwardRef(({
|
|
|
33
34
|
var _a2;
|
|
34
35
|
setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
|
|
35
36
|
}, autoComplete }),
|
|
36
|
-
showCounter && !status && /* @__PURE__ */
|
|
37
|
-
"text-danger": currentLength === restProps.maxLength,
|
|
38
|
-
"text-gray-700": currentLength !== restProps.maxLength
|
|
39
|
-
}), children: [
|
|
40
|
-
currentLength,
|
|
41
|
-
" / ",
|
|
42
|
-
restProps.maxLength
|
|
43
|
-
] })
|
|
37
|
+
showCounter && !status && /* @__PURE__ */ jsx(Textcounter, { currentLength, maxLength: restProps.maxLength ?? 0 })
|
|
44
38
|
] });
|
|
45
39
|
});
|
|
46
40
|
export {
|
|
@@ -2,13 +2,14 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useFormControl } from "../Form/FormContext.js";
|
|
5
|
+
import Textcounter from "../TextCounter/TextCounter.js";
|
|
5
6
|
const TextArea = /* @__PURE__ */ forwardRef(({
|
|
6
7
|
noValidationIcon,
|
|
7
8
|
placeholder,
|
|
8
9
|
size = "md",
|
|
9
10
|
height = "md",
|
|
10
11
|
className,
|
|
11
|
-
showCounter,
|
|
12
|
+
showCounter = !1,
|
|
12
13
|
...restProps
|
|
13
14
|
}, ref) => {
|
|
14
15
|
var _a;
|
|
@@ -17,7 +18,7 @@ const TextArea = /* @__PURE__ */ forwardRef(({
|
|
|
17
18
|
isRequired,
|
|
18
19
|
isReadOnly,
|
|
19
20
|
status
|
|
20
|
-
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.
|
|
21
|
+
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.defaultValue) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
|
|
21
22
|
"form-control": !isReadOnly,
|
|
22
23
|
"form-control-lg": size === "lg",
|
|
23
24
|
"form-control-sm": size === "sm",
|
|
@@ -30,18 +31,11 @@ const TextArea = /* @__PURE__ */ forwardRef(({
|
|
|
30
31
|
"no-validation-icon": noValidationIcon
|
|
31
32
|
}, className);
|
|
32
33
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx("textarea", { ref, id, className: classes, placeholder, required: isRequired, readOnly: isReadOnly, onChange: (e) => {
|
|
34
|
+
/* @__PURE__ */ jsx("textarea", { ref, id, className: classes, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps, onChange: (e) => {
|
|
34
35
|
var _a2;
|
|
35
36
|
setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
|
|
36
|
-
}
|
|
37
|
-
showCounter && !status && /* @__PURE__ */
|
|
38
|
-
"text-danger": currentLength === restProps.maxLength,
|
|
39
|
-
"text-gray-700": currentLength !== restProps.maxLength
|
|
40
|
-
}), children: [
|
|
41
|
-
currentLength,
|
|
42
|
-
" / ",
|
|
43
|
-
restProps.maxLength
|
|
44
|
-
] })
|
|
37
|
+
} }),
|
|
38
|
+
showCounter && !status && /* @__PURE__ */ jsx(Textcounter, { currentLength, maxLength: restProps.maxLength ?? 0 })
|
|
45
39
|
] });
|
|
46
40
|
});
|
|
47
41
|
export {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TextcounterProps {
|
|
2
|
+
/**
|
|
3
|
+
* The current number of characters in the text input
|
|
4
|
+
*/
|
|
5
|
+
currentLength: number;
|
|
6
|
+
/**
|
|
7
|
+
* The maximum number of characters allowed in the text input
|
|
8
|
+
*/
|
|
9
|
+
maxLength: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Textcounter: {
|
|
12
|
+
({ currentLength, maxLength }: TextcounterProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default Textcounter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
const Textcounter = ({
|
|
4
|
+
currentLength,
|
|
5
|
+
maxLength
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("span", { className: clsx("caption text-end float-end mt-n32 py-2 px-12 ", {
|
|
7
|
+
"text-danger": currentLength === maxLength,
|
|
8
|
+
"text-gray-700": currentLength !== maxLength
|
|
9
|
+
}), children: [
|
|
10
|
+
currentLength,
|
|
11
|
+
" / ",
|
|
12
|
+
maxLength
|
|
13
|
+
] });
|
|
14
|
+
export {
|
|
15
|
+
Textcounter as default
|
|
16
|
+
};
|
|
@@ -66,9 +66,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
66
66
|
} = useThumb({
|
|
67
67
|
isUpdating,
|
|
68
68
|
selectedResource: isUpdating ? resource : void 0
|
|
69
|
-
})
|
|
70
|
-
watch("description");
|
|
71
|
-
const onSubmit = async function(formData) {
|
|
69
|
+
}), onSubmit = async function(formData) {
|
|
72
70
|
var _a2, _b2;
|
|
73
71
|
try {
|
|
74
72
|
const data = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.4.0-develop-pedago.
|
|
3
|
+
"version": "2.4.0-develop-pedago.20251105110423",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"react-slugify": "^3.0.3",
|
|
132
132
|
"swiper": "^10.1.0",
|
|
133
133
|
"ua-parser-js": "^1.0.36",
|
|
134
|
-
"@edifice.io/
|
|
135
|
-
"@edifice.io/
|
|
136
|
-
"@edifice.io/utilities": "2.4.0-develop-pedago.
|
|
134
|
+
"@edifice.io/bootstrap": "2.4.0-develop-pedago.20251105110423",
|
|
135
|
+
"@edifice.io/tiptap-extensions": "2.4.0-develop-pedago.20251105110423",
|
|
136
|
+
"@edifice.io/utilities": "2.4.0-develop-pedago.20251105110423"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -164,8 +164,8 @@
|
|
|
164
164
|
"vite": "^5.4.11",
|
|
165
165
|
"vite-plugin-dts": "^4.1.0",
|
|
166
166
|
"vite-tsconfig-paths": "^5.0.1",
|
|
167
|
-
"@edifice.io/client": "2.4.0-develop-pedago.
|
|
168
|
-
"@edifice.io/config": "2.4.0-develop-pedago.
|
|
167
|
+
"@edifice.io/client": "2.4.0-develop-pedago.20251105110423",
|
|
168
|
+
"@edifice.io/config": "2.4.0-develop-pedago.20251105110423"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@react-spring/web": "^9.7.5",
|