@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,467 @@
|
|
|
1
|
+
.noseur-form-bd-cl {
|
|
2
|
+
border-color: var(--noseurFormBorderColor, #dfdfdf);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* Button */
|
|
6
|
+
.noseur-button {
|
|
7
|
+
outline: none;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-width: 1px;
|
|
11
|
+
border-radius: 7px;
|
|
12
|
+
text-align: center;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: fit-content;
|
|
15
|
+
align-items: center;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
height: fit-content;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
vertical-align: bottom;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
padding: 10px 15px 10px 15px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.noseur-button:hover {
|
|
26
|
+
filter: brightness(97%);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Input and TextArea */
|
|
30
|
+
.noseur-input {
|
|
31
|
+
flex: 1;
|
|
32
|
+
outline: none;
|
|
33
|
+
padding: 0.7rem;
|
|
34
|
+
font-size: 15px;
|
|
35
|
+
border-radius: 6px;
|
|
36
|
+
background: transparent;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
border: 1px solid #dfdfdf;
|
|
39
|
+
-moz-box-sizing: border-box;
|
|
40
|
+
-webkit-box-sizing: border-box;
|
|
41
|
+
color: var(--noseurInputColor, #3e3f41);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.noseur-input-filled {
|
|
45
|
+
background-color: #eff2f5;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.noseur-input-flushed {
|
|
49
|
+
border: none;
|
|
50
|
+
border-radius: 0px;
|
|
51
|
+
padding: 0.7rem 0px 0.7rem 0px;
|
|
52
|
+
border-bottom: 1px solid var(--noseurInputFlushedBorderColor, #dfdfdf);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
textarea.noseur-input {
|
|
56
|
+
flex: initial;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Checkbox */
|
|
60
|
+
.noseur-checkbox {
|
|
61
|
+
display: flex;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
width: fit-content;
|
|
64
|
+
align-items: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.noseur-checkbox > input {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.noseur-checkbox-box {
|
|
72
|
+
width: 18px;
|
|
73
|
+
height: 18px;
|
|
74
|
+
outline: none;
|
|
75
|
+
min-width: 18px;
|
|
76
|
+
min-height: 18px;
|
|
77
|
+
user-select: none;
|
|
78
|
+
border-width: 2px;
|
|
79
|
+
border-radius: 5px;
|
|
80
|
+
border-style: solid;
|
|
81
|
+
align-items: center;
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
vertical-align: bottom;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.noseur-checkbox-box > .noseur-icon {
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Dropdown */
|
|
92
|
+
.noseur-dropdown {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.noseur-dropdown > .noseur-fctrl-c > .noseur-fctrl-lc {
|
|
97
|
+
min-width: auto;
|
|
98
|
+
margin-right: 5px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.noseur-dropdown > .noseur-fctrl-c > .noseur-fctrl-lc > img,
|
|
102
|
+
.noseur-dropdown > .noseur-fctrl-c > .noseur-fctrl-lc > .noseur-dropdown-left-content > img,
|
|
103
|
+
.noseur-dropdown > .noseur-fctrl-c > .noseur-fctrl-rc > .noseur-dropdown-right-content > img {
|
|
104
|
+
width: auto;
|
|
105
|
+
height: 22px;
|
|
106
|
+
margin-left: 9px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.noseur-dropdown-inputtext {
|
|
110
|
+
min-width: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.noseur-dropdown-left-content {
|
|
114
|
+
margin: 0px;
|
|
115
|
+
display: flex;
|
|
116
|
+
margin-left: 5px;
|
|
117
|
+
align-items: center;
|
|
118
|
+
align-self: flex-start;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.noseur-dropdown-right-content {
|
|
122
|
+
margin: 0px;
|
|
123
|
+
display: flex;
|
|
124
|
+
margin-right: 5px;
|
|
125
|
+
align-items: center;
|
|
126
|
+
align-self: flex-end;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.noseur-dropdown-left-content > *,
|
|
130
|
+
.noseur-dropdown-right-content > * {
|
|
131
|
+
margin: 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.noseur-dropdown-popover {
|
|
135
|
+
display: flex;
|
|
136
|
+
overflow: auto;
|
|
137
|
+
min-width: 190px;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
border-radius: 0px 0px 3px 3px;
|
|
140
|
+
--componentMarginTopOrBottom: 3px;
|
|
141
|
+
background-color: var(--noseurDropdownPopoverBgColor, white);
|
|
142
|
+
box-shadow: 0 2px 12px 0 var(--noseurDropdownPopoverBoxShadowColor, rgba(0, 0, 0, 0.1)) !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.noseur-dropdown-popover-list {
|
|
146
|
+
flex: 1;
|
|
147
|
+
margin: 0px;
|
|
148
|
+
padding: 0px;
|
|
149
|
+
overflow: auto;
|
|
150
|
+
margin-top: 7px;
|
|
151
|
+
/*height: 350px;*/
|
|
152
|
+
margin-bottom: 7px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.noseur-dropdown-popover-list > li {
|
|
156
|
+
border: none;
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
list-style-type: none;
|
|
160
|
+
padding: 12px 15px 12px 15px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.noseur-dropdown-popover-list > li.default-style:hover {
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.noseur-dropdown-popover-list > li.default-style[aria-selected=true] {
|
|
169
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.noseur-dropdown-popover-li-grp {
|
|
173
|
+
font-weight: bold;
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.noseur-dropdown-popover-li-item {
|
|
178
|
+
display: flex;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.noseur-dropdown-popover-li-item > img {
|
|
182
|
+
width: 20px;
|
|
183
|
+
height: 20px;
|
|
184
|
+
max-width: 20px;
|
|
185
|
+
max-height: 20px;
|
|
186
|
+
margin-right: 10px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.noseur-dropdown-popover-empty {
|
|
190
|
+
padding: 30px;
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* File Input */
|
|
197
|
+
.noseur-file-input {
|
|
198
|
+
display: flex;
|
|
199
|
+
overflow: auto;
|
|
200
|
+
width: fit-content;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.noseur-file-input-control {
|
|
204
|
+
display: flex;
|
|
205
|
+
padding: 7px 10px;
|
|
206
|
+
position: absolute;
|
|
207
|
+
width: fit-content;
|
|
208
|
+
flex-direction: row;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.noseur-file-input-control > *:not(:last-child) {
|
|
212
|
+
margin-right: 5px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.noseur-file-input-label {
|
|
216
|
+
margin: 5px;
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
padding: 7px 10px;
|
|
220
|
+
border-radius: 5px;
|
|
221
|
+
width: fit-content;
|
|
222
|
+
width: -moz-fit-content;
|
|
223
|
+
width: -webkit-fit-content;
|
|
224
|
+
color: var(--noseurFileInputLabelColor, #fff);
|
|
225
|
+
background: var(--noseurFileInputLabelBgColor, hsla(0, 1.4%, 59%, 0.5));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.noseur-file-input > div > .noseur-file-input-preview {
|
|
229
|
+
display: flex;
|
|
230
|
+
width: inherit;
|
|
231
|
+
height: inherit;
|
|
232
|
+
position: relative;
|
|
233
|
+
align-items: center;
|
|
234
|
+
border-radius: inherit;
|
|
235
|
+
color: var(--noseurSchemeMainColor, #ededed);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.noseur-file-input > .noseur-file-input-previews,
|
|
239
|
+
.noseur-file-input > div > .noseur-file-input-preview > img {
|
|
240
|
+
border-radius: inherit;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-close {
|
|
244
|
+
top: 0px;
|
|
245
|
+
right: 0px;
|
|
246
|
+
margin: 5px;
|
|
247
|
+
position: absolute;
|
|
248
|
+
padding: 10px 12px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.noseur-file-input > div > .noseur-file-input-preview-empty,
|
|
252
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-file-input-preview-image,
|
|
253
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-file-input-preview-video {
|
|
254
|
+
width: inherit;
|
|
255
|
+
height: inherit;
|
|
256
|
+
font-size: 30px;
|
|
257
|
+
justify-content: center;
|
|
258
|
+
border: 1px solid var(--noseurSchemeMainColor01Percent, rgba(237, 237, 237, 0.5));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.noseur-file-input > div > .noseur-file-input-preview-empty {
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.noseur-file-input > div > .noseur-file-input-preview-empty > i {
|
|
266
|
+
padding: 20px;
|
|
267
|
+
border-radius: 100%;
|
|
268
|
+
background: var(--noseurSchemeMainColor01Percent, rgba(237, 237, 237, 0.5));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-file-input-preview-binary {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-file-input-preview-binary > * {
|
|
277
|
+
margin-right: 5px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.noseur-file-input > div > .noseur-file-input-preview > .noseur-file-input-preview-binary > .noseur-close {
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
margin-left: 5px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.noseur-file-input > div.noseur-fl-d-r > .noseur-file-input-preview:not(.noseur-file-input-preview:first-child) {
|
|
286
|
+
margin-left: 15px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.noseur-file-input > div.noseur-fl-d-c > .noseur-file-input-preview:not(.noseur-file-input-preview:first-child) {
|
|
290
|
+
margin-top: 15px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.noseur-file-input.noseur-file-input-controlled {
|
|
294
|
+
width: auto;
|
|
295
|
+
border-radius: 7px;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
border: 1px solid var(--noseurSchemeMainColor, rgba(237, 237, 237, 0.2));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.noseur-file-input.noseur-file-input-controlled > .noseur-file-input-fixture {
|
|
301
|
+
padding: 15px;
|
|
302
|
+
display: flex;
|
|
303
|
+
background-color: var(--noseurSchemeStripColor, rgba(237, 237, 237, 0.5));
|
|
304
|
+
border-bottom: 1px solid var(--noseurSchemeMainColor, rgba(237, 237, 237, 0.5));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.noseur-file-input.noseur-file-input-controlled > .noseur-file-input-fixture > button:not(.noseur-file-input-fixture > button:first-child) {
|
|
308
|
+
margin-left: 10px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.noseur-file-input > .noseur-file-input-previews {
|
|
312
|
+
width: inherit;
|
|
313
|
+
height: inherit;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.noseur-file-input.noseur-file-input-controlled > .noseur-file-input-previews {
|
|
317
|
+
margin: 15px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.noseur-file-input.noseur-file-input-controlled > .noseur-file-input-previews > .noseur-file-input-preview {
|
|
321
|
+
width: auto;
|
|
322
|
+
border: none;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/* Radio button */
|
|
326
|
+
.noseur-radiobutton {
|
|
327
|
+
display: flex;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
width: fit-content;
|
|
330
|
+
align-items: center;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.noseur-radiobutton > input {
|
|
334
|
+
display: none;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.noseur-radiobutton-box {
|
|
338
|
+
width: 18px;
|
|
339
|
+
height: 18px;
|
|
340
|
+
outline: none;
|
|
341
|
+
min-width: 18px;
|
|
342
|
+
min-height: 18px;
|
|
343
|
+
user-select: none;
|
|
344
|
+
border-width: 2px;
|
|
345
|
+
border-radius: 100%;
|
|
346
|
+
border-style: solid;
|
|
347
|
+
align-items: center;
|
|
348
|
+
display: inline-flex;
|
|
349
|
+
vertical-align: bottom;
|
|
350
|
+
justify-content: center;
|
|
351
|
+
border-color: var(--noseurSchemeMainColor, var(--noseurFormBorderColor, #dfdfdf));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.noseur-radiobutton-box > .noseur-icon {
|
|
355
|
+
font-size: 12px;
|
|
356
|
+
border-radius: 100%;
|
|
357
|
+
color: var(--noseurSchemeMainColor, var(--noseurFormBorderColor, #dfdfdf));
|
|
358
|
+
background-color: var(--noseurSchemeMainColor, var(--noseurFormBorderColor, #dfdfdf));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Color palette */
|
|
362
|
+
.noseur-color-palette {
|
|
363
|
+
display: grid;
|
|
364
|
+
width: fit-content;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.noseur-color-palette-tile {
|
|
368
|
+
cursor: pointer;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.noseur-color-palette-tile:hover,
|
|
372
|
+
.noseur-color-palette-tile.active {
|
|
373
|
+
border-color: rgb(255, 255, 255) !important;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Color Map */
|
|
377
|
+
.noseur-color-map {
|
|
378
|
+
display: flex;
|
|
379
|
+
width: fit-content;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.noseur-color-map-map {
|
|
383
|
+
position: relative;
|
|
384
|
+
border-radius: 5px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.noseur-color-map-map-gradient {
|
|
388
|
+
width: 100%;
|
|
389
|
+
height: 100%;
|
|
390
|
+
border-radius: 5px;
|
|
391
|
+
position: absolute;
|
|
392
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0), black), linear-gradient(to right, white, rgba(255, 255, 255, 0));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/* Slider */
|
|
396
|
+
.noseur-slider {
|
|
397
|
+
border: none;
|
|
398
|
+
display: flex;
|
|
399
|
+
position: relative;
|
|
400
|
+
border-radius: 7px;
|
|
401
|
+
align-items: center;
|
|
402
|
+
background: var(--noseurSchemeMainColor01Percent, #e5e7eb);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.noseur-slider-vertical {
|
|
406
|
+
height: 14rem;
|
|
407
|
+
width: 0.286rem;
|
|
408
|
+
margin: 0px 12px;
|
|
409
|
+
flex-direction: column;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.noseur-slider-horizontal {
|
|
413
|
+
width: 14rem;
|
|
414
|
+
height: 0.286rem;
|
|
415
|
+
margin: 12px 0px;
|
|
416
|
+
flex-direction: row;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.noseur-slider-range,
|
|
420
|
+
.noseur-slider-handle {
|
|
421
|
+
position: absolute;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.noseur-slider-range {
|
|
425
|
+
border-radius: 7px;
|
|
426
|
+
background: var(--noseurSchemeMainColor, #7199be);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.noseur-slider-vertical > .noseur-slider-range {
|
|
430
|
+
width: 100%;
|
|
431
|
+
}
|
|
432
|
+
.noseur-slider-vertical > .noseur-slider-range.inverse {
|
|
433
|
+
bottom: 0px;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.noseur-slider-horizontal > .noseur-slider-range {
|
|
437
|
+
height: 100%;
|
|
438
|
+
}
|
|
439
|
+
.noseur-slider-horizontal > .noseur-slider-range.inverse {
|
|
440
|
+
right: 0px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.noseur-slider-handle {
|
|
444
|
+
cursor: grab;
|
|
445
|
+
width: 0.7rem;
|
|
446
|
+
height: 0.7rem;
|
|
447
|
+
border-radius: 100%;
|
|
448
|
+
background: var(--noseurSchemeAccentColor, white);
|
|
449
|
+
border: 2px solid var(--noseurSchemeMainColor, #7199be);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.noseur-slider-handle:active {
|
|
453
|
+
cursor: grabbing;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.noseur-slider-handle.active {
|
|
457
|
+
z-index: 2;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/* Calendar */
|
|
461
|
+
.noseur-calendar {
|
|
462
|
+
display: flex;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.noseur-calendar-week {
|
|
466
|
+
display: flex;
|
|
467
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "./Form.css";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ComponentBaseProps } from '../core/ComponentBaseProps';
|
|
4
|
+
import { NoseurElement, NoseurFormElement, NoseurInputValue } from "../constants/Types";
|
|
5
|
+
export type InputOnInputCompleteHandler = (value: string) => void;
|
|
6
|
+
export type InputOnFirstInputCompleteHandler = (value?: string) => void;
|
|
7
|
+
export interface BareInputManageRef<T> {
|
|
8
|
+
clear: () => void;
|
|
9
|
+
setValue: (value: T) => void;
|
|
10
|
+
value: () => T | null | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface InputManageRef extends BareInputManageRef<string> {
|
|
13
|
+
}
|
|
14
|
+
export interface InputProps extends ComponentBaseProps<NoseurFormElement, InputManageRef> {
|
|
15
|
+
rows: number;
|
|
16
|
+
type: string;
|
|
17
|
+
mask: string;
|
|
18
|
+
fill: boolean;
|
|
19
|
+
raised: boolean;
|
|
20
|
+
filled: boolean;
|
|
21
|
+
rounded: boolean;
|
|
22
|
+
flushed: boolean;
|
|
23
|
+
maskSlot: string;
|
|
24
|
+
readOnly: boolean;
|
|
25
|
+
required: boolean;
|
|
26
|
+
highlight: boolean;
|
|
27
|
+
borderless: boolean;
|
|
28
|
+
inputFilter: RegExp;
|
|
29
|
+
placeholder: string;
|
|
30
|
+
children: NoseurElement;
|
|
31
|
+
autoGrowHeight: boolean;
|
|
32
|
+
value: NoseurInputValue;
|
|
33
|
+
defaultValue: NoseurInputValue;
|
|
34
|
+
completeInputOnBlurOnly: boolean;
|
|
35
|
+
completeInputOnEnterPressOnly: boolean;
|
|
36
|
+
onInputComplete: InputOnInputCompleteHandler | undefined;
|
|
37
|
+
onFirstInput: InputOnFirstInputCompleteHandler | undefined;
|
|
38
|
+
onInputEmpty: React.FormEventHandler<NoseurFormElement> | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const TextInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
41
|
+
export declare const EmailInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
42
|
+
export declare const NumberInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
43
|
+
export declare const TextAreaInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
44
|
+
export declare const PasswordInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
45
|
+
export declare const MoneyInput: ({ ref, ...props }: Partial<InputProps>) => React.JSX.Element;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import "./Form.css";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Scheme } from '../constants/Scheme';
|
|
4
|
+
import { DOMHelper } from "../utils/DOMUtils";
|
|
5
|
+
import { Classname } from "../utils/Classname";
|
|
6
|
+
import { ObjectHelper } from "../utils/ObjectHelper";
|
|
7
|
+
import { InputFilter, InputHelper } from "../utils/InputHelper";
|
|
8
|
+
;
|
|
9
|
+
;
|
|
10
|
+
class Input extends React.Component {
|
|
11
|
+
static defaultProps = {
|
|
12
|
+
type: "text",
|
|
13
|
+
maskSlot: "X",
|
|
14
|
+
scheme: Scheme.STATELESS,
|
|
15
|
+
};
|
|
16
|
+
state = {
|
|
17
|
+
value: this.props.value ?? this.props.defaultValue
|
|
18
|
+
};
|
|
19
|
+
internalInputElement;
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.onBlur = this.onBlur.bind(this);
|
|
23
|
+
this.onKeyUp = this.onKeyUp.bind(this);
|
|
24
|
+
this.onInput = this.onInput.bind(this);
|
|
25
|
+
this.onKeyDown = this.onKeyDown.bind(this);
|
|
26
|
+
this.resolveMask = this.resolveMask.bind(this);
|
|
27
|
+
this.onPasteCapture = this.onPasteCapture.bind(this);
|
|
28
|
+
}
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
ObjectHelper.resolveManageRef(this, {
|
|
31
|
+
clear: () => {
|
|
32
|
+
if (!this.internalInputElement)
|
|
33
|
+
return;
|
|
34
|
+
this.internalInputElement.value = "";
|
|
35
|
+
if (this.props.autoGrowHeight) {
|
|
36
|
+
this.internalInputElement.style.height = DOMHelper.calculateHeight(this.internalInputElement) + "px";
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
value: () => {
|
|
40
|
+
if (!this.internalInputElement)
|
|
41
|
+
return null;
|
|
42
|
+
return this.internalInputElement.value;
|
|
43
|
+
},
|
|
44
|
+
setValue: (value) => {
|
|
45
|
+
this.setState({ value }, () => {
|
|
46
|
+
if (!this.internalInputElement)
|
|
47
|
+
return;
|
|
48
|
+
this.internalInputElement.value = value;
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
componentWillUnmount() {
|
|
54
|
+
ObjectHelper.resolveManageRef(this, null);
|
|
55
|
+
}
|
|
56
|
+
resolveMask(element) {
|
|
57
|
+
const value = element.value;
|
|
58
|
+
const valueParts = value.split("");
|
|
59
|
+
const maskParts = new Set(this.props.maskSlot);
|
|
60
|
+
const resolvedValue = this.props.mask.split("");
|
|
61
|
+
const [from, to] = [element.selectionStart, element.selectionEnd];
|
|
62
|
+
console.log("SELECTEION", from, to);
|
|
63
|
+
/*for (let index = 0, valueIndex = 0; index < resolvedValue.length && (!!valueParts[valueIndex] && valueIndex < resolvedValue.length); index++) {
|
|
64
|
+
console.log("PLACEHOLDER INDEX", valueParts[valueIndex], index);
|
|
65
|
+
if (maskParts.has(resolvedValue[index])) resolvedValue[index] = valueParts[valueIndex++];
|
|
66
|
+
}*/
|
|
67
|
+
const maskSlotIndexes = {};
|
|
68
|
+
for (let index = from, sindex = 0; index < resolvedValue.length && sindex < valueParts.length; index++) {
|
|
69
|
+
console.log("PLACEHOLDER INDEX", from, index, resolvedValue[index]);
|
|
70
|
+
if (maskParts.has(resolvedValue[index])) {
|
|
71
|
+
maskSlotIndexes["" + index] = sindex;
|
|
72
|
+
sindex++;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const [index, sindex] of Object.entries(maskSlotIndexes))
|
|
76
|
+
resolvedValue[parseInt(index)] = valueParts[sindex];
|
|
77
|
+
/*const masskSlotIndexes = resolvedValue.reduce((acc: number[], c: string, index: number): number[] => {
|
|
78
|
+
if (maskParts.has(c)) acc.push(index);
|
|
79
|
+
return acc;
|
|
80
|
+
}, []);*
|
|
81
|
+
/*for (let index = 0; index < valueParts.length; index++) {
|
|
82
|
+
maskParts.has()
|
|
83
|
+
console.log("PLACEHOLDER INDEX", valueParts[index]);
|
|
84
|
+
}*/
|
|
85
|
+
/*for (let index = 1; index < maskParts.size; index++) {
|
|
86
|
+
const maskPart = maskParts[index];
|
|
87
|
+
console.log(" ", maskPart, valueParts[index-1], index, index-1);
|
|
88
|
+
resolvedValue += (maskPart == "" ? valueParts[index-1] : maskPart);
|
|
89
|
+
}*/
|
|
90
|
+
element.value = resolvedValue.join("");
|
|
91
|
+
console.log("TO RESOLVE MASK", value, "=>", "resolvedValue", maskSlotIndexes, resolvedValue.join(""), maskParts, this.props.mask, this.props.maskSlot);
|
|
92
|
+
}
|
|
93
|
+
onKeyDown(event) {
|
|
94
|
+
this.props.onKeyDown && this.props.onKeyDown(event);
|
|
95
|
+
!this.props.inputFilter || InputHelper.validateEventKeyInput(this.props.inputFilter, event);
|
|
96
|
+
}
|
|
97
|
+
onPasteCapture(event) {
|
|
98
|
+
this.props.onPasteCapture && this.props.onPasteCapture(event);
|
|
99
|
+
!this.props.inputFilter || InputHelper.validateEventValue(this.props.inputFilter, event, event.clipboardData.getData('Text'));
|
|
100
|
+
}
|
|
101
|
+
onInput(event) {
|
|
102
|
+
this.props.onInput && this.props.onInput(event);
|
|
103
|
+
const value = event.target.value;
|
|
104
|
+
const valueLength = value.length;
|
|
105
|
+
const hasValue = !!this.state.value;
|
|
106
|
+
if (this.props.mask)
|
|
107
|
+
this.resolveMask(event.target);
|
|
108
|
+
if (this.props.onFirstInput && !hasValue)
|
|
109
|
+
this.props.onFirstInput(value);
|
|
110
|
+
if (this.props.onInputEmpty && hasValue && !valueLength)
|
|
111
|
+
this.props.onInputEmpty(event);
|
|
112
|
+
this.setState({ value });
|
|
113
|
+
if (this.props.autoGrowHeight) {
|
|
114
|
+
event.target.style.height = DOMHelper.calculateHeight(event.target) + "px";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
onBlur(event) {
|
|
118
|
+
this.props.onBlur && this.props.onBlur(event);
|
|
119
|
+
if (this.props.completeInputOnEnterPressOnly)
|
|
120
|
+
return;
|
|
121
|
+
this.props.onInputComplete && this.props.onInputComplete(event.target.value);
|
|
122
|
+
}
|
|
123
|
+
onKeyUp(event) {
|
|
124
|
+
this.props.onKeyUp && this.props.onKeyUp(event);
|
|
125
|
+
if (this.props.completeInputOnBlurOnly)
|
|
126
|
+
return;
|
|
127
|
+
const key = InputHelper.getKey(event);
|
|
128
|
+
if (key == 13)
|
|
129
|
+
this.props.onInputComplete && this.props.onInputComplete(event.target.value);
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
const eventProps = ObjectHelper.extractEventProps(this.props, ["onInputEmpty", "onFirstInput", "onInputComplete"]);
|
|
133
|
+
const className = Classname.build((!this.props.noStyle && this.props.highlight) ? `${this.props.scheme}-bd-cl` : null, (!this.props.noStyle && this.props.scheme && !this.props.flushed) ? `${this.props.scheme}-bd-3px-bx-sw-fc` : null, (!this.props.noStyle && this.props.scheme) ? `${this.props.scheme}-bd-cl-fc ${this.props.scheme}-bd-cl-hv` : null, {
|
|
134
|
+
'noseur-wd-100-pct': this.props.fill,
|
|
135
|
+
'noseur-no-bd': this.props.borderless,
|
|
136
|
+
'noseur-disabled': this.props.disabled,
|
|
137
|
+
'noseur-input-flushed': this.props.flushed,
|
|
138
|
+
'noseur-skeleton': this.props.scheme === Scheme.SKELETON,
|
|
139
|
+
'noseur-raised-bd': !this.props.noStyle && this.props.raised,
|
|
140
|
+
'noseur-bd-radius-20': !this.props.noStyle && this.props.rounded,
|
|
141
|
+
'noseur-input-filled': !this.props.noStyle && this.props.filled,
|
|
142
|
+
}, "noseur-input", this.props.className);
|
|
143
|
+
const props = {
|
|
144
|
+
className,
|
|
145
|
+
...eventProps,
|
|
146
|
+
id: this.props.id,
|
|
147
|
+
key: this.props.key,
|
|
148
|
+
rows: this.props.rows,
|
|
149
|
+
type: this.props.type,
|
|
150
|
+
name: this.props.name,
|
|
151
|
+
style: this.props.style,
|
|
152
|
+
children: this.props.children,
|
|
153
|
+
required: this.props.required,
|
|
154
|
+
readOnly: this.props.readOnly,
|
|
155
|
+
defaultValue: this.state.value,
|
|
156
|
+
placeholder: this.props.placeholder,
|
|
157
|
+
onBlur: this.onBlur,
|
|
158
|
+
onKeyUp: this.onKeyUp,
|
|
159
|
+
onInput: this.onInput,
|
|
160
|
+
onKeyDown: this.onKeyDown,
|
|
161
|
+
onPasteCapture: this.onPasteCapture,
|
|
162
|
+
ref: (el) => {
|
|
163
|
+
if (!el)
|
|
164
|
+
return;
|
|
165
|
+
this.internalInputElement = el;
|
|
166
|
+
ObjectHelper.resolveRef(this.props.forwardRef, el);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
if (this.props.value)
|
|
170
|
+
props.value = this.props.value;
|
|
171
|
+
if (this.internalInputElement && !this.internalInputElement.value && this.internalInputElement.value !== this.state.value) {
|
|
172
|
+
this.internalInputElement.value = this.state.value ?? "";
|
|
173
|
+
}
|
|
174
|
+
return (this.props.type === "textarea"
|
|
175
|
+
? React.createElement("textarea", { ...props })
|
|
176
|
+
: React.createElement("input", { ...props }));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
export const TextInput = ({ ref, ...props }) => {
|
|
180
|
+
return (React.createElement(Input, { ...props, forwardRef: ref }));
|
|
181
|
+
};
|
|
182
|
+
export const EmailInput = ({ ref, ...props }) => (React.createElement(Input, { ...props, forwardRef: ref, type: "email" }));
|
|
183
|
+
export const NumberInput = ({ ref, ...props }) => (React.createElement(Input, { ...props, forwardRef: ref, type: "number" }));
|
|
184
|
+
export const TextAreaInput = ({ ref, ...props }) => (React.createElement(Input, { ...props, forwardRef: ref, type: "textarea" }));
|
|
185
|
+
export const PasswordInput = ({ ref, ...props }) => (React.createElement(Input, { ...props, forwardRef: ref, type: "password" }));
|
|
186
|
+
export const MoneyInput = ({ ref, ...props }) => (React.createElement(Input, { ...props, forwardRef: ref, inputFilter: InputFilter.MONEY }));
|