linear-react-components-ui 1.1.24-beta.0 → 1.1.24-beta.10
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/lib/BaseMask-0c14ef51.d.ts +24 -0
- package/lib/Cnpj-bde01dd0.d.ts +18 -0
- package/lib/Cpf-3fa496ad.d.ts +18 -0
- package/lib/Phone-2bb0b397.d.ts +18 -0
- package/lib/ZipCode-09460e18.d.ts +13 -0
- package/lib/alerts/AlertProvider.js +1 -2
- package/lib/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +2 -3
- package/lib/alerts/withAlert.js +1 -2
- package/lib/assets/styles/calendar.scss +140 -35
- package/lib/assets/styles/datepicker2.scss +3 -9
- package/lib/assets/styles/file.scss +8 -0
- package/lib/assets/styles/filefield.scss +42 -0
- package/lib/assets/styles/numberfield.scss +18 -0
- package/lib/assets/styles/periodpicker.scss +1 -1
- package/lib/assets/styles/radiofield.scss +185 -0
- package/lib/assets/styles/selectfield.scss +1 -3
- package/lib/assets/styles/table.scss +6 -0
- package/lib/assets/styles/textfield.scss +61 -27
- package/lib/avatar/index.js +9 -11
- package/lib/badge/index.js +4 -4
- package/lib/buttons/Button.js +1 -2
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +22 -21
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +2 -2
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +123 -44
- package/lib/checkbox/index.js +2 -3
- package/lib/dialog/Custom.js +2 -3
- package/lib/dialog/Question.js +5 -4
- package/lib/dialog/base/Content.js +5 -6
- package/lib/dialog/base/Header.js +3 -4
- package/lib/dialog/base/index.js +33 -23
- package/lib/dialog/form/index.js +52 -12
- package/lib/dialog/types.d.ts +4 -0
- package/lib/dialog/wizard/index.js +1 -2
- package/lib/dialog/wizard/progressbar.js +1 -1
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/dialog/wizard/useWizard.js +1 -2
- package/lib/drawer/Content.js +1 -2
- package/lib/drawer/Drawer.js +6 -7
- package/lib/drawer/Header.js +2 -3
- package/lib/dropdown/Popup.js +7 -7
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +3 -4
- package/lib/fieldset/index.js +8 -9
- package/lib/form/Field.js +2 -3
- package/lib/form/FieldArray.js +2 -3
- package/lib/form/FieldNumber.js +4 -5
- package/lib/form/FieldPeriod.js +3 -4
- package/lib/form/index.js +3 -4
- package/lib/form/withFieldHOC.js +1 -2
- package/lib/form/withFormSecurity.js +1 -2
- package/lib/form2/helpers.js +1 -1
- package/lib/form2/index.d.ts +1 -1
- package/lib/form2/types.d.ts +7 -3
- package/lib/form2/useForm/index.js +22 -15
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/hint/index.js +1 -7
- package/lib/icons/helper.d.ts +16 -0
- package/lib/icons/helper.js +16 -0
- package/lib/icons/index.js +9 -9
- package/lib/index-208e7f62.d.ts +44 -0
- package/lib/index-3b70931d.d.ts +44 -0
- package/lib/index-442d51a2.d.ts +15 -0
- package/lib/index-4e511971.d.ts +26 -0
- package/lib/index-7dfa8924.d.ts +22 -0
- package/lib/index-9e576346.d.ts +23 -0
- package/lib/index-d3b6a19a.d.ts +41 -0
- package/lib/index-ecafc8c6.d.ts +30 -0
- package/lib/inputs/base/InputTextBase.js +9 -8
- package/lib/inputs/base/helpers.js +3 -7
- package/lib/inputs/base/types.d.ts +1 -1
- package/lib/inputs/color/index.js +2 -3
- package/lib/inputs/date/Dropdown.js +6 -4
- package/lib/inputs/date/index.js +34 -22
- package/lib/inputs/errorMessage/index.js +2 -3
- package/lib/inputs/file/DefaultFile.js +31 -31
- package/lib/inputs/file/DragDropFile.js +18 -17
- package/lib/inputs/file/File.js +6 -5
- package/lib/inputs/file/FileButtonSettings.js +0 -1
- package/lib/inputs/file/index.js +0 -1
- package/lib/inputs/inputHOC.js +1 -2
- package/lib/inputs/mask/BaseMask.js +1 -2
- package/lib/inputs/mask/Cnpj.js +1 -2
- package/lib/inputs/mask/Cpf.js +1 -2
- package/lib/inputs/multiSelect/ActionButtons.js +1 -2
- package/lib/inputs/multiSelect/Dropdown.js +11 -11
- package/lib/inputs/multiSelect/helper.js +2 -1
- package/lib/inputs/multiSelect/index.js +10 -9
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/index.js +3 -3
- package/lib/inputs/period/Dropdown.js +7 -4
- package/lib/inputs/period/PeriodList.js +3 -12
- package/lib/inputs/period/helper.js +1 -3
- package/lib/inputs/period/index.js +116 -113
- package/lib/inputs/period/types.d.ts +4 -1
- package/lib/inputs/search/index.js +8 -5
- package/lib/inputs/select/ActionButtons.js +1 -1
- package/lib/inputs/select/Dropdown.js +3 -4
- package/lib/inputs/select/helper.js +13 -10
- package/lib/inputs/select/multiple/Selecteds.js +2 -2
- package/lib/inputs/select/multiple/index.js +14 -11
- package/lib/inputs/select/simple/index.js +19 -13
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs/types.d.ts +1 -0
- package/lib/inputs2/checkboxfield/index.d.ts +1 -1
- package/lib/inputs2/checkboxfield/index.js +18 -15
- package/lib/inputs2/colorfield/index.d.ts +2 -2
- package/lib/inputs2/colorfield/index.js +5 -5
- package/lib/inputs2/date/base/constants.js +2 -1
- package/lib/inputs2/date/base/index.js +6 -8
- package/lib/inputs2/date/datefield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/datefield/calendarbox.js +3 -2
- package/lib/inputs2/date/datefield/context.d.ts +1 -0
- package/lib/inputs2/date/datefield/index.d.ts +1 -0
- package/lib/inputs2/date/datefield/index.js +44 -33
- package/lib/inputs2/date/datefield/triggers.js +1 -2
- package/lib/inputs2/date/datefield/types.d.ts +2 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +8 -6
- package/lib/inputs2/date/dateperiodfield/context.d.ts +1 -0
- package/lib/inputs2/date/dateperiodfield/index.d.ts +1 -0
- package/lib/inputs2/date/dateperiodfield/index.js +66 -48
- package/lib/inputs2/date/dateperiodfield/triggers.js +19 -14
- package/lib/inputs2/date/dateperiodfield/types.d.ts +2 -0
- package/lib/inputs2/date/helpers.d.ts +1 -0
- package/lib/inputs2/date/types.d.ts +2 -1
- package/lib/inputs2/{number/Number.d.ts → filefield/index.d.ts} +2 -2
- package/lib/inputs2/filefield/index.js +174 -0
- package/lib/inputs2/index.d.ts +20 -14
- package/lib/inputs2/index.js +10 -11
- package/lib/inputs2/mask/BaseMask.d.ts +2 -2
- package/lib/inputs2/mask/BaseMask.js +7 -7
- package/lib/inputs2/mask/Cnpj.d.ts +3 -3
- package/lib/inputs2/mask/Cnpj.js +4 -5
- package/lib/inputs2/mask/Cpf.d.ts +3 -3
- package/lib/inputs2/mask/Cpf.js +4 -5
- package/lib/inputs2/mask/Phone.d.ts +3 -3
- package/lib/inputs2/mask/Phone.js +1 -2
- package/lib/inputs2/mask/ZipCode.d.ts +3 -3
- package/lib/inputs2/mask/ZipCode.js +1 -2
- package/lib/inputs2/numberfield/currency.d.ts +13 -0
- package/lib/inputs2/numberfield/currency.js +91 -0
- package/lib/inputs2/numberfield/decimal.d.ts +13 -0
- package/lib/inputs2/{number/BaseNumber.js → numberfield/decimal.js} +57 -58
- package/lib/inputs2/numberfield/helpers.d.ts +30 -0
- package/lib/inputs2/numberfield/helpers.js +53 -0
- package/lib/inputs2/numberfield/index.d.ts +12 -0
- package/lib/inputs2/numberfield/index.js +104 -0
- package/lib/inputs2/numberfield/types.d.ts +36 -0
- package/lib/inputs2/numberfield/types.js +5 -0
- package/lib/inputs2/{number/BaseNumber.d.ts → radiofield/index.d.ts} +4 -5
- package/lib/inputs2/radiofield/index.js +144 -0
- package/lib/inputs2/radiofield/types.d.ts +33 -0
- package/lib/inputs2/radiofield/types.js +5 -0
- package/lib/inputs2/selectfield/context.d.ts +1 -0
- package/lib/inputs2/selectfield/index.d.ts +2 -1
- package/lib/inputs2/selectfield/index.js +118 -58
- package/lib/inputs2/selectfield/item.d.ts +2 -1
- package/lib/inputs2/selectfield/item.js +8 -4
- package/lib/inputs2/selectfield/listbox.d.ts +1 -1
- package/lib/inputs2/selectfield/listbox.js +24 -10
- package/lib/inputs2/selectfield/options.d.ts +9 -0
- package/lib/inputs2/selectfield/options.js +26 -0
- package/lib/inputs2/selectfield/search.d.ts +1 -1
- package/lib/inputs2/selectfield/search.js +3 -4
- package/lib/inputs2/selectfield/selections.d.ts +1 -1
- package/lib/inputs2/selectfield/selections.js +3 -2
- package/lib/inputs2/selectfield/triggers.js +17 -8
- package/lib/inputs2/selectfield/types.d.ts +0 -1
- package/lib/inputs2/slot/index.d.ts +2 -2
- package/lib/inputs2/{number/Decimal.d.ts → textareafield/index.d.ts} +2 -5
- package/lib/inputs2/textareafield/index.js +194 -0
- package/lib/inputs2/textfield/index.d.ts +1 -1
- package/lib/inputs2/textfield/index.js +18 -17
- package/lib/labelMessages/index.js +4 -6
- package/lib/labels/DefaultLabel.js +2 -6
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +10 -12
- package/lib/list/index.js +2 -4
- package/lib/menus/float/MenuItem.js +3 -4
- package/lib/menus/float/SubMenuContainer.js +2 -3
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/MenuLink.js +1 -2
- package/lib/menus/sidenav/NavMenuGroup.js +2 -3
- package/lib/menus/sidenav/NavMenuItem.js +10 -9
- package/lib/menus/sidenav/NavSubMenuItem.js +2 -3
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +6 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +1 -2
- package/lib/panel/Content.js +9 -8
- package/lib/panel/Default.js +3 -4
- package/lib/panel/Header.js +4 -5
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/PopoverText.js +1 -2
- package/lib/popover/index.js +2 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +3 -4
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +1 -2
- package/lib/skeleton/index.js +1 -4
- package/lib/spinner/index.js +3 -4
- package/lib/split/Split.js +2 -3
- package/lib/split/SplitSide.js +4 -5
- package/lib/table/Body.js +4 -5
- package/lib/table/Header.js +9 -7
- package/lib/table/HeaderColumn.js +2 -3
- package/lib/table/Row.js +4 -5
- package/lib/table/RowColumn.js +2 -3
- package/lib/table/index.js +20 -16
- package/lib/table/types.d.ts +1 -0
- package/lib/tabs/DropdownTabs.js +2 -3
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +4 -9
- package/lib/tabs/Panel.js +8 -7
- package/lib/tabs/context.js +7 -5
- package/lib/tabs/index.js +1 -2
- package/lib/textContent/index.js +2 -3
- package/lib/toolbar/ButtonBar.js +2 -3
- package/lib/toolbar/LabelBar.js +1 -2
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/TooltipContent.js +8 -9
- package/lib/tooltip/useTooltip.js +8 -8
- package/lib/treetable/Body.js +2 -3
- package/lib/treetable/Header.js +3 -4
- package/lib/treetable/Row.js +9 -10
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -6
- package/lib/treeview/index.js +5 -6
- package/lib/uitour/index.js +9 -8
- package/package.json +1 -1
- package/lib/BaseMask-3d5d581d.d.ts +0 -24
- package/lib/BaseNumber-797088d7.d.ts +0 -23
- package/lib/Cnpj-1602be21.d.ts +0 -18
- package/lib/Cpf-4d6b9079.d.ts +0 -18
- package/lib/Currency-b33d3a22.d.ts +0 -18
- package/lib/Decimal-55e836d5.d.ts +0 -13
- package/lib/Number-9c6aceff.d.ts +0 -20
- package/lib/Phone-79e5e3b4.d.ts +0 -18
- package/lib/ZipCode-8c2e9d8b.d.ts +0 -13
- package/lib/calendar/base/Day.d.ts +0 -8
- package/lib/calendar/base/Day.js +0 -36
- package/lib/calendar/base/Month.d.ts +0 -8
- package/lib/calendar/base/Month.js +0 -39
- package/lib/calendar/base/Week.d.ts +0 -8
- package/lib/calendar/base/Week.js +0 -35
- package/lib/index-18a64236.d.ts +0 -23
- package/lib/index-43ad8140.d.ts +0 -41
- package/lib/index-772f9f1a.d.ts +0 -44
- package/lib/index-8a59cf4b.d.ts +0 -23
- package/lib/inputs2/number/Currency.d.ts +0 -11
- package/lib/inputs2/number/Currency.js +0 -47
- package/lib/inputs2/number/Decimal.js +0 -36
- package/lib/inputs2/number/Number.js +0 -49
- package/lib/inputs2/number/format_number.d.ts +0 -5
- package/lib/inputs2/number/format_number.js +0 -29
|
@@ -13,8 +13,7 @@ const _excluded = ["children", "customClassWrapper", "hasValidationErrors"],
|
|
|
13
13
|
_excluded3 = ["children", "skeletonize", "customClassInputContainer"],
|
|
14
14
|
_excluded4 = ["customClass"],
|
|
15
15
|
_excluded5 = ["children", "isReadOnly", "isDisabled", "skeletonize", "inputFieldId", "calendarBoxOpen", "showCalendarButton", "showClearButton", "onClearSelectedDate", "onClickTriggerCalendar", "hasValidDateSelection", "hasValidPeriodSelected", "clearButtonTestId", "calendarButtonTestId"];
|
|
16
|
-
function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
19
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -29,7 +28,7 @@ const Root = exports.Root = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
|
29
28
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, rest, {
|
|
30
29
|
ref: ref,
|
|
31
30
|
"data-state-error": hasValidationErrors,
|
|
32
|
-
className:
|
|
31
|
+
className: "date-field-root ".concat(customClassWrapper)
|
|
33
32
|
}), children);
|
|
34
33
|
});
|
|
35
34
|
Root.displayName = 'BaseDateRoot';
|
|
@@ -52,7 +51,7 @@ const Label = exports.Label = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
52
51
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
53
52
|
return /*#__PURE__*/_react.default.createElement("span", _extends({}, rest, {
|
|
54
53
|
ref: ref,
|
|
55
|
-
className:
|
|
54
|
+
className: "root-label ".concat(customClassLabel),
|
|
56
55
|
"data-state-skeletonize": skeletonize
|
|
57
56
|
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
58
57
|
className: "label",
|
|
@@ -83,7 +82,7 @@ const Container = exports.Container = /*#__PURE__*/_react.default.forwardRef((pr
|
|
|
83
82
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, rest, {
|
|
84
83
|
ref: ref,
|
|
85
84
|
"data-state-skeletonize": skeletonize,
|
|
86
|
-
className:
|
|
85
|
+
className: "container ".concat(customClassInputContainer)
|
|
87
86
|
}), children);
|
|
88
87
|
});
|
|
89
88
|
Container.displayName = 'BaseDateContainer';
|
|
@@ -98,7 +97,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
98
97
|
type: "text",
|
|
99
98
|
role: "combobox",
|
|
100
99
|
"aria-haspopup": "true",
|
|
101
|
-
className:
|
|
100
|
+
className: "input ".concat(customClass),
|
|
102
101
|
"aria-autocomplete": "list"
|
|
103
102
|
}));
|
|
104
103
|
});
|
|
@@ -148,8 +147,7 @@ const Triggers = exports.Triggers = /*#__PURE__*/_react.default.forwardRef((prop
|
|
|
148
147
|
"aria-controls": inputFieldId,
|
|
149
148
|
"data-state-read-only": isReadOnly,
|
|
150
149
|
"data-state-visible": showClearButton,
|
|
151
|
-
"data-state-valid-date-selected": hasValidDateSelection,
|
|
152
|
-
"data-state-valid-period-selected": hasValidPeriodSelected,
|
|
150
|
+
"data-state-valid-date-selected": hasValidDateSelection || hasValidPeriodSelected,
|
|
153
151
|
onClick: handleOnClickClear,
|
|
154
152
|
onMouseDown: event => {
|
|
155
153
|
event.preventDefault();
|
|
@@ -2,6 +2,6 @@ import React__default from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface DateFieldCalendarBoxProps extends React__default.ComponentProps<'div'> {
|
|
4
4
|
}
|
|
5
|
-
declare const CalendarBox: React__default.ForwardRefExoticComponent<Pick<DateFieldCalendarBoxProps, "
|
|
5
|
+
declare const CalendarBox: React__default.ForwardRefExoticComponent<Pick<DateFieldCalendarBoxProps, "children" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "align" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
7
|
export { CalendarBox, DateFieldCalendarBoxProps };
|
|
@@ -30,7 +30,8 @@ const CalendarBox = exports.CalendarBox = /*#__PURE__*/_react.default.forwardRef
|
|
|
30
30
|
} = (0, _constants.useCalendarPosition)(calendarBoxOpen, dateContainerRef);
|
|
31
31
|
const weeks = (0, _helpers.generateCalendarWeeks)(calendarDisplayDate);
|
|
32
32
|
const handleOnMouseDown = event => {
|
|
33
|
-
|
|
33
|
+
var _event$preventDefault;
|
|
34
|
+
event === null || event === void 0 ? void 0 : (_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 ? void 0 : _event$preventDefault.call(event);
|
|
34
35
|
};
|
|
35
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
37
|
ref: ref,
|
|
@@ -72,7 +73,7 @@ const CalendarBox = exports.CalendarBox = /*#__PURE__*/_react.default.forwardRef
|
|
|
72
73
|
className: "date-calendar-box-days-of-week"
|
|
73
74
|
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, _moment.default.weekdaysShort(true).map((day, idx) => /*#__PURE__*/_react.default.createElement("th", {
|
|
74
75
|
role: "columnheader",
|
|
75
|
-
key:
|
|
76
|
+
key: "day-of-week-".concat(idx + 1)
|
|
76
77
|
}, day))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
78
|
className: "date-calendar-box-grid-of-days"
|
|
78
79
|
}, /*#__PURE__*/_react.default.createElement("table", {
|
|
@@ -6,6 +6,7 @@ import '../../../@types/ColorStyles.js';
|
|
|
6
6
|
import '../../../tooltip/types.js';
|
|
7
7
|
import '../../../@types/Position.js';
|
|
8
8
|
import '../../../@types/PermissionAttr.js';
|
|
9
|
+
import '../types.js';
|
|
9
10
|
|
|
10
11
|
declare const DateFieldContext: React__default.Context<DateFieldContextProps>;
|
|
11
12
|
declare const useDateFieldContext: () => DateFieldContextProps;
|
|
@@ -21,15 +21,15 @@ var _helpers2 = require("../helpers");
|
|
|
21
21
|
var _triggers = require("./triggers");
|
|
22
22
|
var _calendarbox = require("./calendarbox");
|
|
23
23
|
var _context = require("./context");
|
|
24
|
-
const _excluded = ["label", "errors", "tooltip", "tooltipPosition", "tooltipWidth", "onDeniedActions", "permissionAttr", "customClass", "customClassLabel", "customClassWrapper", "customClassInputContainer", "textAlign", "labelUppercase", "skeletonize", "hintPosition", "gridLayout", "themePopover", "popoverAlign", "showCalendarButton", "openCalendarOnFocus", "undigitable", "shouldCloseOnSelect", "showClearDateButton", "placeholder"];
|
|
24
|
+
const _excluded = ["label", "errors", "tooltip", "tooltipPosition", "tooltipWidth", "onDeniedActions", "permissionAttr", "customClass", "customClassLabel", "customClassWrapper", "customClassInputContainer", "textAlign", "labelUppercase", "skeletonize", "hintPosition", "gridLayout", "themePopover", "popoverAlign", "showCalendarButton", "openCalendarOnFocus", "undigitable", "shouldCloseOnSelect", "showClearDateButton", "placeholder", "returnValueType"];
|
|
25
25
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
26
|
-
function
|
|
27
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
28
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
28
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
30
29
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
30
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
31
|
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
32
|
+
var _props$hint;
|
|
33
33
|
const {
|
|
34
34
|
label,
|
|
35
35
|
errors,
|
|
@@ -54,7 +54,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
54
54
|
undigitable = false,
|
|
55
55
|
shouldCloseOnSelect = true,
|
|
56
56
|
showClearDateButton = true,
|
|
57
|
-
placeholder = _helpers2.TOKEN_PTBR_FORMAT
|
|
57
|
+
placeholder = _helpers2.TOKEN_PTBR_FORMAT,
|
|
58
|
+
returnValueType = 'default'
|
|
58
59
|
} = props,
|
|
59
60
|
rest = _objectWithoutProperties(props, _excluded);
|
|
60
61
|
const onDenied = _react.default.useMemo(() => {
|
|
@@ -67,7 +68,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
67
68
|
const [calendarBoxOpen, setCalendarBoxOpen] = _react.default.useState(false);
|
|
68
69
|
const [activeDescendant, setActiveDescendant] = _react.default.useState((0, _moment.default)().format(_helpers2.TOKEN_ISO_FORMAT));
|
|
69
70
|
const [selectedDate, setSelectedDate] = _react.default.useState(null);
|
|
70
|
-
const [calendarDisplayDate, setCalendarDisplayDate] = _react.default.useState(selectedDate
|
|
71
|
+
const [calendarDisplayDate, setCalendarDisplayDate] = _react.default.useState(selectedDate !== null && selectedDate !== void 0 ? selectedDate : (0, _moment.default)());
|
|
71
72
|
const calendarRef = _react.default.useRef(null);
|
|
72
73
|
const inputRootRef = _react.default.useRef(null);
|
|
73
74
|
const dateInputRef = _react.default.useRef(null);
|
|
@@ -82,7 +83,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
82
83
|
placeholderChar: '_'
|
|
83
84
|
}, {
|
|
84
85
|
ref: dateInputRef,
|
|
85
|
-
defaultValue: selectedDate
|
|
86
|
+
defaultValue: selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.format(_helpers2.TOKEN_PTBR_FORMAT),
|
|
86
87
|
onComplete: value => {
|
|
87
88
|
const date = (0, _moment.default)(value, _helpers2.TOKEN_PTBR_FORMAT);
|
|
88
89
|
if (date.isValid()) {
|
|
@@ -91,20 +92,22 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
const inputId = _react.default.useMemo(() => props.id || props.name || (0, _uuid.v1)(), [props.id, props.name]);
|
|
94
|
-
const hasLabel = !_lodash.default.isEmpty(props
|
|
95
|
+
const hasLabel = !_lodash.default.isEmpty(props === null || props === void 0 ? void 0 : props.label);
|
|
95
96
|
const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);
|
|
96
97
|
const isDisabled = Boolean(props.disabled || onDenied.disabled);
|
|
97
|
-
const hasHintMessages = Boolean(props.hint
|
|
98
|
-
const hasValidationErrors = Boolean(errors
|
|
99
|
-
const hasValidDateSelected = !_lodash.default.isEmpty(props
|
|
98
|
+
const hasHintMessages = Boolean((_props$hint = props.hint) === null || _props$hint === void 0 ? void 0 : _props$hint.length);
|
|
99
|
+
const hasValidationErrors = Boolean(errors === null || errors === void 0 ? void 0 : errors.length);
|
|
100
|
+
const hasValidDateSelected = !_lodash.default.isEmpty(props === null || props === void 0 ? void 0 : props.value);
|
|
100
101
|
const handleUpdateDateState = _react.default.useCallback(date => {
|
|
101
|
-
|
|
102
|
+
var _props$onChange;
|
|
103
|
+
const nonIsoDateFormat = date.format(_helpers2.TOKEN_ISO_FORMAT);
|
|
104
|
+
const isoDateFormat = date.toISOString();
|
|
102
105
|
setSelectedDate(date.clone());
|
|
103
106
|
setCalendarDisplayDate(date.clone());
|
|
104
|
-
props.onChange
|
|
107
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
|
105
108
|
target: {
|
|
106
109
|
name: props.name,
|
|
107
|
-
value:
|
|
110
|
+
value: returnValueType === 'default' ? nonIsoDateFormat : isoDateFormat
|
|
108
111
|
}
|
|
109
112
|
});
|
|
110
113
|
if (shouldCloseOnSelect) handleCloseCalendar();
|
|
@@ -116,7 +119,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
116
119
|
const handleChangeCalendarBoxState = _react.default.useCallback(() => {
|
|
117
120
|
setCalendarBoxOpen(prevState => {
|
|
118
121
|
if (dateInputRef.current !== document.activeElement) {
|
|
119
|
-
|
|
122
|
+
var _dateInputRef$current, _dateInputRef$current2;
|
|
123
|
+
dateInputRef === null || dateInputRef === void 0 ? void 0 : (_dateInputRef$current = dateInputRef.current) === null || _dateInputRef$current === void 0 ? void 0 : (_dateInputRef$current2 = _dateInputRef$current.focus) === null || _dateInputRef$current2 === void 0 ? void 0 : _dateInputRef$current2.call(_dateInputRef$current);
|
|
120
124
|
}
|
|
121
125
|
return !prevState;
|
|
122
126
|
});
|
|
@@ -138,7 +142,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
138
142
|
});
|
|
139
143
|
}, []);
|
|
140
144
|
const handleOnClickClearSelectedDate = _react.default.useCallback(() => {
|
|
141
|
-
|
|
145
|
+
var _props$onChange2;
|
|
146
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, {
|
|
142
147
|
target: {
|
|
143
148
|
name: props.name,
|
|
144
149
|
value: ''
|
|
@@ -149,22 +154,24 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
149
154
|
handleCloseCalendar();
|
|
150
155
|
}, [props.onChange]);
|
|
151
156
|
const handleOnBlur = event => {
|
|
152
|
-
|
|
157
|
+
var _props$onBlur;
|
|
158
|
+
props === null || props === void 0 ? void 0 : (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, event);
|
|
153
159
|
handleCloseCalendar();
|
|
154
|
-
setActiveDescendant((selectedDate
|
|
155
|
-
setCalendarDisplayDate(selectedDate
|
|
160
|
+
setActiveDescendant((selectedDate !== null && selectedDate !== void 0 ? selectedDate : (0, _moment.default)()).format(_helpers2.TOKEN_ISO_FORMAT));
|
|
161
|
+
setCalendarDisplayDate(selectedDate !== null && selectedDate !== void 0 ? selectedDate : (0, _moment.default)());
|
|
156
162
|
if (_lodash.default.size(unmaskedValue) !== 8) {
|
|
157
|
-
const date = (0, _moment.default)(_lodash.default.toString(props
|
|
163
|
+
const date = (0, _moment.default)(_lodash.default.toString(props === null || props === void 0 ? void 0 : props.value), _helpers2.TOKEN_ISO_FORMAT);
|
|
158
164
|
if (date.isValid()) {
|
|
159
165
|
setMaskValue(date.format('DD/MM/YYYY'));
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
};
|
|
163
169
|
const handleOnFocus = event => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
var _props$onFocus;
|
|
171
|
+
props === null || props === void 0 ? void 0 : (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 ? void 0 : _props$onFocus.call(props, event);
|
|
172
|
+
setActiveDescendant((selectedDate !== null && selectedDate !== void 0 ? selectedDate : (0, _moment.default)()).format(_helpers2.TOKEN_ISO_FORMAT));
|
|
173
|
+
setCalendarDisplayDate(selectedDate !== null && selectedDate !== void 0 ? selectedDate : (0, _moment.default)());
|
|
174
|
+
if (!isReadOnly && openCalendarOnFocus) {
|
|
168
175
|
handleOpenCalendar();
|
|
169
176
|
}
|
|
170
177
|
};
|
|
@@ -172,18 +179,21 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
172
179
|
if (undigitable) {
|
|
173
180
|
event.preventDefault();
|
|
174
181
|
} else {
|
|
175
|
-
|
|
182
|
+
var _props$onPaste;
|
|
183
|
+
(_props$onPaste = props.onPaste) === null || _props$onPaste === void 0 ? void 0 : _props$onPaste.call(props, event);
|
|
176
184
|
}
|
|
177
185
|
};
|
|
178
186
|
const handleOnBeforeInput = event => {
|
|
179
187
|
if (undigitable) {
|
|
180
188
|
event.preventDefault();
|
|
181
189
|
} else {
|
|
182
|
-
|
|
190
|
+
var _props$onBeforeInput;
|
|
191
|
+
(_props$onBeforeInput = props.onBeforeInput) === null || _props$onBeforeInput === void 0 ? void 0 : _props$onBeforeInput.call(props, event);
|
|
183
192
|
}
|
|
184
193
|
};
|
|
185
194
|
const handleOnKeyDown = event => {
|
|
186
|
-
|
|
195
|
+
var _props$onKeyDown;
|
|
196
|
+
props === null || props === void 0 ? void 0 : (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
|
|
187
197
|
if (calendarBoxOpen && event.key && !event.shiftKey && !event.altKey && _helpers2.NAVIGATION_KEYS.includes(event.key)) {
|
|
188
198
|
event.preventDefault();
|
|
189
199
|
switch (event.key) {
|
|
@@ -223,11 +233,12 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
223
233
|
}
|
|
224
234
|
};
|
|
225
235
|
_react.default.useEffect(() => {
|
|
226
|
-
|
|
236
|
+
var _props$value;
|
|
237
|
+
const currentValue = (_props$value = props === null || props === void 0 ? void 0 : props.value) !== null && _props$value !== void 0 ? _props$value : null;
|
|
227
238
|
const date = (0, _moment.default)(_lodash.default.toString(currentValue), _helpers2.TOKEN_ISO_FORMAT);
|
|
228
239
|
setSelectedDate(date.isValid() ? date : null);
|
|
229
240
|
setMaskValue(date.format(_helpers2.TOKEN_PTBR_FORMAT));
|
|
230
|
-
}, [props
|
|
241
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
231
242
|
const contextValues = _react.default.useMemo(() => ({
|
|
232
243
|
label,
|
|
233
244
|
inputFieldId: inputId,
|
|
@@ -268,11 +279,11 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
268
279
|
"data-testid": "test-date-field-label",
|
|
269
280
|
label: label,
|
|
270
281
|
inputId: inputId,
|
|
271
|
-
hint: props
|
|
282
|
+
hint: props === null || props === void 0 ? void 0 : props.hint,
|
|
272
283
|
isDisabled: isDisabled,
|
|
273
284
|
isReadOnly: isReadOnly,
|
|
274
285
|
skeletonize: skeletonize,
|
|
275
|
-
required: props
|
|
286
|
+
required: props === null || props === void 0 ? void 0 : props.required,
|
|
276
287
|
hintPosition: hintPosition,
|
|
277
288
|
themePopover: themePopover,
|
|
278
289
|
popoverAlign: popoverAlign,
|
|
@@ -286,7 +297,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
286
297
|
}, /*#__PURE__*/_react.default.createElement(BaseDate.Input, _extends({}, rest, {
|
|
287
298
|
ref: (0, _helpers.mergeRefs)(ref, dateInputRef),
|
|
288
299
|
id: inputId,
|
|
289
|
-
name: props
|
|
300
|
+
name: props === null || props === void 0 ? void 0 : props.name,
|
|
290
301
|
value: maskedValue,
|
|
291
302
|
readOnly: isReadOnly,
|
|
292
303
|
disabled: isDisabled,
|
|
@@ -322,8 +333,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
322
333
|
className: "error",
|
|
323
334
|
"data-state-skeletonize": skeletonize,
|
|
324
335
|
"aria-describedby": String(props.name).concat('-errors')
|
|
325
|
-
}, errors
|
|
326
|
-
key:
|
|
336
|
+
}, errors === null || errors === void 0 ? void 0 : errors.map((error, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
337
|
+
key: "".concat(index + 1, "-").concat(error)
|
|
327
338
|
}, error, "\xA0")))))), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
328
339
|
targetRef: inputRootRef,
|
|
329
340
|
text: tooltip,
|
|
@@ -7,8 +7,7 @@ exports.Triggers = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _context = require("./context");
|
|
9
9
|
var BaseDate = _interopRequireWildcard(require("../base"));
|
|
10
|
-
function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
const Triggers = () => {
|
|
14
13
|
const {
|
|
@@ -4,6 +4,7 @@ import { ColorTheme } from '../../../@types/ColorStyles.js';
|
|
|
4
4
|
import { ITooltipCommonProps } from '../../../tooltip/types.js';
|
|
5
5
|
import { HintPosition, Position } from '../../../@types/Position.js';
|
|
6
6
|
import { PermissionAttr, OnDenied } from '../../../@types/PermissionAttr.js';
|
|
7
|
+
import { DateValueReturnType } from '../types.js';
|
|
7
8
|
import 'react';
|
|
8
9
|
|
|
9
10
|
type InputHTMLProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'multiple'>;
|
|
@@ -24,6 +25,7 @@ interface DateFieldInputProps extends InputHTMLProps, ITooltipCommonProps {
|
|
|
24
25
|
openCalendarOnFocus?: boolean;
|
|
25
26
|
shouldCloseOnSelect?: boolean;
|
|
26
27
|
showClearDateButton?: boolean;
|
|
28
|
+
returnValueType?: DateValueReturnType;
|
|
27
29
|
textAlign?: TextAlign;
|
|
28
30
|
hintPosition?: HintPosition;
|
|
29
31
|
themePopover?: ColorTheme;
|
|
@@ -2,6 +2,6 @@ import React__default from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface DateFieldCalendarBoxProps extends React__default.ComponentProps<'div'> {
|
|
4
4
|
}
|
|
5
|
-
declare const CalendarBox: React__default.ForwardRefExoticComponent<Pick<DateFieldCalendarBoxProps, "
|
|
5
|
+
declare const CalendarBox: React__default.ForwardRefExoticComponent<Pick<DateFieldCalendarBoxProps, "children" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "align" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
7
|
export { CalendarBox, DateFieldCalendarBoxProps };
|
|
@@ -34,13 +34,14 @@ const CalendarBox = exports.CalendarBox = /*#__PURE__*/_react.default.forwardRef
|
|
|
34
34
|
const isInRange = day => selectedDate.inicial && selectedDate.final && day.isAfter(selectedDate.inicial, 'day') && day.isBefore(selectedDate.final, 'day');
|
|
35
35
|
const isSelected = day => selectedDate.inicial && day.isSame(selectedDate.inicial, 'day') || selectedDate.final && day.isSame(selectedDate.final, 'day');
|
|
36
36
|
const handleOnMouseDown = event => {
|
|
37
|
-
|
|
37
|
+
var _event$preventDefault;
|
|
38
|
+
event === null || event === void 0 ? void 0 : (_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 ? void 0 : _event$preventDefault.call(event);
|
|
38
39
|
};
|
|
39
40
|
const handleOnClick = (___, daySelected) => {
|
|
40
41
|
const inputActive = document.activeElement;
|
|
41
42
|
let inputType = undefined;
|
|
42
|
-
if (inputActive
|
|
43
|
-
if (inputActive
|
|
43
|
+
if ((inputActive === null || inputActive === void 0 ? void 0 : inputActive.id) === initialInputId) inputType = 'initial';
|
|
44
|
+
if ((inputActive === null || inputActive === void 0 ? void 0 : inputActive.id) === finalInputId) inputType = 'final';
|
|
44
45
|
if (!_lodash.default.isUndefined(inputType)) {
|
|
45
46
|
handleChangeUpdateDateState({
|
|
46
47
|
date: daySelected,
|
|
@@ -89,7 +90,7 @@ const CalendarBox = exports.CalendarBox = /*#__PURE__*/_react.default.forwardRef
|
|
|
89
90
|
className: "date-calendar-box-days-of-week"
|
|
90
91
|
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, _moment.default.weekdaysShort(true).map((day, idx) => /*#__PURE__*/_react.default.createElement("th", {
|
|
91
92
|
role: "columnheader",
|
|
92
|
-
key:
|
|
93
|
+
key: "day-of-week-".concat(idx + 1)
|
|
93
94
|
}, day))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
94
95
|
className: "date-calendar-box-grid-of-days"
|
|
95
96
|
}, /*#__PURE__*/_react.default.createElement("table", {
|
|
@@ -101,11 +102,12 @@ const CalendarBox = exports.CalendarBox = /*#__PURE__*/_react.default.forwardRef
|
|
|
101
102
|
role: "row",
|
|
102
103
|
key: weekIndex + 1
|
|
103
104
|
}, week.map((day, dateIndex) => {
|
|
105
|
+
var _isInRange, _isSelected;
|
|
104
106
|
const idActiveDescendant = day.format(_helpers.TOKEN_ISO_FORMAT);
|
|
105
107
|
const isToday = _lodash.default.isEqual((0, _moment.default)().format(_helpers.TOKEN_ISO_FORMAT), day.format(_helpers.TOKEN_ISO_FORMAT));
|
|
106
|
-
const inRange = isInRange(day)
|
|
108
|
+
const inRange = (_isInRange = isInRange(day)) !== null && _isInRange !== void 0 ? _isInRange : false;
|
|
107
109
|
const hasFocus = _lodash.default.isEqual(activeDescendant, day.format(_helpers.TOKEN_ISO_FORMAT));
|
|
108
|
-
const hasSelected = isSelected(day)
|
|
110
|
+
const hasSelected = (_isSelected = isSelected(day)) !== null && _isSelected !== void 0 ? _isSelected : false;
|
|
109
111
|
const isCurrentMonth = day.month() === calendarDisplayDate.month();
|
|
110
112
|
const descriptionDate = day.format('LL');
|
|
111
113
|
return /*#__PURE__*/_react.default.createElement("td", {
|
|
@@ -6,6 +6,7 @@ import '../../../@types/ColorStyles.js';
|
|
|
6
6
|
import '../../../tooltip/types.js';
|
|
7
7
|
import '../../../@types/Position.js';
|
|
8
8
|
import '../../../@types/PermissionAttr.js';
|
|
9
|
+
import '../types.js';
|
|
9
10
|
|
|
10
11
|
declare const DatePeriodFieldContext: React__default.Context<DatePeriodContextProps>;
|
|
11
12
|
declare const useDatePeriodFieldContext: () => DatePeriodContextProps;
|