@dynamic-framework/ui-react 1.32.3 → 1.34.0
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/css/bootstrap-icons.css +2078 -0
- package/dist/css/bootstrap-icons.json +2052 -0
- package/dist/css/bootstrap-icons.min.css +5 -0
- package/dist/css/bootstrap-icons.scss +2090 -0
- package/dist/css/dynamic-ui-non-root.css +21 -8
- package/dist/css/dynamic-ui-non-root.min.css +3 -3
- package/dist/css/dynamic-ui-root.css +2 -2
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +21 -8
- package/dist/css/dynamic-ui.min.css +3 -3
- package/dist/css/fonts/bootstrap-icons.woff +0 -0
- package/dist/css/fonts/bootstrap-icons.woff2 +0 -0
- package/dist/index.esm.js +148 -57
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +164 -63
- package/dist/index.js.map +1 -1
- package/dist/types/components/DInputCheck/DInputCheck.d.ts +2 -1
- package/dist/types/components/DQuickActionButton/DQuickActionButton.d.ts +4 -9
- package/dist/types/components/DSelect/DSelect.d.ts +3 -1
- package/dist/types/components/DSelect/components/DSelectPlaceholder.d.ts +2 -0
- package/dist/types/contexts/DContext.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useMediaBreakpointUp.d.ts +6 -0
- package/dist/types/hooks/useMediaQuery.d.ts +1 -0
- package/dist/types/utils/getCssVariable.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/mediaQuery.d.ts +2 -0
- package/package.json +96 -88
- package/src/style/abstracts/variables/_forms.scss +1 -1
- package/src/style/base/_form-check.scss +18 -0
- package/src/style/components/_d-quick-action-button.scss +4 -2
|
Binary file
|
|
Binary file
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import React, { useMemo, useEffect, useState, useCallback, createContext, useContext, Fragment, forwardRef, useId, useRef } from 'react';
|
|
2
|
+
import React, { useMemo, useEffect, useState, useCallback, createContext, useContext, Fragment, useLayoutEffect, forwardRef, useId, useRef, useSyncExternalStore } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { __rest } from 'tslib';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
@@ -200,7 +200,12 @@ function useDPortalContext() {
|
|
|
200
200
|
return context;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
function getCssVariable(variable) {
|
|
204
|
+
const computedStyle = getComputedStyle(document.documentElement);
|
|
205
|
+
return computedStyle.getPropertyValue(variable).trim();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const DEFAULT_STATE = {
|
|
204
209
|
language: 'en',
|
|
205
210
|
currency: {
|
|
206
211
|
symbol: '$',
|
|
@@ -243,18 +248,40 @@ const defaultState = {
|
|
|
243
248
|
decrease: 'dash-square',
|
|
244
249
|
},
|
|
245
250
|
},
|
|
251
|
+
breakpoints: {
|
|
252
|
+
xs: '',
|
|
253
|
+
sm: '',
|
|
254
|
+
md: '',
|
|
255
|
+
lg: '',
|
|
256
|
+
xl: '',
|
|
257
|
+
xxl: '',
|
|
258
|
+
},
|
|
246
259
|
setContext: () => { },
|
|
247
260
|
portalName: 'd-portal',
|
|
248
261
|
};
|
|
249
|
-
const DContext = createContext(
|
|
250
|
-
function DContextProvider({ language =
|
|
262
|
+
const DContext = createContext(DEFAULT_STATE);
|
|
263
|
+
function DContextProvider({ language = DEFAULT_STATE.language, currency = DEFAULT_STATE.currency, icon = DEFAULT_STATE.icon, iconMap = DEFAULT_STATE.iconMap, portalName = DEFAULT_STATE.portalName, availablePortals, children, }) {
|
|
251
264
|
const [internalContext, setInternalContext,] = useState({
|
|
252
265
|
language,
|
|
253
266
|
currency,
|
|
254
267
|
icon,
|
|
255
268
|
iconMap,
|
|
269
|
+
breakpoints: DEFAULT_STATE.breakpoints,
|
|
256
270
|
});
|
|
257
271
|
const setContext = useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
272
|
+
useLayoutEffect(() => {
|
|
273
|
+
console.log('context');
|
|
274
|
+
setContext({
|
|
275
|
+
breakpoints: {
|
|
276
|
+
xs: getCssVariable(`--${PREFIX_BS}breakpoint-xs`),
|
|
277
|
+
sm: getCssVariable(`--${PREFIX_BS}breakpoint-sm`),
|
|
278
|
+
md: getCssVariable(`--${PREFIX_BS}breakpoint-md`),
|
|
279
|
+
lg: getCssVariable(`--${PREFIX_BS}breakpoint-lg`),
|
|
280
|
+
xl: getCssVariable(`--${PREFIX_BS}breakpoint-xl`),
|
|
281
|
+
xxl: getCssVariable(`--${PREFIX_BS}breakpoint-xxl`),
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
}, [setContext]);
|
|
258
285
|
const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
259
286
|
return (jsx(DContext.Provider, { value: value, children: jsx(DPortalContextProvider, { portalName: portalName, availablePortals: availablePortals, children: children }) }));
|
|
260
287
|
}
|
|
@@ -560,31 +587,37 @@ function DInput(_a, ref) {
|
|
|
560
587
|
}
|
|
561
588
|
const ForwardedDInput = forwardRef(DInput);
|
|
562
589
|
ForwardedDInput.displayName = 'DInput';
|
|
563
|
-
var DInput$1 = ForwardedDInput;
|
|
564
590
|
|
|
565
591
|
function DDatePickerTime(_a) {
|
|
566
592
|
var { value, onChange, id, label, className, style } = _a, props = __rest(_a, ["value", "onChange", "id", "label", "className", "style"]);
|
|
567
|
-
return (jsxs("div", { className: classNames('d-flex align-items-center gap-2 flex-column d-datepicker-time', className), style: style, children: [label && (jsx("label", { htmlFor: id, className: "d-datepicker-time-label", children: label })), jsx(
|
|
593
|
+
return (jsxs("div", { className: classNames('d-flex align-items-center gap-2 flex-column d-datepicker-time', className), style: style, children: [label && (jsx("label", { htmlFor: id, className: "d-datepicker-time-label", children: label })), jsx(ForwardedDInput, Object.assign({ className: "w-100" }, onChange && {
|
|
568
594
|
onChange,
|
|
569
595
|
}, { type: "time", id: id, value: value }, props))] }));
|
|
570
596
|
}
|
|
571
597
|
|
|
572
598
|
function DDatePickerInput(_a, ref) {
|
|
573
599
|
var { value, onClick, id, iconEnd, className, style, inputLabel, readOnly: ignored } = _a, props = __rest(_a, ["value", "onClick", "id", "iconEnd", "className", "style", "inputLabel", "readOnly"]);
|
|
574
|
-
return (jsx(
|
|
600
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: ref, onClick: onClick, readOnly: true, type: "text", id: id, value: value, onIconEndClick: onClick, iconEnd: iconEnd, className: className, style: style, label: inputLabel }, props)));
|
|
575
601
|
}
|
|
576
602
|
const ForwardedDDatePickerInput = forwardRef(DDatePickerInput);
|
|
577
603
|
ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
|
|
578
|
-
var DDatePickerInput$1 = ForwardedDDatePickerInput;
|
|
579
604
|
|
|
580
605
|
function DInputCheck(_a) {
|
|
581
|
-
var { id: idProp, type, name, label, ariaLabel, checked = false, disabled = false, invalid = false, valid = false, indeterminate, value, onChange, className, style, dataAttributes } = _a, props = __rest(_a, ["id", "type", "name", "label", "ariaLabel", "checked", "disabled", "invalid", "valid", "indeterminate", "value", "onChange", "className", "style", "dataAttributes"]);
|
|
606
|
+
var { id: idProp, type, name, label, ariaLabel, checked = false, disabled = false, invalid = false, valid = false, indeterminate, value, hint, onChange, className, style, dataAttributes } = _a, props = __rest(_a, ["id", "type", "name", "label", "ariaLabel", "checked", "disabled", "invalid", "valid", "indeterminate", "value", "hint", "onChange", "className", "style", "dataAttributes"]);
|
|
582
607
|
const innerRef = useRef(null);
|
|
583
608
|
const innerId = useId();
|
|
584
609
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
585
610
|
const handleChange = useCallback((event) => {
|
|
586
611
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
587
612
|
}, [onChange]);
|
|
613
|
+
const ariaDescribedby = useMemo(() => ([
|
|
614
|
+
!!hint && `${id}Hint`,
|
|
615
|
+
]
|
|
616
|
+
.filter(Boolean)
|
|
617
|
+
.join(' ')), [
|
|
618
|
+
id,
|
|
619
|
+
hint,
|
|
620
|
+
]);
|
|
588
621
|
useEffect(() => {
|
|
589
622
|
if (innerRef.current) {
|
|
590
623
|
innerRef.current.indeterminate = Boolean(indeterminate);
|
|
@@ -598,24 +631,25 @@ function DInputCheck(_a) {
|
|
|
598
631
|
const inputComponent = useMemo(() => (jsx("input", Object.assign({ ref: innerRef, onChange: handleChange, className: classNames('form-check-input', {
|
|
599
632
|
'is-invalid': invalid,
|
|
600
633
|
'is-valid': valid,
|
|
601
|
-
}, className), style: style, id: id, disabled: disabled, type: type, name: name, value: value, "aria-label": ariaLabel }, props))), [
|
|
602
|
-
ariaLabel,
|
|
603
|
-
className,
|
|
604
|
-
disabled,
|
|
605
|
-
valid,
|
|
606
|
-
props,
|
|
607
|
-
invalid,
|
|
634
|
+
}, className), style: style, id: id, disabled: disabled, type: type, name: name, value: value, "aria-label": ariaLabel }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, props))), [
|
|
608
635
|
handleChange,
|
|
609
|
-
|
|
610
|
-
|
|
636
|
+
invalid,
|
|
637
|
+
valid,
|
|
638
|
+
className,
|
|
611
639
|
style,
|
|
640
|
+
id,
|
|
641
|
+
disabled,
|
|
612
642
|
type,
|
|
643
|
+
name,
|
|
613
644
|
value,
|
|
645
|
+
ariaLabel,
|
|
646
|
+
ariaDescribedby,
|
|
647
|
+
props,
|
|
614
648
|
]);
|
|
615
649
|
if (!label) {
|
|
616
650
|
return inputComponent;
|
|
617
651
|
}
|
|
618
|
-
return (jsxs("div", Object.assign({ className: "form-check" }, dataAttributes, { children: [inputComponent, jsx("label", { className: "form-check-label", htmlFor: id, children: label })] })));
|
|
652
|
+
return (jsxs("div", Object.assign({ className: "form-check" }, dataAttributes, { children: [inputComponent, jsx("label", { className: "form-check-label", htmlFor: id, children: label }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
619
653
|
}
|
|
620
654
|
|
|
621
655
|
function DSelectOptionCheck(_a) {
|
|
@@ -686,8 +720,17 @@ function DSelectSingleValueEmojiText(_a) {
|
|
|
686
720
|
}), getValue: getValue }, props, { children: [jsx("span", { children: value.emoji }), jsx("span", { children: children })] })));
|
|
687
721
|
}
|
|
688
722
|
|
|
723
|
+
function DSelectPlaceholder(_a) {
|
|
724
|
+
var { selectProps, innerProps: innerPropsProp, children } = _a, props = __rest(_a, ["selectProps", "innerProps", "children"]);
|
|
725
|
+
const id = useMemo(() => `${selectProps.inputId}Placeholder`, [selectProps.inputId]);
|
|
726
|
+
const innerProps = useMemo(() => (Object.assign(Object.assign({}, innerPropsProp), { id })), [innerPropsProp, id]);
|
|
727
|
+
return (jsx(components.Placeholder, Object.assign({ innerProps: innerProps, selectProps: selectProps }, props, { children: children })));
|
|
728
|
+
}
|
|
729
|
+
|
|
689
730
|
function DSelect(_a) {
|
|
690
|
-
var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid, menuWithMaxContent = false, disabled, clearable, loading, rtl, searchable, multi, components, defaultValue, onIconStartClick, onIconEndClick, dataAttributes } = _a, props = __rest(_a, ["id", "className", "style", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "hint", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "invalid", "valid", "menuWithMaxContent", "disabled", "clearable", "loading", "rtl", "searchable", "multi", "components", "defaultValue", "onIconStartClick", "onIconEndClick", "dataAttributes"]);
|
|
731
|
+
var { id: idProp, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid, menuWithMaxContent = false, disabled, clearable, loading, rtl, searchable, multi, components, defaultValue, placeholder, onIconStartClick, onIconEndClick, dataAttributes } = _a, props = __rest(_a, ["id", "className", "style", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "hint", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "invalid", "valid", "menuWithMaxContent", "disabled", "clearable", "loading", "rtl", "searchable", "multi", "components", "defaultValue", "placeholder", "onIconStartClick", "onIconEndClick", "dataAttributes"]);
|
|
732
|
+
const innerId = useId();
|
|
733
|
+
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
691
734
|
const handleOnIconStartClick = useCallback(() => {
|
|
692
735
|
onIconStartClick === null || onIconStartClick === void 0 ? void 0 : onIconStartClick(defaultValue);
|
|
693
736
|
}, [onIconStartClick, defaultValue]);
|
|
@@ -700,14 +743,14 @@ function DSelect(_a) {
|
|
|
700
743
|
'input-group': true,
|
|
701
744
|
'has-validation': invalid,
|
|
702
745
|
disabled: disabled || loading,
|
|
703
|
-
}), children: [iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix }) })), jsx(Select, Object.assign({ styles: {
|
|
746
|
+
}), children: [iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix }) })), jsx(Select, Object.assign({ id: `${id}Container`, inputId: id, styles: {
|
|
704
747
|
control: (base) => (Object.assign(Object.assign({}, base), { minHeight: 'unset' })),
|
|
705
748
|
container: (base) => (Object.assign(Object.assign({}, base), { flex: 1 })),
|
|
706
749
|
menu: (base) => (Object.assign(Object.assign({}, base), { width: menuWithMaxContent ? 'max-context' : '100%', zIndex: 1000 })),
|
|
707
750
|
}, className: classNames('d-select-component', {
|
|
708
751
|
'is-invalid': invalid,
|
|
709
752
|
'is-valid': valid,
|
|
710
|
-
}), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, unstyled: true, components: Object.assign({ DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), (iconEnd && !loading) && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
753
|
+
}), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, placeholder: placeholder, unstyled: true, components: Object.assign({ Placeholder: DSelectPlaceholder, DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), (iconEnd && !loading) && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
711
754
|
}
|
|
712
755
|
var DSelect$1 = Object.assign(DSelect, {
|
|
713
756
|
OptionCheck: DSelectOptionCheck,
|
|
@@ -720,6 +763,7 @@ var DSelect$1 = Object.assign(DSelect, {
|
|
|
720
763
|
OptionEmoji: DSelectOptionEmoji,
|
|
721
764
|
SingleValueEmoji: DSelectSingleValueEmoji,
|
|
722
765
|
SingleValueEmojiText: DSelectSingleValueEmojiText,
|
|
766
|
+
Placeholder: DSelectPlaceholder,
|
|
723
767
|
});
|
|
724
768
|
|
|
725
769
|
function DDatePickerHeader({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, iconPrevMonth, iconNextMonth, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, prevMonthAriaLabel = 'decrease month', nextMonthAriaLabel = 'increase month', iconSize, buttonVariant, buttonTheme, locale, style, className, minYearSelect, maxYearSelect, }) {
|
|
@@ -769,15 +813,14 @@ function DDatePicker(_a) {
|
|
|
769
813
|
]);
|
|
770
814
|
const defaultRenderCustomHeader = useCallback((headerProps) => (jsx(DatePickerHeader, Object.assign({}, headerProps))), [DatePickerHeader]);
|
|
771
815
|
const renderCustomHeader = useMemo(() => (renderCustomHeaderProp || defaultRenderCustomHeader), [defaultRenderCustomHeader, renderCustomHeaderProp]);
|
|
772
|
-
return (jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (jsx(
|
|
816
|
+
return (jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (jsx(ForwardedDDatePickerInput, { id: inputId, "aria-label": inputAriaLabel, iconEndAriaLabel: inputActionAriaLabel, iconMaterialStyle: iconMaterialStyleProp, iconEnd: iconInput, inputLabel: inputLabel, className: className, style: style, invalid: invalid, valid: valid, hint: inputHint })), customTimeInput: (jsx(DDatePickerTime, { id: timeId, label: timeLabel })), placeholderText: placeholder }, locale && { locale }, dataAttributes, props)));
|
|
773
817
|
}
|
|
774
818
|
|
|
775
819
|
function DInputMask(props, ref) {
|
|
776
|
-
return (jsx(InputMask, Object.assign({ ref: ref, component:
|
|
820
|
+
return (jsx(InputMask, Object.assign({ ref: ref, component: ForwardedDInput }, props)));
|
|
777
821
|
}
|
|
778
822
|
const ForwardedDInputMask = forwardRef(DInputMask);
|
|
779
823
|
ForwardedDInputMask.displayName = 'DInputMask';
|
|
780
|
-
var DInputMask$1 = ForwardedDInputMask;
|
|
781
824
|
|
|
782
825
|
function formatValue(value, currencyOptions) {
|
|
783
826
|
if (value === undefined) {
|
|
@@ -877,6 +920,47 @@ function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSe
|
|
|
877
920
|
};
|
|
878
921
|
}
|
|
879
922
|
|
|
923
|
+
function subscribeToMediaQuery(query, callback) {
|
|
924
|
+
const mediaQueryList = window.matchMedia(query);
|
|
925
|
+
mediaQueryList.addEventListener('change', callback);
|
|
926
|
+
return () => {
|
|
927
|
+
mediaQueryList.removeEventListener('change', callback);
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
function checkMediaQuery(query) {
|
|
931
|
+
return window.matchMedia(query).matches;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
function useMediaQuery(mediaQuery, useListener = false) {
|
|
935
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
936
|
+
const noop = (_) => () => { };
|
|
937
|
+
return useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
941
|
+
const { breakpoints } = useDContext();
|
|
942
|
+
const mediaQuery = useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
943
|
+
return useMediaQuery(mediaQuery, useListener);
|
|
944
|
+
}
|
|
945
|
+
function useMediaBreakpointUpXs(useListener = false) {
|
|
946
|
+
return useMediaBreakpointUp('xs', useListener);
|
|
947
|
+
}
|
|
948
|
+
function useMediaBreakpointUpSm(useListener = false) {
|
|
949
|
+
return useMediaBreakpointUp('sm', useListener);
|
|
950
|
+
}
|
|
951
|
+
function useMediaBreakpointUpMd(useListener = false) {
|
|
952
|
+
return useMediaBreakpointUp('md', useListener);
|
|
953
|
+
}
|
|
954
|
+
function useMediaBreakpointUpLg(useListener = false) {
|
|
955
|
+
return useMediaBreakpointUp('lg', useListener);
|
|
956
|
+
}
|
|
957
|
+
function useMediaBreakpointUpXl(useListener = false) {
|
|
958
|
+
return useMediaBreakpointUp('xl', useListener);
|
|
959
|
+
}
|
|
960
|
+
function useMediaBreakpointUpXxl(useListener = false) {
|
|
961
|
+
return useMediaBreakpointUp('xxl', useListener);
|
|
962
|
+
}
|
|
963
|
+
|
|
880
964
|
function DInputCounter(_a, ref) {
|
|
881
965
|
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = __rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
882
966
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -906,7 +990,7 @@ function DInputCounter(_a, ref) {
|
|
|
906
990
|
const { iconMap: { input } } = useDContext();
|
|
907
991
|
const iconEnd = useMemo(() => iconEndProp || input.increase, [iconEndProp, input.increase]);
|
|
908
992
|
const iconStart = useMemo(() => iconStartProp || input.decrease, [iconStartProp, input.decrease]);
|
|
909
|
-
return (jsx(
|
|
993
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: inputRef, value: valueString, style: generateStyleVariables, iconStart: iconStart, iconEnd: iconEnd, invalid: internalIsInvalid || invalid, type: "number", onChange: handleOnChange, onWheel: handleOnWheel, onIconStartClick: handleOnIconStartClick, onIconEndClick: handleOnIconEndClick, iconStartAriaLabel: iconStartAriaLabel, iconEndAriaLabel: iconEndAriaLabel }, internalValue === minValue && {
|
|
910
994
|
iconStartDisabled: true,
|
|
911
995
|
}, internalValue === maxValue && {
|
|
912
996
|
iconEndDisabled: true,
|
|
@@ -914,7 +998,6 @@ function DInputCounter(_a, ref) {
|
|
|
914
998
|
}
|
|
915
999
|
const ForwardedDInputCounter = forwardRef(DInputCounter);
|
|
916
1000
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
917
|
-
var DInputCounter$1 = ForwardedDInputCounter;
|
|
918
1001
|
|
|
919
1002
|
/**
|
|
920
1003
|
* @deprecated
|
|
@@ -923,22 +1006,20 @@ function DInputCurrencyBase(_a, ref) {
|
|
|
923
1006
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = __rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
924
1007
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
925
1008
|
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
926
|
-
return (jsx(
|
|
1009
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: inputRef, value: innerValue, onChange: handleOnChange, style: generateStyleVariables, inputMode: "decimal", type: innerType, onFocus: handleOnFocus, onBlur: handleOnBlur, onWheel: handleOnWheel, inputStart: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, inputProps)));
|
|
927
1010
|
}
|
|
928
1011
|
const ForwardedDInputCurrencyBase$1 = forwardRef(DInputCurrencyBase);
|
|
929
1012
|
ForwardedDInputCurrencyBase$1.displayName = 'DInputCurrencyBase';
|
|
930
|
-
var DInputCurrencyBase$1 = ForwardedDInputCurrencyBase$1;
|
|
931
1013
|
|
|
932
1014
|
function DInputCurrency(_a, ref) {
|
|
933
1015
|
var { value, minValue, maxValue, currencyCode, onFocus, onBlur, onChange } = _a, props = __rest(_a, ["value", "minValue", "maxValue", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
934
1016
|
const { currency: currencyOptions } = useDContext();
|
|
935
1017
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
936
1018
|
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
937
|
-
return (jsx(
|
|
1019
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: inputRef, value: innerValue, onChange: handleOnChange, style: generateStyleVariables, inputMode: "decimal", type: innerType, onFocus: handleOnFocus, onBlur: handleOnBlur, onWheel: handleOnWheel, inputStart: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, props)));
|
|
938
1020
|
}
|
|
939
1021
|
const ForwardedDInputCurrencyBase = forwardRef(DInputCurrency);
|
|
940
1022
|
ForwardedDInputCurrencyBase.displayName = 'DInputCurrency';
|
|
941
|
-
var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
942
1023
|
|
|
943
1024
|
/**
|
|
944
1025
|
* @deprecated
|
|
@@ -946,11 +1027,10 @@ var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
|
946
1027
|
function DInputSearch(_a, ref) {
|
|
947
1028
|
var { type, iconEnd: iconEndProp, iconEndAriaLabel = 'search' } = _a, props = __rest(_a, ["type", "iconEnd", "iconEndAriaLabel"]);
|
|
948
1029
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
949
|
-
return (jsx(
|
|
1030
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: inputRef, type: "text", iconEnd: "search", iconEndAriaLabel: iconEndAriaLabel }, props)));
|
|
950
1031
|
}
|
|
951
1032
|
const ForwardedDInputSearch = forwardRef(DInputSearch);
|
|
952
1033
|
ForwardedDInputSearch.displayName = 'DInputSearch';
|
|
953
|
-
var DInputSearch$1 = ForwardedDInputSearch;
|
|
954
1034
|
|
|
955
1035
|
function DInputPassword(_a, ref) {
|
|
956
1036
|
var { onIconEndClick, iconEndAriaLabel = 'show/hide password' } = _a, props = __rest(_a, ["onIconEndClick", "iconEndAriaLabel"]);
|
|
@@ -962,11 +1042,10 @@ function DInputPassword(_a, ref) {
|
|
|
962
1042
|
}, [onIconEndClick]);
|
|
963
1043
|
const { iconMap: { input } } = useDContext();
|
|
964
1044
|
const iconEnd = useMemo(() => (!visible ? input.hide : input.show), [input.hide, input.show, visible]);
|
|
965
|
-
return (jsx(
|
|
1045
|
+
return (jsx(ForwardedDInput, Object.assign({ ref: inputRef, iconEnd: iconEnd, type: !visible ? 'password' : 'text', onIconEndClick: handleOnIconEndClick, iconEndAriaLabel: iconEndAriaLabel }, props)));
|
|
966
1046
|
}
|
|
967
1047
|
const ForwardedDInputPassword = forwardRef(DInputPassword);
|
|
968
1048
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
969
|
-
var DInputPassword$1 = ForwardedDInputPassword;
|
|
970
1049
|
|
|
971
1050
|
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false, characters = 4, innerInputMode = 'text', hint, invalid = false, valid = false, className, style, dataAttributes, onChange, }) {
|
|
972
1051
|
const innerId = useId();
|
|
@@ -1182,7 +1261,6 @@ function DInputRange(_a, ref) {
|
|
|
1182
1261
|
}
|
|
1183
1262
|
const ForwardedDInputRange = forwardRef(DInputRange);
|
|
1184
1263
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1185
|
-
var DInputRange$1 = ForwardedDInputRange;
|
|
1186
1264
|
|
|
1187
1265
|
/**
|
|
1188
1266
|
* @deprecated Please use DListGroup.Item or DListGroupItem instead
|
|
@@ -1405,29 +1483,42 @@ function DProgress({ className, style, currentValue, minValue = 0, maxValue = 10
|
|
|
1405
1483
|
return (jsx("div", Object.assign({ className: classNames('progress', className) }, dataAttributes, { children: 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 }) })));
|
|
1406
1484
|
}
|
|
1407
1485
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
const globalClickHandler = useCallback(() => {
|
|
1413
|
-
if (actionLinkText) {
|
|
1414
|
-
return;
|
|
1486
|
+
function DQuickActionButton({ line1, line2, className, actionIcon, actionIconFamilyClass, actionIconFamilyPrefix, actionIconTheme, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, href, hrefTarget, style, dataAttributes, }) {
|
|
1487
|
+
const Tag = useMemo(() => {
|
|
1488
|
+
if (href) {
|
|
1489
|
+
return 'a';
|
|
1415
1490
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
const actionLinkClickHandler = useCallback(() => {
|
|
1419
|
-
if (!actionLinkText) {
|
|
1420
|
-
return;
|
|
1491
|
+
if (onClick) {
|
|
1492
|
+
return 'button';
|
|
1421
1493
|
}
|
|
1422
|
-
|
|
1423
|
-
}, [
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1494
|
+
return 'div';
|
|
1495
|
+
}, [href, onClick]);
|
|
1496
|
+
const tagProps = useMemo(() => {
|
|
1497
|
+
if (href) {
|
|
1498
|
+
return {
|
|
1499
|
+
className: classNames('d-quick-action-button', 'd-quick-action-button-feedback', className),
|
|
1500
|
+
href,
|
|
1501
|
+
target: hrefTarget,
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
if (onClick) {
|
|
1505
|
+
return {
|
|
1506
|
+
className: classNames('d-quick-action-button', 'd-quick-action-button-feedback', className),
|
|
1507
|
+
onClick,
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
return {
|
|
1511
|
+
className: classNames('d-quick-action-button', className),
|
|
1512
|
+
};
|
|
1513
|
+
}, [
|
|
1514
|
+
className,
|
|
1515
|
+
href,
|
|
1516
|
+
hrefTarget,
|
|
1517
|
+
onClick,
|
|
1518
|
+
]);
|
|
1519
|
+
return (jsxs(Tag, Object.assign({ style: style }, tagProps, dataAttributes, { children: [representativeIcon && (jsx(DIcon, { className: "d-quick-action-button-representative-icon", size: representativeIconHasCircle
|
|
1429
1520
|
? `var(--${PREFIX_BS}quick-action-button-representative-icon-size)`
|
|
1430
|
-
: `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 })] }) }),
|
|
1521
|
+
: `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 })] }) }), actionIcon && (jsx(DIcon, { className: "d-quick-action-button-action-icon", icon: actionIcon, size: `var(--${PREFIX_BS}quick-action-button-action-icon-size)`, theme: actionIconTheme, familyClass: actionIconFamilyClass, familyPrefix: actionIconFamilyPrefix }))] })));
|
|
1431
1522
|
}
|
|
1432
1523
|
|
|
1433
1524
|
/**
|
|
@@ -1727,5 +1818,5 @@ function changeQueryString(values, { useSearch = true, pushState = false, } = {}
|
|
|
1727
1818
|
return searchParams.toString();
|
|
1728
1819
|
}
|
|
1729
1820
|
|
|
1730
|
-
export { DAlert, DAvatar, DBadge, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase,
|
|
1821
|
+
export { DAlert, DAvatar, DBadge, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, ForwardedDInput as DInput, DInputCheck, ForwardedDInputCounter as DInputCounter, ForwardedDInputCurrencyBase as DInputCurrency, ForwardedDInputCurrencyBase$1 as DInputCurrencyBase, ForwardedDInputMask as DInputMask, ForwardedDInputPassword as DInputPassword, DInputPin, ForwardedDInputRange as DInputRange, ForwardedDInputSearch as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListGroup$1 as DListGroup, DListGroupItem, DListItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSelect$1 as DSelect, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTableHead, DTabs$1 as DTabs, DToast$1 as DToast, DToastContainer, DTooltip, changeQueryString, checkMediaQuery, configureI8n as configureI18n, formatCurrency, getCssVariable, getQueryString, subscribeToMediaQuery, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, useMediaBreakpointUpLg, useMediaBreakpointUpMd, useMediaBreakpointUpSm, useMediaBreakpointUpXl, useMediaBreakpointUpXs, useMediaBreakpointUpXxl, useMediaQuery, usePortal, useProvidedRefOrCreate, useStackState, useTabContext };
|
|
1731
1822
|
//# sourceMappingURL=index.esm.js.map
|