@rolster/react-components 19.4.6 → 19.4.8
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/cjs/assets/{index-ChnUq-Oa.css → index-CP_fr3gi.css} +89 -0
- package/dist/cjs/index.cjs +93 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/components/atoms/AreaText/AreaText.css +79 -0
- package/dist/esm/components/atoms/AreaText/AreaText.css.map +1 -0
- package/dist/esm/components/atoms/AreaText/AreaText.d.ts +23 -0
- package/dist/esm/components/atoms/AreaText/AreaText.js +71 -0
- package/dist/esm/components/atoms/AreaText/AreaText.js.map +1 -0
- package/dist/esm/components/molecules/FieldArea/FieldArea.css +6 -0
- package/dist/esm/components/molecules/FieldArea/FieldArea.css.map +1 -0
- package/dist/esm/components/molecules/FieldArea/FieldArea.d.ts +9 -0
- package/dist/esm/components/molecules/FieldArea/FieldArea.js +22 -0
- package/dist/esm/components/molecules/FieldArea/FieldArea.js.map +1 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.css +2 -0
- package/dist/esm/components/organisms/Dropdown/Dropdown.css.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +2 -2
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/controllers/DropdownController.d.ts +3 -1
- package/dist/esm/controllers/DropdownController.js +6 -4
- package/dist/esm/controllers/DropdownController.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -70,6 +70,86 @@
|
|
|
70
70
|
align-self: flex-end;
|
|
71
71
|
} /*# sourceMappingURL=Amount.css.map */
|
|
72
72
|
|
|
73
|
+
.rls-area-text {
|
|
74
|
+
--pvt-font-color: var(--rlc-area-text-font-color, var(--rls-app-color-900));
|
|
75
|
+
--pvt-font-size: var(--rlc-area-text-font-size, var(--rls-input-font-size));
|
|
76
|
+
--pvt-letter-spacing: var(
|
|
77
|
+
--rlc-area-text-letter-spacing,
|
|
78
|
+
var(--rls-input-letter-spacing)
|
|
79
|
+
);
|
|
80
|
+
--pvt-line-height: var(--rlc-area-text-line-height, 1.5);
|
|
81
|
+
--pvt-min-height: var(
|
|
82
|
+
--rlc-area-text-min-height,
|
|
83
|
+
calc(var(--rls-sizing-x12) * 3)
|
|
84
|
+
);
|
|
85
|
+
--pvt-padding: var(--rlc-area-text-padding, var(--rls-sizing-x3) 0rem);
|
|
86
|
+
--pvt-text-align: var(--rlc-area-text-text-align, left);
|
|
87
|
+
--pvt-value-font-color: var(--pvt-font-color);
|
|
88
|
+
--pvt-value-opacity: 1;
|
|
89
|
+
--pvt-component-font-color: transparent;
|
|
90
|
+
position: relative;
|
|
91
|
+
width: var(--rlc-area-text-width, 100%);
|
|
92
|
+
}
|
|
93
|
+
.rls-area-text--focused {
|
|
94
|
+
--pvt-component-font-color: var(--pvt-font-color);
|
|
95
|
+
--pvt-value-font-color: transparent;
|
|
96
|
+
}
|
|
97
|
+
.rls-area-text--disabled {
|
|
98
|
+
--pvt-value-opacity: 0.5;
|
|
99
|
+
}
|
|
100
|
+
.rls-area-text__component {
|
|
101
|
+
position: relative;
|
|
102
|
+
width: 100%;
|
|
103
|
+
min-height: var(--pvt-min-height);
|
|
104
|
+
padding: var(--pvt-padding);
|
|
105
|
+
cursor: text;
|
|
106
|
+
border: none;
|
|
107
|
+
outline: none;
|
|
108
|
+
background: rgba(0, 0, 0, 0);
|
|
109
|
+
color: var(--pvt-component-font-color);
|
|
110
|
+
font-weight: var(--rls-font-weight-medium);
|
|
111
|
+
font-size: var(--pvt-font-size);
|
|
112
|
+
line-height: var(--pvt-line-height);
|
|
113
|
+
text-align: var(--pvt-text-align);
|
|
114
|
+
letter-spacing: var(--pvt-letter-spacing);
|
|
115
|
+
font-family: inherit;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
resize: none;
|
|
118
|
+
}
|
|
119
|
+
.rls-area-text__component::placeholder {
|
|
120
|
+
color: var(--rls-app-color-400);
|
|
121
|
+
}
|
|
122
|
+
.rls-area-text__component::selection {
|
|
123
|
+
background: var(--rls-theme-color-700);
|
|
124
|
+
color: var(--rls-app-color-050);
|
|
125
|
+
}
|
|
126
|
+
.rls-area-text__component:read-only {
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
}
|
|
129
|
+
.rls-area-text__component:disabled {
|
|
130
|
+
opacity: 0.5;
|
|
131
|
+
}
|
|
132
|
+
.rls-area-text__value {
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0rem;
|
|
135
|
+
left: 0rem;
|
|
136
|
+
width: 100%;
|
|
137
|
+
min-height: var(--pvt-min-height);
|
|
138
|
+
padding: var(--pvt-padding);
|
|
139
|
+
background: rgba(0, 0, 0, 0);
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
white-space: pre-wrap;
|
|
143
|
+
word-break: break-word;
|
|
144
|
+
opacity: var(--pvt-value-opacity);
|
|
145
|
+
color: var(--pvt-value-font-color);
|
|
146
|
+
font-weight: var(--rls-font-weight-medium);
|
|
147
|
+
font-size: var(--pvt-font-size);
|
|
148
|
+
line-height: var(--pvt-line-height);
|
|
149
|
+
text-align: var(--pvt-text-align);
|
|
150
|
+
letter-spacing: var(--pvt-letter-spacing);
|
|
151
|
+
} /*# sourceMappingURL=AreaText.css.map */
|
|
152
|
+
|
|
73
153
|
.rls-avatar {
|
|
74
154
|
--rlc-image-width: var(--rlc-avatar-width);
|
|
75
155
|
--rlc-image-height: var(--rlc-avatar-height);
|
|
@@ -1458,6 +1538,13 @@
|
|
|
1458
1538
|
box-sizing: border-box;
|
|
1459
1539
|
} /*# sourceMappingURL=FieldDecimal.css.map */
|
|
1460
1540
|
|
|
1541
|
+
.rls-field-area {
|
|
1542
|
+
--rlc-field-box-body-padding: var(--rls-sizing-x3) var(--rls-sizing-x4);
|
|
1543
|
+
position: relative;
|
|
1544
|
+
width: 100%;
|
|
1545
|
+
box-sizing: border-box;
|
|
1546
|
+
} /*# sourceMappingURL=FieldArea.css.map */
|
|
1547
|
+
|
|
1461
1548
|
.rls-field-file {
|
|
1462
1549
|
--rlc-field-box-body-padding: var(--rls-sizing-x3) var(--rls-sizing-x4);
|
|
1463
1550
|
--rlc-action-ripple-dimension: var(--rls-sizing-x12);
|
|
@@ -2645,12 +2732,14 @@
|
|
|
2645
2732
|
opacity: 0;
|
|
2646
2733
|
width: auto;
|
|
2647
2734
|
z-index: -16;
|
|
2735
|
+
pointer-events: none;
|
|
2648
2736
|
transition: opacity 240ms 0ms var(--rls-standard-curve);
|
|
2649
2737
|
}
|
|
2650
2738
|
.rls-dropdown--visible {
|
|
2651
2739
|
--pvt-content-opacity: 1;
|
|
2652
2740
|
--pvt-content-transform: scale(1, 1);
|
|
2653
2741
|
opacity: 1;
|
|
2742
|
+
pointer-events: initial;
|
|
2654
2743
|
z-index: var(--rlc-dropdown-z-index, var(--rls-z-index-4));
|
|
2655
2744
|
}
|
|
2656
2745
|
.rls-dropdown__content {
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -469,6 +469,73 @@ function RlsAmount({ value, className, decimals, rlsTheme, symbol }) {
|
|
|
469
469
|
return (jsxRuntimeExports.jsxs("div", { className: classNameAmount, "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { className: "rls-amount__symbol", children: symbol }), jsxRuntimeExports.jsxs("div", { className: "rls-amount__content", children: [jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
+
function RlsAreaText({ autoComplete, children, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, resize, rows, value }) {
|
|
473
|
+
const valueInitial = String(formControl?.value ?? value ?? '');
|
|
474
|
+
const [valueArea, setValueArea] = require$$0.useState(valueInitial);
|
|
475
|
+
const [focused, setFocused] = require$$0.useState(false);
|
|
476
|
+
const elementRef = require$$0.useRef(null);
|
|
477
|
+
const areaRef = formControl?.elementRef ?? elementRef;
|
|
478
|
+
const changeIsInternal = require$$0.useRef(false);
|
|
479
|
+
const refreshHeight = require$$0.useCallback(() => {
|
|
480
|
+
const element = areaRef.current;
|
|
481
|
+
if (!element) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
element.style.height = 'auto';
|
|
485
|
+
element.style.height = `${element.scrollHeight}px`;
|
|
486
|
+
}, [areaRef]);
|
|
487
|
+
require$$0.useEffect(() => {
|
|
488
|
+
if (!changeIsInternal.current) {
|
|
489
|
+
const nextValue = String(formControl?.value ?? value ?? '');
|
|
490
|
+
valueArea !== nextValue && setValueArea(nextValue);
|
|
491
|
+
}
|
|
492
|
+
changeIsInternal.current = false;
|
|
493
|
+
}, [formControl?.value, value, valueArea]);
|
|
494
|
+
require$$0.useEffect(() => {
|
|
495
|
+
refreshHeight();
|
|
496
|
+
}, [refreshHeight, valueArea]);
|
|
497
|
+
const onChangeArea = require$$0.useCallback((event) => {
|
|
498
|
+
const nextValue = event.target.value;
|
|
499
|
+
changeIsInternal.current = true;
|
|
500
|
+
onValue?.(nextValue);
|
|
501
|
+
setValueArea(nextValue);
|
|
502
|
+
formControl?.setValue(nextValue);
|
|
503
|
+
event.target.style.height = 'auto';
|
|
504
|
+
event.target.style.height = `${event.target.scrollHeight}px`;
|
|
505
|
+
}, [formControl, onValue]);
|
|
506
|
+
const onKeyDownArea = require$$0.useCallback((event) => {
|
|
507
|
+
onKeyDown?.(event);
|
|
508
|
+
event.key === 'Enter' && onEnter?.();
|
|
509
|
+
}, [onKeyDown, onEnter]);
|
|
510
|
+
const onKeyUpArea = require$$0.useCallback((event) => {
|
|
511
|
+
onKeyUp?.(event);
|
|
512
|
+
}, [onKeyUp]);
|
|
513
|
+
const onFocusArea = require$$0.useCallback(() => {
|
|
514
|
+
formControl?.focus();
|
|
515
|
+
setFocused(() => true);
|
|
516
|
+
onFocus?.();
|
|
517
|
+
}, [formControl, onFocus]);
|
|
518
|
+
const onBlurArea = require$$0.useCallback(() => {
|
|
519
|
+
formControl?.blur();
|
|
520
|
+
setFocused(() => false);
|
|
521
|
+
onBlur?.();
|
|
522
|
+
}, [formControl, onBlur]);
|
|
523
|
+
const className = require$$0.useMemo(() => {
|
|
524
|
+
return renderClassStatus('rls-area-text', {
|
|
525
|
+
disabled: formControl?.disabled || disabled,
|
|
526
|
+
focused: formControl?.focused ?? focused,
|
|
527
|
+
readonly: readOnly
|
|
528
|
+
});
|
|
529
|
+
}, [
|
|
530
|
+
formControl?.disabled,
|
|
531
|
+
formControl?.focused,
|
|
532
|
+
disabled,
|
|
533
|
+
focused,
|
|
534
|
+
readOnly
|
|
535
|
+
]);
|
|
536
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("textarea", { ref: areaRef, className: "rls-area-text__component", autoComplete: autoComplete ?? 'off', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, rows: rows, style: { resize }, onFocus: onFocusArea, onBlur: onBlurArea, onChange: onChangeArea, onKeyDown: onKeyDownArea, onKeyUp: onKeyUpArea, value: valueArea }), jsxRuntimeExports.jsx("span", { className: "rls-area-text__value", children: children ?? valueArea })] }));
|
|
537
|
+
}
|
|
538
|
+
|
|
472
539
|
function RlsAvatar({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
473
540
|
const className = require$$0.useMemo(() => {
|
|
474
541
|
return renderClassStatus('rls-avatar', { contrasted, rounded, skeleton });
|
|
@@ -980,6 +1047,22 @@ function RlsFieldDecimal(props) {
|
|
|
980
1047
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDecimal, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
981
1048
|
}
|
|
982
1049
|
|
|
1050
|
+
function RlsFieldArea(props) {
|
|
1051
|
+
const { children, formControl, identifier, rlsTheme } = props;
|
|
1052
|
+
const disabled = require$$0.useMemo(() => {
|
|
1053
|
+
return formControl?.disabled || props.disabled;
|
|
1054
|
+
}, [formControl?.disabled, props.disabled]);
|
|
1055
|
+
const className = require$$0.useMemo(() => {
|
|
1056
|
+
return renderClassStatus('rls-field-box', {
|
|
1057
|
+
disabled,
|
|
1058
|
+
error: formControl?.wrong,
|
|
1059
|
+
focused: formControl?.focused && !disabled,
|
|
1060
|
+
readonly: props.readOnly
|
|
1061
|
+
}, 'rls-field-area');
|
|
1062
|
+
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1063
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsAreaText, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1064
|
+
}
|
|
1065
|
+
|
|
983
1066
|
function RlsFieldFile({ accept, children, disabled: disabledProp, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
984
1067
|
const inputRef = require$$0.useRef(null);
|
|
985
1068
|
const disabled = require$$0.useMemo(() => formControl?.disabled || disabledProp, [formControl?.disabled, disabledProp]);
|
|
@@ -2103,8 +2186,8 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2103
2186
|
});
|
|
2104
2187
|
}, []);
|
|
2105
2188
|
require$$0.useEffect(() => {
|
|
2106
|
-
props.onInput?.(autocomplete.
|
|
2107
|
-
}, [autocomplete.
|
|
2189
|
+
props.onInput?.(autocomplete.pattern);
|
|
2190
|
+
}, [autocomplete.pattern, props.onInput]);
|
|
2108
2191
|
const disabled = require$$0.useMemo(() => {
|
|
2109
2192
|
return formControl?.disabled || props.disabled;
|
|
2110
2193
|
}, [formControl?.disabled, props.disabled]);
|
|
@@ -3344,15 +3427,16 @@ function RlsApplication({ children }) {
|
|
|
3344
3427
|
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
3345
3428
|
}
|
|
3346
3429
|
|
|
3347
|
-
function useDropdownController() {
|
|
3430
|
+
function useDropdownController(effect = '0% 0%') {
|
|
3348
3431
|
const [visible, setVisible] = require$$0.useState(false);
|
|
3349
3432
|
const component = require$$0.useRef(null);
|
|
3350
3433
|
const open = require$$0.useCallback((positionX, positionY) => {
|
|
3351
|
-
component.current.
|
|
3434
|
+
const content = component.current.querySelector('.rls-dropdown__content');
|
|
3435
|
+
content.style.transformOrigin = effect;
|
|
3352
3436
|
component.current.style.top = `${positionY}px`;
|
|
3353
3437
|
component.current.style.left = `${positionX}px`;
|
|
3354
3438
|
setVisible(true);
|
|
3355
|
-
}, []);
|
|
3439
|
+
}, [effect]);
|
|
3356
3440
|
const openWithEvent = require$$0.useCallback((event) => {
|
|
3357
3441
|
const rectContent = component.current.getBoundingClientRect();
|
|
3358
3442
|
const rectElement = event.target.getBoundingClientRect();
|
|
@@ -3400,7 +3484,8 @@ function useDropdownController() {
|
|
|
3400
3484
|
effect = '0% 0%';
|
|
3401
3485
|
break;
|
|
3402
3486
|
}
|
|
3403
|
-
component.current.
|
|
3487
|
+
const content = component.current.querySelector('.rls-dropdown__content');
|
|
3488
|
+
content.style.transformOrigin = effect;
|
|
3404
3489
|
component.current.style.top = `${positionY}px`;
|
|
3405
3490
|
component.current.style.left = `${positionX}px`;
|
|
3406
3491
|
setVisible(true);
|
|
@@ -3433,6 +3518,7 @@ exports.ConfirmationResult = ConfirmationResult;
|
|
|
3433
3518
|
exports.RlsAlert = RlsAlert;
|
|
3434
3519
|
exports.RlsAmount = RlsAmount;
|
|
3435
3520
|
exports.RlsApplication = RlsApplication;
|
|
3521
|
+
exports.RlsAreaText = RlsAreaText;
|
|
3436
3522
|
exports.RlsAvatar = RlsAvatar;
|
|
3437
3523
|
exports.RlsBadge = RlsBadge;
|
|
3438
3524
|
exports.RlsBallot = RlsBallot;
|
|
@@ -3459,6 +3545,7 @@ exports.RlsDatatableSubheader = RlsDatatableSubheader;
|
|
|
3459
3545
|
exports.RlsDatatableTitle = RlsDatatableTitle;
|
|
3460
3546
|
exports.RlsDatatableTotals = RlsDatatableTotals;
|
|
3461
3547
|
exports.RlsDropdown = RlsDropdown;
|
|
3548
|
+
exports.RlsFieldArea = RlsFieldArea;
|
|
3462
3549
|
exports.RlsFieldAutocomplete = RlsFieldAutocomplete;
|
|
3463
3550
|
exports.RlsFieldAutocompleteTemplate = RlsFieldAutocompleteTemplate;
|
|
3464
3551
|
exports.RlsFieldClock = RlsFieldClock;
|