@dynamic-framework/ui-react 1.7.0 → 1.7.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/index.esm.js CHANGED
@@ -740,7 +740,7 @@ function DFormikInputCurrency(_a) {
740
740
  return (jsx(DInputCurrency, Object.assign({}, props, { name: field.name, value: field.value, onChange: (value) => helpers.setValue(value), onBlur: (value) => field.onBlur(value), isInvalid: !!meta.error, hint: (meta === null || meta === void 0 ? void 0 : meta.error) || hint })));
741
741
  }
742
742
 
743
- function DInputSelect({ id, name, label = '', options, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, isDisabled = false, isLoading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, hint, selectedOption, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
743
+ function DInputSelect({ id, name, label = '', className, options, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, isDisabled = false, isLoading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, hint, selectedOption, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
744
744
  const internalValueExtractor = useCallback((option) => {
745
745
  if (valueExtractor) {
746
746
  return valueExtractor(option);
@@ -773,7 +773,7 @@ function DInputSelect({ id, name, label = '', options, labelIcon, labelIconFamil
773
773
  const iconEndClickHandler = useCallback((event) => {
774
774
  onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
775
775
  }, [onIconEndClick]);
776
- return (jsxs("div", { className: "d-input", children: [label && (jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsx(DIcon, { className: "mdinput-icon", icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxs("div", { className: "d-input-control", children: [jsxs("div", { className: classNames({
776
+ return (jsxs("div", { className: classNames('d-input', className), children: [label && (jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsx(DIcon, { className: "mdinput-icon", icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxs("div", { className: "d-input-control", children: [jsxs("div", { className: classNames({
777
777
  'input-group': true,
778
778
  disabled: isDisabled || isLoading,
779
779
  }), children: [iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: isDisabled || isLoading, children: iconStart && (jsx(DIcon, { className: "d-input-icon", icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), jsx("select", Object.assign({ id: id, name: name, className: "form-select", "aria-label": label, disabled: isDisabled || isLoading, "aria-describedby": `${id}Add ${id}Hint`, onChange: changeHandler, onBlur: blurHandler }, selectedOption && { value: internalValueExtractor(selectedOption) }, { children: options.map((option) => (jsx("option", { value: internalValueExtractor(option), children: internalLabelExtractor(option) }, internalValueExtractor(option)))) })), iconEnd && !isLoading && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: isDisabled || isLoading, children: iconEnd && (jsx(DIcon, { className: "d-input-icon", icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), isLoading && (jsx("div", { className: "input-group-text form-control-icon loading", children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })] }));
@@ -1077,8 +1077,10 @@ function DModalHeader({ showCloseButton, onClose, children, }) {
1077
1077
  return (jsxs("div", { className: "modal-header", children: [showCloseButton && (jsx("button", { type: "button", className: "d-modal-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: "x-lg" }) })), children] }));
1078
1078
  }
1079
1079
 
1080
- function DOffcanvas({ name, isStatic, isScrollable, openFrom = 'end', children, }) {
1081
- return (jsx("div", Object.assign({ className: `offcanvas offcanvas-${openFrom} show`, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, isStatic && ({
1080
+ function DOffcanvas({ name, className, isStatic, isScrollable, openFrom = 'end', children, }) {
1081
+ return (jsx("div", Object.assign({ className: classNames('offcanvas show', {
1082
+ [`offcanvas-${openFrom}`]: openFrom,
1083
+ }, className), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, isStatic && ({
1082
1084
  [`data-${PREFIX_BS}backdrop`]: 'static',
1083
1085
  [`data-${PREFIX_BS}keyboard`]: 'false',
1084
1086
  }), isScrollable && ({
@@ -1148,7 +1150,7 @@ function DProgress({ currentValue, minValue = 0, maxValue = 100, hideCurrentValu
1148
1150
  return (jsx("div", { className: "progress", children: jsx("div", { className: classNames(generateClasses), role: "progressbar", "aria-label": "Progress bar", style: { width: `${currentValue}%` }, "aria-valuenow": currentValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, children: !hideCurrentValue && formatProgress }) }));
1149
1151
  }
1150
1152
 
1151
- function DQuickActionButton({ line1, line2, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }) {
1153
+ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }) {
1152
1154
  const globalClickHandler = useCallback(() => {
1153
1155
  if (actionLinkText) {
1154
1156
  return;
@@ -1165,20 +1167,20 @@ function DQuickActionButton({ line1, line2, actionLinkText, actionLinkTheme = 's
1165
1167
  onClickSecondary === null || onClickSecondary === void 0 ? void 0 : onClickSecondary();
1166
1168
  }, [onClickSecondary]);
1167
1169
  const Tag = useMemo(() => (actionLinkText ? 'div' : 'button'), [actionLinkText]);
1168
- return (jsxs(Tag, { className: "d-quick-action-button", onClick: !actionLinkText ? globalClickHandler : undefined, style: style, children: [representativeIcon && (jsx(DIcon, { className: "d-quick-action-button-representative-icon", size: representativeIconHasCircle
1170
+ return (jsxs(Tag, { className: classNames('d-quick-action-button', className), onClick: !actionLinkText ? globalClickHandler : undefined, style: style, children: [representativeIcon && (jsx(DIcon, { className: "d-quick-action-button-representative-icon", size: representativeIconHasCircle
1169
1171
  ? `var(--${PREFIX_BS}quick-action-button-representative-icon-size)`
1170
1172
  : `var(--${PREFIX_BS}quick-action-button-representative-image-size)`, icon: representativeIcon, hasCircle: representativeIconHasCircle, theme: representativeIconTheme, familyClass: representativeIconFamilyClass, familyPrefix: representativeIconFamilyPrefix })), representativeImage && (jsx("img", { className: "d-quick-action-button-representative-image", src: representativeImage, alt: "" })), jsx("div", { className: "d-quick-action-button-content", children: jsxs("div", { className: "d-quick-action-button-text", children: [jsx("span", { className: "d-quick-action-button-line1", children: line1 }), jsx("small", { className: "d-quick-action-button-line2", children: line2 })] }) }), secondaryActionIcon && (jsx(DButton, { className: "d-quick-action-button-secondary-action-link", type: "button", variant: "link", iconStart: secondaryActionIcon, iconStartFamilyClass: actionIconFamilyClass, iconStartFamilyPrefix: actionIconFamilyPrefix, theme: actionLinkTheme, onClick: secondaryActionLinkClickHandler, isStopPropagationEnabled: true })), actionLinkText && !actionIcon && (jsx(DButton, { className: "d-quick-action-button-action-link", type: "button", variant: "link", theme: actionLinkTheme, text: actionLinkText, onClick: actionLinkClickHandler, isStopPropagationEnabled: true })), actionIcon && !actionLinkText && (jsx(DIcon, { className: "d-quick-action-button-action-icon", icon: actionIcon, size: `var(--${PREFIX_BS}quick-action-button-action-icon-size)`, familyClass: actionIconFamilyClass, familyPrefix: actionIconFamilyPrefix }))] }));
1171
1173
  }
1172
1174
 
1173
- function DQuickActionCheck({ id, name, value, line1, line2, line3, isChecked, onChange, }) {
1175
+ function DQuickActionCheck({ id, name, value, line1, line2, line3, className, isChecked, onChange, }) {
1174
1176
  const changeHandler = useCallback((event) => {
1175
1177
  event.stopPropagation();
1176
1178
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
1177
1179
  }, [onChange]);
1178
- return (jsxs("label", { className: "d-quick-action-check", htmlFor: id, children: [jsx(DInputCheck, { id: id, type: "radio", name: name, value: value, isChecked: isChecked, onChange: changeHandler }), jsxs("div", { className: "d-quick-action-check-detail", children: [jsx("span", { className: "d-quick-action-check-line1", children: line1 }), jsx("span", { className: "d-quick-action-check-line2", children: line2 })] }), jsx("span", { className: "d-quick-action-check-line3", children: line3 })] }));
1180
+ return (jsxs("label", { className: classNames('d-quick-action-check', className), htmlFor: id, children: [jsx(DInputCheck, { id: id, type: "radio", name: name, value: value, isChecked: isChecked, onChange: changeHandler }), jsxs("div", { className: "d-quick-action-check-detail", children: [jsx("span", { className: "d-quick-action-check-line1", children: line1 }), jsx("span", { className: "d-quick-action-check-line2", children: line2 })] }), jsx("span", { className: "d-quick-action-check-line3", children: line3 })] }));
1179
1181
  }
1180
1182
 
1181
- function DQuickActionSelect({ id, name, value, line1, line2, isSelected = false, onChange, }) {
1183
+ function DQuickActionSelect({ id, name, value, line1, line2, className, isSelected = false, onChange, }) {
1182
1184
  const innerRef = useRef(null);
1183
1185
  const changeHandler = useCallback((event) => {
1184
1186
  event.stopPropagation();
@@ -1189,15 +1191,15 @@ function DQuickActionSelect({ id, name, value, line1, line2, isSelected = false,
1189
1191
  innerRef.current.checked = isSelected;
1190
1192
  }
1191
1193
  }, [isSelected]);
1192
- return (jsxs("label", { className: "d-quick-action-select", htmlFor: id, children: [jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsx("span", { className: "d-quick-action-select-line2", children: line2 })] }));
1194
+ return (jsxs("label", { className: classNames('d-quick-action-select', className), htmlFor: id, children: [jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsx("span", { className: "d-quick-action-select-line2", children: line2 })] }));
1193
1195
  }
1194
1196
 
1195
- function DQuickActionSwitch({ id, name, label, hint, isChecked, isDisabled, onClick, }) {
1197
+ function DQuickActionSwitch({ id, name, label, hint, className, isChecked, isDisabled, onClick, }) {
1196
1198
  const clickHandler = useCallback((event) => {
1197
1199
  event.stopPropagation();
1198
1200
  onClick === null || onClick === void 0 ? void 0 : onClick(isChecked);
1199
1201
  }, [isChecked, onClick]);
1200
- return (jsxs("button", { className: "d-quick-action-switch", type: "button", onClick: clickHandler, children: [jsxs("div", { className: "d-quick-action-switch-content", children: [jsx(DInputSwitch, { id: id, name: name, isDisabled: isDisabled, isChecked: isChecked, isReadonly: true }), jsx("label", { className: "d-quick-action-switch-label", htmlFor: id, children: label })] }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
1202
+ return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, children: [jsxs("div", { className: "d-quick-action-switch-content", children: [jsx(DInputSwitch, { id: id, name: name, isDisabled: isDisabled, isChecked: isChecked, isReadonly: true }), jsx("label", { className: "d-quick-action-switch-label", htmlFor: id, children: label })] }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
1201
1203
  }
1202
1204
 
1203
1205
  function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {