@festo-ui/react 4.0.3-pre-20221213.1 → 5.0.0-dev.72
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/index.css +3 -3202
- package/index.d.ts +50 -48
- package/index.js +50 -4797
- package/lib/components/accordion/Accordion.d.ts +9 -9
- package/lib/components/accordion/Accordion.js +38 -0
- package/lib/components/accordion/AccordionContext.d.ts +11 -11
- package/lib/components/accordion/AccordionContext.js +3 -0
- package/lib/components/accordion/accordion-header/AccordionHeader.d.ts +4 -4
- package/lib/components/accordion/accordion-header/AccordionHeader.js +17 -0
- package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -9
- package/lib/components/accordion/accordion-item/AccordionItem.js +64 -0
- package/lib/components/accordion/accordion-item/AccordionItemContext.d.ts +8 -8
- package/lib/components/accordion/accordion-item/AccordionItemContext.js +3 -0
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +4 -4
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +71 -0
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +4 -4
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +41 -0
- package/lib/components/breadcrumb/Breadcrumb.d.ts +14 -14
- package/lib/components/breadcrumb/Breadcrumb.js +45 -0
- package/lib/components/buttons/button/Button.d.ts +12 -12
- package/lib/components/buttons/button/Button.js +37 -0
- package/lib/components/card/Card.d.ts +4 -4
- package/lib/components/card/Card.js +13 -0
- package/lib/components/card/CardBody.d.ts +7 -7
- package/lib/components/card/CardBody.js +18 -0
- package/lib/components/card/CardHeader.d.ts +9 -9
- package/lib/components/card/CardHeader.js +23 -0
- package/lib/components/card/CardNotification.d.ts +9 -9
- package/lib/components/card/CardNotification.js +26 -0
- package/lib/components/chips/chip/Chip.d.ts +19 -19
- package/lib/components/chips/chip/Chip.js +46 -0
- package/lib/components/chips/chip/DeleteIcon.d.ts +2 -0
- package/lib/components/chips/chip/DeleteIcon.js +7 -0
- package/lib/components/chips/chip-container/ChipContainer.d.ts +8 -8
- package/lib/components/chips/chip-container/ChipContainer.js +17 -0
- package/lib/components/link-button/LinkButton.d.ts +10 -10
- package/lib/components/link-button/LinkButton.js +26 -0
- package/lib/components/loading-indicator/LoadingIndicator.d.ts +7 -7
- package/lib/components/loading-indicator/LoadingIndicator.js +40 -0
- package/lib/components/modals/AlertModal.d.ts +14 -14
- package/lib/components/modals/AlertModal.js +76 -0
- package/lib/components/modals/ConfirmModal.d.ts +13 -13
- package/lib/components/modals/ConfirmModal.js +56 -0
- package/lib/components/modals/Modal.d.ts +11 -11
- package/lib/components/modals/Modal.js +76 -0
- package/lib/components/modals/ModalFooter.d.ts +4 -4
- package/lib/components/modals/ModalFooter.js +18 -0
- package/lib/components/modals/Prompt.d.ts +16 -16
- package/lib/components/modals/Prompt.js +65 -0
- package/lib/components/pagination/Pagination.d.ts +17 -17
- package/lib/components/pagination/Pagination.js +107 -0
- package/lib/components/popovers/legend/Legend.d.ts +12 -12
- package/lib/components/popovers/legend/Legend.js +25 -0
- package/lib/components/popovers/popover/Popover.d.ts +18 -18
- package/lib/components/popovers/popover/Popover.js +109 -0
- package/lib/components/popovers/popover-menu/PopoverMenu.d.ts +15 -15
- package/lib/components/popovers/popover-menu/PopoverMenu.js +54 -0
- package/lib/components/popovers/tooltip/Tooltip.d.ts +10 -10
- package/lib/components/popovers/tooltip/Tooltip.js +64 -0
- package/lib/components/progress/Progress.d.ts +9 -9
- package/lib/components/progress/Progress.js +32 -0
- package/lib/components/search-input/ClearButton.d.ts +2 -0
- package/lib/components/search-input/ClearButton.js +10 -0
- package/lib/components/search-input/SearchInput.d.ts +15 -0
- package/lib/components/search-input/SearchInput.js +75 -0
- package/lib/components/search-input/SearchSuggestion.d.ts +17 -0
- package/lib/components/search-input/SearchSuggestion.js +32 -0
- package/lib/components/search-input/useSearchInput.d.ts +13 -0
- package/lib/components/search-input/useSearchInput.js +94 -0
- package/lib/components/snackbar/Snackbar.d.ts +23 -23
- package/lib/components/snackbar/Snackbar.js +87 -0
- package/lib/components/snackbar/SnackbarContext.d.ts +8 -8
- package/lib/components/snackbar/SnackbarContext.js +2 -0
- package/lib/components/snackbar/SnackbarProvider.d.ts +8 -8
- package/lib/components/snackbar/SnackbarProvider.js +58 -0
- package/lib/components/snackbar/useSnackbar.d.ts +3 -3
- package/lib/components/snackbar/useSnackbar.js +3 -0
- package/lib/components/stepper-horizontal/StepperHorizontal.d.ts +7 -7
- package/lib/components/stepper-horizontal/StepperHorizontal.js +62 -0
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +7 -7
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +23 -0
- package/lib/components/stepper-vertical/StepperVertical.d.ts +7 -7
- package/lib/components/stepper-vertical/StepperVertical.js +37 -0
- package/lib/components/stepper-vertical/step-vertical/StepVertical.d.ts +12 -12
- package/lib/components/stepper-vertical/step-vertical/StepVertical.js +77 -0
- package/lib/components/tab/Tabs.d.ts +23 -23
- package/lib/components/tab/Tabs.js +229 -0
- package/lib/components/tab/interfaces.d.ts +5 -0
- package/lib/components/tab/interfaces.js +1 -0
- package/lib/components/tab/tab-pane/TabPane.d.ts +11 -13
- package/lib/components/tab/tab-pane/TabPane.js +23 -0
- package/lib/components/tab/useTabScroll.d.ts +24 -24
- package/lib/components/tab/useTabScroll.js +233 -0
- package/lib/components/table-header-cell/TableHeaderCell.d.ts +7 -7
- package/lib/components/table-header-cell/TableHeaderCell.js +21 -0
- package/lib/forms/checkbox/Checkbox.d.ts +16 -16
- package/lib/forms/checkbox/Checkbox.js +88 -0
- package/lib/forms/color-indicator/ColorIndicator.d.ts +12 -12
- package/lib/forms/color-indicator/ColorIndicator.js +122 -0
- package/lib/forms/color-picker/ColorHelper.d.ts +9 -9
- package/lib/forms/color-picker/ColorHelper.js +142 -0
- package/lib/forms/color-picker/ColorPicker.d.ts +15 -15
- package/lib/forms/color-picker/ColorPicker.js +539 -0
- package/lib/forms/date-picker/DatePicker.d.ts +22 -21
- package/lib/forms/date-picker/DatePicker.js +124 -0
- package/lib/forms/date-range-picker/DateRangePicker.d.ts +20 -20
- package/lib/forms/date-range-picker/DateRangePicker.js +135 -0
- package/lib/forms/radio/RadioButton.d.ts +15 -15
- package/lib/forms/radio/RadioButton.js +56 -0
- package/lib/forms/radio/RadioGroup.d.ts +13 -13
- package/lib/forms/radio/RadioGroup.js +35 -0
- package/lib/forms/radio/RadioGroupContext.d.ts +12 -12
- package/lib/forms/radio/RadioGroupContext.js +3 -0
- package/lib/forms/segment/Segment.d.ts +14 -14
- package/lib/forms/segment/Segment.js +77 -0
- package/lib/forms/segment/segment-control/SegmentControl.d.ts +15 -15
- package/lib/forms/segment/segment-control/SegmentControl.js +64 -0
- package/lib/forms/select/Select.d.ts +26 -26
- package/lib/forms/select/Select.js +281 -0
- package/lib/forms/select/select-option/SelectOption.d.ts +10 -10
- package/lib/forms/select/select-option/SelectOption.js +16 -0
- package/lib/forms/slider/Slider.d.ts +18 -17
- package/lib/forms/slider/Slider.js +92 -0
- package/lib/forms/switch/Switch.d.ts +13 -12
- package/lib/forms/switch/Switch.js +51 -0
- package/lib/forms/text-area/TextArea.d.ts +22 -21
- package/lib/forms/text-area/TextArea.js +108 -0
- package/lib/forms/text-editor/TextEditor.d.ts +29 -29
- package/lib/forms/text-editor/TextEditor.js +255 -0
- package/lib/forms/text-editor/TextEditorButton.d.ts +14 -14
- package/lib/forms/text-editor/TextEditorButton.js +82 -0
- package/lib/forms/text-input/TextInput.d.ts +21 -21
- package/lib/forms/text-input/TextInput.js +75 -0
- package/lib/forms/time-picker/TimePicker.d.ts +18 -18
- package/lib/forms/time-picker/TimePicker.js +161 -0
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +12 -12
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +213 -0
- package/lib/helper/index.d.ts +2 -2
- package/lib/helper/index.js +7 -0
- package/lib/helper/setRef.d.ts +2 -2
- package/lib/helper/setRef.js +7 -0
- package/lib/helper/types.d.ts +7 -7
- package/lib/helper/types.js +1 -0
- package/lib/helper/useControlled.d.ts +6 -6
- package/lib/helper/useControlled.js +18 -0
- package/lib/helper/useForkRef.d.ts +2 -2
- package/lib/helper/useForkRef.js +20 -0
- package/lib/helper/useId.d.ts +1 -0
- package/lib/helper/useId.js +21 -0
- package/lib/helper/useOnClickOutside.d.ts +2 -2
- package/lib/helper/useOnClickOutside.js +18 -0
- package/node/index.js +370 -0
- package/node/lib/components/accordion/Accordion.js +46 -0
- package/node/lib/components/accordion/AccordionContext.js +10 -0
- package/node/lib/components/accordion/accordion-header/AccordionHeader.js +25 -0
- package/node/lib/components/accordion/accordion-item/AccordionItem.js +71 -0
- package/node/lib/components/accordion/accordion-item/AccordionItemContext.js +10 -0
- package/node/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +78 -0
- package/node/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +49 -0
- package/node/lib/components/breadcrumb/Breadcrumb.js +52 -0
- package/node/lib/components/buttons/button/Button.js +44 -0
- package/node/lib/components/card/Card.js +21 -0
- package/node/lib/components/card/CardBody.js +25 -0
- package/node/lib/components/card/CardHeader.js +30 -0
- package/node/lib/components/card/CardNotification.js +33 -0
- package/node/lib/components/chips/chip/Chip.js +54 -0
- package/node/lib/components/chips/chip/DeleteIcon.js +13 -0
- package/node/lib/components/chips/chip-container/ChipContainer.js +25 -0
- package/node/lib/components/link-button/LinkButton.js +33 -0
- package/node/lib/components/loading-indicator/LoadingIndicator.js +48 -0
- package/node/lib/components/modals/AlertModal.js +82 -0
- package/node/lib/components/modals/ConfirmModal.js +62 -0
- package/node/lib/components/modals/Modal.js +84 -0
- package/node/lib/components/modals/ModalFooter.js +26 -0
- package/node/lib/components/modals/Prompt.js +72 -0
- package/node/lib/components/pagination/Pagination.js +116 -0
- package/node/lib/components/popovers/legend/Legend.js +32 -0
- package/node/lib/components/popovers/popover/Popover.js +117 -0
- package/node/lib/components/popovers/popover-menu/PopoverMenu.js +61 -0
- package/node/lib/components/popovers/tooltip/Tooltip.js +70 -0
- package/node/lib/components/progress/Progress.js +40 -0
- package/node/lib/components/search-input/ClearButton.js +16 -0
- package/node/lib/components/search-input/SearchInput.js +82 -0
- package/node/lib/components/search-input/SearchSuggestion.js +39 -0
- package/node/lib/components/search-input/useSearchInput.js +101 -0
- package/node/lib/components/snackbar/Snackbar.js +94 -0
- package/node/lib/components/snackbar/SnackbarContext.js +10 -0
- package/node/lib/components/snackbar/SnackbarProvider.js +65 -0
- package/node/lib/components/snackbar/useSnackbar.js +11 -0
- package/node/lib/components/stepper-horizontal/StepperHorizontal.js +70 -0
- package/node/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +31 -0
- package/node/lib/components/stepper-vertical/StepperVertical.js +47 -0
- package/node/lib/components/stepper-vertical/step-vertical/StepVertical.js +84 -0
- package/node/lib/components/tab/Tabs.js +237 -0
- package/node/lib/components/tab/interfaces.js +5 -0
- package/node/lib/components/tab/tab-pane/TabPane.js +31 -0
- package/node/lib/components/tab/useTabScroll.js +236 -0
- package/node/lib/components/table-header-cell/TableHeaderCell.js +29 -0
- package/node/lib/forms/checkbox/Checkbox.js +97 -0
- package/node/lib/forms/color-indicator/ColorIndicator.js +130 -0
- package/node/lib/forms/color-picker/ColorHelper.js +149 -0
- package/node/lib/forms/color-picker/ColorPicker.js +549 -0
- package/node/lib/forms/date-picker/DatePicker.js +131 -0
- package/node/lib/forms/date-range-picker/DateRangePicker.js +142 -0
- package/node/lib/forms/radio/RadioButton.js +63 -0
- package/node/lib/forms/radio/RadioGroup.js +43 -0
- package/node/lib/forms/radio/RadioGroupContext.js +10 -0
- package/node/lib/forms/segment/Segment.js +84 -0
- package/node/lib/forms/segment/segment-control/SegmentControl.js +72 -0
- package/node/lib/forms/select/Select.js +289 -0
- package/node/lib/forms/select/select-option/SelectOption.js +26 -0
- package/node/lib/forms/slider/Slider.js +101 -0
- package/node/lib/forms/switch/Switch.js +58 -0
- package/node/lib/forms/text-area/TextArea.js +117 -0
- package/node/lib/forms/text-editor/TextEditor.js +261 -0
- package/node/lib/forms/text-editor/TextEditorButton.js +88 -0
- package/node/lib/forms/text-input/TextInput.js +84 -0
- package/node/lib/forms/time-picker/TimePicker.js +169 -0
- package/node/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +222 -0
- package/node/lib/helper/index.js +15 -0
- package/node/lib/helper/setRef.js +13 -0
- package/node/lib/helper/types.js +5 -0
- package/node/lib/helper/useControlled.js +24 -0
- package/node/lib/helper/useForkRef.js +26 -0
- package/node/lib/helper/useId.js +27 -0
- package/node/lib/helper/useOnClickOutside.js +24 -0
- package/package.json +20 -10
- package/README.md +0 -17
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useForkRef = _interopRequireDefault(require("../../../helper/useForkRef"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
const TimePickerDropdown = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
15
|
+
let {
|
|
16
|
+
timeFormat,
|
|
17
|
+
date,
|
|
18
|
+
onDateChange,
|
|
19
|
+
showSeconds,
|
|
20
|
+
onClose,
|
|
21
|
+
style
|
|
22
|
+
} = _ref;
|
|
23
|
+
const innerRef = (0, _react.useRef)(null);
|
|
24
|
+
const combinedRef = (0, _useForkRef.default)(ref, innerRef);
|
|
25
|
+
const hoursRef = (0, _react.useRef)(null);
|
|
26
|
+
const [tmpHours, setTmpHours] = (0, _react.useState)(null);
|
|
27
|
+
const [tmpMinutes, setTmpMinutes] = (0, _react.useState)(null);
|
|
28
|
+
const [tmpSeconds, setTmpSeconds] = (0, _react.useState)(null);
|
|
29
|
+
const [innerDate, setInnerDate] = (0, _react.useState)(date);
|
|
30
|
+
const min = 0;
|
|
31
|
+
const hourMax = timeFormat === '12' ? 12 : 23;
|
|
32
|
+
const minutesSecondsMax = 59;
|
|
33
|
+
(0, _react.useEffect)(() => {
|
|
34
|
+
requestAnimationFrame(() => {
|
|
35
|
+
hoursRef.current?.focus();
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
38
|
+
function handleKeyPress(e) {
|
|
39
|
+
if (e.key === 'Escape' || e.key === 'Enter') {
|
|
40
|
+
onClose(e.key === 'Enter' ? innerDate : undefined);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function handleHourUp() {
|
|
44
|
+
const newDate = new Date(innerDate);
|
|
45
|
+
newDate.setHours(innerDate.getHours() + 1);
|
|
46
|
+
setInnerDate(newDate);
|
|
47
|
+
onDateChange(newDate);
|
|
48
|
+
setTmpHours(null);
|
|
49
|
+
}
|
|
50
|
+
function handleHourDown() {
|
|
51
|
+
const newDate = new Date(innerDate);
|
|
52
|
+
newDate.setHours(innerDate.getHours() - 1);
|
|
53
|
+
setInnerDate(newDate);
|
|
54
|
+
onDateChange(newDate);
|
|
55
|
+
setTmpHours(null);
|
|
56
|
+
}
|
|
57
|
+
function handleHourChange(e) {
|
|
58
|
+
const newDate = new Date(innerDate);
|
|
59
|
+
const hour = +e.target.value;
|
|
60
|
+
newDate.setHours(Math.min(Math.max(hour, min), hourMax));
|
|
61
|
+
setInnerDate(newDate);
|
|
62
|
+
setTmpHours(e.target.value);
|
|
63
|
+
}
|
|
64
|
+
function handleMinuteUp() {
|
|
65
|
+
const newDate = new Date(innerDate);
|
|
66
|
+
newDate.setMinutes(innerDate.getMinutes() + 1);
|
|
67
|
+
setInnerDate(newDate);
|
|
68
|
+
onDateChange(newDate);
|
|
69
|
+
setTmpMinutes(null);
|
|
70
|
+
}
|
|
71
|
+
function handleMinuteDown() {
|
|
72
|
+
const newDate = new Date(innerDate);
|
|
73
|
+
newDate.setMinutes(innerDate.getMinutes() - 1);
|
|
74
|
+
setInnerDate(newDate);
|
|
75
|
+
onDateChange(newDate);
|
|
76
|
+
setTmpMinutes(null);
|
|
77
|
+
}
|
|
78
|
+
function handleMinuteChange(e) {
|
|
79
|
+
const newDate = new Date(innerDate);
|
|
80
|
+
const minute = +e.target.value;
|
|
81
|
+
newDate.setMinutes(Math.min(Math.max(minute, min), minutesSecondsMax));
|
|
82
|
+
setInnerDate(newDate);
|
|
83
|
+
setTmpMinutes(e.target.value);
|
|
84
|
+
}
|
|
85
|
+
function handleSecondUp() {
|
|
86
|
+
const newDate = new Date(innerDate);
|
|
87
|
+
newDate.setSeconds(innerDate.getSeconds() + 1);
|
|
88
|
+
setInnerDate(newDate);
|
|
89
|
+
onDateChange(newDate);
|
|
90
|
+
setTmpSeconds(null);
|
|
91
|
+
}
|
|
92
|
+
function handleSecondDown() {
|
|
93
|
+
const newDate = new Date(innerDate);
|
|
94
|
+
newDate.setSeconds(innerDate.getSeconds() - 1);
|
|
95
|
+
setInnerDate(newDate);
|
|
96
|
+
onDateChange(newDate);
|
|
97
|
+
setTmpSeconds(null);
|
|
98
|
+
}
|
|
99
|
+
function handleSecondChange(e) {
|
|
100
|
+
const newDate = new Date(innerDate);
|
|
101
|
+
const seconds = +e.target.value;
|
|
102
|
+
newDate.setSeconds(Math.min(Math.max(seconds, min), minutesSecondsMax));
|
|
103
|
+
setInnerDate(newDate);
|
|
104
|
+
setTmpSeconds(e.target.value);
|
|
105
|
+
}
|
|
106
|
+
const hours = timeFormat === '12' ? (innerDate.getHours() + 11) % 12 + 1 : innerDate.getHours();
|
|
107
|
+
return (
|
|
108
|
+
/*#__PURE__*/
|
|
109
|
+
// should not be an issue with dialog
|
|
110
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
111
|
+
(0, _jsxRuntime.jsxs)("div", {
|
|
112
|
+
role: "dialog",
|
|
113
|
+
style: style,
|
|
114
|
+
ref: combinedRef,
|
|
115
|
+
className: (0, _classnames.default)('fr-timepicker fwe-timepicker', {
|
|
116
|
+
'fwe-timepicker-am-pm': timeFormat === '12'
|
|
117
|
+
}),
|
|
118
|
+
onKeyDown: e => handleKeyPress(e),
|
|
119
|
+
tabIndex: -1,
|
|
120
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
121
|
+
className: "fwe-timepicker-spinners",
|
|
122
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
123
|
+
className: "fwe-timepicker-spinners-hours",
|
|
124
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
125
|
+
type: "button",
|
|
126
|
+
"aria-label": "hour up",
|
|
127
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
128
|
+
onClick: () => handleHourUp(),
|
|
129
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
130
|
+
"aria-hidden": true,
|
|
131
|
+
className: "fwe-icon fwe-icon-arrows-expand"
|
|
132
|
+
})
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
134
|
+
"aria-label": "hours value",
|
|
135
|
+
className: "fwe-timepicker-hide-spinners",
|
|
136
|
+
type: "number",
|
|
137
|
+
min: min,
|
|
138
|
+
step: 1,
|
|
139
|
+
value: tmpHours ?? (hours < 10 ? '0' : '') + hours,
|
|
140
|
+
max: hourMax,
|
|
141
|
+
onInput: handleHourChange,
|
|
142
|
+
ref: hoursRef
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
"aria-label": "hour down",
|
|
146
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
147
|
+
onClick: () => handleHourDown(),
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
149
|
+
"aria-hidden": true,
|
|
150
|
+
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
151
|
+
})
|
|
152
|
+
})]
|
|
153
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
154
|
+
className: "fwe-timepicker-spinners-minutes",
|
|
155
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
156
|
+
type: "button",
|
|
157
|
+
"aria-label": "minute up",
|
|
158
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
159
|
+
onClick: () => handleMinuteUp(),
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
161
|
+
"aria-hidden": true,
|
|
162
|
+
className: "fwe-icon fwe-icon-arrows-expand"
|
|
163
|
+
})
|
|
164
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
165
|
+
"aria-label": "minutes value",
|
|
166
|
+
className: "fwe-timepicker-hide-spinners",
|
|
167
|
+
type: "number",
|
|
168
|
+
min: min,
|
|
169
|
+
step: 1,
|
|
170
|
+
value: tmpMinutes ?? (innerDate.getMinutes() < 10 ? '0' : '') + innerDate.getMinutes(),
|
|
171
|
+
max: minutesSecondsMax,
|
|
172
|
+
onInput: handleMinuteChange
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
174
|
+
type: "button",
|
|
175
|
+
"aria-label": "minute down",
|
|
176
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
177
|
+
onClick: () => handleMinuteDown(),
|
|
178
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
179
|
+
"aria-hidden": true,
|
|
180
|
+
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
}), showSeconds && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
184
|
+
className: "fwe-timepicker-spinners-seconds",
|
|
185
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
186
|
+
type: "button",
|
|
187
|
+
"aria-label": "seconds up",
|
|
188
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
189
|
+
onClick: () => handleSecondUp(),
|
|
190
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
191
|
+
"aria-hidden": true,
|
|
192
|
+
className: "fwe-icon fwe-icon-arrows-expand"
|
|
193
|
+
})
|
|
194
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
195
|
+
"aria-label": "seconds value",
|
|
196
|
+
className: "fwe-timepicker-hide-spinners",
|
|
197
|
+
type: "number",
|
|
198
|
+
min: min,
|
|
199
|
+
step: 1,
|
|
200
|
+
value: tmpSeconds ?? (innerDate.getSeconds() < 10 ? '0' : '') + innerDate.getSeconds(),
|
|
201
|
+
max: minutesSecondsMax,
|
|
202
|
+
onInput: handleSecondChange
|
|
203
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
204
|
+
type: "button",
|
|
205
|
+
"aria-label": "minute down",
|
|
206
|
+
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
207
|
+
onClick: () => handleSecondDown(),
|
|
208
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
209
|
+
"aria-hidden": true,
|
|
210
|
+
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
211
|
+
})
|
|
212
|
+
})]
|
|
213
|
+
})]
|
|
214
|
+
}), timeFormat === '12' && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
215
|
+
className: "fwe-badge fwe-badge-control",
|
|
216
|
+
children: innerDate.getHours() >= 12 ? 'PM' : 'AM'
|
|
217
|
+
})]
|
|
218
|
+
})
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
var _default = TimePickerDropdown;
|
|
222
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.provideDiv = exports.default = void 0;
|
|
7
|
+
const provideDiv = () => {
|
|
8
|
+
const div = document.createElement('div');
|
|
9
|
+
const id = Math.floor(Math.random() * 1000);
|
|
10
|
+
div.setAttribute('id', `${id}`);
|
|
11
|
+
return div;
|
|
12
|
+
};
|
|
13
|
+
exports.provideDiv = provideDiv;
|
|
14
|
+
var _default = provideDiv;
|
|
15
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useControlled;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useControlled(_ref) {
|
|
9
|
+
let {
|
|
10
|
+
controlled,
|
|
11
|
+
default: defaultValue
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
current: isControlled
|
|
15
|
+
} = (0, _react.useRef)(controlled !== undefined);
|
|
16
|
+
const [valueState, setValue] = (0, _react.useState)(defaultValue);
|
|
17
|
+
const value = isControlled ? controlled : valueState;
|
|
18
|
+
const setValueIfUncontrolled = (0, _react.useCallback)(newValue => {
|
|
19
|
+
if (!isControlled) {
|
|
20
|
+
setValue(newValue);
|
|
21
|
+
}
|
|
22
|
+
}, [isControlled]);
|
|
23
|
+
return [value, setValueIfUncontrolled];
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useForkRef;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _setRef = _interopRequireDefault(require("./setRef"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
// https://github.com/facebook/react/issues/13029#issuecomment-497629971
|
|
11
|
+
function useForkRef(refA, refB) {
|
|
12
|
+
/**
|
|
13
|
+
* This will create a new function if the ref props change and are defined.
|
|
14
|
+
* This means react will call the old forkRef with `null` and the new forkRef
|
|
15
|
+
* with the ref. Cleanup naturally emerges from this behavior
|
|
16
|
+
*/
|
|
17
|
+
return _react.default.useMemo(() => {
|
|
18
|
+
if ((refA === null || refA === undefined) && (refB == null || refB === undefined)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return instance => {
|
|
22
|
+
(0, _setRef.default)(refA, instance);
|
|
23
|
+
(0, _setRef.default)(refB, instance);
|
|
24
|
+
};
|
|
25
|
+
}, [refA, refB]);
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useId;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
// eslint-disable-next-line no-useless-concat
|
|
10
|
+
const maybeReactUseId = _react.default['useId' + ''];
|
|
11
|
+
let nextId = 0;
|
|
12
|
+
function useLegacyId() {
|
|
13
|
+
const [id, setId] = _react.default.useState(undefined);
|
|
14
|
+
_react.default.useEffect(() => {
|
|
15
|
+
if (id == null) {
|
|
16
|
+
nextId += 1;
|
|
17
|
+
setId(`fr-${nextId}`);
|
|
18
|
+
}
|
|
19
|
+
}, [setId]);
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
function useId(idInput) {
|
|
23
|
+
if (idInput !== undefined && idInput !== null) {
|
|
24
|
+
return idInput;
|
|
25
|
+
}
|
|
26
|
+
return maybeReactUseId ? maybeReactUseId() : useLegacyId();
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useOnClickOutside;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useOnClickOutside(ref, callback, ref2) {
|
|
9
|
+
(0, _react.useEffect)(() => {
|
|
10
|
+
const listener = event => {
|
|
11
|
+
// Do nothing if clicking ref's element or descendent elements
|
|
12
|
+
if (!ref.current || ref.current.contains(event.target) || ref2 && (!ref2.current || ref2.current.contains(event.target))) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
callback(event);
|
|
16
|
+
};
|
|
17
|
+
document.addEventListener('mousedown', listener);
|
|
18
|
+
document.addEventListener('touchstart', listener);
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener('mousedown', listener);
|
|
21
|
+
document.removeEventListener('touchstart', listener);
|
|
22
|
+
};
|
|
23
|
+
}, [ref, ref2, callback]);
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@festo-ui/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-dev.72",
|
|
4
4
|
"author": "Festo UI (styleguide@festo.com)",
|
|
5
5
|
"license": "apache-2.0",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
+
"@festo-ui/web-essentials": "*",
|
|
7
8
|
"react": "^17.0.0 || ^18.0.0",
|
|
8
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
9
|
-
"@festo-ui/web-essentials": "*"
|
|
9
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": [
|
|
12
12
|
"*.scss",
|
|
13
13
|
"*.css"
|
|
14
14
|
],
|
|
15
15
|
"module": "./index.js",
|
|
16
|
-
"main": "./index.js",
|
|
16
|
+
"main": "./node/index.js",
|
|
17
17
|
"types": "./index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"@popperjs/core": "^2.11.0",
|
|
20
|
+
"@types/quill": "^2.0.10",
|
|
19
21
|
"classnames": "^2.2.6",
|
|
20
|
-
"
|
|
22
|
+
"flatpickr": "^4.6.9",
|
|
23
|
+
"quill": "1.3.7",
|
|
24
|
+
"react-draggable": "^4.4.4",
|
|
21
25
|
"react-outside-click-handler": "^1.3.0",
|
|
22
26
|
"react-popper": "^2.3.0",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
"react-transition-group": "^4.4.2",
|
|
28
|
+
"sass": "^1.57.1",
|
|
29
|
+
"xss": "^1.0.10"
|
|
30
|
+
},
|
|
31
|
+
"browserslist": [
|
|
32
|
+
"defaults"
|
|
33
|
+
],
|
|
34
|
+
"postcss": {
|
|
35
|
+
"plugins": {
|
|
36
|
+
"autoprefixer": {}
|
|
37
|
+
}
|
|
28
38
|
}
|
|
29
39
|
}
|
package/README.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# FESTO UI
|
|
2
|
-
|
|
3
|
-
## React Component Library
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
To install Festo React, run:
|
|
8
|
-
|
|
9
|
-
`npm install @festo-ui/react @festo-ui/web-essentials`
|
|
10
|
-
|
|
11
|
-
### Stylesheets
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
/* The following lines should be included in your src/index.js or App.js file*/
|
|
15
|
-
import '@festo-ui/web-essentials/dist/css/festo-web-essentials.min.css';
|
|
16
|
-
import '@festo-ui/react/index.css';
|
|
17
|
-
```
|