@m4l/components 9.1.46 → 9.1.48
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/@types/types.d.ts +36 -27
- package/components/Label/Label.styles.js +10 -12
- package/components/PropertyValue/PropertyValue.d.ts +5 -1
- package/components/PropertyValue/PropertyValue.js +53 -166
- package/components/PropertyValue/PropertyValue.styles.d.ts +2 -0
- package/components/PropertyValue/PropertyValue.styles.js +99 -0
- package/components/PropertyValue/constants.d.ts +1 -0
- package/components/PropertyValue/constants.js +2 -0
- package/components/PropertyValue/slots/PropertyValueEnum.d.ts +5 -0
- package/components/PropertyValue/slots/PropertyValueEnum.js +9 -0
- package/components/PropertyValue/slots/PropertyValueSlots.d.ts +9 -0
- package/components/PropertyValue/slots/PropertyValueSlots.js +21 -0
- package/components/PropertyValue/slots/index.d.ts +2 -0
- package/components/PropertyValue/tests/PropertyValue.test.d.ts +1 -0
- package/components/PropertyValue/types.d.ts +77 -3
- package/components/WindowConfirm/WindowConfirm.styles.js +18 -33
- package/components/mui_extended/Button/Button.js +1 -1
- package/components/mui_extended/TextField/TextField.js +1 -1
- package/components/mui_extended/TextField/TextField.styles.js +169 -172
- package/components/mui_extended/TextField/types.d.ts +1 -1
- package/package.json +1 -1
- package/components/PropertyValue/classes/constants.d.ts +0 -1
- package/components/PropertyValue/classes/constants.js +0 -4
- package/components/PropertyValue/classes/index.d.ts +0 -13
- package/components/PropertyValue/classes/index.js +0 -40
- package/components/PropertyValue/classes/types.d.ts +0 -12
- package/components/PropertyValue/styles.js +0 -7
- package/components/PropertyValue/tests/constants.d.ts +0 -1
- package/components/PropertyValue/tests/utils.d.ts +0 -5
package/@types/types.d.ts
CHANGED
|
@@ -128,7 +128,8 @@ import {
|
|
|
128
128
|
import { SideBarOwnerState } from '../components/SideBar/types';
|
|
129
129
|
import {
|
|
130
130
|
PaperFormSlotsType,
|
|
131
|
-
PaperFormOwnerState
|
|
131
|
+
PaperFormOwnerState,
|
|
132
|
+
} from '../components/PaperForm/types';
|
|
132
133
|
import { WindowBaseOwnerState, WindowBaseType } from '../components/WindowBase';
|
|
133
134
|
import { OwnerStateWindowConfirm, WindowConfirmType } from '../components/WindowConfirm';
|
|
134
135
|
import { AppBarSlotsType, AppBarOwnerState } from '../components/AppBar/types';
|
|
@@ -147,6 +148,7 @@ import { BooleanFormatterOwnerState, PresentationType } from '../components/form
|
|
|
147
148
|
import { ToggleIconButtonOwnerState, ToggleIconButtonSlotsType } from '../components/mui_extended/ToggleIconButton/types';
|
|
148
149
|
|
|
149
150
|
import { PopoverOwnerState, PopoverSlotsType } from '../components/mui_extended/Popover/types';
|
|
151
|
+
import { PropertyVaLueOwnerState, PropertyValueType } from '../components/PropertyValue/types';
|
|
150
152
|
|
|
151
153
|
declare module '@mui/material/styles' {
|
|
152
154
|
// Define the slots in the theme
|
|
@@ -195,6 +197,7 @@ declare module '@mui/material/styles' {
|
|
|
195
197
|
M4LToggleButton: ToggleButtonSlotsType;
|
|
196
198
|
M4LBooleanFormatter: PresentationType;
|
|
197
199
|
M4LToggleIconButton: ToggleIconButtonSlotsType;
|
|
200
|
+
M4LPropertyValue: PropertyValueType;
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
interface ComponentsPropsList {
|
|
@@ -243,6 +246,7 @@ declare module '@mui/material/styles' {
|
|
|
243
246
|
M4LToggleButton: Partial<ToggleButtonOwnerState>;
|
|
244
247
|
M4LBooleanFormatter: Partial<BooleanFormatterOwnerState>;
|
|
245
248
|
M4LToggleIconButton: Partial<ToggleIconButtonOwnerState>;
|
|
249
|
+
M4LPropertyValue: Partial<PropertyVaLueOwnerState>;
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
interface Components {
|
|
@@ -535,31 +539,36 @@ declare module '@mui/material/styles' {
|
|
|
535
539
|
defaultProps?: ComponentsPropsList['M4LAvatar'];
|
|
536
540
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAvatar'];
|
|
537
541
|
variants?: ComponentsVariants['M4LAvatar'];
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
542
|
+
M4LAccordion?: {
|
|
543
|
+
defaultProps?: ComponentsPropsList['M4LAccordion'];
|
|
544
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAccordion'];
|
|
545
|
+
variants?: ComponentsVariants['M4LAccordion'];
|
|
546
|
+
};
|
|
547
|
+
M4LPopper?: {
|
|
548
|
+
defaultProps?: ComponentsPropsList['M4LPopper'];
|
|
549
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LPopper'];
|
|
550
|
+
variants?: ComponentsVariants['M4LPopper'];
|
|
551
|
+
};
|
|
552
|
+
M4LToggleButton?: {
|
|
553
|
+
defaultProps?: ComponentsPropsList['M4LToggleButton'];
|
|
554
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LToggleButton'];
|
|
555
|
+
variants?: ComponentsVariants['M4LToggleButton'];
|
|
556
|
+
};
|
|
557
|
+
M4LBooleanFormatter?: {
|
|
558
|
+
defaultProps?: ComponentsPropsList['M4LBooleanFormatter'];
|
|
559
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LBooleanFormatter'];
|
|
560
|
+
variants?: ComponentsVariants['M4LBooleanFormatter'];
|
|
561
|
+
};
|
|
562
|
+
M4LToggleIconButton?: {
|
|
563
|
+
defaultProps?: ComponentsPropsList['M4LToggleIconButton'];
|
|
564
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LToggleIconButton'];
|
|
565
|
+
variants?: ComponentsVariants['M4LToggleIconButton'];
|
|
566
|
+
M4LPropertyValue?: {
|
|
567
|
+
defaultProps?: ComponentsPropsList['M4LPropertyValue'];
|
|
568
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LPropertyValue'];
|
|
569
|
+
variants?: ComponentsVariants['M4LPropertyValue'];
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
}
|
|
563
573
|
}
|
|
564
|
-
}
|
|
565
574
|
}
|
|
@@ -3,8 +3,8 @@ const labelStyles = {
|
|
|
3
3
|
* Estilos para el contenedor raíz del Label.
|
|
4
4
|
* @author Bruce Escobar - automatic
|
|
5
5
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
6
|
-
* @updatedAt 2024-
|
|
7
|
-
* @updatedUser
|
|
6
|
+
* @updatedAt 2024-12-30 12:00:12 - automatic
|
|
7
|
+
* @updatedUser cesar - automatic
|
|
8
8
|
*/
|
|
9
9
|
root: ({ ownerState, theme }) => ({
|
|
10
10
|
display: "flex",
|
|
@@ -37,11 +37,10 @@ const labelStyles = {
|
|
|
37
37
|
* Estilos para el slot Typography.
|
|
38
38
|
* @author Bruce Escobar - automatic
|
|
39
39
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
40
|
-
* @updatedAt 2024-
|
|
41
|
-
* @updatedUser
|
|
40
|
+
* @updatedAt 2024-12-30 12:00:12 - automatic
|
|
41
|
+
* @updatedUser cesar - automatic
|
|
42
42
|
*/
|
|
43
43
|
typographyStyled: ({ theme, ownerState }) => ({
|
|
44
|
-
marginInlineStart: theme.spacing(0.4),
|
|
45
44
|
"& .MuiTypography-root": {
|
|
46
45
|
color: theme.vars.palette.text.secondary,
|
|
47
46
|
[theme.breakpoints.up("sm")]: {
|
|
@@ -59,11 +58,10 @@ const labelStyles = {
|
|
|
59
58
|
* Estilos para el mensaje obligatorio.
|
|
60
59
|
* @author Bruce Escobar - automatic
|
|
61
60
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
62
|
-
* @updatedAt 2024-
|
|
63
|
-
* @updatedUser
|
|
61
|
+
* @updatedAt 2024-12-30 12:00:12 - automatic
|
|
62
|
+
* @updatedUser cesar - automatic
|
|
64
63
|
*/
|
|
65
64
|
typographyMandatoryMessageStyled: ({ theme, ownerState }) => ({
|
|
66
|
-
marginInlineStart: theme.spacing(0.4),
|
|
67
65
|
"& .MuiTypography-root": {
|
|
68
66
|
color: theme.vars.palette.text.primary,
|
|
69
67
|
[theme.breakpoints.up("sm")]: {
|
|
@@ -78,8 +76,8 @@ const labelStyles = {
|
|
|
78
76
|
* Estilos para el icono del mensaje de ayuda.
|
|
79
77
|
* @author Bruce Escobar - automatic
|
|
80
78
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
81
|
-
* @updatedAt 2024-
|
|
82
|
-
* @updatedUser
|
|
79
|
+
* @updatedAt 2024-12-30 12:00:12 - automatic
|
|
80
|
+
* @updatedUser cesar - automatic
|
|
83
81
|
*/
|
|
84
82
|
iconHelperMessageStyled: ({ theme }) => ({
|
|
85
83
|
height: "24px",
|
|
@@ -97,8 +95,8 @@ const labelStyles = {
|
|
|
97
95
|
* Estilos para el componente Skeleton.
|
|
98
96
|
* @author Bruce Escobar - automatic
|
|
99
97
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
100
|
-
* @updatedAt 2024-
|
|
101
|
-
* @updatedUser
|
|
98
|
+
* @updatedAt 2024-12-30 12:00:12 - automatic
|
|
99
|
+
* @updatedUser cesar - automatic
|
|
102
100
|
*/
|
|
103
101
|
skeletonStyled: ({ ownerState, theme }) => ({
|
|
104
102
|
// borderRadius:theme.vars.size.borderRadius.r1,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { PropertyValueProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* PropertyValue component is used to display a property and its value in a form or not.
|
|
4
|
+
* @author cesar - automatic
|
|
5
|
+
* @createdAt 2024-12-19 14:44:17 - automatic
|
|
6
|
+
* @updatedAt 2024-12-30 09:30:27 - automatic
|
|
7
|
+
* @updatedUser cesar - automatic
|
|
4
8
|
*/
|
|
5
9
|
export declare function PropertyValue(props: PropertyValueProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,195 +1,82 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { P as PropertyValueRoot } from "./styles.js";
|
|
3
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
4
|
-
import { p as propertyValueUtilityClasses } from "./classes/index.js";
|
|
5
2
|
import clsx from "clsx";
|
|
6
3
|
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
|
|
7
|
-
import { T as TEST_PROPS_DATA, C as COMPONENT_PREFIX } from "./constants.js";
|
|
8
|
-
import { g as getNameDataTestId } from "../../test/getNameDataTestId.js";
|
|
4
|
+
import { T as TEST_PROPS_DATA, P as PROPERTY_VALUE_KEY_COMPONENT, C as COMPONENT_PREFIX } from "./constants.js";
|
|
5
|
+
import { a as getPropDataTestId, g as getNameDataTestId } from "../../test/getNameDataTestId.js";
|
|
6
|
+
import { P as PropertyValueRootStyled, a as PropertyStyled, V as ValueStyled } from "./slots/PropertyValueSlots.js";
|
|
7
|
+
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
9
8
|
import { L as Label } from "../Label/Label.js";
|
|
9
|
+
import { T as Typography } from "../mui_extended/Typography/Typography.js";
|
|
10
10
|
import { I as Icon } from "../Icon/Icon.js";
|
|
11
11
|
function PropertyValue(props) {
|
|
12
12
|
const {
|
|
13
13
|
property,
|
|
14
|
-
|
|
14
|
+
startAdornment,
|
|
15
15
|
value,
|
|
16
|
-
propertyWidth = 200,
|
|
17
|
-
valueHeight = "auto",
|
|
18
|
-
valueWidth = "100",
|
|
19
|
-
valueWidthMobile,
|
|
20
|
-
isForm,
|
|
21
16
|
className,
|
|
17
|
+
isForm,
|
|
22
18
|
dataTestId = "",
|
|
23
19
|
disabled = false,
|
|
24
20
|
mandatory,
|
|
25
21
|
mandatoryMessage,
|
|
26
|
-
helperMessage
|
|
22
|
+
helperMessage,
|
|
23
|
+
semanticWidth = "fullWidth"
|
|
27
24
|
} = props;
|
|
28
|
-
const isDesktop = useResponsiveDesktop();
|
|
29
|
-
const getValueW = () => {
|
|
30
|
-
if (valueWidthMobile && !isDesktop) {
|
|
31
|
-
return valueWidthMobile;
|
|
32
|
-
}
|
|
33
|
-
if (valueWidth === 75 && isDesktop) {
|
|
34
|
-
return 75;
|
|
35
|
-
} else if (valueWidth === 75 && !isDesktop) {
|
|
36
|
-
return 100;
|
|
37
|
-
}
|
|
38
|
-
if (valueWidth === 50 && isDesktop) {
|
|
39
|
-
return 50;
|
|
40
|
-
} else if (valueWidth === 50 && !isDesktop) {
|
|
41
|
-
return 100;
|
|
42
|
-
}
|
|
43
|
-
if (valueWidth === 25 && isDesktop || valueWidth === 12.5 && isDesktop) {
|
|
44
|
-
return valueWidth;
|
|
45
|
-
}
|
|
46
|
-
if (valueWidth === 25 && !isDesktop) {
|
|
47
|
-
return 50;
|
|
48
|
-
}
|
|
49
|
-
if (valueWidth === 12.5 && !isDesktop) {
|
|
50
|
-
return 25;
|
|
51
|
-
}
|
|
52
|
-
return 100;
|
|
53
|
-
};
|
|
54
25
|
const ownerState = {
|
|
55
26
|
disabled: isForm && disabled ? disabled : false,
|
|
56
27
|
isForm: isForm ? true : false,
|
|
57
|
-
|
|
28
|
+
semanticWidth
|
|
29
|
+
};
|
|
30
|
+
const renderIcon = () => {
|
|
31
|
+
if (!startAdornment) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
if (typeof startAdornment === "string") {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Icon,
|
|
37
|
+
{
|
|
38
|
+
src: startAdornment
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return startAdornment;
|
|
43
|
+
};
|
|
44
|
+
const renderValue = () => {
|
|
45
|
+
if (typeof value === "string") {
|
|
46
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "bodyDens", children: value });
|
|
47
|
+
}
|
|
48
|
+
return value;
|
|
58
49
|
};
|
|
59
|
-
const classes = propertyValueUtilityClasses(ownerState);
|
|
60
|
-
if (!isForm) {
|
|
61
|
-
return /* @__PURE__ */ jsxs(
|
|
62
|
-
PropertyValueRoot,
|
|
63
|
-
{
|
|
64
|
-
className: clsx(classes.root, className),
|
|
65
|
-
style: {
|
|
66
|
-
gridTemplateColumns: propertyWidth ? `${propertyWidth}px 1fr` : "150px 1fr"
|
|
67
|
-
},
|
|
68
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
69
|
-
[TEST_PROPS_DATA]: JSON.stringify([
|
|
70
|
-
{ property: property ? true : false, value: value ? true : false }
|
|
71
|
-
]),
|
|
72
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
73
|
-
COMPONENT_PREFIX,
|
|
74
|
-
"root",
|
|
75
|
-
dataTestId
|
|
76
|
-
)
|
|
77
|
-
} : {},
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ jsxs(
|
|
80
|
-
"div",
|
|
81
|
-
{
|
|
82
|
-
className: classes.property,
|
|
83
|
-
style: {
|
|
84
|
-
width: propertyWidth && isDesktop ? propertyWidth : "150px",
|
|
85
|
-
minWidth: propertyWidth && isDesktop ? propertyWidth : "150px"
|
|
86
|
-
},
|
|
87
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
88
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
89
|
-
COMPONENT_PREFIX,
|
|
90
|
-
"property",
|
|
91
|
-
dataTestId
|
|
92
|
-
)
|
|
93
|
-
} : {},
|
|
94
|
-
children: [
|
|
95
|
-
iconProperty ? /* @__PURE__ */ jsx(Icon, { src: iconProperty, className: classes.iconProperty }) : null,
|
|
96
|
-
/* @__PURE__ */ jsx(
|
|
97
|
-
Label,
|
|
98
|
-
{
|
|
99
|
-
label: property,
|
|
100
|
-
mandatory,
|
|
101
|
-
mandatoryMessage,
|
|
102
|
-
helperMessage
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
className: classes.value,
|
|
112
|
-
style: {
|
|
113
|
-
width: `${getValueW()}%`,
|
|
114
|
-
maxWidth: `${getValueW()}%`,
|
|
115
|
-
height: valueHeight
|
|
116
|
-
},
|
|
117
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
118
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
119
|
-
COMPONENT_PREFIX,
|
|
120
|
-
"value",
|
|
121
|
-
dataTestId
|
|
122
|
-
)
|
|
123
|
-
} : {},
|
|
124
|
-
children: value
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
50
|
return /* @__PURE__ */ jsxs(
|
|
132
|
-
|
|
51
|
+
PropertyValueRootStyled,
|
|
133
52
|
{
|
|
134
|
-
|
|
135
|
-
|
|
53
|
+
role: isForm ? "property-value-form-role" : "property-value-role",
|
|
54
|
+
className: clsx(getComponentSlotRoot(PROPERTY_VALUE_KEY_COMPONENT), className),
|
|
55
|
+
...getPropDataTestId(PROPERTY_VALUE_KEY_COMPONENT, "root", dataTestId),
|
|
56
|
+
ownerState,
|
|
136
57
|
...process.env.NODE_ENV !== "production" ? {
|
|
137
|
-
[TEST_PROPS_DATA]: JSON.stringify([
|
|
138
|
-
|
|
139
|
-
]),
|
|
140
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
141
|
-
COMPONENT_PREFIX,
|
|
142
|
-
"root",
|
|
143
|
-
dataTestId
|
|
144
|
-
)
|
|
58
|
+
[TEST_PROPS_DATA]: JSON.stringify([{ property: !!property, value: !!value }]),
|
|
59
|
+
[TEST_PROP_ID]: getNameDataTestId(COMPONENT_PREFIX, "root", dataTestId)
|
|
145
60
|
} : {},
|
|
146
61
|
children: [
|
|
147
|
-
/* @__PURE__ */ jsxs(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
dataTestId
|
|
160
|
-
)
|
|
161
|
-
} : {},
|
|
162
|
-
children: [
|
|
163
|
-
iconProperty ? /* @__PURE__ */ jsx(Icon, { src: iconProperty, className: classes.iconProperty }) : null,
|
|
164
|
-
/* @__PURE__ */ jsx(
|
|
165
|
-
Label,
|
|
166
|
-
{
|
|
167
|
-
label: property,
|
|
168
|
-
mandatory,
|
|
169
|
-
mandatoryMessage,
|
|
170
|
-
helperMessage
|
|
171
|
-
}
|
|
172
|
-
)
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
),
|
|
62
|
+
/* @__PURE__ */ jsxs(PropertyStyled, { ownerState, children: [
|
|
63
|
+
renderIcon(),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
Label,
|
|
66
|
+
{
|
|
67
|
+
label: property,
|
|
68
|
+
mandatory,
|
|
69
|
+
mandatoryMessage,
|
|
70
|
+
helperMessage
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
176
74
|
/* @__PURE__ */ jsx(
|
|
177
|
-
|
|
75
|
+
ValueStyled,
|
|
178
76
|
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
maxWidth: `${getValueW()}%`,
|
|
183
|
-
height: valueHeight
|
|
184
|
-
},
|
|
185
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
186
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
187
|
-
COMPONENT_PREFIX,
|
|
188
|
-
"value",
|
|
189
|
-
dataTestId
|
|
190
|
-
)
|
|
191
|
-
} : {},
|
|
192
|
-
children: value
|
|
77
|
+
role: "property-value-value-role",
|
|
78
|
+
ownerState,
|
|
79
|
+
children: renderValue()
|
|
193
80
|
}
|
|
194
81
|
)
|
|
195
82
|
]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const CONTAINER_QUERY_NAME = "container";
|
|
2
|
+
const propertyValueStyles = {
|
|
3
|
+
/**
|
|
4
|
+
* Property Value Root Styles
|
|
5
|
+
* @author cesar - automatic
|
|
6
|
+
* @createdAt 2024-12-19 14:44:17 - automatic
|
|
7
|
+
* @updatedAt 2025-01-02 08:01:12 - automatic
|
|
8
|
+
* @updatedUser cesar - automatic
|
|
9
|
+
*/
|
|
10
|
+
Root: ({ theme, ownerState }) => {
|
|
11
|
+
const createSemanticStyle = (minWidth, maxWidth) => ({
|
|
12
|
+
minWidth,
|
|
13
|
+
maxWidth,
|
|
14
|
+
[`@container ${CONTAINER_QUERY_NAME} (max-width: ${parseInt(minWidth, 10)}px)`]: {
|
|
15
|
+
minWidth: "100%",
|
|
16
|
+
maxWidth: "100%"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const semanticStylesMap = {
|
|
20
|
+
email: createSemanticStyle("260px", "400px"),
|
|
21
|
+
shortName: createSemanticStyle("40px", "90px"),
|
|
22
|
+
mediumName: createSemanticStyle("80px", "260px"),
|
|
23
|
+
bigName: createSemanticStyle("330px", "520px"),
|
|
24
|
+
shortId: createSemanticStyle("16px", "44px"),
|
|
25
|
+
mediumId: createSemanticStyle("28px", "60px"),
|
|
26
|
+
bigId: createSemanticStyle("36px", "200px"),
|
|
27
|
+
shortDescription: createSemanticStyle("324px", "796px"),
|
|
28
|
+
mediumDescription: createSemanticStyle("796px", "1500px"),
|
|
29
|
+
bigDescription: {
|
|
30
|
+
minWidth: "100%",
|
|
31
|
+
maxWidth: "100%"
|
|
32
|
+
},
|
|
33
|
+
shortNumber: createSemanticStyle("30px", "50px"),
|
|
34
|
+
mediumNumber: createSemanticStyle("44px", "60px"),
|
|
35
|
+
bigNumber: createSemanticStyle("61px", "162px"),
|
|
36
|
+
percentNumber: createSemanticStyle("30px", "50px"),
|
|
37
|
+
fullWidth: {
|
|
38
|
+
minWidth: "100%",
|
|
39
|
+
maxWidth: "100%"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const semanticStyle = ownerState?.semanticWidth && semanticStylesMap[ownerState.semanticWidth] ? semanticStylesMap[ownerState.semanticWidth] : {};
|
|
43
|
+
return {
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: ownerState?.isForm ? "column" : "row",
|
|
46
|
+
justifyContent: ownerState?.isForm ? "space-between" : "center",
|
|
47
|
+
alignItems: "flex-start",
|
|
48
|
+
gap: theme.vars.size.baseSpacings["sp0-5"],
|
|
49
|
+
color: theme.palette.text.primary,
|
|
50
|
+
paddingTop: !ownerState?.isForm ? theme.vars.size.baseSpacings.sp1 : void 0,
|
|
51
|
+
paddingBottom: !ownerState?.isForm ? theme.vars.size.baseSpacings.sp1 : void 0,
|
|
52
|
+
borderBottom: !ownerState?.isForm ? `${theme.vars.palette.border.disabled} solid 1px` : "none",
|
|
53
|
+
"&:hover": !ownerState?.isForm && {
|
|
54
|
+
background: theme.vars.palette.background?.hover
|
|
55
|
+
},
|
|
56
|
+
...semanticStyle,
|
|
57
|
+
[`@container ${CONTAINER_QUERY_NAME} (min-width: 0px) and (max-width: 400px)`]: {
|
|
58
|
+
flexDirection: "column"
|
|
59
|
+
},
|
|
60
|
+
...theme.generalSettings.isMobile && {
|
|
61
|
+
flexDirection: "column"
|
|
62
|
+
},
|
|
63
|
+
variants: []
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Property Styles
|
|
68
|
+
* @author cesar - automatic
|
|
69
|
+
* @createdAt 2024-12-26 11:44:46 - automatic
|
|
70
|
+
* @updatedAt 2025-01-02 08:01:12 - automatic
|
|
71
|
+
* @updatedUser cesar - automatic
|
|
72
|
+
*/
|
|
73
|
+
property: ({ theme, ownerState }) => ({
|
|
74
|
+
display: "flex",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
minWidth: "200px",
|
|
77
|
+
width: ownerState?.semanticWidth ? "auto" : "200px",
|
|
78
|
+
fontSize: theme.typography.body2.fontSize,
|
|
79
|
+
color: theme.palette.text.primary
|
|
80
|
+
}),
|
|
81
|
+
/**
|
|
82
|
+
* Value Styles (Form and No Form Combined)
|
|
83
|
+
* @author cesar - automatic
|
|
84
|
+
* @createdAt 2024-12-26 11:44:46 - automatic
|
|
85
|
+
* @updatedAt 2025-01-02 08:01:12 - automatic
|
|
86
|
+
* @updatedUser cesar - automatic
|
|
87
|
+
*/
|
|
88
|
+
value: ({ theme, ownerState }) => ({
|
|
89
|
+
width: "100%",
|
|
90
|
+
display: "flex",
|
|
91
|
+
justifyContent: "flex-start",
|
|
92
|
+
...ownerState?.isForm && {
|
|
93
|
+
gap: theme.vars.size.baseSpacings["sp0-5"]
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
propertyValueStyles as p
|
|
99
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var PropertyValueSlots = /* @__PURE__ */ ((PropertyValueSlots2) => {
|
|
2
|
+
PropertyValueSlots2["Root"] = "Root";
|
|
3
|
+
PropertyValueSlots2["property"] = "property";
|
|
4
|
+
PropertyValueSlots2["value"] = "value";
|
|
5
|
+
return PropertyValueSlots2;
|
|
6
|
+
})(PropertyValueSlots || {});
|
|
7
|
+
export {
|
|
8
|
+
PropertyValueSlots as P
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const PropertyValueRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const PropertyStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown> & {
|
|
5
|
+
ownerState: Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown>;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const ValueStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown> & {
|
|
8
|
+
ownerState: Partial<import('../types').PropertyVaLueOwnerState> & Record<string, unknown>;
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { P as PROPERTY_VALUE_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { p as propertyValueStyles } from "../PropertyValue.styles.js";
|
|
4
|
+
import { P as PropertyValueSlots } from "./PropertyValueEnum.js";
|
|
5
|
+
const PropertyValueRootStyled = styled("div", {
|
|
6
|
+
name: PROPERTY_VALUE_KEY_COMPONENT,
|
|
7
|
+
slot: PropertyValueSlots.Root
|
|
8
|
+
})(propertyValueStyles?.Root);
|
|
9
|
+
const PropertyStyled = styled("div", {
|
|
10
|
+
name: PROPERTY_VALUE_KEY_COMPONENT,
|
|
11
|
+
slot: PropertyValueSlots.property
|
|
12
|
+
})(propertyValueStyles?.property);
|
|
13
|
+
const ValueStyled = styled("div", {
|
|
14
|
+
name: PROPERTY_VALUE_KEY_COMPONENT,
|
|
15
|
+
slot: PropertyValueSlots.value
|
|
16
|
+
})(propertyValueStyles?.value);
|
|
17
|
+
export {
|
|
18
|
+
PropertyValueRootStyled as P,
|
|
19
|
+
ValueStyled as V,
|
|
20
|
+
PropertyStyled as a
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|