@rivtn/noseur 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/esm/Template.d.ts +7 -0
- package/dist/esm/Template.js +13 -0
- package/dist/esm/compose/Composed.css +437 -0
- package/dist/esm/compose/exotic/ColorPicker.d.ts +41 -0
- package/dist/esm/compose/exotic/ColorPicker.js +85 -0
- package/dist/esm/compose/exotic/ColorSlider.d.ts +30 -0
- package/dist/esm/compose/exotic/ColorSlider.js +99 -0
- package/dist/esm/compose/form/ComposedPassword.d.ts +25 -0
- package/dist/esm/compose/form/ComposedPassword.js +103 -0
- package/dist/esm/compose/form/DateTimeInput.d.ts +28 -0
- package/dist/esm/compose/form/DateTimeInput.js +154 -0
- package/dist/esm/compose/form/DateTimePicker.d.ts +341 -0
- package/dist/esm/compose/form/DateTimePicker.js +1265 -0
- package/dist/esm/compose/form/FormControl.d.ts +33 -0
- package/dist/esm/compose/form/FormControl.js +163 -0
- package/dist/esm/compose/form/FormGroup.d.ts +14 -0
- package/dist/esm/compose/form/FormGroup.js +58 -0
- package/dist/esm/compose/overlay/Alert.d.ts +56 -0
- package/dist/esm/compose/overlay/Alert.js +267 -0
- package/dist/esm/constants/Alignment.d.ts +17 -0
- package/dist/esm/constants/Alignment.js +18 -0
- package/dist/esm/constants/Direction.d.ts +26 -0
- package/dist/esm/constants/Direction.js +22 -0
- package/dist/esm/constants/Orientation.d.ts +8 -0
- package/dist/esm/constants/Orientation.js +9 -0
- package/dist/esm/constants/Scheme.d.ts +39 -0
- package/dist/esm/constants/Scheme.js +43 -0
- package/dist/esm/constants/Transition.d.ts +81 -0
- package/dist/esm/constants/Transition.js +85 -0
- package/dist/esm/constants/Types.d.ts +74 -0
- package/dist/esm/constants/Types.js +14 -0
- package/dist/esm/core/ComponentBaseProps.d.ts +53 -0
- package/dist/esm/core/ComponentBaseProps.js +33 -0
- package/dist/esm/core/noseur.css +2390 -0
- package/dist/esm/data/Column.d.ts +235 -0
- package/dist/esm/data/Column.js +98 -0
- package/dist/esm/data/Data.css +213 -0
- package/dist/esm/data/Data.d.ts +98 -0
- package/dist/esm/data/Data.js +142 -0
- package/dist/esm/data/List.d.ts +14 -0
- package/dist/esm/data/List.js +117 -0
- package/dist/esm/data/Table.d.ts +22 -0
- package/dist/esm/data/Table.js +236 -0
- package/dist/esm/form/Button.d.ts +35 -0
- package/dist/esm/form/Button.js +131 -0
- package/dist/esm/form/Calendar.d.ts +20 -0
- package/dist/esm/form/Calendar.js +46 -0
- package/dist/esm/form/Checkbox.d.ts +20 -0
- package/dist/esm/form/Checkbox.js +155 -0
- package/dist/esm/form/ColorMap.d.ts +22 -0
- package/dist/esm/form/ColorMap.js +43 -0
- package/dist/esm/form/ColorPalette.d.ts +28 -0
- package/dist/esm/form/ColorPalette.js +87 -0
- package/dist/esm/form/Dropdown.d.ts +78 -0
- package/dist/esm/form/Dropdown.js +360 -0
- package/dist/esm/form/FileInput.d.ts +134 -0
- package/dist/esm/form/FileInput.js +523 -0
- package/dist/esm/form/Form.css +467 -0
- package/dist/esm/form/Input.d.ts +45 -0
- package/dist/esm/form/Input.js +186 -0
- package/dist/esm/form/RadioButton.d.ts +21 -0
- package/dist/esm/form/RadioButton.js +178 -0
- package/dist/esm/form/Slider.d.ts +21 -0
- package/dist/esm/form/Slider.js +163 -0
- package/dist/esm/hooks/useSearchParams.d.ts +15 -0
- package/dist/esm/hooks/useSearchParams.js +50 -0
- package/dist/esm/hooks/useSubscription.d.ts +9 -0
- package/dist/esm/hooks/useSubscription.js +26 -0
- package/dist/esm/index.d.ts +60 -0
- package/dist/esm/index.js +73 -0
- package/dist/esm/layout/GridView.d.ts +23 -0
- package/dist/esm/layout/GridView.js +34 -0
- package/dist/esm/layout/Layout.css +5 -0
- package/dist/esm/misc/Misc.css +164 -0
- package/dist/esm/misc/ProgressBar.d.ts +22 -0
- package/dist/esm/misc/ProgressBar.js +86 -0
- package/dist/esm/overlay/Dialog.d.ts +46 -0
- package/dist/esm/overlay/Dialog.js +290 -0
- package/dist/esm/overlay/Message.d.ts +35 -0
- package/dist/esm/overlay/Message.js +187 -0
- package/dist/esm/overlay/Overlay.css +382 -0
- package/dist/esm/overlay/Popover.d.ts +30 -0
- package/dist/esm/overlay/Popover.js +245 -0
- package/dist/esm/overlay/Portal.d.ts +11 -0
- package/dist/esm/overlay/Portal.js +29 -0
- package/dist/esm/overlay/Toast.d.ts +49 -0
- package/dist/esm/overlay/Toast.js +341 -0
- package/dist/esm/panel/Accordion.d.ts +26 -0
- package/dist/esm/panel/Accordion.js +127 -0
- package/dist/esm/panel/Panel.css +317 -0
- package/dist/esm/panel/Panel.d.ts +43 -0
- package/dist/esm/panel/Panel.js +125 -0
- package/dist/esm/panel/ScrollPanel.d.ts +27 -0
- package/dist/esm/panel/ScrollPanel.js +43 -0
- package/dist/esm/panel/TabPane.d.ts +82 -0
- package/dist/esm/panel/TabPane.js +237 -0
- package/dist/esm/presentation/Chart.d.ts +49 -0
- package/dist/esm/presentation/Chart.js +62 -0
- package/dist/esm/presentation/Paginator.d.ts +90 -0
- package/dist/esm/presentation/Paginator.js +331 -0
- package/dist/esm/presentation/Presentation.css +23 -0
- package/dist/esm/sensor/DragSensor.d.ts +50 -0
- package/dist/esm/sensor/DragSensor.js +156 -0
- package/dist/esm/sensor/ViewportSensor.d.ts +18 -0
- package/dist/esm/sensor/ViewportSensor.js +85 -0
- package/dist/esm/utils/BoolHelper.d.ts +13 -0
- package/dist/esm/utils/BoolHelper.js +105 -0
- package/dist/esm/utils/Classname.d.ts +9 -0
- package/dist/esm/utils/Classname.js +20 -0
- package/dist/esm/utils/ColorHelper.d.ts +127 -0
- package/dist/esm/utils/ColorHelper.js +198 -0
- package/dist/esm/utils/DOMUtils.d.ts +142 -0
- package/dist/esm/utils/DOMUtils.js +759 -0
- package/dist/esm/utils/DateHelper.d.ts +115 -0
- package/dist/esm/utils/DateHelper.js +338 -0
- package/dist/esm/utils/Debugger.d.ts +12 -0
- package/dist/esm/utils/Debugger.js +30 -0
- package/dist/esm/utils/FileHelper.d.ts +8 -0
- package/dist/esm/utils/FileHelper.js +65 -0
- package/dist/esm/utils/FunctionStackManager.d.ts +13 -0
- package/dist/esm/utils/FunctionStackManager.js +59 -0
- package/dist/esm/utils/InputHelper.d.ts +37 -0
- package/dist/esm/utils/InputHelper.js +70 -0
- package/dist/esm/utils/MicroBuilder.d.ts +24 -0
- package/dist/esm/utils/MicroBuilder.js +61 -0
- package/dist/esm/utils/ObjectHelper.d.ts +51 -0
- package/dist/esm/utils/ObjectHelper.js +334 -0
- package/dist/esm/utils/StringHelper.d.ts +10 -0
- package/dist/esm/utils/StringHelper.js +54 -0
- package/dist/esm/utils/Subscriber.d.ts +14 -0
- package/dist/esm/utils/Subscriber.js +27 -0
- package/dist/esm/utils/Timer.d.ts +32 -0
- package/dist/esm/utils/Timer.js +68 -0
- package/dist/esm/utils/TypeChecker.d.ts +12 -0
- package/dist/esm/utils/TypeChecker.js +38 -0
- package/package.json +63 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import "./Overlay.css";
|
|
2
|
+
import { Portal } from "./Portal";
|
|
3
|
+
import { Timer } from "../utils/Timer";
|
|
4
|
+
import { Classname } from "../utils/Classname";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Alignment } from "../constants/Alignment";
|
|
7
|
+
import { MicroBuilder } from "../utils/MicroBuilder";
|
|
8
|
+
import { ObjectHelper } from "../utils/ObjectHelper";
|
|
9
|
+
import { Transition } from "../constants/Transition";
|
|
10
|
+
import { CSSTransition } from 'react-transition-group';
|
|
11
|
+
import { ProgressBar } from "../misc/ProgressBar";
|
|
12
|
+
class MessageComponent extends React.Component {
|
|
13
|
+
static defaultProps = {
|
|
14
|
+
lifetime: 10000,
|
|
15
|
+
transitionTimeout: 1000,
|
|
16
|
+
transition: Transition.BOUNCE_IN_OUT,
|
|
17
|
+
};
|
|
18
|
+
state = {
|
|
19
|
+
mount: false,
|
|
20
|
+
props: this.props,
|
|
21
|
+
};
|
|
22
|
+
timer;
|
|
23
|
+
progressBarComponent;
|
|
24
|
+
transitionNodeRef;
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super(props);
|
|
27
|
+
this.onEnter = this.onEnter.bind(this);
|
|
28
|
+
this.onClose = this.onClose.bind(this);
|
|
29
|
+
this.onClick = this.onClick.bind(this);
|
|
30
|
+
this.onExited = this.onExited.bind(this);
|
|
31
|
+
this.onEntered = this.onEntered.bind(this);
|
|
32
|
+
this.onMouseEnter = this.onMouseEnter.bind(this);
|
|
33
|
+
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
34
|
+
this.onTimerAction = this.onTimerAction.bind(this);
|
|
35
|
+
this.transitionNodeRef = React.createRef();
|
|
36
|
+
}
|
|
37
|
+
componentDidMount() {
|
|
38
|
+
ObjectHelper.resolveManageRef(this, {
|
|
39
|
+
close: this.onClose,
|
|
40
|
+
update: (messageProps, borrowLifetime = true) => {
|
|
41
|
+
const shouldNowBeSticky = messageProps.sticky;
|
|
42
|
+
const currentlySticky = this.state.props.sticky;
|
|
43
|
+
this.setState({ props: ObjectHelper.merge(this.state.props, messageProps) }, (() => {
|
|
44
|
+
if (currentlySticky && !shouldNowBeSticky) {
|
|
45
|
+
if (this.timer) {
|
|
46
|
+
if (borrowLifetime)
|
|
47
|
+
this.timer.resume();
|
|
48
|
+
else
|
|
49
|
+
this.timer.restart(this.state.props.lifetime);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.onEntered();
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!this.timer)
|
|
57
|
+
return;
|
|
58
|
+
if (!currentlySticky && shouldNowBeSticky) {
|
|
59
|
+
this.timer.pause();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (borrowLifetime)
|
|
63
|
+
return;
|
|
64
|
+
this.timer.restart(this.state.props.lifetime);
|
|
65
|
+
}).bind(this));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
this.setState({ mount: true });
|
|
69
|
+
}
|
|
70
|
+
componentWillUnmount() {
|
|
71
|
+
if (!this.timer)
|
|
72
|
+
return;
|
|
73
|
+
this.timer.stop();
|
|
74
|
+
this.timer = undefined;
|
|
75
|
+
}
|
|
76
|
+
onEnter() {
|
|
77
|
+
this.props.onEnterDOM && this.props.onEnterDOM();
|
|
78
|
+
}
|
|
79
|
+
onEntered() {
|
|
80
|
+
if (this.state.props.sticky)
|
|
81
|
+
return;
|
|
82
|
+
this.timer = new Timer({
|
|
83
|
+
delay: 800,
|
|
84
|
+
timeout: this.state.props.lifetime,
|
|
85
|
+
isInterval: !!this.state.props.showProgressbar,
|
|
86
|
+
cbs: {
|
|
87
|
+
onAction: this.onTimerAction,
|
|
88
|
+
onEnd: () => {
|
|
89
|
+
this.onClose(true);
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
this.timer.start();
|
|
94
|
+
}
|
|
95
|
+
onExited() {
|
|
96
|
+
this.props.onExitDOM && this.props.onExitDOM();
|
|
97
|
+
}
|
|
98
|
+
onTimerAction(percentage) {
|
|
99
|
+
if (!this.progressBarComponent)
|
|
100
|
+
return;
|
|
101
|
+
this.progressBarComponent.setValue(100 - percentage);
|
|
102
|
+
}
|
|
103
|
+
onClose(fromTimer = false) {
|
|
104
|
+
this.componentWillUnmount();
|
|
105
|
+
this.setState({ mount: false });
|
|
106
|
+
if (!fromTimer)
|
|
107
|
+
this.props.onClose && this.props.onClose();
|
|
108
|
+
}
|
|
109
|
+
onMouseEnter(event) {
|
|
110
|
+
this.props.onMouseEnter && this.props.onMouseEnter(event);
|
|
111
|
+
if (this.props.pauseDelayOnHover && this.timer)
|
|
112
|
+
this.timer.pause();
|
|
113
|
+
}
|
|
114
|
+
onMouseLeave(event) {
|
|
115
|
+
this.props.onMouseLeave && this.props.onMouseLeave(event);
|
|
116
|
+
if (this.state.props.pauseDelayOnHover && this.timer)
|
|
117
|
+
this.timer.resume();
|
|
118
|
+
}
|
|
119
|
+
onClick(event) {
|
|
120
|
+
if (this.props.closeOnClick)
|
|
121
|
+
this.onClose();
|
|
122
|
+
this.props.onAction && this.props.onAction();
|
|
123
|
+
this.props.onClick && this.props.onClick(event);
|
|
124
|
+
}
|
|
125
|
+
renderIcon(hasSiblings) {
|
|
126
|
+
return MicroBuilder.buildIcon(this.state.props.icon, {
|
|
127
|
+
applyFaScheme: true,
|
|
128
|
+
style: { marginLeft: 10 },
|
|
129
|
+
relativeAlignment: (hasSiblings ? Alignment.LEFT : undefined),
|
|
130
|
+
scheme: (this.state.props.foreScheme ? this.state.props.scheme : undefined),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
renderCloseIcon(contentIsPresent) {
|
|
134
|
+
const scheme = this.props.attrsRelay?.closeIcon?.scheme ?? (this.state.props.foreScheme ? this.state.props.scheme : undefined);
|
|
135
|
+
const className = Classname.build("fa fa-times", (scheme ? `${scheme}-tx-hv` : null), this.props.attrsRelay?.closeIcon?.className);
|
|
136
|
+
return (React.createElement("i", { onClick: (e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
this.onClose();
|
|
139
|
+
}, className: className, id: this.props.attrsRelay?.closeIcon?.id, style: { marginLeft: (contentIsPresent ? 15 : 0), ...this.props.attrsRelay?.closeIcon?.style } }));
|
|
140
|
+
}
|
|
141
|
+
renderContent() {
|
|
142
|
+
const className = Classname.build("noseur-message-content", this.props.attrsRelay?.content?.className);
|
|
143
|
+
const content = (this.state.props.content instanceof Function ? this.state.props.content(this.props.attrsRelay?.content) : this.state.props.content);
|
|
144
|
+
return (React.createElement("div", { className: className, id: this.props.attrsRelay?.content?.id }, content));
|
|
145
|
+
}
|
|
146
|
+
renderProgressBar(scheme) {
|
|
147
|
+
const cachedSelfRef = this.props.attrsRelay?.progressBar?.manageRef;
|
|
148
|
+
const cachedClassName = this.props.attrsRelay?.progressBar?.className;
|
|
149
|
+
const progressProps = {
|
|
150
|
+
...this.props.attrsRelay?.progressBar,
|
|
151
|
+
value: 100,
|
|
152
|
+
className: Classname.build(cachedClassName),
|
|
153
|
+
manageRef: (r) => {
|
|
154
|
+
if (!r)
|
|
155
|
+
return;
|
|
156
|
+
this.progressBarComponent = r;
|
|
157
|
+
if (cachedSelfRef)
|
|
158
|
+
ObjectHelper.resolveRef(cachedSelfRef, r);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
return (React.createElement(ProgressBar, { ...progressProps, noLabel: progressProps.noLabel || true, scheme: progressProps.scheme ?? (this.state.props.foreScheme ? this.state.props.scheme : (scheme ? `${scheme}-bg-accent` : undefined)) }));
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const transition = this.state.props.transition;
|
|
165
|
+
const content = (this.state.props.content ? this.renderContent() : null);
|
|
166
|
+
const closeIcon = (this.state.props.sticky ? null : this.renderCloseIcon(!!content));
|
|
167
|
+
const icon = (this.state.props.icon ? this.renderIcon(!!content || !!closeIcon) : null);
|
|
168
|
+
const scheme = (!this.state.props.foreScheme && this.state.props.scheme ? this.state.props.scheme : null);
|
|
169
|
+
const progressBar = (this.state.props.showProgressbar ? this.renderProgressBar(scheme ?? undefined) : null);
|
|
170
|
+
const className = Classname.build("noseur-message", {
|
|
171
|
+
"noseur-wd-100-pct": this.state.props.fill
|
|
172
|
+
}, scheme, (this.state.props.scheme ? `${this.state.props.scheme}-bd-rd ${this.state.props.scheme}-vars` : null), (this.state.props.closeOnClick ? "noseur-cursor-pointer" : null), this.state.props.className);
|
|
173
|
+
const ref = (el) => {
|
|
174
|
+
ObjectHelper.resolveRef(this.props.forwardRef, el);
|
|
175
|
+
ObjectHelper.resolveRef(this.transitionNodeRef, el);
|
|
176
|
+
};
|
|
177
|
+
const children = (React.createElement(CSSTransition, { classNames: transition, options: this.state.props.transitionOptions, timeout: transition === Transition.NONE ? 0 : this.state.props.transitionTimeout, nodeRef: this.transitionNodeRef, in: this.state.mount, unmountOnExit: true, onEnter: this.onEnter, onEntered: this.onEntered, onExited: this.onExited },
|
|
178
|
+
React.createElement("div", { ref: ref, className: className, id: this.props.id, style: this.state.props.style, onClick: this.onClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave },
|
|
179
|
+
React.createElement("div", { className: "noseur-message-container" },
|
|
180
|
+
icon,
|
|
181
|
+
content,
|
|
182
|
+
closeIcon),
|
|
183
|
+
progressBar)));
|
|
184
|
+
return (!this.state.props.container ? children : React.createElement(Portal, { children: children, container: this.state.props.container, visible: true }));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export const Message = ({ ref, ...props }) => (React.createElement(MessageComponent, { ...props, forwardRef: ref }));
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/* Popover */
|
|
2
|
+
.noseur-popover {
|
|
3
|
+
border: 0 none;
|
|
4
|
+
min-width: 50px;
|
|
5
|
+
position: absolute;
|
|
6
|
+
--popoverArrowLeftOffset: 0px;
|
|
7
|
+
--componentMarginTopOrBottom: 10px;
|
|
8
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.noseur-popover-arrow:before {
|
|
12
|
+
content: " ";
|
|
13
|
+
display: block;
|
|
14
|
+
position: absolute;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
border-left: 5px solid transparent;
|
|
17
|
+
border-right: 5px solid transparent;
|
|
18
|
+
top: calc(0px - var(--componentMarginTopOrBottom, 5px));
|
|
19
|
+
left: calc(var(--popoverArrowLeftOffset, 0px) + 1.25rem);
|
|
20
|
+
border-bottom: var(--componentMarginTopOrBottom, 5px) solid var(--noseurArrowColor, #f2f2f2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.noseur-popover-arrow-flipped:before {
|
|
24
|
+
top: 100%;
|
|
25
|
+
border-bottom: 0px;
|
|
26
|
+
border-top: 5px solid #f2f2f2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.noseur-popover-b {
|
|
30
|
+
display: flex;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
max-height: 70%;
|
|
33
|
+
min-width: 150px;
|
|
34
|
+
padding: 10px 0px;
|
|
35
|
+
border-radius: 5px;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
--componentMarginTopOrBottom: 8px;
|
|
38
|
+
background-color: var(--noseurPopoverBgColor, #FFFFFF);
|
|
39
|
+
border: 1px solid var(--noseurPopoverBorderColor, #F0F0F0);
|
|
40
|
+
box-shadow: 0px 0px 21px var(--noseurPopoverBoxShadowColor, rgba(0, 0, 0, 0.1));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.noseur-popover-b > * {
|
|
44
|
+
display: flex;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
padding: 15px 30px;
|
|
48
|
+
padding-right: 80px;
|
|
49
|
+
font-weight: normal;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.noseur-popover-b > *:hover,
|
|
55
|
+
.noseur-popover-b > *:active,
|
|
56
|
+
.noseur-popover-b > *.active {
|
|
57
|
+
color: var(--noseurPopoverItemColor);
|
|
58
|
+
font-weight: var(--noseurPopoverItemFontWeight, normal);
|
|
59
|
+
background-color: var(--noseurPopoverItemHighlight, rgb(235, 235, 235));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.noseur-popover-b > a {
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.noseur-popover-b > *.danger {
|
|
67
|
+
color: #FF0000;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.noseur-popover-b > *.menu-item {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Dialog */
|
|
75
|
+
.noseur-dialog,
|
|
76
|
+
.noseur-dialog-modal.noseur-component-overlay {
|
|
77
|
+
pointer-events: auto;
|
|
78
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.noseur-dialog {
|
|
82
|
+
width: 50%;
|
|
83
|
+
display: flex;
|
|
84
|
+
max-width: 95%;
|
|
85
|
+
max-height: 90%;
|
|
86
|
+
position: relative;
|
|
87
|
+
transform: scale(1);
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
-webkit-transform: scale(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.noseur-dialog-modal {
|
|
93
|
+
top: 0;
|
|
94
|
+
left: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
margin: 0px;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 100%;
|
|
100
|
+
display: none;
|
|
101
|
+
position: fixed;
|
|
102
|
+
align-items: center;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
-ms-flex-pack: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
transition-property: background-color;
|
|
108
|
+
-webkit-transition-property: background-color;
|
|
109
|
+
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.noseur-dialog-modal.noseur-component-overlay {
|
|
113
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.noseur-dialog-visible {
|
|
117
|
+
display: flex;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.noseur-dialog-maximized {
|
|
121
|
+
max-width: 100%;
|
|
122
|
+
transition: none;
|
|
123
|
+
max-height: 100%;
|
|
124
|
+
top: 0 !important;
|
|
125
|
+
left: 0 !important;
|
|
126
|
+
width: 100vw !important;
|
|
127
|
+
height: 100vh !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.noseur-dialog-content {
|
|
131
|
+
margin: 0px;
|
|
132
|
+
padding: 1rem;
|
|
133
|
+
overflow: auto;
|
|
134
|
+
background-color: var(--noseurDialogContentBgColor, white);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.noseur-dialog-content-bd-t {
|
|
138
|
+
border-top-left-radius: 4px;
|
|
139
|
+
border-top-right-radius: 4px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.noseur-dialog-content-bd-b {
|
|
143
|
+
border-bottom-left-radius: 4px;
|
|
144
|
+
border-bottom-right-radius: 4px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.noseur-dialog-maximized .noseur-dialog-content {
|
|
148
|
+
-ms-flex-positive: 1;
|
|
149
|
+
flex-grow: 1;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.noseur-dialog-header {
|
|
153
|
+
margin: 0px;
|
|
154
|
+
display: flex;
|
|
155
|
+
padding: 1rem;
|
|
156
|
+
overflow: auto;
|
|
157
|
+
align-items: center;
|
|
158
|
+
background: #ffffff;
|
|
159
|
+
border-top-left-radius: 4px;
|
|
160
|
+
border-top-right-radius: 4px;
|
|
161
|
+
justify-content: space-between;
|
|
162
|
+
border-bottom: 1px solid #e9ecef;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.noseur-dialog-header.nl {
|
|
166
|
+
justify-content: flex-end;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.noseur-dialog .noseur-dialog-header .noseur-dialog-title {
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
font-size: 1.25rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.noseur-dialog-header-right {
|
|
175
|
+
margin-left: 0.5rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.noseur-dialog-header-right > .noseur-dialog-header-close-icon,
|
|
179
|
+
.noseur-dialog-header-right > .noseur-dialog-header-maximize-icon {
|
|
180
|
+
padding: 0.5rem;
|
|
181
|
+
margin-right: 1rem;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.noseur-dialog .noseur-dialog-footer {
|
|
186
|
+
overflow: auto;
|
|
187
|
+
border-top: 1px solid #e9ecef;
|
|
188
|
+
background: #ffffff;
|
|
189
|
+
color: #212529;
|
|
190
|
+
padding: 1rem;
|
|
191
|
+
text-align: right;
|
|
192
|
+
border-bottom-right-radius: 4px;
|
|
193
|
+
border-bottom-left-radius: 4px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/*alignment*/
|
|
197
|
+
.noseur-dialog-left {
|
|
198
|
+
justify-content: flex-start;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.noseur-dialog-right {
|
|
202
|
+
justify-content: flex-end;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.noseur-dialog-top {
|
|
206
|
+
align-items: flex-start;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.noseur-dialog-top-left {
|
|
210
|
+
justify-content: flex-start;
|
|
211
|
+
align-items: flex-start;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.noseur-dialog-top-right {
|
|
215
|
+
justify-content: flex-end;
|
|
216
|
+
align-items: flex-start;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.noseur-dialog-bottom {
|
|
220
|
+
align-items: flex-end;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.noseur-dialog-bottom-left {
|
|
224
|
+
justify-content: flex-start;
|
|
225
|
+
align-items: flex-end;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.noseur-dialog-bottom-right {
|
|
229
|
+
justify-content: flex-end;
|
|
230
|
+
align-items: flex-end;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.noseur-confirm-dialog .noseur-dialog-content {
|
|
234
|
+
display: flex;
|
|
235
|
+
overflow: auto;
|
|
236
|
+
align-items: center;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Message */
|
|
240
|
+
.noseur-message {
|
|
241
|
+
display: flex;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
width: fit-content;
|
|
244
|
+
border-radius: 5px;
|
|
245
|
+
align-items: center;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.noseur-message-container {
|
|
250
|
+
padding: 8px;
|
|
251
|
+
display: flex;
|
|
252
|
+
width: fit-content;
|
|
253
|
+
align-items: center;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.noseur-message-container > i.fa-times {
|
|
257
|
+
opacity: 0.6;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
margin-bottom: 1px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.noseur-message-container > i.fa-times:hover {
|
|
263
|
+
opacity: 1;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.noseur-message > .noseur-progress-bar {
|
|
267
|
+
width: 100%;
|
|
268
|
+
height: 5px;
|
|
269
|
+
border-radius: 0px;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* Toast and Messages */
|
|
273
|
+
.noseur-messages {
|
|
274
|
+
position: relative;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.noseur-toast > div,
|
|
278
|
+
.noseur-messages > div {
|
|
279
|
+
z-index: 1005;
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.noseur-toast > div {
|
|
285
|
+
position: fixed;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.noseur-messages > div {
|
|
289
|
+
position: absolute;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.noseur-toast > div > .noseur-message,
|
|
293
|
+
.noseur-messages > div > .noseur-message {
|
|
294
|
+
margin-top: var(--messageMarginTop, 0px);
|
|
295
|
+
margin-left: var(--messageMarginLeft, 0px);
|
|
296
|
+
margin-right: var(--messageMarginRight, 0px);
|
|
297
|
+
margin-bottom: var(--messageMarginBottom, 0px);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.noseur-toast > .noseur-toast-none,
|
|
301
|
+
.noseur-toast > .noseur-toast-top-left,
|
|
302
|
+
.noseur-messages > .noseur-messages-none,
|
|
303
|
+
.noseur-messages > .noseur-messages-top-left {
|
|
304
|
+
top: 0.5em;
|
|
305
|
+
left: 0.5em;
|
|
306
|
+
align-items: flex-start;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.noseur-toast > .noseur-toast-top-right,
|
|
310
|
+
.noseur-messages > .noseur-messages-top-right {
|
|
311
|
+
top: 0.5em;
|
|
312
|
+
right: 0.5em;
|
|
313
|
+
align-items: flex-end;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.noseur-toast > .noseur-toast-top,
|
|
317
|
+
.noseur-toast > .noseur-toast-top-center,
|
|
318
|
+
.noseur-messages > .noseur-messages-top,
|
|
319
|
+
.noseur-messages > .noseur-messages-top-center {
|
|
320
|
+
left: 50%;
|
|
321
|
+
top: 0.5em;
|
|
322
|
+
align-items: center;
|
|
323
|
+
transform: translateX(-50%);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.noseur-toast > .noseur-toast-bottom-left,
|
|
327
|
+
.noseur-messages > .noseur-messages-bottom-left {
|
|
328
|
+
left: 0.5em;
|
|
329
|
+
bottom: 0.5em;
|
|
330
|
+
align-items: flex-start;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.noseur-toast > .noseur-toast-bottom-right,
|
|
334
|
+
.noseur-messages > .noseur-messages-bottom-right {
|
|
335
|
+
right: 0.5em;
|
|
336
|
+
bottom: 0.5em;
|
|
337
|
+
align-items: flex-end;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.noseur-toast > .noseur-toast-bottom,
|
|
341
|
+
.noseur-messages > .noseur-messages-bottom,
|
|
342
|
+
.noseur-toast > .noseur-toast-bottom-center,
|
|
343
|
+
.noseur-messages > .noseur-messages-bottom-center {
|
|
344
|
+
left: 50%;
|
|
345
|
+
bottom: 0.5em;
|
|
346
|
+
transform: translateX(-50%);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.noseur-toast > .noseur-toast-left,
|
|
350
|
+
.noseur-messages > .noseur-messages-left,
|
|
351
|
+
.noseur-toast > .noseur-toast-center-left,
|
|
352
|
+
.noseur-messages > .noseur-messages-center-left {
|
|
353
|
+
top: 50%;
|
|
354
|
+
left: 0.5em;
|
|
355
|
+
transform: translateY(-50%);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.noseur-toast > .noseur-toast-right,
|
|
359
|
+
.noseur-messages > .noseur-messages-right,
|
|
360
|
+
.noseur-toast > .noseur-toast-center-right,
|
|
361
|
+
.noseur-messages > .noseur-messages-center-right {
|
|
362
|
+
top: 50%;
|
|
363
|
+
right: 0.5em;
|
|
364
|
+
align-items: flex-end;
|
|
365
|
+
transform: translateY(-50%);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.noseur-toast > .noseur-toast-center,
|
|
369
|
+
.noseur-messages > .noseur-messages-center {
|
|
370
|
+
top: 50%;
|
|
371
|
+
left: 50%;
|
|
372
|
+
transform: translate(-50%);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.noseur-toast > .noseur-toast-top,
|
|
376
|
+
.noseur-toast > .noseur-toast-bottom,
|
|
377
|
+
.noseur-toast > .noseur-toast-center,
|
|
378
|
+
.noseur-messages > .noseur-messages-top,
|
|
379
|
+
.noseur-messages > .noseur-messages-bottom,
|
|
380
|
+
.noseur-messages > .noseur-messages-center {
|
|
381
|
+
align-items: center;
|
|
382
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./Overlay.css";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ComponentBaseProps, TransitionProps } from "../core/ComponentBaseProps";
|
|
4
|
+
import { NoseurDivElement, NoseurRawElement } from '../constants/Types';
|
|
5
|
+
export type PopoverEvent = () => void;
|
|
6
|
+
export interface PopoverManageRef {
|
|
7
|
+
hide: () => void;
|
|
8
|
+
visible: () => boolean;
|
|
9
|
+
sticky: (sticky: boolean) => void;
|
|
10
|
+
show: (event?: Event, target?: HTMLElement) => void;
|
|
11
|
+
rePosition: (event?: Event, cb?: () => void) => void;
|
|
12
|
+
toggle: (event?: Event, target?: HTMLElement) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface PopoverProps<T1 = NoseurDivElement, T2 = PopoverManageRef, T3 = {}> extends ComponentBaseProps<T1, T2, T3>, TransitionProps {
|
|
15
|
+
sticky: boolean;
|
|
16
|
+
baseZIndex: number;
|
|
17
|
+
trapFocus: boolean;
|
|
18
|
+
notDismissable: boolean;
|
|
19
|
+
dismissOnClick: boolean;
|
|
20
|
+
matchTargetSize: boolean;
|
|
21
|
+
container: NoseurRawElement;
|
|
22
|
+
positional: "left" | "right";
|
|
23
|
+
pointingArrowClassName: string | null;
|
|
24
|
+
onOpenFocusRef: React.MutableRefObject<any>;
|
|
25
|
+
onCloseFocusRef: React.MutableRefObject<any>;
|
|
26
|
+
outsideClickLogic: "elemental" | "positional";
|
|
27
|
+
onShow: PopoverEvent;
|
|
28
|
+
onHide: PopoverEvent;
|
|
29
|
+
}
|
|
30
|
+
export declare const Popover: ({ ref, ...props }: Partial<PopoverProps>) => React.JSX.Element;
|