@festo-ui/react 4.0.3-pre-20221124.8 → 5.0.0-dev.102
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,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _TextEditorButton = _interopRequireDefault(require("./TextEditorButton"));
|
|
10
|
+
var _useId = _interopRequireDefault(require("../../helper/useId"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
const xss = require('xss');
|
|
14
|
+
const defaultConfig = {
|
|
15
|
+
toolbar: {
|
|
16
|
+
bold: true,
|
|
17
|
+
italic: true,
|
|
18
|
+
underline: true,
|
|
19
|
+
alignCenter: true,
|
|
20
|
+
alignRight: true,
|
|
21
|
+
bulletList: true,
|
|
22
|
+
orderedList: true,
|
|
23
|
+
image: true,
|
|
24
|
+
link: true
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function TextEditor(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
disabled = false,
|
|
30
|
+
label,
|
|
31
|
+
maxLength,
|
|
32
|
+
value,
|
|
33
|
+
hint,
|
|
34
|
+
error,
|
|
35
|
+
readOnly = false,
|
|
36
|
+
onChange,
|
|
37
|
+
className,
|
|
38
|
+
config: configProps
|
|
39
|
+
} = _ref;
|
|
40
|
+
const editorRef = (0, _react.useRef)(null);
|
|
41
|
+
const [editor, setEditor] = (0, _react.useState)(null);
|
|
42
|
+
const id = (0, _useId.default)();
|
|
43
|
+
const [innerValue, setInnerValue] = (0, _react.useState)(value);
|
|
44
|
+
const config = {
|
|
45
|
+
toolbar: {
|
|
46
|
+
...defaultConfig.toolbar,
|
|
47
|
+
...configProps?.toolbar
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
51
|
+
if (editorRef && editor === null && typeof window === 'object') {
|
|
52
|
+
// eslint-disable-next-line global-require
|
|
53
|
+
const Quill = require('quill');
|
|
54
|
+
const newEditor = new Quill(editorRef.current, {
|
|
55
|
+
modules: {
|
|
56
|
+
toolbar: `#editor-toolbar-${CSS.escape(id ?? '')}`
|
|
57
|
+
},
|
|
58
|
+
theme: 'snow',
|
|
59
|
+
scrollingContainer: `#editor-container-${CSS.escape(id ?? '')}`
|
|
60
|
+
});
|
|
61
|
+
newEditor.root.setAttribute('role', 'textbox');
|
|
62
|
+
newEditor.root.setAttribute('aria-labelledby', `editor-label-${id}`);
|
|
63
|
+
newEditor.root.setAttribute('aria-multiline', 'true');
|
|
64
|
+
newEditor.enable(!readOnly);
|
|
65
|
+
if (disabled) {
|
|
66
|
+
newEditor.disable();
|
|
67
|
+
} else if (!readOnly) {
|
|
68
|
+
newEditor.enable();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// set up a matcher that does allow/disallow to paste images corresponding to config settings
|
|
72
|
+
newEditor.clipboard.addMatcher('img', (_node, delta) => {
|
|
73
|
+
// allowed, passthru delta
|
|
74
|
+
if (config.toolbar?.image === true) {
|
|
75
|
+
return delta;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// not allowed, remove image by setting up a new delta
|
|
79
|
+
const Delta = Quill.import('quill-delta');
|
|
80
|
+
return new Delta().insert('');
|
|
81
|
+
});
|
|
82
|
+
setEditor(newEditor);
|
|
83
|
+
}
|
|
84
|
+
}, [editorRef, editor, disabled, readOnly, className, id, config.toolbar?.image]);
|
|
85
|
+
(0, _react.useEffect)(() => {
|
|
86
|
+
if (editor) {
|
|
87
|
+
editor.on('text-change', () => {
|
|
88
|
+
let html = editor.root.innerHTML;
|
|
89
|
+
if (html === '<p><br></p>' || html === '<div><br></div>' || html === undefined) {
|
|
90
|
+
html = null;
|
|
91
|
+
}
|
|
92
|
+
if (onChange) {
|
|
93
|
+
onChange(html);
|
|
94
|
+
}
|
|
95
|
+
setInnerValue(html);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, [editor, onChange]);
|
|
99
|
+
(0, _react.useEffect)(() => {
|
|
100
|
+
if (editor) {
|
|
101
|
+
const whiteList = {
|
|
102
|
+
...xss.whiteList,
|
|
103
|
+
a: [...xss.whiteList.a, 'rel']
|
|
104
|
+
};
|
|
105
|
+
const sanitizedValue = xss(value, {
|
|
106
|
+
whiteList
|
|
107
|
+
});
|
|
108
|
+
const content = editor.clipboard.convert(sanitizedValue);
|
|
109
|
+
editor.setContents(content, 'silent');
|
|
110
|
+
}
|
|
111
|
+
}, [editor, value]);
|
|
112
|
+
function currentLength() {
|
|
113
|
+
return innerValue?.length || 0;
|
|
114
|
+
}
|
|
115
|
+
function hideDivider(name) {
|
|
116
|
+
const linkOrImage = config.toolbar?.image || config.toolbar?.link;
|
|
117
|
+
const lists = config.toolbar?.bulletList || config.toolbar?.orderedList;
|
|
118
|
+
const typos = config.toolbar?.bold || config.toolbar?.italic || config.toolbar?.underline;
|
|
119
|
+
const textAlign = config.toolbar?.alignCenter || config.toolbar?.alignRight;
|
|
120
|
+
switch (name) {
|
|
121
|
+
case 'typo':
|
|
122
|
+
return !typos || !textAlign && !linkOrImage && !lists;
|
|
123
|
+
case 'text-align':
|
|
124
|
+
return !textAlign || !linkOrImage && !lists;
|
|
125
|
+
case 'lists':
|
|
126
|
+
return !lists || !linkOrImage;
|
|
127
|
+
case 'image':
|
|
128
|
+
return !config.toolbar?.image || !config.toolbar.link;
|
|
129
|
+
default:
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
135
|
+
className: (0, _classnames.default)('fwe-input-text', {
|
|
136
|
+
disabled
|
|
137
|
+
}),
|
|
138
|
+
htmlFor: `editor-label-${id}`,
|
|
139
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
140
|
+
className: (0, _classnames.default)('fwe-editor-toolbar', {
|
|
141
|
+
[`fwe-editor-toolbar-${className}`]: className
|
|
142
|
+
}),
|
|
143
|
+
id: `editor-toolbar-${id}`,
|
|
144
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
145
|
+
className: "ql-formats fwe-d-none",
|
|
146
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
147
|
+
className: "ql-size",
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
150
|
+
value: "small",
|
|
151
|
+
"aria-label": "small"
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
153
|
+
selected: true,
|
|
154
|
+
"aria-label": "selected"
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
156
|
+
value: "large",
|
|
157
|
+
"aria-label": "large"
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
159
|
+
value: "huge",
|
|
160
|
+
"aria-label": "huge"
|
|
161
|
+
})]
|
|
162
|
+
})
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
164
|
+
className: "ql-formats fwe-mr-3",
|
|
165
|
+
children: [config?.toolbar?.bold && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
166
|
+
disabled: disabled,
|
|
167
|
+
type: "bold",
|
|
168
|
+
className: "fwe-mr-3",
|
|
169
|
+
label: "B"
|
|
170
|
+
}), config?.toolbar?.italic && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
type: "italic",
|
|
173
|
+
className: "fwe-mr-3",
|
|
174
|
+
label: "I"
|
|
175
|
+
}), config?.toolbar?.underline && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
176
|
+
disabled: disabled,
|
|
177
|
+
type: "underline",
|
|
178
|
+
label: "U"
|
|
179
|
+
}), !hideDivider('typo') && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
180
|
+
className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
|
|
181
|
+
}), config?.toolbar?.alignCenter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
182
|
+
disabled: disabled,
|
|
183
|
+
category: "align",
|
|
184
|
+
type: "align-center",
|
|
185
|
+
icon: (0, _classnames.default)('text-align-center', {
|
|
186
|
+
'fwe-gray': disabled
|
|
187
|
+
}),
|
|
188
|
+
value: "center",
|
|
189
|
+
className: (0, _classnames.default)('fwe-btn-toolbar-list fwe-btn-toolbar-list-alignments', {
|
|
190
|
+
'fwe-mr-3': config?.toolbar?.alignRight
|
|
191
|
+
})
|
|
192
|
+
}), config?.toolbar?.alignRight && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
193
|
+
disabled: disabled,
|
|
194
|
+
category: "align",
|
|
195
|
+
type: "align-right",
|
|
196
|
+
icon: (0, _classnames.default)('text-align-right', {
|
|
197
|
+
'fwe-gray': disabled
|
|
198
|
+
}),
|
|
199
|
+
value: "right",
|
|
200
|
+
className: "fwe-btn-toolbar-list fwe-btn-toolbar-list-alignments"
|
|
201
|
+
}), !hideDivider('text-align') && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
|
+
className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
|
|
203
|
+
}), config?.toolbar?.bulletList && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
204
|
+
disabled: disabled,
|
|
205
|
+
className: "fwe-mr-3",
|
|
206
|
+
type: "ul",
|
|
207
|
+
list: true,
|
|
208
|
+
icon: "list-list-view",
|
|
209
|
+
value: "bullet"
|
|
210
|
+
}), config?.toolbar?.orderedList && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
211
|
+
disabled: disabled,
|
|
212
|
+
type: "ol",
|
|
213
|
+
list: true,
|
|
214
|
+
icon: "enumeration",
|
|
215
|
+
value: "ordered"
|
|
216
|
+
}), config?.toolbar?.image && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
217
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
218
|
+
className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
220
|
+
disabled: disabled,
|
|
221
|
+
type: "image",
|
|
222
|
+
icon: "image-image",
|
|
223
|
+
noAction: true
|
|
224
|
+
})]
|
|
225
|
+
}), config?.toolbar?.link && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
226
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
227
|
+
className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
|
|
228
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditorButton.default, {
|
|
229
|
+
disabled: disabled,
|
|
230
|
+
type: "link",
|
|
231
|
+
icon: "file-link",
|
|
232
|
+
noAction: true
|
|
233
|
+
})]
|
|
234
|
+
})]
|
|
235
|
+
})]
|
|
236
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
237
|
+
className: (0, _classnames.default)('fwe-editor-container', {
|
|
238
|
+
'fwe-editor-container--error': error
|
|
239
|
+
}),
|
|
240
|
+
id: `editor-container-${id}`,
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
|
+
className: "fwe-editor",
|
|
243
|
+
ref: editorRef
|
|
244
|
+
})
|
|
245
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
246
|
+
className: "fwe-input-text-label",
|
|
247
|
+
children: label
|
|
248
|
+
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
249
|
+
className: "fwe-text-editor-invalid",
|
|
250
|
+
children: error
|
|
251
|
+
}), hint && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
252
|
+
className: "fwe-text-editor-info",
|
|
253
|
+
children: hint
|
|
254
|
+
}), maxLength && maxLength > 0 && value != null && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
255
|
+
className: "fwe-input-text-count",
|
|
256
|
+
children: `${currentLength()} / ${maxLength}`
|
|
257
|
+
})]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
var _default = TextEditor;
|
|
261
|
+
exports.default = _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function TextEditorButton(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
disabled,
|
|
14
|
+
label,
|
|
15
|
+
type,
|
|
16
|
+
className,
|
|
17
|
+
icon,
|
|
18
|
+
list,
|
|
19
|
+
value,
|
|
20
|
+
noAction,
|
|
21
|
+
category
|
|
22
|
+
} = _ref;
|
|
23
|
+
const [active, setActive] = (0, _react.useState)(false);
|
|
24
|
+
const btnRef = (0, _react.useRef)(null);
|
|
25
|
+
function handleClick() {
|
|
26
|
+
const btn = btnRef.current;
|
|
27
|
+
setActive(prevActive => !prevActive);
|
|
28
|
+
btn?.click();
|
|
29
|
+
}
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
31
|
+
function callback(mutationRecords) {
|
|
32
|
+
mutationRecords.forEach(mutationRecord => {
|
|
33
|
+
const {
|
|
34
|
+
classList
|
|
35
|
+
} = mutationRecord.target;
|
|
36
|
+
const {
|
|
37
|
+
oldValue
|
|
38
|
+
} = mutationRecord;
|
|
39
|
+
if (classList.contains('ql-active')) {
|
|
40
|
+
setActive(true);
|
|
41
|
+
}
|
|
42
|
+
if (!classList.contains('ql-active') && oldValue?.includes('ql-active')) {
|
|
43
|
+
setActive(false);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (btnRef.current && !noAction) {
|
|
48
|
+
const observer = new MutationObserver(callback);
|
|
49
|
+
observer.observe(btnRef.current, {
|
|
50
|
+
attributes: true,
|
|
51
|
+
attributeFilter: ['class'],
|
|
52
|
+
attributeOldValue: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, [btnRef, noAction]);
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
58
|
+
ref: btnRef,
|
|
59
|
+
type: "button",
|
|
60
|
+
className: (0, _classnames.default)({
|
|
61
|
+
[`ql-${category || type}`]: !list
|
|
62
|
+
}, {
|
|
63
|
+
'ql-list': list
|
|
64
|
+
}, 'fwe-d-none', {
|
|
65
|
+
[`action-${type}`]: !noAction
|
|
66
|
+
}),
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
value: value
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
className: (0, _classnames.default)('fwe-btn', {
|
|
72
|
+
'fwe-btn-toolbar-list': list
|
|
73
|
+
}, 'fr-button', className, {
|
|
74
|
+
'fwe-active': active && !noAction
|
|
75
|
+
}),
|
|
76
|
+
onClick: () => handleClick(),
|
|
77
|
+
disabled: disabled,
|
|
78
|
+
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
79
|
+
className: `fr-button-text fwe-text-${type}`,
|
|
80
|
+
children: label
|
|
81
|
+
}), icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
82
|
+
className: (0, _classnames.default)('fwe-icon fwe-icon-toolbar-list', `fwe-icon-${icon}`, 'fwe-pr-0')
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
var _default = TextEditorButton;
|
|
88
|
+
exports.default = _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _useId = _interopRequireDefault(require("../../helper/useId"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
const TextInput = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
15
|
+
let {
|
|
16
|
+
disabled,
|
|
17
|
+
required,
|
|
18
|
+
readonly,
|
|
19
|
+
placeholder,
|
|
20
|
+
max,
|
|
21
|
+
min,
|
|
22
|
+
onBlur,
|
|
23
|
+
onFocus,
|
|
24
|
+
onInput,
|
|
25
|
+
step,
|
|
26
|
+
type,
|
|
27
|
+
value,
|
|
28
|
+
error,
|
|
29
|
+
hint,
|
|
30
|
+
label,
|
|
31
|
+
labelClassName,
|
|
32
|
+
id: idProps,
|
|
33
|
+
...props
|
|
34
|
+
} = _ref;
|
|
35
|
+
const id = (0, _useId.default)(idProps);
|
|
36
|
+
const [innerValue, setInnerValue] = (0, _react.useState)(value);
|
|
37
|
+
(0, _react.useEffect)(() => {
|
|
38
|
+
setInnerValue(value);
|
|
39
|
+
}, [value]);
|
|
40
|
+
const supported = ['text', 'number', 'password', 'datetime-local'];
|
|
41
|
+
const innerType = type && supported.indexOf(type) !== -1 ? type : 'text';
|
|
42
|
+
const labelClasses = (0, _classnames.default)('fwe-input-text', labelClassName);
|
|
43
|
+
const hintClasses = (0, _classnames.default)('fwe-input-text-info');
|
|
44
|
+
function handleChange(e) {
|
|
45
|
+
setInnerValue(e.target.value);
|
|
46
|
+
if (props.onChange) {
|
|
47
|
+
props.onChange(e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
51
|
+
className: labelClasses,
|
|
52
|
+
htmlFor: id,
|
|
53
|
+
ref: ref,
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
required: required,
|
|
57
|
+
readOnly: readonly,
|
|
58
|
+
placeholder: placeholder,
|
|
59
|
+
autoComplete: "off",
|
|
60
|
+
min: min,
|
|
61
|
+
max: max,
|
|
62
|
+
step: step,
|
|
63
|
+
onChange: handleChange,
|
|
64
|
+
onBlur: onBlur,
|
|
65
|
+
onFocus: onFocus,
|
|
66
|
+
onInput: onInput,
|
|
67
|
+
type: innerType,
|
|
68
|
+
value: innerValue,
|
|
69
|
+
id: id,
|
|
70
|
+
...props
|
|
71
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
72
|
+
className: "fwe-input-text-label",
|
|
73
|
+
children: label
|
|
74
|
+
}), hint && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
75
|
+
className: hintClasses,
|
|
76
|
+
children: hint
|
|
77
|
+
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
78
|
+
className: "fwe-input-text-invalid",
|
|
79
|
+
children: error
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _default = TextInput;
|
|
84
|
+
exports.default = _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
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 _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
|
+
var _reactPopper = require("react-popper");
|
|
11
|
+
var _useForkRef = _interopRequireDefault(require("../../helper/useForkRef"));
|
|
12
|
+
var _useId = _interopRequireDefault(require("../../helper/useId"));
|
|
13
|
+
var _useOnClickOutside = _interopRequireDefault(require("../../helper/useOnClickOutside"));
|
|
14
|
+
var _TimePickerDropdown = _interopRequireDefault(require("./time-picker-dropdown/TimePickerDropdown"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
const TimePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
error,
|
|
22
|
+
hint,
|
|
23
|
+
required,
|
|
24
|
+
disabled,
|
|
25
|
+
children,
|
|
26
|
+
value,
|
|
27
|
+
options,
|
|
28
|
+
defaultValue,
|
|
29
|
+
formatDate,
|
|
30
|
+
onChange,
|
|
31
|
+
id: idProps,
|
|
32
|
+
...props
|
|
33
|
+
} = _ref;
|
|
34
|
+
const id = (0, _useId.default)(idProps);
|
|
35
|
+
const innerFormatDate = formatDate ?? Intl.DateTimeFormat('default', {
|
|
36
|
+
hour: 'numeric',
|
|
37
|
+
minute: 'numeric',
|
|
38
|
+
...(options?.showSeconds && {
|
|
39
|
+
second: 'numeric'
|
|
40
|
+
})
|
|
41
|
+
}).format;
|
|
42
|
+
const timeFormat = options?.timeFormat ?? '24';
|
|
43
|
+
const [referenceElement, setReferenceElement] = (0, _react.useState)(null);
|
|
44
|
+
const [popperElement, setPopperElement] = (0, _react.useState)(null);
|
|
45
|
+
const customModifier = (0, _react.useMemo)(() => ({
|
|
46
|
+
name: 'offset',
|
|
47
|
+
options: {
|
|
48
|
+
offset: _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
placement
|
|
51
|
+
} = _ref2;
|
|
52
|
+
if (placement === 'bottom') {
|
|
53
|
+
return [0, -12];
|
|
54
|
+
}
|
|
55
|
+
return [0, 0];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}), []);
|
|
59
|
+
const {
|
|
60
|
+
styles,
|
|
61
|
+
attributes
|
|
62
|
+
} = (0, _reactPopper.usePopper)(referenceElement, popperElement, {
|
|
63
|
+
modifiers: [customModifier]
|
|
64
|
+
});
|
|
65
|
+
const combinedRef = (0, _useForkRef.default)(ref, r => setReferenceElement(r));
|
|
66
|
+
const labelRef = (0, _react.useRef)(null);
|
|
67
|
+
const allRefs = (0, _useForkRef.default)(combinedRef, labelRef);
|
|
68
|
+
const timePickerRef = (0, _react.useRef)(null);
|
|
69
|
+
const combinedTimePickerRef = (0, _useForkRef.default)(timePickerRef, r => setPopperElement(r));
|
|
70
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
71
|
+
const closeDropdown = (0, _react.useCallback)(() => {
|
|
72
|
+
setOpen(false);
|
|
73
|
+
}, []);
|
|
74
|
+
(0, _useOnClickOutside.default)(labelRef, closeDropdown, timePickerRef);
|
|
75
|
+
const controlled = value !== undefined;
|
|
76
|
+
const initialValue = controlled ? value : defaultValue;
|
|
77
|
+
const [innerValue, setInnerValue] = (0, _react.useState)(initialValue ?? new Date());
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
79
|
+
if (value !== undefined) {
|
|
80
|
+
setInnerValue(value);
|
|
81
|
+
}
|
|
82
|
+
}, [value]);
|
|
83
|
+
function toggle(e) {
|
|
84
|
+
e?.preventDefault();
|
|
85
|
+
if (!disabled) {
|
|
86
|
+
setOpen(prevOpen => !prevOpen);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function handleDateChange(newDate) {
|
|
90
|
+
if (!controlled) {
|
|
91
|
+
setInnerValue(newDate);
|
|
92
|
+
}
|
|
93
|
+
if (onChange) {
|
|
94
|
+
onChange(newDate);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function handleClose(newDate) {
|
|
98
|
+
if (newDate) {
|
|
99
|
+
handleDateChange(newDate);
|
|
100
|
+
}
|
|
101
|
+
setOpen(false);
|
|
102
|
+
}
|
|
103
|
+
const handleKeyDown = event => {
|
|
104
|
+
if (event.key === 'Enter') {
|
|
105
|
+
toggle();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const handleKeyUp = event => {
|
|
109
|
+
if (event.key === ' ') {
|
|
110
|
+
toggle();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const container = labelRef?.current?.ownerDocument || document;
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
115
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
role: "button",
|
|
118
|
+
ref: allRefs,
|
|
119
|
+
onKeyDown: handleKeyDown,
|
|
120
|
+
onKeyUp: handleKeyUp,
|
|
121
|
+
onClick: toggle,
|
|
122
|
+
...props,
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
124
|
+
htmlFor: id,
|
|
125
|
+
className: "fr-time-picker fwe-input-text fwe-input-text-icon",
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
127
|
+
className: (0, _classnames.default)('fwe-icon fwe-icon-time-time', {
|
|
128
|
+
'fwe-color-hero': open,
|
|
129
|
+
'fwe-color-control-disabled': disabled
|
|
130
|
+
})
|
|
131
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
132
|
+
id: id,
|
|
133
|
+
"aria-label": "picked time",
|
|
134
|
+
type: "text",
|
|
135
|
+
readOnly: true,
|
|
136
|
+
required: required,
|
|
137
|
+
className: (0, _classnames.default)({
|
|
138
|
+
'fwe-border-hero': open
|
|
139
|
+
}),
|
|
140
|
+
value: innerFormatDate(innerValue),
|
|
141
|
+
disabled: disabled
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
143
|
+
className: "fwe-input-text-label",
|
|
144
|
+
children: children
|
|
145
|
+
}), hint && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
146
|
+
className: "fwe-input-text-info",
|
|
147
|
+
children: hint
|
|
148
|
+
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
149
|
+
className: "fwe-input-text-invalid",
|
|
150
|
+
children: error
|
|
151
|
+
})]
|
|
152
|
+
})
|
|
153
|
+
}), open && /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimePickerDropdown.default, {
|
|
154
|
+
ref: combinedTimePickerRef,
|
|
155
|
+
onClose: handleClose,
|
|
156
|
+
onDateChange: handleDateChange,
|
|
157
|
+
timeFormat: timeFormat,
|
|
158
|
+
showSeconds: options?.showSeconds,
|
|
159
|
+
date: innerValue,
|
|
160
|
+
style: {
|
|
161
|
+
...styles.popper,
|
|
162
|
+
minWidth: labelRef?.current?.scrollWidth
|
|
163
|
+
},
|
|
164
|
+
...attributes.popper
|
|
165
|
+
}), container.body)]
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
var _default = TimePicker;
|
|
169
|
+
exports.default = _default;
|