@rolster/react-components 18.18.1 → 18.18.2
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-Bco_fVV_.css → index-DLCk3aif.css} +4 -3
- package/dist/cjs/index.js +23 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-Bco_fVV_.css → index-DLCk3aif.css} +4 -3
- package/dist/es/index.js +24 -14
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.css +1 -3
- package/dist/esm/components/molecules/Ballot/Ballot.css +3 -0
- package/dist/esm/components/organisms/Datatable/Datatable.d.ts +4 -2
- package/dist/esm/components/organisms/Datatable/Datatable.js +4 -4
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +1 -0
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +4 -2
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.d.ts +1 -0
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +11 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/controllers/ListController.js +5 -5
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/package.json +3 -3
|
@@ -51,10 +51,8 @@
|
|
|
51
51
|
border-radius: 50%;
|
|
52
52
|
}
|
|
53
53
|
.rls-avatar span {
|
|
54
|
+
align-self: center;
|
|
54
55
|
font-size: inherit;
|
|
55
|
-
margin: auto;
|
|
56
|
-
height: inherit;
|
|
57
|
-
line-height: inherit;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
.rls-badge {
|
|
@@ -918,6 +916,9 @@
|
|
|
918
916
|
flex-direction: column;
|
|
919
917
|
row-gap: var(--rlc-ballot-component-row-gap);
|
|
920
918
|
}
|
|
919
|
+
.rls-ballot .rls-avatar + .rls-ballot__component {
|
|
920
|
+
width: calc(100% - var(--rlc-avatar-width) - var(--rls-sizing-x4));
|
|
921
|
+
}
|
|
921
922
|
.rls-ballot__title {
|
|
922
923
|
--rlc-skeleton-text-height: var(--rlc-ballot-title-height);
|
|
923
924
|
--rlc-skeleton-text-letter-spacing: var(--rlc-ballot-title-letter-spacing);
|
package/dist/cjs/index.js
CHANGED
|
@@ -2046,11 +2046,11 @@ function RlsDatatableHeader({ children, identifier }) {
|
|
|
2046
2046
|
function RlsDatatableTitle({ children, className, control, identifier }) {
|
|
2047
2047
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: renderClassStatus('rls-datatable__title', { control }, className).trim(), children: children }));
|
|
2048
2048
|
}
|
|
2049
|
-
function RlsDatatableRecord({ children, className, error, identifier, warning }) {
|
|
2050
|
-
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: renderClassStatus('rls-datatable__record', { error, warning }, className).trim(), children: children }));
|
|
2049
|
+
function RlsDatatableRecord({ children, className, error, identifier, info, successs, warning }) {
|
|
2050
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: renderClassStatus('rls-datatable__record', { error, info, successs, warning }, className).trim(), children: children }));
|
|
2051
2051
|
}
|
|
2052
|
-
function RlsDatatableTotals({ children, className, error, identifier, warning }) {
|
|
2053
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className: renderClassStatus('rls-datatable__totals', { error, warning }, className).trim(), children: children }));
|
|
2052
|
+
function RlsDatatableTotals({ children, className, error, identifier, info, successs, warning }) {
|
|
2053
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: renderClassStatus('rls-datatable__totals', { error, info, successs, warning }, className).trim(), children: children }));
|
|
2054
2054
|
}
|
|
2055
2055
|
function RlsDatatableCell({ children, className, control, identifier, overflow }) {
|
|
2056
2056
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: renderClassStatus('rls-datatable__cell', { control, overflow }, className).trim(), children: children }));
|
|
@@ -2129,7 +2129,7 @@ function useListController(props) {
|
|
|
2129
2129
|
refresh(collection.current, formControl?.value, automatic);
|
|
2130
2130
|
}, [suggestions]);
|
|
2131
2131
|
require$$0.useEffect(() => {
|
|
2132
|
-
refresh(collection.current, formControl?.value
|
|
2132
|
+
refresh(collection.current, formControl?.value);
|
|
2133
2133
|
}, [formControl?.value]);
|
|
2134
2134
|
function refresh(collection, state, automatic) {
|
|
2135
2135
|
if (!state) {
|
|
@@ -2150,7 +2150,7 @@ function useListController(props) {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
function refreshWithProtected(collection, automatic) {
|
|
2152
2152
|
if (automatic && collection.value[0]) {
|
|
2153
|
-
|
|
2153
|
+
formControl?.setInitialValue(collection.value[0].value);
|
|
2154
2154
|
return true;
|
|
2155
2155
|
}
|
|
2156
2156
|
if (_protected.current) {
|
|
@@ -2166,9 +2166,9 @@ function useListController(props) {
|
|
|
2166
2166
|
function refreshState(state) {
|
|
2167
2167
|
setState((currentState) => ({ ...currentState, ...state }));
|
|
2168
2168
|
}
|
|
2169
|
-
|
|
2169
|
+
const setFormValue = require$$0.useCallback((value) => {
|
|
2170
2170
|
formControl?.setValue(value);
|
|
2171
|
-
}
|
|
2171
|
+
}, [formControl]);
|
|
2172
2172
|
function navigationInput(event) {
|
|
2173
2173
|
if (state.modalIsVisible) {
|
|
2174
2174
|
const newPosition = components.navigationListFromInput({
|
|
@@ -2542,9 +2542,17 @@ function useFieldSelect(props) {
|
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
2544
|
function onClickAction() {
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2547
|
-
|
|
2545
|
+
const removable = !props.unremovable && !!controller.value;
|
|
2546
|
+
if (removable) {
|
|
2547
|
+
controller.setState({ modalIsVisible: false, value: '' });
|
|
2548
|
+
controller.setFormValue(props.value);
|
|
2549
|
+
props.onValue && props.onValue(props.value);
|
|
2550
|
+
}
|
|
2551
|
+
else {
|
|
2552
|
+
const modalIsVisible = !controller.modalIsVisible;
|
|
2553
|
+
controller.setState({ modalIsVisible });
|
|
2554
|
+
modalIsVisible && controller.inputRef?.current?.focus();
|
|
2555
|
+
}
|
|
2548
2556
|
}
|
|
2549
2557
|
function onClickBackdrop() {
|
|
2550
2558
|
controller.setState({ modalIsVisible: false });
|
|
@@ -2590,7 +2598,7 @@ function useFieldSelect(props) {
|
|
|
2590
2598
|
function RlsFieldSelectTemplate(props) {
|
|
2591
2599
|
const select = useFieldSelect(props);
|
|
2592
2600
|
const { controller } = select;
|
|
2593
|
-
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme } = props;
|
|
2601
|
+
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2594
2602
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2595
2603
|
const className = renderClassStatus('rls-field-box', {
|
|
2596
2604
|
focused: controller.focused && !_disabled,
|
|
@@ -2599,7 +2607,9 @@ function RlsFieldSelectTemplate(props) {
|
|
|
2599
2607
|
}, 'rls-field-list rls-field-select');
|
|
2600
2608
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: controller.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: controller.inputRef, className: "rls-field-list__control", readOnly: true, disabled: _disabled, placeholder: placeholder, value: controller.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput }), jsxRuntimeExports.jsx("button", { className: renderClassStatus('rls-field-list__action', {
|
|
2601
2609
|
visible: controller.modalIsVisible
|
|
2602
|
-
}), disabled: _disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value:
|
|
2610
|
+
}), disabled: _disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: !unremovable && !!controller.value
|
|
2611
|
+
? 'trash-2'
|
|
2612
|
+
: 'arrow-ios-down' }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
2603
2613
|
visible: controller.modalIsVisible,
|
|
2604
2614
|
higher: controller.higher,
|
|
2605
2615
|
hide: !controller.modalIsVisible
|