@dynamic-framework/ui-react 1.2.2 → 1.3.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/dynamic-ui-all.css +1 -1
- package/dist/css/dynamic-ui-react.css +1 -1
- package/dist/css/dynamic-ui.css +1 -1
- package/dist/index.esm.js +177 -175
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +222 -220
- package/dist/index.js.map +1 -1
- package/dist/types/components/{MBoxFile.d.ts → DBoxFile.d.ts} +1 -1
- package/dist/types/components/{MCard.d.ts → DCard.d.ts} +1 -1
- package/dist/types/components/DCardAccount.d.ts +13 -0
- package/dist/types/components/{MCardBody.d.ts → DCardBody.d.ts} +1 -1
- package/dist/types/components/{MCardFooter.d.ts → DCardFooter.d.ts} +1 -1
- package/dist/types/components/{MCardHeader.d.ts → DCardHeader.d.ts} +1 -1
- package/dist/types/components/{MCarousel.d.ts → DCarousel.d.ts} +1 -1
- package/dist/types/components/{MCarouselSlide.d.ts → DCarouselSlide.d.ts} +1 -1
- package/dist/types/components/DCollapse.d.ts +11 -0
- package/dist/types/components/{banking/MCollapseIconText.d.ts → DCollapseIconText.d.ts} +1 -1
- package/dist/types/components/{MCurrencyText.d.ts → DCurrencyText.d.ts} +1 -1
- package/dist/types/components/{MDatePicker.d.ts → DDatePicker.d.ts} +3 -3
- package/dist/types/components/{MDatePickerHeader.d.ts → DDatePickerHeader.d.ts} +5 -4
- package/dist/types/components/DDatePickerInput.d.ts +8 -0
- package/dist/types/components/DDatePickerTime.d.ts +8 -0
- package/dist/types/components/DFormikInput.d.ts +7 -0
- package/dist/types/components/DFormikInputCurrency.d.ts +7 -0
- package/dist/types/components/{MFormikInputSelect.d.ts → DFormikInputSelect.d.ts} +3 -3
- package/dist/types/components/DInputCurrency.d.ts +9 -0
- package/dist/types/components/{MList.d.ts → DList.d.ts} +1 -1
- package/dist/types/components/{MListItem.d.ts → DListItem.d.ts} +2 -2
- package/dist/types/components/{MListItemMovement.d.ts → DListItemMovement.d.ts} +3 -3
- package/dist/types/components/DMonthPicker.d.ts +7 -0
- package/dist/types/components/{MPaginator.d.ts → DPaginator.d.ts} +4 -4
- package/dist/types/components/DPopover.d.ts +8 -0
- package/dist/types/components/{MSkeleton.d.ts → DSkeleton.d.ts} +1 -1
- package/dist/types/components/{MStepper.d.ts → DStepper.d.ts} +1 -1
- package/dist/types/components/{MTabContent.d.ts → DTabContent.d.ts} +1 -1
- package/dist/types/components/{MTabs.d.ts → DTabs.d.ts} +5 -5
- package/dist/types/components/{MToastContainer.d.ts → DToastContainer.d.ts} +2 -2
- package/dist/types/components/{MTooltip.d.ts → DTooltip.d.ts} +2 -2
- package/dist/types/components/banking/{MPermissionItem.d.ts → DPermissionItem.d.ts} +1 -1
- package/dist/types/components/banking/index.d.ts +1 -2
- package/dist/types/components/index.d.ts +27 -27
- package/dist/types/components/proxies.d.ts +21 -21
- package/dist/types/stories/components/{MBadge.stories.d.ts → DBadge.stories.d.ts} +3 -3
- package/dist/types/stories/components/DBoxFile.stories.d.ts +6 -0
- package/dist/types/stories/components/{MButton.stories.d.ts → DButton.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MCard.stories.d.ts → DCard.stories.d.ts} +3 -3
- package/dist/types/stories/components/DCardAccount.stories.d.ts +6 -0
- package/dist/types/stories/components/{MChip.stories.d.ts → DChip.stories.d.ts} +3 -3
- package/dist/types/stories/components/DCurrencyText.stories.d.ts +6 -0
- package/dist/types/stories/components/{MDatePicker.stories.d.ts → DDatePicker.stories.d.ts} +3 -3
- package/dist/types/stories/components/DFormikInput.stories.d.ts +7 -0
- package/dist/types/stories/components/{MFormikInputCurrency.stories.d.ts → DFormikInputCurrency.stories.d.ts} +3 -3
- package/dist/types/stories/components/DFormikInputSelect.stories.d.ts +7 -0
- package/dist/types/stories/components/{MIcon.stories.d.ts → DIcon.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInput.stories.d.ts → DInput.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCheck.stories.d.ts → DInputCheck.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCounter.stories.d.ts → DInputCounter.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCurrency.stories.d.ts → DInputCurrency.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputCurrencyBase.stories.d.ts → DInputCurrencyBase.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputPassword.stories.d.ts → DInputPassword.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputPin.stories.d.ts → DInputPin.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSearch.stories.d.ts → DInputSearch.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSelect.stories.d.ts → DInputSelect.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MInputSwitch.stories.d.ts → DInputSwitch.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MList.stories.d.ts → DList.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MListItem.stories.d.ts → DListItem.stories.d.ts} +3 -3
- package/dist/types/stories/components/DListItemMovement.stories.d.ts +7 -0
- package/dist/types/stories/components/{MPaginator.stories.d.ts → DPaginator.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MProgressBar.stories.d.ts → DProgress.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionButton.stories.d.ts → DQuickActionButton.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionCheck.stories.d.ts → DQuickActionCheck.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionSelect.stories.d.ts → DQuickActionSelect.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MQuickActionSwitch.stories.d.ts → DQuickActionSwitch.stories.d.ts} +3 -3
- package/dist/types/stories/components/DSkeleton.stories.d.ts +6 -0
- package/dist/types/stories/components/{MStepper.stories.d.ts → DStepper.stories.d.ts} +3 -3
- package/dist/types/stories/components/{MTooltip.stories.d.ts → DTooltip.stories.d.ts} +3 -3
- package/dist/types/stories/constants.d.ts +1 -2
- package/dist/types/stories/hooks/useOffcanvasContext.stories.d.ts +2 -2
- package/dist/types/stories/patterns/{MAlert.stories.d.ts → DAlert.stories.d.ts} +3 -3
- package/dist/types/stories/{components/MCarousel.stories.d.ts → patterns/DCarousel.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MCollapse.stories.d.ts → DCollapse.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/DCollapseIconText.stories.d.ts +6 -0
- package/dist/types/stories/patterns/{MModal.stories.d.ts → DModal.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MOffcanvas.stories.d.ts → DOffcanvas.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MPopover.stories.d.ts → DPopover.stories.d.ts} +3 -3
- package/dist/types/stories/patterns/{MTabs.stories.d.ts → DTabs.stories.d.ts} +3 -3
- package/package.json +3 -3
- package/src/style/components/_+import.scss +15 -12
- package/src/style/components/_d-box-file.scss +66 -0
- package/src/style/components/{_m-card-account.scss → _d-card-account.scss} +1 -1
- package/src/style/components/_d-carousel.scss +44 -0
- package/src/style/components/_d-collapse-icon-text.scss +16 -0
- package/src/style/components/_d-collapse.scss +54 -0
- package/src/style/components/_d-datepicker.scss +224 -0
- package/src/style/components/_d-monthpicker.scss +90 -0
- package/src/style/components/_d-paginator.scss +98 -0
- package/src/style/components/_d-permission-group.scss +39 -0
- package/src/style/components/{_m-popover.scss → _d-popover.scss} +2 -2
- package/src/style/components/_d-stepper.scss +156 -0
- package/src/style/components/_d-tabs.scss +56 -0
- package/src/style/components/_d-timepicker.scss +37 -0
- package/dist/types/components/MCardAccount.d.ts +0 -13
- package/dist/types/components/MCollapse.d.ts +0 -11
- package/dist/types/components/MDatePickerInput.d.ts +0 -9
- package/dist/types/components/MDatePickerTime.d.ts +0 -9
- package/dist/types/components/MFormikInput.d.ts +0 -7
- package/dist/types/components/MFormikInputCurrency.d.ts +0 -7
- package/dist/types/components/MInputCurrency.d.ts +0 -9
- package/dist/types/components/MMonthPicker.d.ts +0 -7
- package/dist/types/components/MPopover.d.ts +0 -8
- package/dist/types/stories/components/MBoxFile.stories.d.ts +0 -6
- package/dist/types/stories/components/MCardAccount.stories.d.ts +0 -6
- package/dist/types/stories/components/MFormikInput.stories.d.ts +0 -7
- package/dist/types/stories/components/MFormikInputSelect.stories.d.ts +0 -7
- package/dist/types/stories/components/MListItemMovement.stories.d.ts +0 -7
- package/dist/types/stories/components/MSkeleton.stories.d.ts +0 -6
- package/dist/types/stories/patterns/MCollapseIconText.stories.d.ts +0 -6
- package/src/style/components/_m-box-file.scss +0 -66
- package/src/style/components/_m-carousel.scss +0 -44
- package/src/style/components/_m-collapse-icon-text.scss +0 -16
- package/src/style/components/_m-collapse.scss +0 -56
- package/src/style/components/_m-datepicker.scss +0 -224
- package/src/style/components/_m-monthpicker.scss +0 -90
- package/src/style/components/_m-paginator.scss +0 -98
- package/src/style/components/_m-stepper.scss +0 -156
- package/src/style/components/_m-tabs.scss +0 -56
- package/src/style/components/_m-timepicker.scss +0 -37
package/dist/index.esm.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
3
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
4
|
+
import { __rest } from 'tslib';
|
|
3
5
|
import DatePicker from 'react-datepicker';
|
|
4
6
|
import { DateTime } from 'luxon';
|
|
5
|
-
import React, { createElement,
|
|
6
|
-
import { defineCustomElement } from '@dynamic-framework/ui/components/
|
|
7
|
-
import { defineCustomElement as defineCustomElement$1 } from '@dynamic-framework/ui/components/
|
|
8
|
-
import { defineCustomElement as defineCustomElement$2 } from '@dynamic-framework/ui/components/
|
|
9
|
-
import { defineCustomElement as defineCustomElement$3 } from '@dynamic-framework/ui/components/
|
|
10
|
-
import { defineCustomElement as defineCustomElement$4 } from '@dynamic-framework/ui/components/
|
|
11
|
-
import { defineCustomElement as defineCustomElement$5 } from '@dynamic-framework/ui/components/
|
|
12
|
-
import { defineCustomElement as defineCustomElement$6 } from '@dynamic-framework/ui/components/
|
|
13
|
-
import { defineCustomElement as defineCustomElement$7 } from '@dynamic-framework/ui/components/
|
|
14
|
-
import { defineCustomElement as defineCustomElement$8 } from '@dynamic-framework/ui/components/
|
|
15
|
-
import { defineCustomElement as defineCustomElement$9 } from '@dynamic-framework/ui/components/
|
|
16
|
-
import { defineCustomElement as defineCustomElement$a } from '@dynamic-framework/ui/components/
|
|
17
|
-
import { defineCustomElement as defineCustomElement$b } from '@dynamic-framework/ui/components/
|
|
18
|
-
import { defineCustomElement as defineCustomElement$c } from '@dynamic-framework/ui/components/
|
|
19
|
-
import { defineCustomElement as defineCustomElement$d } from '@dynamic-framework/ui/components/
|
|
20
|
-
import { defineCustomElement as defineCustomElement$e } from '@dynamic-framework/ui/components/
|
|
21
|
-
import { defineCustomElement as defineCustomElement$f } from '@dynamic-framework/ui/components/
|
|
22
|
-
import { defineCustomElement as defineCustomElement$g } from '@dynamic-framework/ui/components/
|
|
23
|
-
import { defineCustomElement as defineCustomElement$h } from '@dynamic-framework/ui/components/
|
|
24
|
-
import { defineCustomElement as defineCustomElement$i } from '@dynamic-framework/ui/components/
|
|
25
|
-
import { defineCustomElement as defineCustomElement$j } from '@dynamic-framework/ui/components/
|
|
26
|
-
import { defineCustomElement as defineCustomElement$k } from '@dynamic-framework/ui/components/
|
|
27
|
-
import {
|
|
7
|
+
import React, { createElement, createContext, useMemo, useContext, useState, useCallback, useEffect, forwardRef, useImperativeHandle, useRef } from 'react';
|
|
8
|
+
import { defineCustomElement } from '@dynamic-framework/ui/components/d-alert.js';
|
|
9
|
+
import { defineCustomElement as defineCustomElement$1 } from '@dynamic-framework/ui/components/d-badge.js';
|
|
10
|
+
import { defineCustomElement as defineCustomElement$2 } from '@dynamic-framework/ui/components/d-button.js';
|
|
11
|
+
import { defineCustomElement as defineCustomElement$3 } from '@dynamic-framework/ui/components/d-chip.js';
|
|
12
|
+
import { defineCustomElement as defineCustomElement$4 } from '@dynamic-framework/ui/components/d-icon.js';
|
|
13
|
+
import { defineCustomElement as defineCustomElement$5 } from '@dynamic-framework/ui/components/d-input.js';
|
|
14
|
+
import { defineCustomElement as defineCustomElement$6 } from '@dynamic-framework/ui/components/d-input-check.js';
|
|
15
|
+
import { defineCustomElement as defineCustomElement$7 } from '@dynamic-framework/ui/components/d-input-counter.js';
|
|
16
|
+
import { defineCustomElement as defineCustomElement$8 } from '@dynamic-framework/ui/components/d-input-currency-base.js';
|
|
17
|
+
import { defineCustomElement as defineCustomElement$9 } from '@dynamic-framework/ui/components/d-input-password.js';
|
|
18
|
+
import { defineCustomElement as defineCustomElement$a } from '@dynamic-framework/ui/components/d-input-pin.js';
|
|
19
|
+
import { defineCustomElement as defineCustomElement$b } from '@dynamic-framework/ui/components/d-input-search.js';
|
|
20
|
+
import { defineCustomElement as defineCustomElement$c } from '@dynamic-framework/ui/components/d-input-select.js';
|
|
21
|
+
import { defineCustomElement as defineCustomElement$d } from '@dynamic-framework/ui/components/d-input-switch.js';
|
|
22
|
+
import { defineCustomElement as defineCustomElement$e } from '@dynamic-framework/ui/components/d-modal.js';
|
|
23
|
+
import { defineCustomElement as defineCustomElement$f } from '@dynamic-framework/ui/components/d-offcanvas.js';
|
|
24
|
+
import { defineCustomElement as defineCustomElement$g } from '@dynamic-framework/ui/components/d-progress.js';
|
|
25
|
+
import { defineCustomElement as defineCustomElement$h } from '@dynamic-framework/ui/components/d-quick-action-button.js';
|
|
26
|
+
import { defineCustomElement as defineCustomElement$i } from '@dynamic-framework/ui/components/d-quick-action-check.js';
|
|
27
|
+
import { defineCustomElement as defineCustomElement$j } from '@dynamic-framework/ui/components/d-quick-action-select.js';
|
|
28
|
+
import { defineCustomElement as defineCustomElement$k } from '@dynamic-framework/ui/components/d-quick-action-switch.js';
|
|
29
|
+
import { liquidParser, PREFIX_BS, formatCurrency } from '@dynamic-framework/ui';
|
|
28
30
|
export { liquidParser } from '@dynamic-framework/ui';
|
|
29
31
|
import ContentLoader from 'react-content-loader';
|
|
30
32
|
import classNames from 'classnames';
|
|
31
|
-
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
32
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
33
33
|
import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
34
34
|
import { useField } from 'formik';
|
|
35
35
|
import { useDropzone } from 'react-dropzone';
|
|
@@ -243,60 +243,42 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
/* eslint-disable */
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
271
|
-
useEffect(() => {
|
|
272
|
-
if (onChange) {
|
|
273
|
-
onChange(toggle);
|
|
274
|
-
}
|
|
275
|
-
}, [toggle, onChange]);
|
|
276
|
-
useEffect(() => {
|
|
277
|
-
setToggle(defaultCollapsed);
|
|
278
|
-
}, [defaultCollapsed]);
|
|
279
|
-
return (jsxs("div", Object.assign({ id: id, className: classNames('m-collapse collapse-container', className) }, { children: [jsxs("button", Object.assign({ className: "collapse-button", type: "button", onClick: onChangeCollapse }, { children: [jsx("div", Object.assign({ className: "flex-grow-1" }, { children: Component })), jsx(MIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] })), toggle && (jsx("div", Object.assign({ className: classNames({
|
|
280
|
-
'collapse-body': true,
|
|
281
|
-
}), style: {
|
|
282
|
-
[`--${PREFIX_BS}m-collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
283
|
-
} }, { children: children })))] })));
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function MCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, }) {
|
|
287
|
-
return (jsx(MCollapse, Object.assign({ defaultCollapsed: true, className: "m-collapse-icon-text", Component: (jsxs("div", Object.assign({ className: "m-collapse-icon-text-header" }, { children: [jsx(MIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", Object.assign({ className: "m-collapse-icon-text-title" }, { children: title }))] }))) }, { children: children })));
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function MPermissionItem({ permission, permissionState, onChange, onAction = () => { }, }) {
|
|
291
|
-
return (jsxs("div", Object.assign({ role: "button", tabIndex: 0, onKeyDown: () => { }, className: "d-flex permission-item align-items-center", onClick: onAction }, { children: [jsx("span", Object.assign({ className: "flex-grow-1 label" }, { children: permission.label })), permission.type === 'custom' && (jsx(MBadge, { theme: "tertiary", text: permissionState })), jsx(MInputSwitch, { mId: permission.id, isChecked: !!permission.value, isDisabled: !permission.enabled, onMChange: ({ detail: checked }) => onChange(checked) })] })));
|
|
246
|
+
const DAlert = /*@__PURE__*/ createReactComponent('d-alert', undefined, undefined, defineCustomElement);
|
|
247
|
+
const DBadge = /*@__PURE__*/ createReactComponent('d-badge', undefined, undefined, defineCustomElement$1);
|
|
248
|
+
const DButton = /*@__PURE__*/ createReactComponent('d-button', undefined, undefined, defineCustomElement$2);
|
|
249
|
+
const DChip = /*@__PURE__*/ createReactComponent('d-chip', undefined, undefined, defineCustomElement$3);
|
|
250
|
+
const DIcon = /*@__PURE__*/ createReactComponent('d-icon', undefined, undefined, defineCustomElement$4);
|
|
251
|
+
const DInput = /*@__PURE__*/ createReactComponent('d-input', undefined, undefined, defineCustomElement$5);
|
|
252
|
+
const DInputCheck = /*@__PURE__*/ createReactComponent('d-input-check', undefined, undefined, defineCustomElement$6);
|
|
253
|
+
const DInputCounter = /*@__PURE__*/ createReactComponent('d-input-counter', undefined, undefined, defineCustomElement$7);
|
|
254
|
+
const DInputCurrencyBase = /*@__PURE__*/ createReactComponent('d-input-currency-base', undefined, undefined, defineCustomElement$8);
|
|
255
|
+
const DInputPassword = /*@__PURE__*/ createReactComponent('d-input-password', undefined, undefined, defineCustomElement$9);
|
|
256
|
+
const DInputPin = /*@__PURE__*/ createReactComponent('d-input-pin', undefined, undefined, defineCustomElement$a);
|
|
257
|
+
const DInputSearch = /*@__PURE__*/ createReactComponent('d-input-search', undefined, undefined, defineCustomElement$b);
|
|
258
|
+
const DInputSelect = /*@__PURE__*/ createReactComponent('d-input-select', undefined, undefined, defineCustomElement$c);
|
|
259
|
+
const DInputSwitch = /*@__PURE__*/ createReactComponent('d-input-switch', undefined, undefined, defineCustomElement$d);
|
|
260
|
+
const DModal = /*@__PURE__*/ createReactComponent('d-modal', undefined, undefined, defineCustomElement$e);
|
|
261
|
+
const DOffcanvas = /*@__PURE__*/ createReactComponent('d-offcanvas', undefined, undefined, defineCustomElement$f);
|
|
262
|
+
const DProgress = /*@__PURE__*/ createReactComponent('d-progress', undefined, undefined, defineCustomElement$g);
|
|
263
|
+
const DQuickActionButton = /*@__PURE__*/ createReactComponent('d-quick-action-button', undefined, undefined, defineCustomElement$h);
|
|
264
|
+
const DQuickActionCheck = /*@__PURE__*/ createReactComponent('d-quick-action-check', undefined, undefined, defineCustomElement$i);
|
|
265
|
+
const DQuickActionSelect = /*@__PURE__*/ createReactComponent('d-quick-action-select', undefined, undefined, defineCustomElement$j);
|
|
266
|
+
const DQuickActionSwitch = /*@__PURE__*/ createReactComponent('d-quick-action-switch', undefined, undefined, defineCustomElement$k);
|
|
267
|
+
|
|
268
|
+
function DPermissionItem({ permission, permissionState, onChange, onAction = () => { }, }) {
|
|
269
|
+
return (jsxs("div", Object.assign({ role: "button", tabIndex: 0, onKeyDown: () => { }, className: "d-flex permission-item align-items-center", onClick: onAction }, { children: [jsx("span", Object.assign({ className: "flex-grow-1 label" }, { children: permission.label })), permission.type === 'custom' && (jsx(DBadge, { theme: "tertiary", text: permissionState })), jsx(DInputSwitch, { innerId: permission.id, isChecked: !!permission.value, isDisabled: !permission.enabled, onEventChange: ({ detail: checked }) => onChange(checked) })] })));
|
|
292
270
|
}
|
|
293
271
|
|
|
294
272
|
function MPermissionGroup({ title, description, permissionState, permissionList, onChangePermission, onCustomAction = () => { }, }) {
|
|
295
|
-
return (jsxs("div", Object.assign({ className: "row operation-group g-0 mb-3 mb-lg-0" }, { children: [jsxs("div", Object.assign({ className: "col-12 col-lg-4 d-flex flex-column justify-content-center" }, { children: [jsx("h6", Object.assign({ className: "fw-bold mb-3 mb-lg-2" }, { children: title })), jsx("p", Object.assign({ className: "fs-8 d-none d-lg-block m-0" }, { children: description }))] })), jsx("div", Object.assign({ className: "col-12 offset-lg-1 col-lg-7" }, { children: permissionList.map((permission) => (jsx(
|
|
273
|
+
return (jsxs("div", Object.assign({ className: "row operation-group g-0 mb-3 mb-lg-0" }, { children: [jsxs("div", Object.assign({ className: "col-12 col-lg-4 d-flex flex-column justify-content-center" }, { children: [jsx("h6", Object.assign({ className: "fw-bold mb-3 mb-lg-2" }, { children: title })), jsx("p", Object.assign({ className: "fs-8 d-none d-lg-block m-0" }, { children: description }))] })), jsx("div", Object.assign({ className: "col-12 offset-lg-1 col-lg-7" }, { children: permissionList.map((permission) => (jsx(DPermissionItem, { permission: permission, permissionState: permissionState, onChange: (isChecked) => onChangePermission(permission, isChecked), onAction: () => onCustomAction(permission) }, permission.id))) }))] })));
|
|
296
274
|
}
|
|
297
275
|
|
|
298
276
|
function MSummaryCard({ title, description, icon, iconSize, iconTheme, Summary, }) {
|
|
299
|
-
return (jsxs("div", { children: [jsx("h6", Object.assign({ className: "fw-bold fs-6" }, { children: title })), jsx("p", Object.assign({ className: "fs-8" }, { children: description })), jsxs("div", Object.assign({ className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8" }, { children: [jsx(
|
|
277
|
+
return (jsxs("div", { children: [jsx("h6", Object.assign({ className: "fw-bold fs-6" }, { children: title })), jsx("p", Object.assign({ className: "fs-8" }, { children: description })), jsxs("div", Object.assign({ className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8" }, { children: [jsx(DIcon, { icon: icon, theme: iconTheme, size: iconSize }), Summary] }))] }));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function DToastContainer({ style, position = 'top-right', }) {
|
|
281
|
+
return (jsx(ToastContainer, { toastClassName: () => 'shadow-none p-0 cursor-default', position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: Slide, style: style }));
|
|
300
282
|
}
|
|
301
283
|
|
|
302
284
|
const LiquidContext = createContext({
|
|
@@ -548,50 +530,50 @@ function useOffcanvasContext() {
|
|
|
548
530
|
return context;
|
|
549
531
|
}
|
|
550
532
|
|
|
551
|
-
function
|
|
552
|
-
var { value,
|
|
553
|
-
return (jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column
|
|
554
|
-
|
|
555
|
-
}, { type: "time",
|
|
533
|
+
function DDatePickerTime(_a) {
|
|
534
|
+
var { value, onEventChange, innerId, label } = _a, props = __rest(_a, ["value", "onEventChange", "innerId", "label"]);
|
|
535
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center gap-2 flex-column d-datepicker-time" }, { children: [label && (jsx("p", Object.assign({ className: "d-datepicker-time-label" }, { children: label }))), jsx(DInput, Object.assign({}, onEventChange && {
|
|
536
|
+
onEventChange: (time) => onEventChange(time),
|
|
537
|
+
}, { type: "time", innerId: innerId, value: value }, props))] })));
|
|
556
538
|
}
|
|
557
539
|
|
|
558
|
-
function
|
|
559
|
-
var { value,
|
|
540
|
+
function DDatePickerInput(_a, ref) {
|
|
541
|
+
var { value, onEventClick, innerId, iconEnd } = _a, props = __rest(_a, ["value", "onEventClick", "innerId", "iconEnd"]);
|
|
560
542
|
useImperativeHandle(ref, () => ({}), []);
|
|
561
|
-
return (jsx("div", Object.assign({ role: "button", onClick:
|
|
543
|
+
return (jsx("div", Object.assign({ role: "button", onClick: onEventClick, onKeyDown: () => { }, tabIndex: -1 }, { children: jsx(DInput, Object.assign({ isReadOnly: true, type: "text", innerId: innerId, value: value, onEventIconEndClick: onEventClick, iconEnd: iconEnd }, props)) })));
|
|
562
544
|
}
|
|
563
|
-
var
|
|
545
|
+
var DDatePickerInput$1 = forwardRef(DDatePickerInput);
|
|
564
546
|
|
|
565
|
-
function
|
|
566
|
-
var {
|
|
547
|
+
function DMonthPicker(_a) {
|
|
548
|
+
var { onEventChangeDate, date } = _a, props = __rest(_a, ["onEventChangeDate", "date"]);
|
|
567
549
|
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
568
550
|
const { language } = useLiquidContext();
|
|
569
551
|
const lang = language || 'en';
|
|
570
|
-
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "
|
|
571
|
-
|
|
572
|
-
}, customInput: (jsx("p", Object.assign({ className: "fw-bold text-capitalize" }, { children: DateTime.fromISO(date).setLocale(lang).toFormat('MMMM yyyy') }))), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between gap-4 fs-6 bg-dark" }, { children: [jsx(
|
|
552
|
+
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: dateJS(date), calendarClassName: "d-month-picker", onChange: (value) => {
|
|
553
|
+
onEventChangeDate(value);
|
|
554
|
+
}, customInput: (jsx("p", Object.assign({ className: "fw-bold text-capitalize" }, { children: DateTime.fromISO(date).setLocale(lang).toFormat('MMMM yyyy') }))), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between gap-4 fs-6 bg-dark" }, { children: [jsx(DButton, { iconStart: "chevron-left", size: "sm", variant: "link", theme: "light", onEventClick: decreaseYear, isDisabled: prevYearButtonDisabled }), jsx("p", Object.assign({ className: "fs-6 fw-bold" }, { children: monthDate.getFullYear() })), jsx(DButton, { iconStart: "chevron-right", size: "sm", variant: "link", theme: "light", onEventClick: increaseYear, isDisabled: nextYearButtonDisabled })] }))) }, props)));
|
|
573
555
|
}
|
|
574
556
|
|
|
575
|
-
function
|
|
557
|
+
function DDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, decreaseMonthIcon, increaseMonthIcon, iconSize, buttonVariant, buttonTheme, }) {
|
|
576
558
|
const { language } = useLiquidContext();
|
|
577
559
|
const lang = language || 'en';
|
|
578
|
-
return (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between
|
|
560
|
+
return (jsxs("div", Object.assign({ className: "d-flex align-items-center justify-content-between d-datepicker-header" }, { children: [jsx(DButton, { iconStart: decreaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onEventClick: decreaseMonth, isDisabled: prevMonthButtonDisabled }), jsx(DMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, { date: monthDate.toISOString(), onEventChangeDate: (value) => {
|
|
579
561
|
if (value) {
|
|
580
562
|
changeMonth(DateTime.fromJSDate(value).month - 1);
|
|
581
563
|
changeYear(DateTime.fromJSDate(value).year);
|
|
582
564
|
}
|
|
583
|
-
} }, lang && { locale: lang })), jsx(
|
|
565
|
+
} }, lang && { locale: lang })), jsx(DButton, { iconStart: increaseMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onEventClick: increaseMonth, isDisabled: nextMonthButtonDisabled })] })));
|
|
584
566
|
}
|
|
585
567
|
|
|
586
|
-
function
|
|
587
|
-
var {
|
|
568
|
+
function DDatePicker(_a) {
|
|
569
|
+
var { onEventChangeDate, date, selectsRange, withMonthSelector, inputLabel, inputIcon = 'calendar', inputId = 'input-calendar', timeId = 'input-time', timeLabel, headerDecreaseMonthIcon = 'chevron-left', headerIncreaseMonthIcon = 'chevron-right', headerIconSize = 'sm', headerButtonVariant = 'link', headerButtonTheme = 'dark' } = _a, props = __rest(_a, ["onEventChangeDate", "date", "selectsRange", "withMonthSelector", "inputLabel", "inputIcon", "inputId", "timeId", "timeLabel", "headerDecreaseMonthIcon", "headerIncreaseMonthIcon", "headerIconSize", "headerButtonVariant", "headerButtonTheme"]);
|
|
588
570
|
const dateJS = (value) => DateTime.fromISO(value).toJSDate();
|
|
589
571
|
const { language } = useLiquidContext();
|
|
590
572
|
const lang = language || 'en';
|
|
591
573
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
592
|
-
const InputPicker = forwardRef(({ value, onClick }, ref) => (jsx(
|
|
593
|
-
const TimeInputPicker = useCallback(({ value, onChange }) => (jsx(
|
|
594
|
-
const DatePickerHeader = useCallback((headerProps) => (jsx(
|
|
574
|
+
const InputPicker = forwardRef(({ value, onClick }, ref) => (jsx(DDatePickerInput$1, { label: inputLabel, innerId: inputId, iconEnd: inputIcon, value: value, onEventClick: onClick, ref: ref })));
|
|
575
|
+
const TimeInputPicker = useCallback(({ value, onChange }) => (jsx(DDatePickerTime, { onEventChange: onChange, value: value, label: timeLabel, innerId: timeId })), [timeLabel, timeId]);
|
|
576
|
+
const DatePickerHeader = useCallback((headerProps) => (jsx(DDatePickerHeader, Object.assign({}, headerProps, { decreaseMonthIcon: headerDecreaseMonthIcon, increaseMonthIcon: headerIncreaseMonthIcon, iconSize: headerIconSize, buttonVariant: headerButtonVariant, buttonTheme: headerButtonTheme, withMonthSelector: !!withMonthSelector }))), [headerButtonTheme,
|
|
595
577
|
headerButtonVariant,
|
|
596
578
|
headerDecreaseMonthIcon,
|
|
597
579
|
headerIconSize,
|
|
@@ -599,11 +581,11 @@ function MDatePicker(_a) {
|
|
|
599
581
|
withMonthSelector,
|
|
600
582
|
]);
|
|
601
583
|
return (jsx(DatePicker, Object.assign({ selected: dateJS(date), calendarClassName: "m-date-picker", onChange: (value) => {
|
|
602
|
-
|
|
584
|
+
onEventChangeDate(value);
|
|
603
585
|
}, renderCustomHeader: (headerProps) => jsx(DatePickerHeader, Object.assign({}, headerProps)), customInput: jsx(InputPicker, {}), customTimeInput: jsx(TimeInputPicker, {}), selectsRange: selectsRange }, lang && { locale: lang }, props)));
|
|
604
586
|
}
|
|
605
587
|
|
|
606
|
-
function
|
|
588
|
+
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
607
589
|
const innerBackgroundColor = useMemo(() => {
|
|
608
590
|
if (backgroundColor) {
|
|
609
591
|
return backgroundColor;
|
|
@@ -622,14 +604,14 @@ function MSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, child
|
|
|
622
604
|
}
|
|
623
605
|
|
|
624
606
|
const TabContext = createContext(undefined);
|
|
625
|
-
function
|
|
607
|
+
function DTabs({ children, defaultSelected, onEventChange, options, className, isVertical, }) {
|
|
626
608
|
const [selected, setSelected] = useState(defaultSelected);
|
|
627
609
|
const onSelect = useCallback((option) => {
|
|
628
610
|
if (option.tab) {
|
|
629
611
|
setSelected(option.tab);
|
|
630
612
|
}
|
|
631
|
-
|
|
632
|
-
}, [
|
|
613
|
+
onEventChange(option);
|
|
614
|
+
}, [onEventChange]);
|
|
633
615
|
useEffect(() => {
|
|
634
616
|
setSelected(defaultSelected);
|
|
635
617
|
}, [defaultSelected]);
|
|
@@ -638,8 +620,8 @@ function MTabs({ children, defaultSelected, onChange, options, className, isVert
|
|
|
638
620
|
isSelected,
|
|
639
621
|
}), [isSelected]);
|
|
640
622
|
return (jsx(TabContext.Provider, Object.assign({ value: value }, { children: jsxs("div", Object.assign({ className: classNames({
|
|
641
|
-
'
|
|
642
|
-
'
|
|
623
|
+
'd-tabs': true,
|
|
624
|
+
'd-tabs-vertical': isVertical,
|
|
643
625
|
}) }, { children: [jsx("nav", Object.assign({ className: "nav" }, { children: options.map((option) => (jsx("button", Object.assign({ id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
644
626
|
active: option.tab === selected,
|
|
645
627
|
}, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.isDisabled, onClick: () => onSelect(option) }, { children: option.label }), option.label))) })), jsx("div", Object.assign({ className: "tab-content" }, { children: children }))] })) })));
|
|
@@ -652,7 +634,7 @@ function useTabContext() {
|
|
|
652
634
|
return context;
|
|
653
635
|
}
|
|
654
636
|
|
|
655
|
-
function
|
|
637
|
+
function DTabContent({ tab, children }) {
|
|
656
638
|
const { isSelected } = useTabContext();
|
|
657
639
|
if (!isSelected(tab)) {
|
|
658
640
|
return null;
|
|
@@ -660,19 +642,17 @@ function MTabContent({ tab, children }) {
|
|
|
660
642
|
return (jsx("div", Object.assign({ className: "tab-pane fade show active", id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab` }, { children: children })));
|
|
661
643
|
}
|
|
662
644
|
|
|
663
|
-
function
|
|
664
|
-
return (jsx(ToastContainer, { toastClassName: () => 'shadow-none p-0 cursor-default', position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: Slide, style: style }));
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
function MPopover({ children, renderComponent, isOpen, setIsOpen = () => { }, }) {
|
|
645
|
+
function DPopover({ children, renderComponent, isOpen, setEventIsOpen, }) {
|
|
668
646
|
const [innerIsOpen, setInnerIsOpen] = useState(false);
|
|
669
647
|
useEffect(() => {
|
|
670
648
|
setInnerIsOpen(isOpen);
|
|
671
649
|
}, [isOpen]);
|
|
672
650
|
const onOpenChange = useCallback((value) => {
|
|
673
651
|
setInnerIsOpen(value);
|
|
674
|
-
|
|
675
|
-
|
|
652
|
+
if (setEventIsOpen) {
|
|
653
|
+
setEventIsOpen(value);
|
|
654
|
+
}
|
|
655
|
+
}, [setEventIsOpen]);
|
|
676
656
|
const { refs, floatingStyles, context } = useFloating({
|
|
677
657
|
open: innerIsOpen,
|
|
678
658
|
onOpenChange,
|
|
@@ -692,7 +672,7 @@ function MPopover({ children, renderComponent, isOpen, setIsOpen = () => { }, })
|
|
|
692
672
|
role,
|
|
693
673
|
]);
|
|
694
674
|
const headingId = useId();
|
|
695
|
-
return (jsxs("div", Object.assign({ className: "
|
|
675
|
+
return (jsxs("div", Object.assign({ className: "d-popover" }, { children: [jsx("div", Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: renderComponent(innerIsOpen) })), innerIsOpen && (jsx(FloatingFocusManager, Object.assign({ context: context, modal: false }, { children: jsx("div", Object.assign({ className: "d-popover-content", ref: refs.setFloating, style: floatingStyles, "aria-labelledby": headingId }, getFloatingProps(), { children: children })) })))] })));
|
|
696
676
|
}
|
|
697
677
|
|
|
698
678
|
function useFormatCurrency(...args) {
|
|
@@ -705,45 +685,45 @@ function useFormatCurrency(...args) {
|
|
|
705
685
|
};
|
|
706
686
|
}
|
|
707
687
|
|
|
708
|
-
function
|
|
688
|
+
function DCurrencyText({ value, className, }) {
|
|
709
689
|
const { values: [valueFormatted] } = useFormatCurrency(value);
|
|
710
690
|
return (jsx("span", Object.assign({ className: className }, { children: valueFormatted })));
|
|
711
691
|
}
|
|
712
692
|
|
|
713
|
-
function
|
|
693
|
+
function DFormikInput(_a) {
|
|
714
694
|
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
715
695
|
const [field, meta, helpers] = useField(name);
|
|
716
|
-
return (jsx(
|
|
696
|
+
return (jsx(DInput, Object.assign({}, props, { name: field.name, value: field.value, onEventChange: ({ detail }) => helpers.setValue(detail), onEventBlur: ({ detail }) => field.onBlur(detail), isInvalid: !!meta.error, hint: meta.error || hint })));
|
|
717
697
|
}
|
|
718
698
|
|
|
719
|
-
function
|
|
699
|
+
function DFormikInputSelect(_a) {
|
|
720
700
|
var { name, labelExtractor = (item) => item === null || item === void 0 ? void 0 : item.label, valueExtractor = (item) => item === null || item === void 0 ? void 0 : item.value } = _a, props = __rest(_a, ["name", "labelExtractor", "valueExtractor"]);
|
|
721
701
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
722
702
|
const [field, , helpers] = useField(name);
|
|
723
|
-
return (jsx(
|
|
703
|
+
return (jsx(DInputSelect, Object.assign({}, props, { name: field.name, selectedOption: field.value, labelExtractor: labelExtractor, valueExtractor: valueExtractor, onEventChange: ({ detail }) => helpers.setValue(detail), onEventBlur: ({ detail }) => field.onBlur(detail) })));
|
|
724
704
|
}
|
|
725
705
|
|
|
726
706
|
const TOOLTIP_FONT_SIZE_BY_SIZE = {
|
|
727
|
-
sm: `var(--${PREFIX_BS}ref-fs-
|
|
707
|
+
sm: `var(--${PREFIX_BS}ref-fs-small)`,
|
|
728
708
|
default: `var(--${PREFIX_BS}body-font-size)`,
|
|
729
709
|
lg: `var(--${PREFIX_BS}ref-fs-6)`,
|
|
730
710
|
};
|
|
731
711
|
const ARROW_WIDTH = 8;
|
|
732
712
|
const ARROW_HEIGHT = 4;
|
|
733
713
|
const GAP = 2;
|
|
734
|
-
function
|
|
714
|
+
function DTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP, padding, withFocus = false, withClick = false, withHover = true, isOpen = false, placement = 'top', size, Component, children, }) {
|
|
735
715
|
const [open, setOpen] = useState(isOpen);
|
|
736
716
|
const styleVariables = useMemo(() => {
|
|
737
717
|
const defaultFontSize = size
|
|
738
718
|
? TOOLTIP_FONT_SIZE_BY_SIZE[size]
|
|
739
719
|
: TOOLTIP_FONT_SIZE_BY_SIZE.default;
|
|
740
720
|
return {
|
|
741
|
-
background: `var(--${PREFIX_BS}
|
|
742
|
-
borderRadius: `var(--${PREFIX_BS}
|
|
743
|
-
color: `var(--${PREFIX_BS}
|
|
744
|
-
fontSize: `var(--${PREFIX_BS}
|
|
745
|
-
padding: `var(--${PREFIX_BS}
|
|
746
|
-
maxWidth: `var(--${PREFIX_BS}
|
|
721
|
+
background: `var(--${PREFIX_BS}tooltip-bg, var(--${PREFIX_BS}tooltip-component-bg, var(--${PREFIX_BS}secondary)))`,
|
|
722
|
+
borderRadius: `var(--${PREFIX_BS}tooltip-border-radius, var(--${PREFIX_BS}tooltip-component-border-radius, var(--${PREFIX_BS}border-radius)))`,
|
|
723
|
+
color: `var(--${PREFIX_BS}tooltip-color, var(--${PREFIX_BS}tooltip-component-color, var(--${PREFIX_BS}white)))`,
|
|
724
|
+
fontSize: `var(--${PREFIX_BS}tooltip-font-size, var(--${PREFIX_BS}tooltip-component-font-size, ${defaultFontSize}))`,
|
|
725
|
+
padding: `var(--${PREFIX_BS}tooltip-padding, var(--${PREFIX_BS}tooltip-component-padding, var(--${PREFIX_BS}ref-spacer-2)))`,
|
|
726
|
+
maxWidth: `var(--${PREFIX_BS}tooltip-max-width, var(--${PREFIX_BS}tooltip-component-max-width, 300px))`,
|
|
747
727
|
};
|
|
748
728
|
}, [size]);
|
|
749
729
|
const arrowRef = useRef(null);
|
|
@@ -780,64 +760,82 @@ function MTooltip({ classNameContainer, className, offSet = ARROW_HEIGHT + GAP,
|
|
|
780
760
|
}, width: ARROW_WIDTH, height: ARROW_HEIGHT }), children] }))) })] }));
|
|
781
761
|
}
|
|
782
762
|
|
|
783
|
-
function
|
|
784
|
-
|
|
763
|
+
function DCollapse({ id, className, Component, hasSeparator = false, defaultCollapsed = false, onEventChange, children, }) {
|
|
764
|
+
const [toggle, setToggle] = useState(defaultCollapsed);
|
|
765
|
+
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
766
|
+
useEffect(() => {
|
|
767
|
+
if (onEventChange) {
|
|
768
|
+
onEventChange(toggle);
|
|
769
|
+
}
|
|
770
|
+
}, [toggle, onEventChange]);
|
|
771
|
+
useEffect(() => {
|
|
772
|
+
setToggle(defaultCollapsed);
|
|
773
|
+
}, [defaultCollapsed]);
|
|
774
|
+
return (jsxs("div", Object.assign({ id: id, className: classNames('collapse-container', className) }, { children: [jsxs("button", Object.assign({ className: "collapse-button", type: "button", onClick: onChangeCollapse }, { children: [jsx("div", Object.assign({ className: "flex-grow-1" }, { children: Component })), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] })), toggle && (jsx("div", Object.assign({ className: classNames({
|
|
775
|
+
'collapse-body': true,
|
|
776
|
+
}), style: {
|
|
777
|
+
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
778
|
+
} }, { children: children })))] })));
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function DInputCurrency(_a) {
|
|
782
|
+
var { onEventChange, onEventBlur, onEventFocus } = _a, otherProps = __rest(_a, ["onEventChange", "onEventBlur", "onEventFocus"]);
|
|
785
783
|
const { currency } = useLiquidContext();
|
|
786
|
-
return (jsx(
|
|
787
|
-
|
|
788
|
-
},
|
|
789
|
-
|
|
784
|
+
return (jsx(DInputCurrencyBase, Object.assign({ currencyOptions: currency, onEventChange: ({ detail }) => onEventChange(detail) }, onEventBlur && {
|
|
785
|
+
onEventBlur: ({ detail }) => onEventBlur(detail),
|
|
786
|
+
}, onEventFocus && {
|
|
787
|
+
onEventFocus: ({ detail }) => onEventFocus(detail),
|
|
790
788
|
}, otherProps)));
|
|
791
789
|
}
|
|
792
790
|
|
|
793
|
-
function
|
|
791
|
+
function DBoxFile(_a) {
|
|
794
792
|
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, isDisabled = false, children } = _a, dropzoneOptions = __rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "isDisabled", "children"]);
|
|
795
793
|
const { acceptedFiles, getRootProps, getInputProps, } = useDropzone(Object.assign({ disabled: isDisabled }, dropzoneOptions));
|
|
796
|
-
return (jsxs("section", Object.assign({ className: classNames('
|
|
797
|
-
'
|
|
794
|
+
return (jsxs("section", Object.assign({ className: classNames('d-box-file', {
|
|
795
|
+
'd-box-file-selected': !!acceptedFiles.length,
|
|
798
796
|
}) }, { children: [jsxs("div", Object.assign({}, getRootProps({
|
|
799
|
-
className: classNames('
|
|
797
|
+
className: classNames('d-box-file-dropzone', {
|
|
800
798
|
disabled: isDisabled,
|
|
801
799
|
}),
|
|
802
|
-
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(
|
|
800
|
+
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsx("div", Object.assign({ className: "d-box-content" }, { children: children }))] })), !!acceptedFiles.length && (jsx("aside", Object.assign({ className: "d-box-files" }, { children: acceptedFiles.map((file) => (jsx("div", Object.assign({ className: "d-box-files-text" }, { children: `${file.name} - ${file.size} bytes` }), file.name))) })))] })));
|
|
803
801
|
}
|
|
804
802
|
|
|
805
|
-
function
|
|
803
|
+
function DCarousel(_a) {
|
|
806
804
|
var { children, className, options } = _a, props = __rest(_a, ["children", "className", "options"]);
|
|
807
|
-
return (jsx(Splide, Object.assign({ className: classNames('
|
|
805
|
+
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), options: Object.assign(Object.assign({}, options), { classes: {
|
|
808
806
|
// Arrows
|
|
809
|
-
arrows: 'splide__arrows
|
|
810
|
-
arrow: 'splide__arrow
|
|
811
|
-
prev: 'splide__arrow--prev
|
|
812
|
-
next: 'splide__arrow--next
|
|
807
|
+
arrows: 'splide__arrows d-carousel-arrows',
|
|
808
|
+
arrow: 'splide__arrow d-carousel-arrow',
|
|
809
|
+
prev: 'splide__arrow--prev d-carousel-arrow-prev',
|
|
810
|
+
next: 'splide__arrow--next d-carousel-arrow-next',
|
|
813
811
|
// Paginator
|
|
814
|
-
pagination: 'splide__pagination
|
|
815
|
-
page: 'splide__pagination__page
|
|
812
|
+
pagination: 'splide__pagination d-carousel-pagination',
|
|
813
|
+
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
816
814
|
} }) }, props, { children: children })));
|
|
817
815
|
}
|
|
818
816
|
|
|
819
|
-
function
|
|
817
|
+
function DCarouselSlide(_a) {
|
|
820
818
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
821
|
-
return (jsx(SplideSlide, Object.assign({ className: classNames('
|
|
819
|
+
return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
822
820
|
}
|
|
823
821
|
|
|
824
|
-
function
|
|
822
|
+
function DList({ children, className, isFlush = false, isNumbered = false, isHorizontal = false, horizontalBreakpoint, }) {
|
|
825
823
|
if (isFlush && isHorizontal) {
|
|
826
824
|
throw new Error("Horizontal and Flush props don't work together");
|
|
827
825
|
}
|
|
828
|
-
return (jsx("div", Object.assign({ className: classNames('
|
|
826
|
+
return (jsx("div", Object.assign({ className: classNames('list-group', {
|
|
829
827
|
'list-group-flush': isFlush && !isHorizontal,
|
|
830
828
|
'list-group-numbered': isNumbered,
|
|
831
829
|
'list-group-horizontal': isHorizontal && !horizontalBreakpoint,
|
|
832
830
|
}, (isHorizontal && horizontalBreakpoint) && `list-group-horizontal-${horizontalBreakpoint}`, className) }, { children: children })));
|
|
833
831
|
}
|
|
834
832
|
|
|
835
|
-
function
|
|
836
|
-
const Tag = useMemo(() => (
|
|
833
|
+
function DListItem({ children, className, isActive = false, isDisabled = false, theme, onEventClick, }) {
|
|
834
|
+
const Tag = useMemo(() => (onEventClick ? 'button' : 'div'), [onEventClick]);
|
|
837
835
|
return (jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
838
|
-
onClick:
|
|
836
|
+
onClick: onEventClick,
|
|
839
837
|
type: 'button',
|
|
840
|
-
}, { className: classNames('
|
|
838
|
+
}, { className: classNames('list-group-item list-group-item-action', theme ? `list-group-item-${theme}` : undefined, className, {
|
|
841
839
|
active: isActive,
|
|
842
840
|
disabled: isDisabled,
|
|
843
841
|
}) }, isActive && { 'aria-current': true }, { children: children })));
|
|
@@ -845,7 +843,7 @@ function MListItem({ children, className, isActive = false, isDisabled = false,
|
|
|
845
843
|
|
|
846
844
|
function useToast() {
|
|
847
845
|
const toast$1 = useCallback((message, { position = 'top-right', type = 'info', showClose = true, autoClose = false, } = {}) => {
|
|
848
|
-
toast(({ closeToast }) => (jsx(
|
|
846
|
+
toast(({ closeToast }) => (jsx(DAlert, Object.assign({ type: type, showClose: showClose, onEventClose: closeToast }, { children: message }))), {
|
|
849
847
|
transition: Slide,
|
|
850
848
|
position,
|
|
851
849
|
autoClose,
|
|
@@ -919,7 +917,7 @@ function useScreenshotWebShare() {
|
|
|
919
917
|
};
|
|
920
918
|
}
|
|
921
919
|
|
|
922
|
-
function
|
|
920
|
+
function DListItemMovement(_a) {
|
|
923
921
|
var { description, date, amount, classNameMovement } = _a, props = __rest(_a, ["description", "date", "amount", "classNameMovement"]);
|
|
924
922
|
const { format } = useFormatCurrency();
|
|
925
923
|
const value = useMemo(() => {
|
|
@@ -935,51 +933,55 @@ function MListItemMovement(_a) {
|
|
|
935
933
|
valueFormatted,
|
|
936
934
|
};
|
|
937
935
|
}, [format, amount]);
|
|
938
|
-
return (jsx(
|
|
936
|
+
return (jsx(DListItem, Object.assign({}, props, { children: jsxs("div", Object.assign({ className: classNames('d-flex justify-content-between align-items-center p-3 gap-3', classNameMovement) }, { children: [jsxs("div", Object.assign({ className: "d-flex flex-column gap-1" }, { children: [jsx("span", Object.assign({ className: "fs-6" }, { children: description })), jsx("span", Object.assign({ className: "sp text-gray-700" }, { children: date }))] })), jsx("span", Object.assign({ className: classNames('fs-6', value.theme) }, { children: value.valueFormatted }))] })) })));
|
|
939
937
|
}
|
|
940
938
|
|
|
941
|
-
function
|
|
939
|
+
function DStepper({ options, currentStep, successIcon = 'check', isVertical = false, }) {
|
|
942
940
|
return (jsx("div", Object.assign({ className: classNames({
|
|
943
|
-
'
|
|
941
|
+
'd-stepper': true,
|
|
944
942
|
'is-vertical': isVertical,
|
|
945
|
-
}) }, { children: options.map(({ label, value }) => (jsxs("div", Object.assign({ className: "
|
|
946
|
-
'
|
|
947
|
-
'
|
|
948
|
-
'
|
|
943
|
+
}) }, { children: options.map(({ label, value }) => (jsxs("div", Object.assign({ className: "d-step" }, { children: [jsx("div", Object.assign({ className: "d-step-value" }, { children: jsx("div", Object.assign({ className: classNames({
|
|
944
|
+
'd-step-icon-container': true,
|
|
945
|
+
'd-step-check': value < currentStep,
|
|
946
|
+
'd-step-current': value === currentStep,
|
|
949
947
|
}) }, { children: value < currentStep
|
|
950
|
-
? (jsx(
|
|
951
|
-
: value })) })), jsx("div", Object.assign({ className: "
|
|
948
|
+
? (jsx(DIcon, { icon: successIcon, innerClass: "d-step-icon" }))
|
|
949
|
+
: value })) })), jsx("div", Object.assign({ className: "d-step-label" }, { children: label }))] }), label))) })));
|
|
952
950
|
}
|
|
953
951
|
|
|
954
|
-
function
|
|
952
|
+
function DFormikInputCurrency(_a) {
|
|
955
953
|
var { name, hint } = _a, props = __rest(_a, ["name", "hint"]);
|
|
956
954
|
const [field, meta, helpers] = useField(name);
|
|
957
|
-
return (jsx(
|
|
955
|
+
return (jsx(DInputCurrency, Object.assign({}, props, { name: field.name, value: field.value, onEventChange: (value) => helpers.setValue(value), onEventBlur: (value) => field.onBlur(value), isInvalid: !!meta.error, hint: (meta === null || meta === void 0 ? void 0 : meta.error) || hint })));
|
|
958
956
|
}
|
|
959
957
|
|
|
960
|
-
function
|
|
958
|
+
function DCard({ className, style, children, }) {
|
|
961
959
|
return (jsx("div", Object.assign({ style: style, className: classNames('card', className) }, { children: children })));
|
|
962
960
|
}
|
|
963
961
|
|
|
964
|
-
function
|
|
962
|
+
function DCardBody({ className, children, }) {
|
|
965
963
|
return (jsx("div", Object.assign({ className: classNames('card-body', className) }, { children: children })));
|
|
966
964
|
}
|
|
967
965
|
|
|
968
|
-
function
|
|
969
|
-
return (jsx(
|
|
966
|
+
function DCardAccount({ className, icon, theme, name, number, balance, balanceText, onEventClick, actionText, }) {
|
|
967
|
+
return (jsx(DCard, Object.assign({ className: classNames('d-card-account', className) }, { children: jsxs(DCardBody, { children: [jsxs("div", Object.assign({ className: "d-flex gap-3 align-items-center" }, { children: [jsx(DIcon, { icon: icon, hasCircle: true, theme: theme, size: "1.5rem" }), jsxs("div", Object.assign({ className: "d-block flex-grow-1" }, { children: [jsx("p", Object.assign({ className: "text-gray-700" }, { children: name })), jsx("small", Object.assign({ className: "text-gray" }, { children: number }))] }))] })), jsxs("div", Object.assign({ className: "d-block" }, { children: [jsx("p", Object.assign({ className: "fw-bold fs-6 text-body" }, { children: balance })), jsx("small", Object.assign({ className: "text-gray-700" }, { children: balanceText }))] })), jsx("div", Object.assign({ className: "d-flex justify-content-end" }, { children: jsx(DButton, { text: actionText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onEventClick: onEventClick }) }))] }) })));
|
|
970
968
|
}
|
|
971
969
|
|
|
972
|
-
function
|
|
970
|
+
function DCardHeader({ className, children, }) {
|
|
973
971
|
return (jsx("div", Object.assign({ className: classNames('card-header', className) }, { children: children })));
|
|
974
972
|
}
|
|
975
973
|
|
|
976
|
-
function
|
|
974
|
+
function DCardFooter({ className, children, }) {
|
|
977
975
|
return (jsx("div", Object.assign({ className: classNames('card-footer', className) }, { children: children })));
|
|
978
976
|
}
|
|
979
977
|
|
|
980
|
-
function
|
|
981
|
-
|
|
982
|
-
|
|
978
|
+
function DCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, }) {
|
|
979
|
+
return (jsx(DCollapse, Object.assign({ defaultCollapsed: true, className: "d-collapse-icon-text", Component: (jsxs("div", Object.assign({ className: "d-collapse-icon-text-header" }, { children: [jsx(DIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", Object.assign({ className: "d-collapse-icon-text-title" }, { children: title }))] }))) }, { children: children })));
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function DPaginator(_a) {
|
|
983
|
+
var { className, nextLabel, previousLabel, showArrows = true, page, onEventPageChange } = _a, props = __rest(_a, ["className", "nextLabel", "previousLabel", "showArrows", "page", "onEventPageChange"]);
|
|
984
|
+
return (jsx(ResponsivePagination, Object.assign({ extraClassName: classNames('pagination', className), nextClassName: classNames('arrow arrow-next', !nextLabel && 'no-label'), nextLabel: nextLabel, previousClassName: classNames('arrow arrow-prev', !previousLabel && 'no-label'), previousLabel: previousLabel, renderNav: showArrows, current: page, onPageChange: onEventPageChange }, props)));
|
|
983
985
|
}
|
|
984
986
|
|
|
985
987
|
const LANG = liquidParser.parse('{{site.language}}');
|
|
@@ -997,5 +999,5 @@ async function configureI8n(resources, _a = {}) {
|
|
|
997
999
|
.then((t) => t);
|
|
998
1000
|
}
|
|
999
1001
|
|
|
1000
|
-
export {
|
|
1002
|
+
export { DAlert, DBadge, DBoxFile, DButton, DCard, DCardAccount, DCardBody, DCardFooter, DCardHeader, DCarousel, DCarouselSlide, DChip, DCollapse, DCollapseIconText, DCurrencyText, DDatePicker, DFormikInput, DFormikInputCurrency, DFormikInputSelect, DIcon, DInput, DInputCheck, DInputCounter, DInputCurrency, DInputCurrencyBase, DInputPassword, DInputPin, DInputSearch, DInputSelect, DInputSwitch, DList, DListItem, DListItemMovement, DModal, DOffcanvas, DPaginator, DPermissionItem, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSkeleton, DStepper, DTabContent, DTabs, DToastContainer, DTooltip, LiquidContext$1 as LiquidContext, LiquidContextProvider, MPermissionGroup, MSummaryCard, ModalContext, ModalContextProvider, OffcanvasContext, OffcanvasContextProvider, configureI8n as configureI18n, useFormatCurrency, useLiquidContext, useModalContext, useOffcanvasContext, useScreenshot, useScreenshotDownload, useScreenshotWebShare, useTabContext, useToast };
|
|
1001
1003
|
//# sourceMappingURL=index.esm.js.map
|