@dynamic-framework/ui-react 1.11.0 → 1.11.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/dist/index.esm.js +7 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -510,7 +510,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
function DInput(_a, ref) {
|
|
513
|
-
var { id, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, readOnly = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, hint, invalid = false, valid = false, floatingLabel = false, inputStart, value, onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "disabled", "readOnly", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "hint", "invalid", "valid", "floatingLabel", "inputStart", "value", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
513
|
+
var { id, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, readOnly = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, hint, invalid = false, valid = false, floatingLabel = false, inputStart, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "disabled", "readOnly", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "hint", "invalid", "valid", "floatingLabel", "inputStart", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
514
514
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
515
515
|
const handleOnChange = React.useCallback((event) => {
|
|
516
516
|
onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value);
|
|
@@ -531,7 +531,7 @@ function DInput(_a, ref) {
|
|
|
531
531
|
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
|
|
532
532
|
'is-invalid': invalid,
|
|
533
533
|
'is-valid': valid,
|
|
534
|
-
}), disabled: disabled || loading, readOnly: readOnly, value: value, onChange: handleOnChange }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
534
|
+
}), disabled: disabled || loading, readOnly: readOnly, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
535
535
|
ariaDescribedby,
|
|
536
536
|
disabled,
|
|
537
537
|
handleOnChange,
|
|
@@ -540,6 +540,8 @@ function DInput(_a, ref) {
|
|
|
540
540
|
inputRef,
|
|
541
541
|
invalid,
|
|
542
542
|
loading,
|
|
543
|
+
placeholder,
|
|
544
|
+
floatingLabel,
|
|
543
545
|
readOnly,
|
|
544
546
|
valid,
|
|
545
547
|
value,
|
|
@@ -1068,12 +1070,13 @@ function DPopover({ children, renderComponent, open, setOpen, adjustContentToRen
|
|
|
1068
1070
|
}
|
|
1069
1071
|
|
|
1070
1072
|
function DProgress({ className, style, currentValue, minValue = 0, maxValue = 100, hideCurrentValue = false, enableStripedAnimation = false, }) {
|
|
1071
|
-
const
|
|
1073
|
+
const percentage = React.useMemo(() => (Math.round((currentValue * 100) / maxValue)), [currentValue, maxValue]);
|
|
1074
|
+
const formatProgress = React.useMemo(() => `${percentage}%`, [percentage]);
|
|
1072
1075
|
const generateClasses = React.useMemo(() => ({
|
|
1073
1076
|
'progress-bar': true,
|
|
1074
1077
|
'progress-bar-striped progress-bar-animated': enableStripedAnimation,
|
|
1075
1078
|
}), [enableStripedAnimation]);
|
|
1076
|
-
return (jsxRuntime.jsx("div", { className:
|
|
1079
|
+
return (jsxRuntime.jsx("div", { className: classNames('progress', className), children: jsxRuntime.jsx("div", { className: classNames(generateClasses), role: "progressbar", "aria-label": "Progress bar", style: Object.assign({ width: formatProgress }, style), "aria-valuenow": currentValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, children: !hideCurrentValue && formatProgress }) }));
|
|
1077
1080
|
}
|
|
1078
1081
|
|
|
1079
1082
|
function DQuickActionButton({ line1, line2, className, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, secondaryActionAriaLabel, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }) {
|