@m4l/components 9.57.1-beta-hotfix-semantic-width-dynamicform.0 β 9.57.1
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/components/CheckableList/slots/styled.d.ts +3 -3
- package/components/DynamicForm/DynamicForm.styles.d.ts.map +1 -1
- package/components/DynamicForm/DynamicForm.styles.js +61 -54
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.d.ts.map +1 -1
- package/components/DynamicForm/subcomponents/DynamicFormContent/DynamicFormContent.js +124 -137
- package/components/Label/Label.d.ts.map +1 -1
- package/components/Label/Label.js +26 -40
- package/components/Label/Label.styles.d.ts.map +1 -1
- package/components/Label/Label.styles.js +52 -52
- package/components/Label/types.d.ts +0 -2
- package/components/Label/types.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.js +57 -82
- package/components/PropertyValue/PropertyValue.styles.d.ts.map +1 -1
- package/components/PropertyValue/PropertyValue.styles.js +91 -87
- package/components/PropertyValue/types.d.ts +1 -5
- package/components/PropertyValue/types.d.ts.map +1 -1
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/package.json +7 -7
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts +0 -26
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.d.ts.map +0 -1
- package/components/DynamicForm/helpers/resolveAdaptiveFieldLayout/resolveAdaptiveFieldLayout.js +0 -64
- package/components/PropertyValue/semanticWidth.d.ts +0 -7
- package/components/PropertyValue/semanticWidth.d.ts.map +0 -1
- package/components/PropertyValue/semanticWidth.js +0 -31
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { useModuleDictionary as
|
|
5
|
-
import { NotificationCheckCircleFill as
|
|
6
|
-
import { Icon as
|
|
1
|
+
import { jsx as o, jsxs as C } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as A, useMemo as g, memo as L } from "react";
|
|
3
|
+
import N from "clsx";
|
|
4
|
+
import { useModuleDictionary as R, useEnvironment as O } from "@m4l/core";
|
|
5
|
+
import { NotificationCheckCircleFill as T, NotificationWarningFill as H } from "@m4l/icons";
|
|
6
|
+
import { Icon as W } from "@m4l/base";
|
|
7
7
|
import { TEST_PROP_ID as z } from "../../../../test/constants_no_mock.js";
|
|
8
8
|
import { ActionsContainer as G } from "../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
9
9
|
import { ActionFormIntro as k } from "../../../CommonActions/components/ActionFormIntro/ActionFormIntro.js";
|
|
@@ -11,136 +11,123 @@ import { PropertyValue as x } from "../../../PropertyValue/PropertyValue.js";
|
|
|
11
11
|
import { useDynamicFormConditionals as P } from "../../hooks/useDynamicFormConditionals/useDynamicFormConditionals.js";
|
|
12
12
|
import { resolveFieldRenderHelperMessage as V } from "../../helpers/resolveFieldRenderHelperMessage/resolveFieldRenderHelperMessage.js";
|
|
13
13
|
import { resolveFieldInputLabel as j } from "../../helpers/resolveFieldInputLabel/resolveFieldInputLabel.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
const ie = /* @__PURE__ */ new Set([
|
|
14
|
+
import { DYNAMIC_FORM_DICTIONARY as w } from "../../dictionary.js";
|
|
15
|
+
import { DYNAMIC_FORM_CLASSES as c } from "../../constants.js";
|
|
16
|
+
import { DynamicFormSubmitFeedbackStyled as U, DynamicFormContentRootStyled as Y, DynamicFormFormHeaderStyled as B, DynamicFormFormTitleStyled as K, DynamicFormFormDescriptionStyled as $, DynamicFormFieldsFlowStyled as q, DynamicFormActionsRowStyled as J, DynamicFormFieldWrapperStyled as Q } from "../../slots/DynamicFormSlots.js";
|
|
17
|
+
import { resolveFormHeader as X } from "../../helpers/resolveFormHeader/resolveFormHeader.js";
|
|
18
|
+
import { resolveFieldComponent as Z } from "../../helpers/resolveFieldComponent/resolveFieldComponent.js";
|
|
19
|
+
import { resolveFieldSymbol as ee, resolveFieldMandatory as oe } from "../../helpers/resolveFieldContractAliases/resolveFieldContractAliases.js";
|
|
20
|
+
import { Chip as re } from "../../../Chip/Chip.js";
|
|
21
|
+
const te = /* @__PURE__ */ new Set([
|
|
23
22
|
"RHFCheckableList"
|
|
24
23
|
]);
|
|
25
|
-
function
|
|
26
|
-
const t =
|
|
27
|
-
return t &&
|
|
24
|
+
function ie(a) {
|
|
25
|
+
const t = a.fieldType?.componentId;
|
|
26
|
+
return t && te.has(t) ? "verticalGrow" : "default";
|
|
28
27
|
}
|
|
29
|
-
function
|
|
28
|
+
function ne(a) {
|
|
30
29
|
const t = [];
|
|
31
30
|
let e = [];
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
31
|
+
return a.forEach((r) => {
|
|
32
|
+
const s = ie(r);
|
|
33
|
+
if (s === "verticalGrow") {
|
|
35
34
|
e.length > 0 && (t.push({
|
|
36
35
|
layout: "default",
|
|
37
36
|
fields: e
|
|
38
37
|
}), e = []), t.push({
|
|
39
|
-
layout:
|
|
40
|
-
fields: [
|
|
38
|
+
layout: s,
|
|
39
|
+
fields: [r]
|
|
41
40
|
});
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
|
-
e.push(
|
|
43
|
+
e.push(r);
|
|
45
44
|
}), e.length > 0 && t.push({
|
|
46
45
|
layout: "default",
|
|
47
46
|
fields: e
|
|
48
47
|
}), t;
|
|
49
48
|
}
|
|
50
|
-
const
|
|
49
|
+
const D = L(function(t) {
|
|
51
50
|
const {
|
|
52
51
|
field: e,
|
|
53
|
-
currentSize:
|
|
54
|
-
fieldWrapperClassName:
|
|
55
|
-
fieldFlow:
|
|
56
|
-
layout:
|
|
57
|
-
readOnly:
|
|
58
|
-
} = t, { getLabel:
|
|
52
|
+
currentSize: r,
|
|
53
|
+
fieldWrapperClassName: s,
|
|
54
|
+
fieldFlow: S,
|
|
55
|
+
layout: d,
|
|
56
|
+
readOnly: p = !1
|
|
57
|
+
} = t, { getLabel: u } = R(), { host_api_remote: f } = O(), l = d === "verticalGrow";
|
|
59
58
|
if (typeof e.name != "string" || e.name.trim() === "")
|
|
60
59
|
return null;
|
|
61
|
-
const
|
|
60
|
+
const h = V(
|
|
62
61
|
e,
|
|
63
|
-
|
|
64
|
-
), i =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
size: o,
|
|
70
|
-
symbol: v
|
|
71
|
-
}), m = re(e, {
|
|
72
|
-
size: o,
|
|
73
|
-
getLabel: F,
|
|
74
|
-
hostApiRemote: h,
|
|
75
|
-
readOnly: y,
|
|
62
|
+
u
|
|
63
|
+
), i = Z(e, {
|
|
64
|
+
size: r,
|
|
65
|
+
getLabel: u,
|
|
66
|
+
hostApiRemote: f,
|
|
67
|
+
readOnly: p,
|
|
76
68
|
suppressLabel: !0
|
|
77
69
|
});
|
|
78
|
-
return
|
|
79
|
-
|
|
70
|
+
return i ? /* @__PURE__ */ o(
|
|
71
|
+
Q,
|
|
80
72
|
{
|
|
81
73
|
ownerState: {
|
|
82
|
-
readOnly:
|
|
83
|
-
fieldFlow:
|
|
84
|
-
layout:
|
|
85
|
-
|
|
86
|
-
semanticWidth: e.metadata?.semanticWidth,
|
|
87
|
-
wrapperWidth: d.wrapperWidth
|
|
74
|
+
readOnly: p,
|
|
75
|
+
fieldFlow: S,
|
|
76
|
+
layout: d,
|
|
77
|
+
semanticWidth: e.metadata?.semanticWidth
|
|
88
78
|
},
|
|
89
|
-
className:
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
className: N(
|
|
80
|
+
s,
|
|
81
|
+
c.fieldWrapper
|
|
92
82
|
),
|
|
93
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ o(
|
|
94
84
|
x,
|
|
95
85
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
labelWidth: d.labelWidth,
|
|
99
|
-
property: i,
|
|
100
|
-
value: m,
|
|
86
|
+
property: j(e, u),
|
|
87
|
+
value: i,
|
|
101
88
|
isForm: !0,
|
|
102
|
-
mandatory:
|
|
103
|
-
helperMessage:
|
|
104
|
-
symbol:
|
|
105
|
-
valueHeight:
|
|
89
|
+
mandatory: oe(e),
|
|
90
|
+
helperMessage: h,
|
|
91
|
+
symbol: ee(e),
|
|
92
|
+
valueHeight: l ? "100%" : void 0
|
|
106
93
|
}
|
|
107
94
|
)
|
|
108
95
|
}
|
|
109
96
|
) : null;
|
|
110
97
|
});
|
|
111
|
-
|
|
112
|
-
const se =
|
|
98
|
+
D.displayName = "DynamicFormFieldRow";
|
|
99
|
+
const se = A((a, t) => {
|
|
113
100
|
const {
|
|
114
101
|
data: e,
|
|
115
|
-
currentSize:
|
|
116
|
-
fieldWrapperClassName:
|
|
117
|
-
dataTestId:
|
|
118
|
-
dataMeta:
|
|
119
|
-
coupled:
|
|
120
|
-
actionFormIntroProps:
|
|
121
|
-
renderActions:
|
|
122
|
-
readOnly:
|
|
123
|
-
suppressFormHeader:
|
|
102
|
+
currentSize: r,
|
|
103
|
+
fieldWrapperClassName: s,
|
|
104
|
+
dataTestId: S,
|
|
105
|
+
dataMeta: d,
|
|
106
|
+
coupled: p = !1,
|
|
107
|
+
actionFormIntroProps: u,
|
|
108
|
+
renderActions: f,
|
|
109
|
+
readOnly: l = !1,
|
|
110
|
+
suppressFormHeader: h = !0,
|
|
124
111
|
submitFeedbackStatus: i,
|
|
125
|
-
fieldFlow:
|
|
126
|
-
} =
|
|
112
|
+
fieldFlow: y = "responsiveWrap"
|
|
113
|
+
} = a, { getLabel: I } = R(), { visibleFields: _ } = P(e), F = h ? null : X(e.form), b = ne(_), v = g(
|
|
127
114
|
() => ({
|
|
128
|
-
size:
|
|
129
|
-
readOnly:
|
|
130
|
-
fieldFlow:
|
|
115
|
+
size: r,
|
|
116
|
+
readOnly: l,
|
|
117
|
+
fieldFlow: y
|
|
131
118
|
}),
|
|
132
|
-
[
|
|
133
|
-
), M = !
|
|
134
|
-
|
|
119
|
+
[r, y, l]
|
|
120
|
+
), M = !p && i ? /* @__PURE__ */ o(U, { children: /* @__PURE__ */ o(
|
|
121
|
+
re,
|
|
135
122
|
{
|
|
136
|
-
size:
|
|
137
|
-
label:
|
|
138
|
-
i === "success" ?
|
|
123
|
+
size: r,
|
|
124
|
+
label: I(
|
|
125
|
+
i === "success" ? w.SUBMIT_SUCCESS_MESSAGE : w.SUBMIT_ERROR_MESSAGE
|
|
139
126
|
),
|
|
140
|
-
startIcon: /* @__PURE__ */
|
|
141
|
-
|
|
127
|
+
startIcon: /* @__PURE__ */ o(
|
|
128
|
+
W,
|
|
142
129
|
{
|
|
143
|
-
src: i === "success" ? /* @__PURE__ */
|
|
130
|
+
src: i === "success" ? /* @__PURE__ */ o(T, {}) : /* @__PURE__ */ o(H, {}),
|
|
144
131
|
color: i === "success" ? "chips.success.contained.color" : "chips.error.contained.color"
|
|
145
132
|
}
|
|
146
133
|
),
|
|
@@ -152,85 +139,85 @@ const se = E((c, t) => {
|
|
|
152
139
|
Y,
|
|
153
140
|
{
|
|
154
141
|
ref: t,
|
|
155
|
-
ownerState:
|
|
156
|
-
className:
|
|
157
|
-
...typeof
|
|
158
|
-
...process.env.NODE_ENV !== "production" ? { [z]:
|
|
142
|
+
ownerState: v,
|
|
143
|
+
className: N(c.contentRoot),
|
|
144
|
+
...typeof d == "string" ? { "data-meta": d } : {},
|
|
145
|
+
...process.env.NODE_ENV !== "production" ? { [z]: S } : {},
|
|
159
146
|
children: [
|
|
160
|
-
|
|
161
|
-
|
|
147
|
+
F?.title && /* @__PURE__ */ C(
|
|
148
|
+
B,
|
|
162
149
|
{
|
|
163
|
-
className:
|
|
150
|
+
className: c.formHeader,
|
|
164
151
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ o(
|
|
166
153
|
K,
|
|
167
154
|
{
|
|
168
|
-
className:
|
|
155
|
+
className: c.formTitle,
|
|
169
156
|
component: "h2",
|
|
170
|
-
size:
|
|
157
|
+
size: r,
|
|
171
158
|
variant: "paragraphDens",
|
|
172
|
-
children:
|
|
159
|
+
children: F.title
|
|
173
160
|
}
|
|
174
161
|
),
|
|
175
|
-
|
|
162
|
+
F.description && /* @__PURE__ */ o(
|
|
176
163
|
$,
|
|
177
164
|
{
|
|
178
|
-
className:
|
|
165
|
+
className: c.formDescription,
|
|
179
166
|
color: "text.secondary",
|
|
180
167
|
component: "p",
|
|
181
|
-
size:
|
|
168
|
+
size: r,
|
|
182
169
|
variant: "bodyStandard",
|
|
183
|
-
children:
|
|
170
|
+
children: F.description
|
|
184
171
|
}
|
|
185
172
|
)
|
|
186
173
|
]
|
|
187
174
|
}
|
|
188
175
|
),
|
|
189
176
|
M,
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
return
|
|
194
|
-
|
|
177
|
+
b.map((m) => {
|
|
178
|
+
if (m.layout === "verticalGrow") {
|
|
179
|
+
const n = m.fields[0];
|
|
180
|
+
return n ? /* @__PURE__ */ o(
|
|
181
|
+
D,
|
|
195
182
|
{
|
|
196
|
-
field:
|
|
197
|
-
currentSize:
|
|
198
|
-
fieldWrapperClassName:
|
|
199
|
-
fieldFlow:
|
|
200
|
-
layout:
|
|
201
|
-
readOnly:
|
|
183
|
+
field: n,
|
|
184
|
+
currentSize: r,
|
|
185
|
+
fieldWrapperClassName: s,
|
|
186
|
+
fieldFlow: y,
|
|
187
|
+
layout: m.layout,
|
|
188
|
+
readOnly: l
|
|
202
189
|
},
|
|
203
|
-
|
|
190
|
+
n.id
|
|
204
191
|
) : null;
|
|
205
192
|
}
|
|
206
|
-
const
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
|
|
193
|
+
const E = m.fields.map((n) => n.id).join("-");
|
|
194
|
+
return /* @__PURE__ */ o(
|
|
195
|
+
q,
|
|
209
196
|
{
|
|
210
|
-
ownerState:
|
|
211
|
-
className:
|
|
212
|
-
children:
|
|
213
|
-
|
|
197
|
+
ownerState: v,
|
|
198
|
+
className: c.fieldsFlow,
|
|
199
|
+
children: m.fields.map((n) => /* @__PURE__ */ o(
|
|
200
|
+
D,
|
|
214
201
|
{
|
|
215
|
-
field:
|
|
216
|
-
currentSize:
|
|
217
|
-
fieldWrapperClassName:
|
|
218
|
-
fieldFlow:
|
|
219
|
-
layout:
|
|
220
|
-
readOnly:
|
|
202
|
+
field: n,
|
|
203
|
+
currentSize: r,
|
|
204
|
+
fieldWrapperClassName: s,
|
|
205
|
+
fieldFlow: y,
|
|
206
|
+
layout: m.layout,
|
|
207
|
+
readOnly: l
|
|
221
208
|
},
|
|
222
|
-
|
|
209
|
+
n.id
|
|
223
210
|
))
|
|
224
211
|
},
|
|
225
|
-
`flow-${
|
|
212
|
+
`flow-${E}`
|
|
226
213
|
);
|
|
227
214
|
}),
|
|
228
|
-
!
|
|
215
|
+
!p && !l && /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(G, { children: f ? f() : /* @__PURE__ */ o(
|
|
229
216
|
k,
|
|
230
217
|
{
|
|
231
|
-
size:
|
|
218
|
+
size: r,
|
|
232
219
|
color: "default",
|
|
233
|
-
...
|
|
220
|
+
...u
|
|
234
221
|
}
|
|
235
222
|
) }) })
|
|
236
223
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAE,MAAM,SAAS,CAAC;AAatD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAE,MAAM,SAAS,CAAC;AAatD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,qDAwEtC,CAAC"}
|
|
@@ -1,48 +1,34 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useModuleSkeleton as
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as p } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useModuleSkeleton as N } from "@m4l/core";
|
|
3
3
|
import L from "clsx";
|
|
4
|
-
import { LABEL_KEY_COMPONENT as
|
|
5
|
-
import { useComponentSize as
|
|
6
|
-
import { NotificationInformationOutlined as
|
|
7
|
-
import { LabelRootStyled as
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
10
|
-
helperMessage: r,
|
|
11
|
-
label: h,
|
|
12
|
-
labelOverflow: u = "ellipsis",
|
|
13
|
-
symbol: c,
|
|
14
|
-
mandatory: m,
|
|
15
|
-
mandatoryMessage: o,
|
|
16
|
-
htmlFor: b,
|
|
17
|
-
id: f,
|
|
18
|
-
error: g,
|
|
19
|
-
size: d = "medium",
|
|
4
|
+
import { LABEL_KEY_COMPONENT as w, classLabelRoot as z, LAB_SPECIFY as k } from "./constants.js";
|
|
5
|
+
import { useComponentSize as v } from "../../hooks/useComponentSize/index.js";
|
|
6
|
+
import { NotificationInformationOutlined as C } from "@m4l/icons";
|
|
7
|
+
import { LabelRootStyled as I, TypographyStyled as x, TypographyMandatoryMessageStyled as E, IconHelperMessageStyled as j, SkeletonStyled as i } from "./slots/LabelSlots.js";
|
|
8
|
+
const P = (y) => {
|
|
9
|
+
const { helperMessage: r, label: h, symbol: c, mandatory: m, mandatoryMessage: o, htmlFor: u, id: b, error: f, size: d = "medium", disabled: t, className: g } = y, M = N(), { currentSize: s } = v(d), S = typeof r == "string" && r.length > 0, n = s === "small" || s === "medium" ? s : "medium", e = {
|
|
20
10
|
disabled: t,
|
|
21
|
-
className: M
|
|
22
|
-
} = y, N = w(), { currentSize: l } = C(d), p = typeof r == "string" && r.length > 0, s = l === "small" || l === "medium" ? l : "medium", e = {
|
|
23
|
-
disabled: t,
|
|
24
|
-
labelOverflow: u,
|
|
25
11
|
size: d
|
|
26
12
|
};
|
|
27
13
|
return /* @__PURE__ */ a(
|
|
28
|
-
|
|
14
|
+
I,
|
|
29
15
|
{
|
|
30
|
-
"aria-label":
|
|
16
|
+
"aria-label": w,
|
|
31
17
|
ownerState: { ...e },
|
|
32
|
-
htmlFor:
|
|
33
|
-
id:
|
|
34
|
-
children:
|
|
18
|
+
htmlFor: u,
|
|
19
|
+
id: b,
|
|
20
|
+
children: M ? /* @__PURE__ */ l(p, { children: [
|
|
35
21
|
/* @__PURE__ */ a(i, { ownerState: { ...e }, variant: "rectangular", className: "SkeletonWidthLabel" }),
|
|
36
22
|
m && /* @__PURE__ */ a(i, { ownerState: { ...e }, variant: "circular", className: "MandatoryLabel" }),
|
|
37
|
-
|
|
38
|
-
] }) : /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
23
|
+
S && /* @__PURE__ */ a(i, { ownerState: { ...e }, variant: "circular", className: "HelperIconLabel" })
|
|
24
|
+
] }) : /* @__PURE__ */ l(p, { children: [
|
|
25
|
+
/* @__PURE__ */ l(
|
|
26
|
+
x,
|
|
41
27
|
{
|
|
42
|
-
className: L(
|
|
28
|
+
className: L(z, k, "M4lclassCssSpecificity", g),
|
|
43
29
|
ownerState: { ...e },
|
|
44
30
|
variant: "bodyStandard",
|
|
45
|
-
size:
|
|
31
|
+
size: n,
|
|
46
32
|
disabled: t,
|
|
47
33
|
children: [
|
|
48
34
|
h,
|
|
@@ -51,26 +37,26 @@ const R = (y) => {
|
|
|
51
37
|
}
|
|
52
38
|
),
|
|
53
39
|
m && /* @__PURE__ */ a(
|
|
54
|
-
|
|
40
|
+
E,
|
|
55
41
|
{
|
|
56
42
|
ownerState: { ...e },
|
|
57
43
|
variant: "bodyStandard",
|
|
58
44
|
className: o ? "mandatoryMessage" : "mandatoryAsterisk",
|
|
59
|
-
size:
|
|
45
|
+
size: n,
|
|
60
46
|
disabled: t,
|
|
61
47
|
children: o || "*"
|
|
62
48
|
}
|
|
63
49
|
),
|
|
64
|
-
|
|
50
|
+
S && /* @__PURE__ */ a(
|
|
65
51
|
j,
|
|
66
52
|
{
|
|
67
53
|
tooltipContent: r,
|
|
68
54
|
ownerState: { ...e },
|
|
69
55
|
placement: "right",
|
|
70
|
-
size:
|
|
71
|
-
className:
|
|
56
|
+
size: n,
|
|
57
|
+
className: f ? "helper-icon-error" : "helper-icon",
|
|
72
58
|
disabled: t,
|
|
73
|
-
src: /* @__PURE__ */ a(
|
|
59
|
+
src: /* @__PURE__ */ a(C, {})
|
|
74
60
|
}
|
|
75
61
|
)
|
|
76
62
|
] })
|
|
@@ -78,5 +64,5 @@ const R = (y) => {
|
|
|
78
64
|
);
|
|
79
65
|
};
|
|
80
66
|
export {
|
|
81
|
-
|
|
67
|
+
P as Label
|
|
82
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAU3D,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"Label.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Label/Label.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAU3D,eAAO,MAAM,WAAW,EAAE,WA0IzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getIconPaintStyles as
|
|
1
|
+
import { getIconPaintStyles as t } from "@m4l/base";
|
|
2
2
|
import { getHeightSizeStyles as i } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
-
function
|
|
4
|
-
return
|
|
3
|
+
function l(s) {
|
|
4
|
+
return t(s);
|
|
5
5
|
}
|
|
6
6
|
const n = {
|
|
7
7
|
/**
|
|
@@ -10,25 +10,25 @@ const n = {
|
|
|
10
10
|
* @param {object} ownerState - El estado del componente.
|
|
11
11
|
* @returns {object} - Los estilos aplicados al root del Label.
|
|
12
12
|
*/
|
|
13
|
-
root: ({ theme:
|
|
13
|
+
root: ({ theme: s, ownerState: e }) => ({
|
|
14
14
|
width: "100%",
|
|
15
15
|
display: "flex",
|
|
16
16
|
flexDirection: "row",
|
|
17
17
|
alignItems: "center",
|
|
18
18
|
...i(
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
s.generalSettings.isMobile,
|
|
20
|
+
e?.size || "small",
|
|
21
21
|
"base",
|
|
22
|
-
(
|
|
23
|
-
minHeight:
|
|
22
|
+
(a) => ({
|
|
23
|
+
minHeight: a,
|
|
24
24
|
height: "auto",
|
|
25
25
|
maxHeight: "none"
|
|
26
26
|
})
|
|
27
27
|
),
|
|
28
|
-
gap:
|
|
28
|
+
gap: s.size.baseSpacings.sp1,
|
|
29
29
|
/** Estilos para el estado disabled del Label πΆβπ«οΈ */
|
|
30
|
-
...
|
|
31
|
-
color:
|
|
30
|
+
...e?.disabled && {
|
|
31
|
+
color: s.vars.palette.text.disabled,
|
|
32
32
|
'& > [class*="M4LIcon-icon"]': {
|
|
33
33
|
PointerEvents: "none"
|
|
34
34
|
}
|
|
@@ -37,17 +37,17 @@ const n = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Estilos para el slot Typography del Label.
|
|
39
39
|
*/
|
|
40
|
-
typographyStyled: ({ theme:
|
|
40
|
+
typographyStyled: ({ theme: s, ownerState: e }) => ({
|
|
41
41
|
"&.MuiTypography-root": {
|
|
42
42
|
width: "fit-content",
|
|
43
|
-
minWidth:
|
|
44
|
-
overflow:
|
|
45
|
-
textOverflow:
|
|
43
|
+
minWidth: s.vars.size.baseSpacings.sp2,
|
|
44
|
+
overflow: "hidden",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
46
46
|
whiteSpace: "nowrap",
|
|
47
47
|
"&.M4lclassCssSpecificity": {
|
|
48
|
-
color:
|
|
49
|
-
...
|
|
50
|
-
color:
|
|
48
|
+
color: s.vars.palette.text.secondary,
|
|
49
|
+
...e?.disabled === !0 && {
|
|
50
|
+
color: s.vars.palette.text.disabled
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -55,17 +55,17 @@ const n = {
|
|
|
55
55
|
/**
|
|
56
56
|
* Estilos para el slot Typography del mensaje obligatorio del Label.
|
|
57
57
|
*/
|
|
58
|
-
typographyMandatoryMessageStyled: ({ theme:
|
|
58
|
+
typographyMandatoryMessageStyled: ({ theme: s, ownerState: e }) => ({
|
|
59
59
|
"&.MuiTypography-root": {
|
|
60
60
|
width: "fit-content",
|
|
61
|
-
overflow:
|
|
62
|
-
textOverflow:
|
|
61
|
+
overflow: "hidden",
|
|
62
|
+
textOverflow: "ellipsis",
|
|
63
63
|
whiteSpace: "nowrap",
|
|
64
|
-
minWidth:
|
|
64
|
+
minWidth: s.vars.size.baseSpacings.sp2,
|
|
65
65
|
"&.M4lclassCssSpecificity": {
|
|
66
|
-
color:
|
|
67
|
-
...
|
|
68
|
-
color:
|
|
66
|
+
color: s.vars.palette.text.primary,
|
|
67
|
+
...e?.disabled && {
|
|
68
|
+
color: s.vars.palette.text.disabled
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -73,16 +73,16 @@ const n = {
|
|
|
73
73
|
/**
|
|
74
74
|
* Estilos para el slot Icon del Label.
|
|
75
75
|
*/
|
|
76
|
-
iconHelperMessageStyled: ({ theme:
|
|
77
|
-
const
|
|
76
|
+
iconHelperMessageStyled: ({ theme: s, ownerState: e }) => {
|
|
77
|
+
const a = e?.disabled ? s.vars.palette.text.disabled : s.vars.palette.info.enabled, r = e?.disabled ? s.vars.palette.text.disabled : s.vars.palette.info.hover;
|
|
78
78
|
return {
|
|
79
|
-
borderRadius:
|
|
80
|
-
cursor:
|
|
81
|
-
...a
|
|
82
|
-
"&:hover":
|
|
79
|
+
borderRadius: s.vars.size.borderRadius.r1,
|
|
80
|
+
cursor: e?.disabled ? "default" : "pointer",
|
|
81
|
+
...l(a),
|
|
82
|
+
"&:hover": l(r),
|
|
83
83
|
...i(
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
s.generalSettings.isMobile,
|
|
85
|
+
e?.size || "small",
|
|
86
86
|
"base"
|
|
87
87
|
)
|
|
88
88
|
};
|
|
@@ -90,44 +90,44 @@ const n = {
|
|
|
90
90
|
/**
|
|
91
91
|
* Estilos para el slot Skeleton del Label.
|
|
92
92
|
*/
|
|
93
|
-
skeletonStyled: ({ ownerState:
|
|
93
|
+
skeletonStyled: ({ ownerState: s, theme: e }) => ({
|
|
94
94
|
width: "100%",
|
|
95
|
-
borderRadius:
|
|
95
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
96
96
|
display: "flex",
|
|
97
97
|
alignItems: "center",
|
|
98
|
-
backgroundColor:
|
|
98
|
+
backgroundColor: e.vars.palette.skeleton.default,
|
|
99
99
|
...i(
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
e.generalSettings.isMobile,
|
|
101
|
+
s?.size || "medium",
|
|
102
102
|
"base"
|
|
103
103
|
),
|
|
104
104
|
"&.MandatoryLabel": {
|
|
105
|
-
width:
|
|
106
|
-
paddingLeft:
|
|
107
|
-
paddingRight:
|
|
105
|
+
width: e.vars.size.baseSpacings["sp0-5"],
|
|
106
|
+
paddingLeft: e.vars.size.baseSpacings.sp1,
|
|
107
|
+
paddingRight: e.vars.size.baseSpacings.sp1
|
|
108
108
|
},
|
|
109
109
|
"&.SkeletonWidthLabel": {
|
|
110
|
-
width:
|
|
111
|
-
borderRadius:
|
|
110
|
+
width: e.vars.size.baseSpacings.sp14,
|
|
111
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
112
112
|
...i(
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
e.generalSettings.isMobile,
|
|
114
|
+
s?.size || "medium",
|
|
115
115
|
"base"
|
|
116
116
|
),
|
|
117
117
|
...i(
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
e.generalSettings.isMobile,
|
|
119
|
+
s?.size || "small",
|
|
120
120
|
"base"
|
|
121
121
|
)
|
|
122
122
|
},
|
|
123
123
|
"&.HelperIconLabel": {
|
|
124
|
-
borderRadius:
|
|
124
|
+
borderRadius: e.vars.size.borderRadius.r4,
|
|
125
125
|
...i(
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
e.generalSettings.isMobile,
|
|
127
|
+
s?.size || "small",
|
|
128
128
|
"base",
|
|
129
|
-
(
|
|
130
|
-
width:
|
|
129
|
+
(a) => ({
|
|
130
|
+
width: a
|
|
131
131
|
})
|
|
132
132
|
)
|
|
133
133
|
}
|