@rolster/react-components 18.22.2 → 18.22.4
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-CkCoIjNb.css → index-DrZV0dgi.css} +32 -17
- package/dist/cjs/index.js +44 -21
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-CkCoIjNb.css → index-DrZV0dgi.css} +32 -17
- package/dist/es/index.js +44 -22
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Image/Image.css +8 -0
- package/dist/esm/components/atoms/Image/Image.css.map +1 -0
- package/dist/esm/components/atoms/Image/Image.d.ts +6 -0
- package/dist/esm/components/atoms/Image/Image.js +22 -0
- package/dist/esm/components/atoms/Image/Image.js.map +1 -0
- package/dist/esm/components/atoms/index.d.ts +1 -0
- package/dist/esm/components/atoms/index.js +1 -0
- package/dist/esm/components/atoms/index.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.css +8 -6
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.css.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.css +8 -6
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.css.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.css +7 -5
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.css.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.d.ts +1 -0
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js +1 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js.map +1 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.d.ts +1 -0
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js +21 -17
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js.map +1 -1
- package/package.json +1 -1
|
@@ -514,6 +514,15 @@
|
|
|
514
514
|
transition: all 160ms 0ms var(--rls-standard-curve);
|
|
515
515
|
} /*# sourceMappingURL=CheckBox.css.map */
|
|
516
516
|
|
|
517
|
+
.rls-image {
|
|
518
|
+
content-visibility: auto;
|
|
519
|
+
background-color: var(--rls-theme-color-600);
|
|
520
|
+
opacity: 0;
|
|
521
|
+
}
|
|
522
|
+
.rls-image--complet {
|
|
523
|
+
opacity: 1;
|
|
524
|
+
} /*# sourceMappingURL=Image.css.map */
|
|
525
|
+
|
|
517
526
|
.rls-input {
|
|
518
527
|
--pvt-font-color: var(--rlc-input-font-color, var(--rls-app-color-900));
|
|
519
528
|
--pvt-font-size: var(--rlc-input-font-size, var(--rls-input-font-size));
|
|
@@ -1275,18 +1284,20 @@
|
|
|
1275
1284
|
width: auto;
|
|
1276
1285
|
}
|
|
1277
1286
|
.rls-label-checkbox__text {
|
|
1278
|
-
max-width: calc(100% - var(--rls-sizing-
|
|
1279
|
-
height: var(--pvt-text-height);
|
|
1280
|
-
line-height: var(--rls-sizing-x12);
|
|
1287
|
+
max-width: calc(100% - var(--rls-sizing-x28));
|
|
1281
1288
|
color: var(--rls-app-color-600);
|
|
1289
|
+
line-height: var(--pvt-text-height);
|
|
1282
1290
|
font-size: var(--rls-label-font-size);
|
|
1283
1291
|
font-weight: var(--rls-font-weight-medium);
|
|
1284
1292
|
letter-spacing: var(--rls-label-letter-spacing);
|
|
1285
1293
|
user-select: none;
|
|
1286
1294
|
opacity: var(--pvt-text-opacity);
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1295
|
+
}
|
|
1296
|
+
.rls-label-checkbox__text > p {
|
|
1297
|
+
height: initial;
|
|
1298
|
+
overflow: initial;
|
|
1299
|
+
text-overflow: initial;
|
|
1300
|
+
white-space: initial;
|
|
1290
1301
|
} /*# sourceMappingURL=LabelCheckBox.css.map */
|
|
1291
1302
|
|
|
1292
1303
|
.rls-label-radiobutton {
|
|
@@ -1314,18 +1325,20 @@
|
|
|
1314
1325
|
width: auto;
|
|
1315
1326
|
}
|
|
1316
1327
|
.rls-label-radiobutton__text {
|
|
1317
|
-
max-width: calc(100% - var(--rls-sizing-
|
|
1318
|
-
height: var(--pvt-text-height);
|
|
1319
|
-
line-height: var(--rls-sizing-x12);
|
|
1328
|
+
max-width: calc(100% - var(--rls-sizing-x28));
|
|
1320
1329
|
color: var(--rls-app-color-600);
|
|
1330
|
+
line-height: var(--pvt-text-height);
|
|
1321
1331
|
font-size: var(--rls-label-font-size);
|
|
1322
1332
|
font-weight: var(--rls-font-weight-medium);
|
|
1323
1333
|
letter-spacing: var(--rls-label-letter-spacing);
|
|
1324
1334
|
user-select: none;
|
|
1325
1335
|
opacity: var(--pvt-text-opacity);
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1336
|
+
}
|
|
1337
|
+
.rls-label-radiobutton__text > p {
|
|
1338
|
+
height: initial;
|
|
1339
|
+
overflow: initial;
|
|
1340
|
+
text-overflow: initial;
|
|
1341
|
+
white-space: initial;
|
|
1329
1342
|
} /*# sourceMappingURL=LabelRadioButton.css.map */
|
|
1330
1343
|
|
|
1331
1344
|
.rls-label-switch {
|
|
@@ -1353,17 +1366,19 @@
|
|
|
1353
1366
|
}
|
|
1354
1367
|
.rls-label-switch__text {
|
|
1355
1368
|
max-width: calc(100% - var(--rls-sizing-x28));
|
|
1356
|
-
height: var(--pvt-text-height);
|
|
1357
|
-
line-height: var(--rls-sizing-x12);
|
|
1358
1369
|
color: var(--rls-app-color-600);
|
|
1370
|
+
line-height: var(--pvt-text-height);
|
|
1359
1371
|
font-size: var(--rls-label-font-size);
|
|
1360
1372
|
font-weight: var(--rls-font-weight-medium);
|
|
1361
1373
|
letter-spacing: var(--rls-label-letter-spacing);
|
|
1362
1374
|
user-select: none;
|
|
1363
1375
|
opacity: var(--pvt-text-opacity);
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1376
|
+
}
|
|
1377
|
+
.rls-label-switch__text > p {
|
|
1378
|
+
height: initial;
|
|
1379
|
+
overflow: initial;
|
|
1380
|
+
text-overflow: initial;
|
|
1381
|
+
white-space: initial;
|
|
1367
1382
|
} /*# sourceMappingURL=LabelSwitch.css.map */
|
|
1368
1383
|
|
|
1369
1384
|
.rls-pagination {
|
package/dist/es/index.js
CHANGED
|
@@ -1552,6 +1552,24 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
|
1552
1552
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
|
+
function RlsImage({ src }) {
|
|
1556
|
+
const [isComplet, setIsComplet] = useState(false);
|
|
1557
|
+
const refSrc = useRef(src);
|
|
1558
|
+
const className = useMemo(() => {
|
|
1559
|
+
return renderClassStatus('rls-image', { complet: isComplet });
|
|
1560
|
+
}, [isComplet]);
|
|
1561
|
+
useEffect(() => {
|
|
1562
|
+
if (refSrc.current !== src) {
|
|
1563
|
+
setIsComplet(false);
|
|
1564
|
+
refSrc.current = src;
|
|
1565
|
+
}
|
|
1566
|
+
}, [src]);
|
|
1567
|
+
const onLoad = useCallback(() => {
|
|
1568
|
+
setIsComplet(true);
|
|
1569
|
+
}, []);
|
|
1570
|
+
return jsxRuntimeExports.jsx("img", { className: className, src: src, onLoad: onLoad });
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1555
1573
|
function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
1556
1574
|
const valueInitial = formControl?.value ?? value ? String(value) : '';
|
|
1557
1575
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
@@ -1885,7 +1903,7 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1885
1903
|
const className = useMemo(() => {
|
|
1886
1904
|
return renderClassStatus('rls-label-checkbox', { disabled, extended });
|
|
1887
1905
|
}, [disabled, extended]);
|
|
1888
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("
|
|
1906
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1889
1907
|
}
|
|
1890
1908
|
|
|
1891
1909
|
function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, rlsTheme, value }) {
|
|
@@ -1899,7 +1917,7 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1899
1917
|
const className = useMemo(() => {
|
|
1900
1918
|
return renderClassStatus('rls-label-radiobutton', { disabled, extended });
|
|
1901
1919
|
}, [disabled, extended]);
|
|
1902
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("
|
|
1920
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__text", children: children })] }));
|
|
1903
1921
|
}
|
|
1904
1922
|
|
|
1905
1923
|
function RlsLabelSwitch({ children, disabled, extended, identifier, formControl, rlsTheme }) {
|
|
@@ -1915,7 +1933,7 @@ function RlsLabelSwitch({ children, disabled, extended, identifier, formControl,
|
|
|
1915
1933
|
const className = useMemo(() => {
|
|
1916
1934
|
return renderClassStatus('rls-label-switch', { disabled, extended });
|
|
1917
1935
|
}, [disabled, extended]);
|
|
1918
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("
|
|
1936
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-switch__text", children: children })] }));
|
|
1919
1937
|
}
|
|
1920
1938
|
|
|
1921
1939
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
@@ -3376,25 +3394,28 @@ function RlsImageEditor(props) {
|
|
|
3376
3394
|
refOverlayLeft.current.style.width = `calc(${left}px)`;
|
|
3377
3395
|
}, []);
|
|
3378
3396
|
const refreshSelectionFromWidth = useCallback((rateSelection) => {
|
|
3379
|
-
const
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3397
|
+
const ratioFactor = getRatioFactor(props.ratio || '1:1');
|
|
3398
|
+
const _ratio = rateSelection * ratioFactor;
|
|
3399
|
+
const offsetWidth = refImage.current?.offsetWidth || 0;
|
|
3400
|
+
const offsetHeight = refImage.current?.offsetHeight || 0;
|
|
3401
|
+
let width = (offsetWidth * rateSelection) / 100;
|
|
3402
|
+
let height = (offsetWidth * _ratio) / 100;
|
|
3403
|
+
if (height > offsetHeight) {
|
|
3404
|
+
height = offsetHeight;
|
|
3405
|
+
width = height / ratioFactor;
|
|
3387
3406
|
}
|
|
3388
3407
|
return { height, width };
|
|
3389
3408
|
}, [props.ratio]);
|
|
3390
3409
|
const refreshSelectionFromHeight = useCallback((rateSelection) => {
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3410
|
+
const ratioFactor = getRatioFactor(props.ratio || '1:1');
|
|
3411
|
+
const _ratio = rateSelection * ratioFactor;
|
|
3412
|
+
const offsetWidth = refImage.current?.offsetWidth || 0;
|
|
3413
|
+
const offsetHeight = refImage.current?.offsetHeight || 0;
|
|
3414
|
+
let height = (offsetHeight * rateSelection) / 100;
|
|
3415
|
+
let width = (offsetHeight * _ratio) / 100;
|
|
3416
|
+
if (width > offsetWidth) {
|
|
3417
|
+
width = offsetWidth;
|
|
3418
|
+
height = width / ratioFactor;
|
|
3398
3419
|
}
|
|
3399
3420
|
return { height, width };
|
|
3400
3421
|
}, [props.ratio]);
|
|
@@ -3497,13 +3518,14 @@ function RlsImageEditor(props) {
|
|
|
3497
3518
|
props.formControl?.setValue(value);
|
|
3498
3519
|
};
|
|
3499
3520
|
}
|
|
3500
|
-
}, props.mimeType || 'image/jpeg', 1);
|
|
3521
|
+
}, props.mimeType || 'image/jpeg', props.imgQuality || 1);
|
|
3501
3522
|
}, [
|
|
3502
3523
|
props.ratio,
|
|
3503
3524
|
props.mimeType,
|
|
3504
3525
|
props.onValue,
|
|
3505
3526
|
props.formControl,
|
|
3506
|
-
props.imgWidth
|
|
3527
|
+
props.imgWidth,
|
|
3528
|
+
props.imgQuality
|
|
3507
3529
|
]);
|
|
3508
3530
|
const onRestore = useCallback(() => {
|
|
3509
3531
|
const context = refCanvas.current.getContext('2d');
|
|
@@ -3565,7 +3587,7 @@ function RlsImageChooser(props) {
|
|
|
3565
3587
|
const onCancel = useCallback(() => {
|
|
3566
3588
|
setSrcEditor(undefined);
|
|
3567
3589
|
}, []);
|
|
3568
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: onSelect, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), srcEditor && (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-chooser__modal", visible: true, children: jsxRuntimeExports.jsx(RlsImageEditor, { src: srcEditor, formControl: props.formControl, imgWidth: props.imgWidth, onValue: onEditorValue, children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "danger", onClick: onCancel, disabled: props.disabled, children: labels.actionCancel }) }) })), jsxRuntimeExports.jsx("input", { ref: refInput, type: "file", disabled: props.disabled })] }));
|
|
3590
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: onSelect, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), srcEditor && (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-chooser__modal", visible: true, children: jsxRuntimeExports.jsx(RlsImageEditor, { src: srcEditor, formControl: props.formControl, imgWidth: props.imgWidth, imgQuality: props.imgQuality, onValue: onEditorValue, children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "danger", onClick: onCancel, disabled: props.disabled, children: labels.actionCancel }) }) })), jsxRuntimeExports.jsx("input", { ref: refInput, type: "file", disabled: props.disabled })] }));
|
|
3569
3591
|
}
|
|
3570
3592
|
|
|
3571
3593
|
const DURATION_ANIMATION = 240;
|
|
@@ -3654,5 +3676,5 @@ function RlsApplication({ children }) {
|
|
|
3654
3676
|
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
3655
3677
|
}
|
|
3656
3678
|
|
|
3657
|
-
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useListController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3679
|
+
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSwitch, RlsSwitchControl, RlsTabularText, RlsToolbar, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useListController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3658
3680
|
//# sourceMappingURL=index.js.map
|