@pingux/astro 1.5.0 → 1.5.1-alpha.0
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.
@@ -80,6 +80,7 @@ var TextAreaField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
80
80
|
|
81
81
|
var textAreaRef = (0, _react.useRef)();
|
82
82
|
var labelRef = (0, _react.useRef)();
|
83
|
+
var labelWrapperRef = (0, _react.useRef)();
|
83
84
|
var containerRef = (0, _react.useRef)();
|
84
85
|
var inputContainerRef = (0, _react.useRef)();
|
85
86
|
var slotContainer = (0, _react.useRef)();
|
@@ -94,6 +95,7 @@ var TextAreaField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
94
95
|
var resizeFloatLabel = function resizeFloatLabel() {
|
95
96
|
/* istanbul ignore next */
|
96
97
|
labelRef.current.style.width = textAreaRef.current.style.width;
|
98
|
+
labelWrapperRef.current.style.width = "".concat(textAreaRef.current.clientWidth - 2, "px");
|
97
99
|
};
|
98
100
|
/* istanbul ignore next */
|
99
101
|
|
@@ -134,19 +136,24 @@ var TextAreaField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
134
136
|
thisRef.removeEventListener('mousemove', props.resizeCallback ? props.resizeCallback : resizeFloatLabel);
|
135
137
|
};
|
136
138
|
}, [props.isUnresizable, props.labelMode, props.resizeCallback]);
|
139
|
+
var labelNode = (0, _react2.jsx)(_Label["default"], (0, _extends2["default"])({
|
140
|
+
ref: labelRef
|
141
|
+
}, fieldLabelProps, {
|
142
|
+
sx: isLabelHigher && {
|
143
|
+
gridRow: '1/5'
|
144
|
+
}
|
145
|
+
}));
|
146
|
+
var wrappedLabel = (0, _react2.jsx)(_Box["default"], {
|
147
|
+
variant: "boxes.floatLabelWrapper",
|
148
|
+
ref: labelWrapperRef
|
149
|
+
}, labelNode);
|
137
150
|
return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
138
151
|
variant: "forms.input.wrapper"
|
139
152
|
}, fieldContainerProps, {
|
140
153
|
sx: _objectSpread(_objectSpread({}, columnStyleProps === null || columnStyleProps === void 0 ? void 0 : columnStyleProps.sx), fieldContainerProps === null || fieldContainerProps === void 0 ? void 0 : fieldContainerProps.sx),
|
141
154
|
ref: containerRef,
|
142
155
|
maxWidth: "100%"
|
143
|
-
}), (0, _react2.jsx)(
|
144
|
-
ref: labelRef
|
145
|
-
}, fieldLabelProps, {
|
146
|
-
sx: isLabelHigher && {
|
147
|
-
gridRow: '1/5'
|
148
|
-
}
|
149
|
-
})), (0, _react2.jsx)(_Box["default"], {
|
156
|
+
}), props.labelMode === 'float' ? wrappedLabel : labelNode, (0, _react2.jsx)(_Box["default"], {
|
150
157
|
isRow: true,
|
151
158
|
variant: "forms.input.container",
|
152
159
|
className: fieldControlProps.className,
|
@@ -299,6 +299,14 @@ var fileInputFieldWrapper = {
|
|
299
299
|
alignItems: 'center'
|
300
300
|
}
|
301
301
|
};
|
302
|
+
var floatLabelWrapper = {
|
303
|
+
backgroundColor: 'white',
|
304
|
+
position: 'relative',
|
305
|
+
height: '17px',
|
306
|
+
bottom: '-18px',
|
307
|
+
left: '3px',
|
308
|
+
zIndex: 2
|
309
|
+
};
|
302
310
|
var _default = {
|
303
311
|
base: base,
|
304
312
|
card: card,
|
@@ -317,6 +325,7 @@ var _default = {
|
|
317
325
|
radioContainer: radioContainer,
|
318
326
|
scrollbox: scrollbox,
|
319
327
|
topShadowScrollbox: topShadowScrollbox,
|
320
|
-
bottomShadowScrollbox: bottomShadowScrollbox
|
328
|
+
bottomShadowScrollbox: bottomShadowScrollbox,
|
329
|
+
floatLabelWrapper: floatLabelWrapper
|
321
330
|
};
|
322
331
|
exports["default"] = _default;
|
@@ -47,6 +47,7 @@ var TextAreaField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
47
47
|
|
48
48
|
var textAreaRef = useRef();
|
49
49
|
var labelRef = useRef();
|
50
|
+
var labelWrapperRef = useRef();
|
50
51
|
var containerRef = useRef();
|
51
52
|
var inputContainerRef = useRef();
|
52
53
|
var slotContainer = useRef();
|
@@ -61,6 +62,7 @@ var TextAreaField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
61
62
|
var resizeFloatLabel = function resizeFloatLabel() {
|
62
63
|
/* istanbul ignore next */
|
63
64
|
labelRef.current.style.width = textAreaRef.current.style.width;
|
65
|
+
labelWrapperRef.current.style.width = "".concat(textAreaRef.current.clientWidth - 2, "px");
|
64
66
|
};
|
65
67
|
/* istanbul ignore next */
|
66
68
|
|
@@ -101,19 +103,27 @@ var TextAreaField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
101
103
|
thisRef.removeEventListener('mousemove', props.resizeCallback ? props.resizeCallback : resizeFloatLabel);
|
102
104
|
};
|
103
105
|
}, [props.isUnresizable, props.labelMode, props.resizeCallback]);
|
106
|
+
|
107
|
+
var labelNode = ___EmotionJSX(Label, _extends({
|
108
|
+
ref: labelRef
|
109
|
+
}, fieldLabelProps, {
|
110
|
+
sx: isLabelHigher && {
|
111
|
+
gridRow: '1/5'
|
112
|
+
}
|
113
|
+
}));
|
114
|
+
|
115
|
+
var wrappedLabel = ___EmotionJSX(Box, {
|
116
|
+
variant: "boxes.floatLabelWrapper",
|
117
|
+
ref: labelWrapperRef
|
118
|
+
}, labelNode);
|
119
|
+
|
104
120
|
return ___EmotionJSX(Box, _extends({
|
105
121
|
variant: "forms.input.wrapper"
|
106
122
|
}, fieldContainerProps, {
|
107
123
|
sx: _objectSpread(_objectSpread({}, columnStyleProps === null || columnStyleProps === void 0 ? void 0 : columnStyleProps.sx), fieldContainerProps === null || fieldContainerProps === void 0 ? void 0 : fieldContainerProps.sx),
|
108
124
|
ref: containerRef,
|
109
125
|
maxWidth: "100%"
|
110
|
-
}), ___EmotionJSX(
|
111
|
-
ref: labelRef
|
112
|
-
}, fieldLabelProps, {
|
113
|
-
sx: isLabelHigher && {
|
114
|
-
gridRow: '1/5'
|
115
|
-
}
|
116
|
-
})), ___EmotionJSX(Box, {
|
126
|
+
}), props.labelMode === 'float' ? wrappedLabel : labelNode, ___EmotionJSX(Box, {
|
117
127
|
isRow: true,
|
118
128
|
variant: "forms.input.container",
|
119
129
|
className: fieldControlProps.className,
|
@@ -277,6 +277,14 @@ var fileInputFieldWrapper = {
|
|
277
277
|
alignItems: 'center'
|
278
278
|
}
|
279
279
|
};
|
280
|
+
var floatLabelWrapper = {
|
281
|
+
backgroundColor: 'white',
|
282
|
+
position: 'relative',
|
283
|
+
height: '17px',
|
284
|
+
bottom: '-18px',
|
285
|
+
left: '3px',
|
286
|
+
zIndex: 2
|
287
|
+
};
|
280
288
|
export default {
|
281
289
|
base: base,
|
282
290
|
card: card,
|
@@ -295,5 +303,6 @@ export default {
|
|
295
303
|
radioContainer: radioContainer,
|
296
304
|
scrollbox: scrollbox,
|
297
305
|
topShadowScrollbox: topShadowScrollbox,
|
298
|
-
bottomShadowScrollbox: bottomShadowScrollbox
|
306
|
+
bottomShadowScrollbox: bottomShadowScrollbox,
|
307
|
+
floatLabelWrapper: floatLabelWrapper
|
299
308
|
};
|