tee3apps-cms-sdk-react 0.0.5 → 0.0.6
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.d.ts +189 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/App.css +37 -0
- package/src/PageFormComponents/BooleanField.tsx +56 -0
- package/src/PageFormComponents/BoxRenderer.tsx +229 -0
- package/src/PageFormComponents/Button.tsx +127 -0
- package/src/PageFormComponents/DateField.tsx +46 -0
- package/src/PageFormComponents/ImageComponent.tsx +163 -0
- package/src/PageFormComponents/InputField.tsx +62 -0
- package/src/PageFormComponents/NumberField.tsx +56 -0
- package/src/PageFormComponents/PageForm.css +67 -0
- package/src/PageFormComponents/PageForm.tsx +195 -0
- package/src/PageFormComponents/RadioField.tsx +59 -0
- package/src/PageFormComponents/RowComponent.tsx +82 -0
- package/src/PageFormComponents/SelectField.tsx +183 -0
- package/src/PageFormComponents/Styles/BooleanField.css +56 -0
- package/src/PageFormComponents/Styles/DateField.css +44 -0
- package/src/PageFormComponents/Styles/InputField.css +50 -0
- package/src/PageFormComponents/Styles/NumberField.css +57 -0
- package/src/PageFormComponents/Styles/RadioField.css +66 -0
- package/src/PageFormComponents/Styles/SelectField.css +264 -0
- package/src/PageFormComponents/TextComponent.tsx +45 -0
- package/src/index.ts +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentProps } from '../types';
|
|
3
|
+
|
|
4
|
+
const TextComponent: React.FC<{ props: ComponentProps }> = ({ props }) => {
|
|
5
|
+
const { text, style } = props;
|
|
6
|
+
const Tag = (style?.headingTag as keyof JSX.IntrinsicElements) || 'p';
|
|
7
|
+
|
|
8
|
+
if (!text?.all) {
|
|
9
|
+
return <div className="text-sm text-gray-500">No text content</div>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const textElement = (
|
|
13
|
+
<Tag
|
|
14
|
+
style={{
|
|
15
|
+
fontSize: style?.fontSize ? `${style.fontSize}px` : '16px',
|
|
16
|
+
fontWeight: style?.fontStyle?.isBold ? 'bold' : 'normal',
|
|
17
|
+
fontStyle: style?.fontStyle?.isItalic ? 'italic' : 'normal',
|
|
18
|
+
textDecoration: style?.fontStyle?.isUnderLine ? 'underline' : 'none',
|
|
19
|
+
textDecorationLine: style?.fontStyle?.isStrikeThrough ? 'line-through' : 'none',
|
|
20
|
+
color: style?.fontColor || '#000',
|
|
21
|
+
textAlign: (style?.textAlign as any) || 'left',
|
|
22
|
+
fontFamily: style?.fontFamily || 'inherit',
|
|
23
|
+
margin: 5,
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
{text.all}
|
|
27
|
+
</Tag>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (props.linktype === 'EXTERNAL' && props.link?.url) {
|
|
31
|
+
return (
|
|
32
|
+
<a
|
|
33
|
+
href={props.link.url}
|
|
34
|
+
target={props.link.target}
|
|
35
|
+
style={{ textDecoration: 'none' }}
|
|
36
|
+
>
|
|
37
|
+
{textElement}
|
|
38
|
+
</a>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return textElement;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default TextComponent;
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default
|
|
1
|
+
export { default as Page } from "./Page";
|
|
2
|
+
export { default as PageForm } from './PageFormComponents/PageForm';
|