@m4l/components 9.1.128 → 9.1.130
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/.storybook/utils/getStylesColorsByMode.d.ts +20 -20
- package/@types/types.d.ts +8 -5
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +3 -3
- package/components/AppBar/slots/AppBarSlots.d.ts +1 -1
- package/components/Chip/slots/ChipSlots.d.ts +1 -1
- package/components/Color/slots/ColorSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.d.ts +5 -0
- package/components/CommonActions/components/ActionFormCancel/{index.js → ActionFormCancel.js} +13 -10
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.styles.d.ts +2 -0
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.styles.js +7 -0
- package/components/CommonActions/components/ActionFormCancel/constanst.d.ts +6 -0
- package/components/CommonActions/components/ActionFormCancel/constanst.js +7 -0
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +3 -0
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.js +12 -0
- package/components/CommonActions/components/ActionFormCancel/slots/ActionsFormCancelEnum.d.ts +3 -0
- package/components/CommonActions/components/ActionFormCancel/slots/ActionsFormCancelEnum.js +7 -0
- package/components/CommonActions/components/ActionFormCancel/slots/index.d.ts +2 -0
- package/components/CommonActions/components/ActionFormCancel/slots/index.js +1 -0
- package/components/CommonActions/components/ActionFormCancel/tests/ActionFormCancel.test.d.ts +1 -0
- package/components/CommonActions/components/ActionFormCancel/types.d.ts +14 -2
- package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
- package/components/CommonActions/dictionary.d.ts +3 -0
- package/components/CommonActions/dictionary.js +4 -1
- package/components/CommonActions/index.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.js +2 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.d.ts +10 -0
- package/components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.js +65 -0
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.js +2 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/types.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/useColumnConcatenatedValue.d.ts +9 -0
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/useColumnConcatenatedValue.js +49 -0
- package/components/DataGrid/formatters/ColumnDateFormatter/index.js +2 -1
- package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.d.ts +14 -0
- package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.js +50 -0
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/useColumnInteractiveCheck.d.ts +12 -0
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/useColumnInteractiveCheck.js +29 -0
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.js +1 -1
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +10 -0
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.js +37 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.js +3 -1
- package/components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.d.ts +10 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.js +35 -0
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.js +3 -1
- package/components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.d.ts +10 -0
- package/components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.js +48 -0
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.d.ts +11 -0
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.js +32 -0
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.js +3 -1
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.d.ts +11 -0
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.js +43 -0
- package/components/DataGrid/formatters/index.d.ts +9 -0
- package/components/DataGrid/helpers/getColumnKey.d.ts +13 -0
- package/components/DataGrid/helpers/getColumnKey.js +11 -0
- package/components/DataGrid/styles.js +2 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +3 -0
- package/components/DataGrid/tests/ColumnsFormatters.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +1 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +4 -4
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +5 -5
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +1 -1
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/WindowConfirm/slots/WindowConfirmSlots.d.ts +3 -3
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +2 -2
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.js +1 -1
- package/components/areas/hooks/index.d.ts +1 -0
- package/components/formatters/BooleanFormatter/BooleanFormatter.d.ts +5 -1
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +23 -17
- package/components/formatters/DateFormatter/DateFormatter.d.ts +2 -1
- package/components/formatters/DateFormatter/DateFormatter.js +4 -4
- package/components/formatters/PriceFormatter/PriceFormatter.js +9 -9
- package/components/formatters/index.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +2 -2
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +2 -2
- package/components/mui_extended/Button/slots/ButtonSlots.d.ts +1 -1
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +2 -2
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +2 -2
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +1 -1
- package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/index.js +93 -73
- package/package.json +1 -1
- package/vendor.js +3 -3
- package/components/CommonActions/classes/constants.js +0 -4
- package/components/CommonActions/classes/index.js +0 -33
- package/components/CommonActions/components/ActionFormCancel/index.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ActionCancelRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "
|
|
1
|
+
declare const ActionCancelRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "startIcon" | "endIcon" | "skeletonWidth" | "disableElevation" | "fullWidth" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').ActionCancelOwnerState> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('..').ActionCancelOwnerState> & Record<string, unknown>;
|
|
3
3
|
}, {}, {}>;
|
|
4
4
|
export { ActionCancelRootStyled };
|
package/components/CommonActions/components/ActionFormCancel/{index.js → ActionFormCancel.js}
RENAMED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFormContext, useFormState } from "react-hook-form";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { B as Button } from "../../../mui_extended/Button/Button.js";
|
|
5
4
|
import { useCallback, useEffect } from "react";
|
|
6
5
|
import { u as useModal } from "../../../../hooks/useModal/index.js";
|
|
7
|
-
import {
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { c as classActoinFormCancelRoot } from "./constanst.js";
|
|
8
|
+
import { D as DICTIONARY } from "../../dictionary.js";
|
|
8
9
|
import { u as useWindowToolsMF } from "../../../areas/hooks/useWindowToolsMF/index.js";
|
|
9
10
|
import { W as WindowConfirm } from "../../../WindowConfirm/WindowConfirm.js";
|
|
10
|
-
|
|
11
|
+
import { B as ButtonRootStyled } from "./slots/ActionFormCancelSlots.js";
|
|
12
|
+
function ActionFormCancel(props) {
|
|
13
|
+
const { className } = props;
|
|
11
14
|
const { getLabel } = useModuleDictionary();
|
|
12
15
|
const { openModal } = useModal();
|
|
13
16
|
const { close: closeWindow, setFnQueryClose: setQueryClose } = useWindowToolsMF();
|
|
@@ -25,8 +28,8 @@ function ActionFormCancel() {
|
|
|
25
28
|
WindowConfirm,
|
|
26
29
|
{
|
|
27
30
|
variant: "warning",
|
|
28
|
-
title: getLabel(
|
|
29
|
-
msg: getLabel(
|
|
31
|
+
title: getLabel(DICTIONARY.CONFIRM_QUIT_TITLE),
|
|
32
|
+
msg: getLabel(DICTIONARY.CONFIRM_QUIT_MSG),
|
|
30
33
|
onClickIntro: onConfirmQuit
|
|
31
34
|
}
|
|
32
35
|
),
|
|
@@ -38,16 +41,16 @@ function ActionFormCancel() {
|
|
|
38
41
|
}, [getLabel, isDirty, openModal]);
|
|
39
42
|
useEffect(() => {
|
|
40
43
|
setQueryClose(onClickCancel);
|
|
41
|
-
}, [
|
|
42
|
-
const classes = useCommonActionsUtilityClasses();
|
|
44
|
+
}, []);
|
|
43
45
|
return /* @__PURE__ */ jsx(
|
|
44
|
-
|
|
46
|
+
ButtonRootStyled,
|
|
45
47
|
{
|
|
48
|
+
ownerState: {},
|
|
46
49
|
variant: "outlined",
|
|
47
50
|
color: "default",
|
|
48
51
|
onClick: onClickCancel,
|
|
49
|
-
className:
|
|
50
|
-
label: getLabel(
|
|
52
|
+
className: clsx(classActoinFormCancelRoot, className),
|
|
53
|
+
label: getLabel(DICTIONARY.LABEL_CANCEL)
|
|
51
54
|
}
|
|
52
55
|
);
|
|
53
56
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ACTION_FORM_CANCEL_KEY_COMPONENT = "M4LActionFormCancel";
|
|
2
|
+
/**
|
|
3
|
+
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
4
|
+
* tener la necesidad de agregar valores en !important.
|
|
5
|
+
*/
|
|
6
|
+
export declare const classActoinFormCancelRoot: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
const ACTION_FORM_CANCEL_KEY_COMPONENT = "M4LActionFormCancel";
|
|
3
|
+
const classActoinFormCancelRoot = getComponentSlotRoot(ACTION_FORM_CANCEL_KEY_COMPONENT);
|
|
4
|
+
export {
|
|
5
|
+
ACTION_FORM_CANCEL_KEY_COMPONENT as A,
|
|
6
|
+
classActoinFormCancelRoot as c
|
|
7
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const ButtonRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "startIcon" | "endIcon" | "skeletonWidth" | "disableElevation" | "fullWidth" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').ActionFormCancelOwnerState> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').ActionFormCancelOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import { A as ACTION_FORM_CANCEL_KEY_COMPONENT } from "../constanst.js";
|
|
3
|
+
import { A as ActionFormCancelSlots } from "./ActionsFormCancelEnum.js";
|
|
4
|
+
import { a as actionFormCancelStyles } from "../ActionFormCancel.styles.js";
|
|
5
|
+
import { B as Button } from "../../../../mui_extended/Button/Button.js";
|
|
6
|
+
const ButtonRootStyled = styled(Button, {
|
|
7
|
+
name: ACTION_FORM_CANCEL_KEY_COMPONENT,
|
|
8
|
+
slot: ActionFormCancelSlots.root
|
|
9
|
+
})(actionFormCancelStyles?.root);
|
|
10
|
+
export {
|
|
11
|
+
ButtonRootStyled as B
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mockUseFlagsPresent: jest.Mock;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
1
|
import { NavigateOptions, To } from 'react-router-dom';
|
|
2
|
+
import { ButtonProps, Theme } from '@mui/material';
|
|
3
|
+
import { Sizes } from '@m4l/styles';
|
|
4
|
+
import { ActionFormCancelSlots } from './slots';
|
|
5
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
6
|
+
import { ACTION_FORM_CANCEL_KEY_COMPONENT } from './constanst';
|
|
3
7
|
export interface ActionFormCancelProps extends ButtonProps {
|
|
4
|
-
to
|
|
8
|
+
to?: To;
|
|
5
9
|
navigateOptions?: NavigateOptions;
|
|
10
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
11
|
+
dictionaryId?: string;
|
|
12
|
+
className?: string;
|
|
6
13
|
}
|
|
14
|
+
export interface ActionFormCancelOwnerState {
|
|
15
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
16
|
+
}
|
|
17
|
+
export type ActionFormCancelType = keyof typeof ActionFormCancelSlots;
|
|
18
|
+
export type ActionFormCancelStyles = OverridesStyleRules<ActionFormCancelSlots, typeof ACTION_FORM_CANCEL_KEY_COMPONENT, Theme>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ActionIntroRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "
|
|
1
|
+
declare const ActionIntroRootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../../mui_extended/Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "startIcon" | "endIcon" | "skeletonWidth" | "disableElevation" | "fullWidth" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').ActionIntroOwnerState> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('..').ActionIntroOwnerState> & Record<string, unknown>;
|
|
3
3
|
}, {}, {}>;
|
|
4
4
|
export { ActionIntroRootStyled };
|
|
@@ -3,4 +3,7 @@ export declare function getCommonActionsDictionary(): string[];
|
|
|
3
3
|
export declare const defaultCommonActionsDictionary: Dictionary;
|
|
4
4
|
export declare const DICTIONARY: {
|
|
5
5
|
readonly LABEL_INTRO: "common_actions.intro";
|
|
6
|
+
readonly LABEL_CANCEL: "common_actions.cancel";
|
|
7
|
+
readonly CONFIRM_QUIT_TITLE: "common_actions.confirm_quit_title";
|
|
8
|
+
readonly CONFIRM_QUIT_MSG: "common_actions.confirm_quit_msg";
|
|
6
9
|
};
|
|
@@ -10,7 +10,10 @@ const defaultCommonActionsDictionary = {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
const DICTIONARY = {
|
|
13
|
-
LABEL_INTRO: "common_actions.intro"
|
|
13
|
+
LABEL_INTRO: "common_actions.intro",
|
|
14
|
+
LABEL_CANCEL: "common_actions.cancel",
|
|
15
|
+
CONFIRM_QUIT_TITLE: "common_actions.confirm_quit_title",
|
|
16
|
+
CONFIRM_QUIT_MSG: "common_actions.confirm_quit_msg"
|
|
14
17
|
};
|
|
15
18
|
export {
|
|
16
19
|
DICTIONARY as D,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ActionsContainer } from './components/ActionsContainer/ActionsContainer';
|
|
2
2
|
export { ActionCancel } from './components/ActionCancel';
|
|
3
3
|
export { ActionIntro } from './components/ActionIntro';
|
|
4
|
-
export { ActionFormCancel } from './components/ActionFormCancel';
|
|
4
|
+
export { ActionFormCancel } from './components/ActionFormCancel/ActionFormCancel';
|
|
5
5
|
export { ActionFormIntro } from './components/ActionFormIntro/ActionFormIntro';
|
|
6
6
|
export { getCommonActionsDictionary } from './dictionary';
|
|
7
7
|
export * from './dictionary';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { B as BooleanFormatter } from "../../../formatters/BooleanFormatter/BooleanFormatter.js";
|
|
4
5
|
function ColumnBooleanFormatter(props) {
|
|
5
|
-
const { fieldValue, presentationType, Component } = props;
|
|
6
|
+
const { fieldValue, presentationType, Component = React.Fragment } = props;
|
|
6
7
|
return (obProps) => {
|
|
7
8
|
const valueMaybeString = getPropertyByString(obProps, fieldValue);
|
|
8
9
|
let fixedValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnBooleanFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Función helper que retorna
|
|
4
|
+
* el formatter de la columna, el filtro y el customSort
|
|
5
|
+
*/
|
|
6
|
+
export declare const useColumnBoolean: <TRow>(props: ColumnBooleanFormatterProps) => {
|
|
7
|
+
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
customFilter: (row: TRow, value: string) => boolean;
|
|
9
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { g as getFormatBoolean } from "../../../formatters/BooleanFormatter/BooleanFormatter.js";
|
|
2
|
+
import { C as ColumnBooleanFormatter } from "./index.js";
|
|
3
|
+
import { useModuleDictionary, getPropertyByString } from "@m4l/core";
|
|
4
|
+
const getCustomBooleanFilter = (props, getLabel) => {
|
|
5
|
+
return (row, value) => {
|
|
6
|
+
const valueMaybeString = getPropertyByString(row, props.fieldValue);
|
|
7
|
+
let fixedValue;
|
|
8
|
+
if (typeof valueMaybeString === "boolean") {
|
|
9
|
+
fixedValue = valueMaybeString;
|
|
10
|
+
} else {
|
|
11
|
+
fixedValue = void 0;
|
|
12
|
+
}
|
|
13
|
+
return getFormatBoolean(
|
|
14
|
+
props.presentationType,
|
|
15
|
+
fixedValue,
|
|
16
|
+
getLabel
|
|
17
|
+
).includes(value);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const getCustomBooleanSort = (props, getLabel) => {
|
|
21
|
+
return (a, b) => {
|
|
22
|
+
const valueMaybeStringA = getPropertyByString(a, props.fieldValue);
|
|
23
|
+
const valueMaybeStringB = getPropertyByString(b, props.fieldValue);
|
|
24
|
+
let fixedValueA;
|
|
25
|
+
let fixedValueB;
|
|
26
|
+
if (typeof valueMaybeStringA === "boolean") {
|
|
27
|
+
fixedValueA = valueMaybeStringA;
|
|
28
|
+
} else {
|
|
29
|
+
fixedValueA = void 0;
|
|
30
|
+
}
|
|
31
|
+
if (typeof valueMaybeStringB === "boolean") {
|
|
32
|
+
fixedValueB = valueMaybeStringB;
|
|
33
|
+
} else {
|
|
34
|
+
fixedValueB = void 0;
|
|
35
|
+
}
|
|
36
|
+
const valueA = getFormatBoolean(
|
|
37
|
+
props.presentationType,
|
|
38
|
+
fixedValueA,
|
|
39
|
+
getLabel
|
|
40
|
+
);
|
|
41
|
+
const valueB = getFormatBoolean(
|
|
42
|
+
props.presentationType,
|
|
43
|
+
fixedValueB,
|
|
44
|
+
getLabel
|
|
45
|
+
);
|
|
46
|
+
if (valueA > valueB) {
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
if (valueA < valueB) {
|
|
50
|
+
return -1;
|
|
51
|
+
}
|
|
52
|
+
return 0;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const useColumnBoolean = (props) => {
|
|
56
|
+
const { getLabel } = useModuleDictionary();
|
|
57
|
+
return {
|
|
58
|
+
formatter: ColumnBooleanFormatter(props),
|
|
59
|
+
customFilter: getCustomBooleanFilter(props, getLabel),
|
|
60
|
+
customSort: getCustomBooleanSort(props, getLabel)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
useColumnBoolean as u
|
|
65
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { C as ConcatenatedFormatter } from "../../../formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
|
|
4
5
|
function ColumnConcatenatedValueFormatter(props) {
|
|
5
|
-
const { fieldValue, fieldSeparator, Component } = props;
|
|
6
|
+
const { fieldValue, fieldSeparator, Component = React.Fragment } = props;
|
|
6
7
|
return (obProps) => {
|
|
7
8
|
const values = fieldValue.map((element) => {
|
|
8
9
|
const valueMaybeString = getPropertyByString(obProps, element);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnConcatenatedValuesFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Funcion helper que retorna el formatter, filter y customSort de la columna concatenada.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useColumnConcatenatedValue: <TRow>(props: ColumnConcatenatedValuesFormatterProps) => {
|
|
6
|
+
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
customFilter: (row: TRow, value: string) => boolean;
|
|
8
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
9
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getPropertyByString } from "@m4l/core";
|
|
2
|
+
import { C as ColumnConcatenatedValueFormatter } from "./index.js";
|
|
3
|
+
import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
4
|
+
import { g as getFormatConcatenated } from "../../../formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
|
|
5
|
+
const getArrayValuesWithFieldValue = (row, fieldValue) => {
|
|
6
|
+
const values = fieldValue.map((element) => {
|
|
7
|
+
const keyWiouthRow = getColumnKey(element);
|
|
8
|
+
const valueMaybeString = getPropertyByString(row, keyWiouthRow);
|
|
9
|
+
let fixedValue;
|
|
10
|
+
if (typeof valueMaybeString === "string" || typeof valueMaybeString === "number") {
|
|
11
|
+
fixedValue = valueMaybeString.toString();
|
|
12
|
+
} else {
|
|
13
|
+
fixedValue = "";
|
|
14
|
+
}
|
|
15
|
+
return fixedValue;
|
|
16
|
+
});
|
|
17
|
+
return values;
|
|
18
|
+
};
|
|
19
|
+
const getCustomContatenatedValueFilter = (props) => {
|
|
20
|
+
return (row, value) => {
|
|
21
|
+
const values = getArrayValuesWithFieldValue(row, props.fieldValue);
|
|
22
|
+
return getFormatConcatenated(values, props.fieldSeparator).includes(value);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const getCustomConcatenatedValueSort = (props) => {
|
|
26
|
+
return (a, b) => {
|
|
27
|
+
const arrayA = getArrayValuesWithFieldValue(a, props.fieldValue);
|
|
28
|
+
const arrayB = getArrayValuesWithFieldValue(b, props.fieldValue);
|
|
29
|
+
const valueA = getFormatConcatenated(arrayA, props.fieldSeparator);
|
|
30
|
+
const valueB = getFormatConcatenated(arrayB, props.fieldSeparator);
|
|
31
|
+
if (valueA > valueB) {
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
if (valueA < valueB) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const useColumnConcatenatedValue = (props) => {
|
|
41
|
+
return {
|
|
42
|
+
formatter: ColumnConcatenatedValueFormatter(props),
|
|
43
|
+
customFilter: getCustomContatenatedValueFilter(props),
|
|
44
|
+
customSort: getCustomConcatenatedValueSort(props)
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
useColumnConcatenatedValue as u
|
|
49
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { D as DateFormatter } from "../../../formatters/DateFormatter/DateFormatter.js";
|
|
4
5
|
function ColumnDateFormatter(props) {
|
|
5
|
-
const { fieldValue, presentationType, Component } = props;
|
|
6
|
+
const { fieldValue, presentationType, Component = React.Fragment } = props;
|
|
6
7
|
return (obProps) => {
|
|
7
8
|
const valueMaybeDateStringNumber = getPropertyByString(obProps, fieldValue);
|
|
8
9
|
let fixedValue;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ColumnDateFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* funcion para filtrar por fecha en una columna
|
|
4
|
+
*/
|
|
5
|
+
export declare const useCustomDateFilter: <TRow>(props: ColumnDateFormatterProps) => (row: TRow, value: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Funcion helper que retorna el formatter,
|
|
8
|
+
* customFilter y customSort de una columna de fecha
|
|
9
|
+
*/
|
|
10
|
+
export declare const useColumnDate: <TRow>(props: ColumnDateFormatterProps) => {
|
|
11
|
+
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
customFilter: (row: TRow, value: string) => boolean;
|
|
13
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
14
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getPropertyByString } from "@m4l/core";
|
|
2
|
+
import { g as getFormatDate } from "../../../formatters/DateFormatter/DateFormatter.js";
|
|
3
|
+
import { C as ColumnDateFormatter } from "./index.js";
|
|
4
|
+
import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
5
|
+
import { useFormatter } from "@m4l/graphics";
|
|
6
|
+
const useCustomDateFilter = (props) => {
|
|
7
|
+
const { dateFormatter } = useFormatter();
|
|
8
|
+
return (row, value) => {
|
|
9
|
+
const fieldValue = getColumnKey(props.fieldValue);
|
|
10
|
+
const rawValue = getPropertyByString(row, fieldValue);
|
|
11
|
+
let dateValue = null;
|
|
12
|
+
if (typeof rawValue === "string") {
|
|
13
|
+
dateValue = new Date(rawValue);
|
|
14
|
+
} else if (rawValue instanceof Date) {
|
|
15
|
+
dateValue = rawValue;
|
|
16
|
+
}
|
|
17
|
+
if (!dateValue || isNaN(dateValue.getTime())) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const formattedDate = getFormatDate(props.presentationType, dateValue, dateFormatter, props.format);
|
|
21
|
+
return formattedDate.includes(value);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getCustomDateSort = (props) => {
|
|
25
|
+
return (a, b) => {
|
|
26
|
+
const key = getColumnKey(props.fieldValue);
|
|
27
|
+
const valueMaybeDateStringNumberA = getPropertyByString(a, key);
|
|
28
|
+
const valueMaybeDateStringNumberB = getPropertyByString(b, key);
|
|
29
|
+
const fixedValueA = new Date(valueMaybeDateStringNumberA);
|
|
30
|
+
const fixedValueB = new Date(valueMaybeDateStringNumberB);
|
|
31
|
+
if (fixedValueA.getTime() > fixedValueB.getTime()) {
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
if (fixedValueA.getTime() < fixedValueB.getTime()) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const useColumnDate = (props) => {
|
|
41
|
+
const customFilter = useCustomDateFilter(props);
|
|
42
|
+
return {
|
|
43
|
+
formatter: ColumnDateFormatter(props),
|
|
44
|
+
customFilter,
|
|
45
|
+
customSort: getCustomDateSort(props)
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
useColumnDate as u
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnInteractiveCheckFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Función que retorna para una columna "check":
|
|
4
|
+
* - formatter: ColumnInteractiveCheckFormatter
|
|
5
|
+
* - filter: getCustomInteractiveCheckFilter
|
|
6
|
+
* - customSort: getCustomInteractiveCheckSort
|
|
7
|
+
*/
|
|
8
|
+
export declare const useColumnInteractiveCheck: <TRow>(props: ColumnInteractiveCheckFormatterProps<TRow>) => {
|
|
9
|
+
formatter: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
filter: (row: TRow, value: boolean) => boolean;
|
|
11
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
12
|
+
};
|
package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/useColumnInteractiveCheck.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { C as ColumnInteractiveCheckFormatter } from "./index.js";
|
|
2
|
+
const getCustomInteractiveCheckFilter = (props) => {
|
|
3
|
+
return (row, value) => {
|
|
4
|
+
return row[props.column.key] === value;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
const getCustomInteractiveCheckSort = (props) => {
|
|
8
|
+
return (a, b) => {
|
|
9
|
+
const valueA = a[props.column.key];
|
|
10
|
+
const valueB = b[props.column.key];
|
|
11
|
+
if (valueA > valueB) {
|
|
12
|
+
return 1;
|
|
13
|
+
}
|
|
14
|
+
if (valueA < valueB) {
|
|
15
|
+
return -1;
|
|
16
|
+
}
|
|
17
|
+
return 0;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const useColumnInteractiveCheck = (props) => {
|
|
21
|
+
return {
|
|
22
|
+
formatter: ColumnInteractiveCheckFormatter(props),
|
|
23
|
+
filter: getCustomInteractiveCheckFilter(props),
|
|
24
|
+
customSort: getCustomInteractiveCheckSort(props)
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
useColumnInteractiveCheck as u
|
|
29
|
+
};
|
|
@@ -5,7 +5,7 @@ function ColumnNestedValueFormatter(props) {
|
|
|
5
5
|
const { fieldValue, Component = WrapperComponent } = props;
|
|
6
6
|
return (obProps) => {
|
|
7
7
|
const property = getPropertyByString(obProps, fieldValue);
|
|
8
|
-
const value = typeof property === "object" ?
|
|
8
|
+
const value = typeof property === "object" ? JSON.stringify(property) : property;
|
|
9
9
|
return /* @__PURE__ */ jsx(Component, { children: value });
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnNestedValueFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Funcion que retorna el formatter, customFilter y customSort
|
|
4
|
+
* de la columna para ColumnNestedValueFormatter.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useColumnNestedValue: <TRow>(props: ColumnNestedValueFormatterProps) => {
|
|
7
|
+
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
customFilter: (row: TRow, value: string) => boolean;
|
|
9
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
|
+
};
|