react-core-ts 1.0.10 → 1.0.11

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/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import './styles/global.css';
2
2
  export { default as AutoComplete } from './AutoComplete';
3
3
  export { default as CustomAutoComplete } from './AutoComplete';
4
4
  export { default as ExpandableAutoComplete } from './ExpandableAutoComplete';
5
+ export { default as ExpandableToolTip } from './utilities/expandableTootltip';
5
6
  export { default as ToolTip } from './utilities/tooltip';
6
7
  export { deepEqual } from './utilities/deepEqual';
7
8
  export type { AutoSuggestionInputProps } from './commontypes';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deepEqual = exports.ToolTip = exports.ExpandableAutoComplete = exports.CustomAutoComplete = exports.AutoComplete = void 0;
6
+ exports.deepEqual = exports.ToolTip = exports.ExpandableToolTip = exports.ExpandableAutoComplete = exports.CustomAutoComplete = exports.AutoComplete = void 0;
7
7
  require("./styles/global.css");
8
8
  var AutoComplete_1 = require("./AutoComplete");
9
9
  Object.defineProperty(exports, "AutoComplete", { enumerable: true, get: function () { return __importDefault(AutoComplete_1).default; } });
@@ -11,6 +11,8 @@ var AutoComplete_2 = require("./AutoComplete");
11
11
  Object.defineProperty(exports, "CustomAutoComplete", { enumerable: true, get: function () { return __importDefault(AutoComplete_2).default; } });
12
12
  var ExpandableAutoComplete_1 = require("./ExpandableAutoComplete");
13
13
  Object.defineProperty(exports, "ExpandableAutoComplete", { enumerable: true, get: function () { return __importDefault(ExpandableAutoComplete_1).default; } });
14
+ var expandableTootltip_1 = require("./utilities/expandableTootltip");
15
+ Object.defineProperty(exports, "ExpandableToolTip", { enumerable: true, get: function () { return __importDefault(expandableTootltip_1).default; } });
14
16
  var tooltip_1 = require("./utilities/tooltip");
15
17
  Object.defineProperty(exports, "ToolTip", { enumerable: true, get: function () { return __importDefault(tooltip_1).default; } });
16
18
  var deepEqual_1 = require("./utilities/deepEqual");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;AAAA,+BAA6B;AAE7B,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAA+D;AAAtD,mIAAA,OAAO,OAAsB;AACtC,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAE1C,+CAAyD;AAAhD,mHAAA,OAAO,OAAW;AAC3B,mDAAkD;AAAzC,sGAAA,SAAS,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;AAAA,+BAA6B;AAE7B,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAA+D;AAAtD,mIAAA,OAAO,OAAsB;AACtC,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,qEAA8E;AAArE,wIAAA,OAAO,OAAqB;AACrC,+CAAyD;AAAhD,mHAAA,OAAO,OAAW;AAC3B,mDAAkD;AAAzC,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,578 @@
1
+ body * {
2
+ box-sizing: border-box;
3
+ }
4
+ :root {
5
+ --grey-dark: #4a4a4a;
6
+ --grey-light: #d3d3d3;
7
+ --blue-navy: #001f3f;
8
+ --input-disabled: #a9a9a9;
9
+ --error-light: #f08080;
10
+ --error-extra-light: #fddede;
11
+ --success: #28a745;
12
+ --success-light: #d4edda;
13
+ --blue-light: #add8e6;
14
+ }
15
+ :root {
16
+ --blue-navy: #001f3f;
17
+ --table-hover: #your-hover-color; /* Replace with your actual color code */
18
+ }
19
+
20
+ .custom-spinner {
21
+ width: 24px !important; /* w-6 */
22
+ height: 24px; /* h-6 */
23
+ color: transparent; /* text-table-hover */
24
+ fill: var(--blue-navy); /* fill-blue-navy */
25
+ animation: spin 1s linear infinite; /* animate-spin */
26
+ width: 15px;
27
+ position: relative;
28
+ top: 1px;
29
+ }
30
+
31
+ @keyframes spin {
32
+ 0% {
33
+ transform: rotate(0deg);
34
+ }
35
+ 100% {
36
+ transform: rotate(360deg);
37
+ }
38
+ }
39
+
40
+ .textfield,
41
+ .textfield-big {
42
+ outline: none;
43
+ color: var(--grey-dark);
44
+ border-color: var(--grey-light);
45
+ background-color: white;
46
+ }
47
+
48
+ .textfield:focus,
49
+ .textfield-big:focus {
50
+ border-color: var(--blue-navy);
51
+ }
52
+
53
+ .textfield:disabled,
54
+ .textfield-big:disabled {
55
+ color: var(--input-disabled);
56
+ }
57
+
58
+ .textfield-error,
59
+ .textfield-big-error {
60
+ outline: none;
61
+ color: var(--error-light) !important;
62
+ border-color: var(--error-light) !important;
63
+ background-color: var(--error-extra-light) !important ;
64
+ }
65
+
66
+ .textfield-error::placeholder,
67
+ .textfield-big-error::placeholder {
68
+ color: var(--error-light);
69
+ }
70
+
71
+ .textfield-success {
72
+ outline: none;
73
+ color: var(--success);
74
+ border-color: var(--success);
75
+ background-color: var(--success-light);
76
+ }
77
+
78
+ .textfield-success:focus {
79
+ ring-width: 0;
80
+ }
81
+
82
+ .textfield-success::placeholder {
83
+ color: var(--success);
84
+ }
85
+
86
+ .textfield-editable {
87
+ outline: none;
88
+ color: var(--grey-dark);
89
+ border-color: var(--blue-navy);
90
+ background-color: var(--blue-light);
91
+ }
92
+
93
+ .textfield-editable::placeholder {
94
+ color: var(--grey-dark);
95
+ }
96
+
97
+ .qbs-autocomplete-suggestions {
98
+ position: absolute;
99
+ height: auto;
100
+ width: 100%;
101
+ padding: 8px; /* Corresponding to p-1.5 in Tailwind */
102
+ z-index: 99;
103
+ margin-top: 4px;
104
+ margin-bottom: 0;
105
+ border-radius: 8px;
106
+ background: #fff;
107
+ box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
108
+ }
109
+ .qbs-autocomplete-suggestions.bottom {
110
+ top: 100%; /* Position below the input */
111
+ /* Other styling */
112
+ }
113
+
114
+ .qbs-autocomplete-suggestions.top {
115
+ bottom: 100%; /* Position above the input */
116
+ /* Other styling */
117
+ }
118
+ .qbs-autocomplete-suggestions-item {
119
+ cursor: pointer;
120
+ padding: 6px 8px;
121
+ border-radius: 6px;
122
+ color: #222;
123
+ font-size: 14px;
124
+ font-weight: 500;
125
+ line-height: 20px; /* 142.857% */
126
+ width: 100%;
127
+ display: flex;
128
+ align-items: flex-start;
129
+ gap: 8px;
130
+ }
131
+ .qbs-autocomplete-suggestions-item:hover {
132
+ background: #f8f8f8;
133
+ border-radius: 6px;
134
+ }
135
+
136
+ /* When value.id is equal to suggestion.id */
137
+ .is-selected {
138
+ border-radius: 6px;
139
+ background: var(--neutrals-grey-20, #f4f4f4);
140
+ }
141
+
142
+ /* When value.id is NOT equal to suggestion.id */
143
+ .qbs-autocomplete-suggestions-item .is-not-selected:hover {
144
+ background-color: #f1f5f9; /* Replace with actual color code for 'hover:bg-table-hover' */
145
+ }
146
+
147
+ .qbs-autocomplete-notfound {
148
+ cursor: pointer;
149
+ padding: 6px 8px;
150
+ border-radius: 6px;
151
+ font-size: 12px;
152
+ font-weight: 500;
153
+ }
154
+
155
+ .qbs-autocomplete-close-icon {
156
+ position: absolute;
157
+ top: calc(50% - 7px);
158
+ right: 2px; /* right-1 */
159
+ padding-left: 0.25rem; /* px-1 */
160
+ padding-right: 0.25rem; /* px-1 */
161
+ display: flex;
162
+ justify-content: center;
163
+ align-items: center;
164
+ background-color: white; /* bg-white */
165
+ }
166
+ .qbs-textfield-default {
167
+ width: 100%;
168
+ position: relative;
169
+ padding-right: 8px;
170
+ min-height: 36px;
171
+ height: 36px;
172
+ border-radius: 6px;
173
+ padding-left: 8px;
174
+ border: 1px solid #d6d8dc;
175
+ background: #fff;
176
+ box-sizing: border-box;
177
+ font-size: 14px;
178
+ font-style: normal;
179
+ font-weight: 500;
180
+ line-height: 20px;
181
+ color: #313131;
182
+ }
183
+
184
+ .qbs-expandable-container {
185
+ border: 1px solid #d6d8dc;
186
+ background: #fff;
187
+ box-sizing: border-box;
188
+ padding: 5px;
189
+ display: flex;
190
+ flex-wrap: wrap;
191
+ flex: 1 1 0%;
192
+ gap: 5px;
193
+ }
194
+
195
+ .qbs-textfield-default.expandable {
196
+ height: auto;
197
+ border: none;
198
+ }
199
+
200
+ .qbs-expandable-container .qbs-textfield-expandable {
201
+ flex: 1 1 auto;
202
+ display: inline-grid;
203
+ grid-template-columns: 0px min-content;
204
+ grid-area: 1 / 1 / 2 / 3;
205
+ overflow: hidden;
206
+ }
207
+ .qbs-expandable-container .qbs-textfield-expandable::after {
208
+ content: attr(data-value) " ";
209
+ visibility: hidden;
210
+ white-space: pre;
211
+ grid-area: 1 / 2;
212
+ font: inherit;
213
+ min-width: 2px;
214
+ border: 0px;
215
+ margin: 0px;
216
+ outline: 0px;
217
+ padding: 0px;
218
+ }
219
+ .qbs-expandable-container .qbs-textfield-expandable input {
220
+ opacity: 1;
221
+ width: 100%;
222
+ grid-area: 1 / 2;
223
+ min-width: 10px;
224
+ border: 0px;
225
+ margin: 0px;
226
+ outline: 0px;
227
+ padding: 0px;
228
+ height: auto;
229
+ min-height: auto;
230
+ border-radius: 0;
231
+ }
232
+
233
+ .qbs-textfield-default::placeholder {
234
+ font-size: 14px;
235
+ font-style: normal;
236
+ font-weight: 500;
237
+ line-height: 20px;
238
+ }
239
+
240
+ .qbs-autocomplete-close-icon button:focus-within {
241
+ outline: none;
242
+ }
243
+
244
+ .fullWidth {
245
+ width: 100%;
246
+ }
247
+
248
+ .autoWidth {
249
+ width: auto;
250
+ }
251
+ .icon-button {
252
+ background: transparent;
253
+ border: none;
254
+ display: inline-flex;
255
+ cursor: pointer;
256
+ padding: 0px 1px;
257
+ }
258
+ .labels {
259
+ font-size: 12px;
260
+ }
261
+ .dropdown-search-input {
262
+ min-width: -webkit-fill-available;
263
+ border-radius: 6px;
264
+ border: 1px solid var(--border-card-color-default, #d6d8dc);
265
+ background: var(--surface-input-bg-color-default, #fff);
266
+ color: #313131;
267
+ font-size: 14px;
268
+ height: 36px;
269
+ padding: 0px 8px;
270
+ font-style: normal;
271
+ font-weight: 500;
272
+ line-height: 20px;
273
+ padding-left: 32px;
274
+ }
275
+ .qbs-autocomplete-suggestions-sub {
276
+ position: relative;
277
+ overflow: auto;
278
+ max-height: 192px;
279
+ top: 0;
280
+ display: flex;
281
+ flex-direction: column;
282
+ gap: 4px;
283
+ }
284
+ .qbs-autocomplete-listitem-container {
285
+ display: flex;
286
+ align-items: center;
287
+ gap: 0px;
288
+ }
289
+ ul {
290
+ list-style-type: none;
291
+ }
292
+
293
+ .react-core-ts-search-container {
294
+ display: flex;
295
+ align-items: center;
296
+ gap: var(--spacing-4, 4px);
297
+ align-self: stretch;
298
+ margin-bottom: 4px;
299
+ }
300
+ .selected-item {
301
+ display: flex;
302
+ align-items: center;
303
+ justify-content: space-between;
304
+ padding: 3px 6px;
305
+ margin: 0;
306
+ background-color: #e0e0e0;
307
+ color: #333;
308
+ border-radius: 6px;
309
+ border: 1px solid rgba(231, 100, 88, 0.1);
310
+ background: rgba(231, 100, 88, 0.1);
311
+ font-size: 12px;
312
+ font-style: normal;
313
+ font-weight: 500;
314
+ line-height: 16px;
315
+ color: #e76458;
316
+ gap: 6px;
317
+ height: 22px;
318
+ }
319
+
320
+ .remove-item-btn {
321
+ background-color: transparent;
322
+ border: none;
323
+ color: #e76458;
324
+ cursor: pointer;
325
+ }
326
+
327
+ .remove-item-btn:hover {
328
+ color: #e76458;
329
+ }
330
+
331
+ .selected-items-container {
332
+ display: flex;
333
+ gap: 12px;
334
+ align-items: center;
335
+ position: absolute;
336
+ left: 8px;
337
+ z-index: 99;
338
+ top: 6.5px;
339
+ flex-wrap: wrap;
340
+ }
341
+
342
+ .qbs-expandable-container .selected-items-container {
343
+ position: relative;
344
+ top: 0;
345
+ left: 0;
346
+ }
347
+
348
+ .selected-item-more {
349
+ display: flex;
350
+ align-items: center;
351
+ justify-content: center;
352
+ padding: 3px 8px;
353
+ margin: 0;
354
+ border-radius: 6px;
355
+ background: #c63a3a;
356
+ font-size: 12px;
357
+ font-style: normal;
358
+ font-weight: 500;
359
+ line-height: 16px;
360
+ color: #fff;
361
+ height: 22px;
362
+ }
363
+
364
+ .loadMoreSection {
365
+ margin: 0;
366
+ cursor: pointer;
367
+ display: flex;
368
+ justify-content: flex-start;
369
+ padding: 8px;
370
+ }
371
+ .loadMoreSection p {
372
+ color: #336cfc;
373
+ font-size: 14px;
374
+ font-style: normal;
375
+ font-weight: 500;
376
+ line-height: 20px;
377
+ margin: 0;
378
+ }
379
+ ::-webkit-scrollbar-track {
380
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
381
+ border-radius: 0px;
382
+ background-color: transparent;
383
+ }
384
+
385
+ ::-webkit-scrollbar {
386
+ width: 6px;
387
+ height: 4px;
388
+ background-color: transparent;
389
+ }
390
+
391
+ ::-webkit-scrollbar-thumb {
392
+ border-radius: 100px;
393
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
394
+ background-color: #ddd;
395
+ }
396
+
397
+ .qbs-autocomplete-suggestions-item.is-selected {
398
+ color: #e76458;
399
+ background: #f8f8f8;
400
+ }
401
+
402
+ span.dropdown-search-icon {
403
+ position: absolute;
404
+ left: 8px;
405
+ top: 10px;
406
+ }
407
+
408
+ .dropdown-search-input:focus {
409
+ outline: none;
410
+ border: 1px solid #222;
411
+ }
412
+
413
+ .qbs-autocomplete-checkbox-container {
414
+ gap: 8px;
415
+ padding: 6px 8px;
416
+ display: flex;
417
+ align-items: flex-start;
418
+ }
419
+
420
+ .qbs-autocomplete-checkbox-container .qbs-autocomplete-suggestions-item {
421
+ padding: 0;
422
+ pointer-events: none;
423
+ }
424
+
425
+ .qbs-autocomplete-checkbox-container:hover {
426
+ background: #f8f8f8;
427
+ border-radius: 6px;
428
+ }
429
+
430
+ .qbs-autocomplete-checkbox-container.is-selected {
431
+ background: #f8f8f8;
432
+ border-radius: 6px;
433
+ }
434
+
435
+ .qbs-autocomplete-checkbox {
436
+ position: relative;
437
+ display: flex;
438
+ align-items: center;
439
+ justify-content: center;
440
+ }
441
+
442
+ .qbs-autocomplete-checkbox input {
443
+ opacity: 0;
444
+ }
445
+
446
+ .qbs-autocomplete-checkbox input ~ label {
447
+ position: absolute;
448
+ border-radius: 3px;
449
+ border: 1px solid #999696;
450
+ width: 16px;
451
+ height: 16px;
452
+ top: 3px;
453
+ transition: all 0.2s ease;
454
+ cursor: pointer;
455
+ }
456
+
457
+ .qbs-autocomplete-checkbox input ~ label svg {
458
+ opacity: 0;
459
+ transition: all 0.2s ease;
460
+ position: absolute;
461
+ left: 3px;
462
+ top: 3px;
463
+ width: 9px;
464
+ height: 9px;
465
+ }
466
+
467
+ .qbs-autocomplete-checkbox input:checked ~ label {
468
+ transition: all 0.2s ease;
469
+ border-radius: 3px;
470
+ background: #e76458;
471
+ border-color: #e76458;
472
+ }
473
+ .qbs-autocomplete-checkbox input:checked ~ label svg {
474
+ opacity: 1;
475
+ transition: all 0.2s ease;
476
+ }
477
+
478
+ .action_label {
479
+ font-size: 14px;
480
+ color: #4c7ad6;
481
+ }
482
+ /* Tooltip.css */
483
+ /* .tooltip-wrapper {
484
+ position: relative;
485
+ display: inline-block;
486
+ }
487
+
488
+ .tooltip-content {
489
+ visibility: hidden;
490
+ width: max-content;
491
+ background-color: black;
492
+ color: white;
493
+ text-align: center;
494
+ max-width: 150px;
495
+ padding: 5px 10px;
496
+ border-radius: 6px;
497
+ position: absolute;
498
+ z-index: 1;
499
+ bottom: 125%;
500
+ left: 50%;
501
+ transform: translateX(-50%);
502
+ transition: visibility 0.2s ease-in-out;
503
+ }
504
+
505
+ .tooltip-content::after {
506
+ content: '';
507
+ position: absolute;
508
+ top: 100%;
509
+ left: 50%;
510
+ margin-left: -5px;
511
+ border-width: 5px;
512
+ border-style: solid;
513
+ border-color: black transparent transparent transparent;
514
+ }
515
+
516
+ .tooltip-wrapper:hover .tooltip-content {
517
+ visibility: visible;
518
+ } */
519
+ .qbs-table-tooltip {
520
+ position: relative;
521
+ display: contents;
522
+ cursor: pointer;
523
+ }
524
+
525
+ .qbs-table-tooltip .tooltiptext, .tooltiptext {
526
+ visibility: hidden;
527
+ background-color: #000;
528
+ color: #fff;
529
+ text-align: center;
530
+ padding: 6px;
531
+ border-radius: 4px;
532
+ position: absolute;
533
+ z-index: 9999;
534
+ opacity: 0;
535
+ transition: opacity 0.3s;
536
+ font-size: 14px;
537
+ font-style: normal;
538
+ font-weight: 400;
539
+ line-height: 16px;
540
+ max-width: 300px;
541
+ }
542
+
543
+ .qbs-table-tooltip.up .tooltiptext {
544
+ bottom: 125%;
545
+ left: 0%;
546
+ }
547
+
548
+ .qbs-table-tooltip.down .tooltiptext {
549
+ top: 125%;
550
+ right: 0px;
551
+ left: auto;
552
+ }
553
+
554
+ .qbs-table-tooltip:hover .tooltiptext {
555
+ visibility: visible;
556
+ opacity: 1;
557
+ }
558
+
559
+ .qbs-table-tooltip .tooltiptext::after, .tooltiptext::after {
560
+ content: "";
561
+ position: absolute;
562
+ border-width: 5px;
563
+ border-style: solid;
564
+ }
565
+
566
+ .qbs-table-tooltip.up .tooltiptext::after, .up.tooltiptext::after {
567
+ top: 100%;
568
+ left: 50%;
569
+ margin-left: -5px;
570
+ border-color: #000 transparent transparent transparent;
571
+ }
572
+
573
+ .qbs-table-tooltip.down .tooltiptext::after, .down.tooltiptext::after {
574
+ bottom: 100%;
575
+ left: 50%;
576
+ margin-left: -5px;
577
+ border-color: transparent transparent #000 transparent;
578
+ }
@@ -0,0 +1 @@
1
+ @import './components/autocomplete.css';
@@ -1,3 +1,3 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  declare const ExpandableToolTip: React.FC<any>;
3
3
  export default ExpandableToolTip;
@@ -41,7 +41,7 @@ var react_1 = __importStar(require("react"));
41
41
  var react_dom_1 = __importDefault(require("react-dom"));
42
42
  var ExpandableToolTip = function (_a) {
43
43
  var title = _a.title, children = _a.children, enabled = _a.enabled;
44
- var _b = (0, react_1.useState)("bottom-position"), dropdownPosition = _b[0], setDropdownPosition = _b[1];
44
+ var _b = (0, react_1.useState)('bottom-position'), dropdownPosition = _b[0], setDropdownPosition = _b[1];
45
45
  var dropRef = (0, react_1.useRef)(null);
46
46
  var menuButtonRef = (0, react_1.useRef)(null);
47
47
  var _c = (0, react_1.useState)(false), visible = _c[0], setVisible = _c[1];
@@ -59,19 +59,19 @@ var ExpandableToolTip = function (_a) {
59
59
  var spaceBelow = viewportHeight - inputBoxRect.bottom;
60
60
  if (spaceAbove > spaceBelow) {
61
61
  if (spaceAbove > 90 && spaceBelow < 120) {
62
- return "top-position";
62
+ return 'top-position';
63
63
  }
64
64
  else {
65
- return "bottom-position";
65
+ return 'bottom-position';
66
66
  }
67
67
  }
68
68
  else {
69
69
  var diff = spaceBelow - spaceAbove;
70
70
  if (spaceAbove > 90 && spaceBelow > 90 && diff < 90) {
71
- return "top-position";
71
+ return 'top-position';
72
72
  }
73
73
  else {
74
- return "bottom-position";
74
+ return 'bottom-position';
75
75
  }
76
76
  }
77
77
  }
@@ -86,7 +86,7 @@ var ExpandableToolTip = function (_a) {
86
86
  var left = rect.left + window.scrollX;
87
87
  var height = rect.height;
88
88
  var width = (_a = dropRef === null || dropRef === void 0 ? void 0 : dropRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
89
- if (dropPosition === "bottom-position") {
89
+ if (dropPosition === 'bottom-position') {
90
90
  top_1 = top_1 + height / 2 - 5;
91
91
  }
92
92
  else {
@@ -111,7 +111,7 @@ var ExpandableToolTip = function (_a) {
111
111
  var boxWidth_1 = menuButtonRef.current.offsetWidth;
112
112
  setTooltipStyle(function (prevStyle) { return (__assign(__assign({}, prevStyle), { left: prevStyle.left + boxWidth_1 / 2 - tooltipWidth_1 / 2 < 0
113
113
  ? 20
114
- : prevStyle.left + boxWidth_1 / 2 - tooltipWidth_1 / 2, width: tooltipWidth_1, top: dropdownPosition === "bottom-position"
114
+ : prevStyle.left + boxWidth_1 / 2 - tooltipWidth_1 / 2, width: tooltipWidth_1, top: dropdownPosition === 'bottom-position'
115
115
  ? prevStyle.top
116
116
  : prevStyle.top - tooltipHeight_1 })); });
117
117
  }
@@ -119,9 +119,9 @@ var ExpandableToolTip = function (_a) {
119
119
  if (visible) {
120
120
  updateTooltipPosition();
121
121
  }
122
- window.addEventListener("resize", updateTooltipPosition);
122
+ window.addEventListener('resize', updateTooltipPosition);
123
123
  return function () {
124
- window.removeEventListener("resize", updateTooltipPosition);
124
+ window.removeEventListener('resize', updateTooltipPosition);
125
125
  };
126
126
  }, [visible, dropdownPosition]);
127
127
  (0, react_1.useEffect)(function () {
@@ -130,26 +130,25 @@ var ExpandableToolTip = function (_a) {
130
130
  setVisible(false);
131
131
  }
132
132
  };
133
- document.addEventListener("mousedown", handleClickOutside);
133
+ document.addEventListener('mousedown', handleClickOutside);
134
134
  return function () {
135
- document.removeEventListener("mousedown", handleClickOutside);
135
+ document.removeEventListener('mousedown', handleClickOutside);
136
136
  };
137
137
  }, []);
138
- return (react_1.default.createElement(react_1.default.Fragment, null,
139
- react_1.default.createElement("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuButtonRef, style: { display: "flex" } },
140
- children,
141
- visible &&
142
- enabled &&
143
- tooltipStyle &&
144
- react_dom_1.default.createPortal(react_1.default.createElement("span", { ref: function (node) { return (dropRef.current = node); }, className: "tooltiptext ".concat(dropdownPosition == "bottom-position" ? "down" : "up"), style: {
145
- top: tooltipStyle.top,
146
- left: tooltipStyle.left,
147
- opacity: 1,
148
- width: tooltipStyle.width,
149
- minWidth: "60px",
150
- maxWidth: "200px",
151
- visibility: "visible",
152
- } }, title), document.body))));
138
+ return (react_1.default.createElement("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: menuButtonRef, style: { display: 'flex' } },
139
+ children,
140
+ visible &&
141
+ enabled &&
142
+ tooltipStyle &&
143
+ react_dom_1.default.createPortal(react_1.default.createElement("span", { ref: function (node) { return (dropRef.current = node); }, className: "tooltiptext ".concat(dropdownPosition == 'bottom-position' ? 'down' : 'up'), style: {
144
+ top: tooltipStyle.top,
145
+ left: tooltipStyle.left,
146
+ opacity: 1,
147
+ width: tooltipStyle.width,
148
+ minWidth: '60px',
149
+ maxWidth: '200px',
150
+ visibility: 'visible',
151
+ } }, title), document.body)));
153
152
  };
154
153
  exports.default = ExpandableToolTip;
155
154
  //# sourceMappingURL=expandableTootltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expandableTootltip.js","sourceRoot":"","sources":["../../src/utilities/expandableTootltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA4E;AAC5E,wDAAiC;AAEjC,IAAM,iBAAiB,GAAkB,UAAC,EAA4B;QAA1B,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA;IAC5D,IAAA,KAA0C,IAAA,gBAAQ,EAAC,iBAAiB,CAAC,EAApE,gBAAgB,QAAA,EAAE,mBAAmB,QAA+B,CAAC;IAC5E,IAAM,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAC7B,IAAM,aAAa,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAC7C,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAC;IACxC,IAAA,KAAkC,IAAA,gBAAQ,EAAC;QAC/C,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;KACT,CAAC,EAJK,YAAY,QAAA,EAAE,eAAe,QAIlC,CAAC;IACH,IAAM,sBAAsB,GAAG;;QAC7B,IAAI,aAAa,CAAC,OAAO,EAAE;YACzB,IAAM,YAAY,GAAG,MAAA,aAAa,CAAC,OAAO,0CAAE,qBAAqB,EAAE,CAAC;YACpE,IAAM,cAAc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QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;gBACtE,UAAU,CAAC,KAAK,CAAC,CAAC;aACnB;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO;YACL,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,uCACE,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAEzB,QAAQ;QAER,OAAO;YACN,OAAO;YACP,YAAY;YACZ,mBAAQ,CAAC,YAAY,CACnB,wCACE,GAAG,EAAE,UAAC,IAAI,IAAK,OAAA,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAxB,CAAwB,EACvC,SAAS,EAAE,uBACT,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACrD,EACF,KAAK,EAAE;oBACL,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,IAAI,EAAE,YAAY,CAAC,IAAI;oBACvB,OAAO,EAAE,CAAC;oBACV,KAAK,EAAE,YAAY,CAAC,KAAK;oBACzB,QAAQ,EAAE,MAAM;oBAChB,QAAQ,EAAE,OAAO;oBACjB,UAAU,EAAE,SAAS;iBACtB,IAEA,KAAK,CACD,EACP,QAAQ,CAAC,IAAI,CACd,CACC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-core-ts",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "React Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.tsx CHANGED
@@ -3,7 +3,7 @@ import './styles/global.css';
3
3
  export { default as AutoComplete } from './AutoComplete';
4
4
  export { default as CustomAutoComplete } from './AutoComplete';
5
5
  export { default as ExpandableAutoComplete } from './ExpandableAutoComplete';
6
-
6
+ export { default as ExpandableToolTip } from './utilities/expandableTootltip';
7
7
  export { default as ToolTip } from './utilities/tooltip';
8
8
  export { deepEqual } from './utilities/deepEqual';
9
9
  export type { AutoSuggestionInputProps } from './commontypes';
@@ -1,8 +1,8 @@
1
- import React, { useState, useRef, useLayoutEffect, useEffect } from "react";
2
- import ReactDOM from "react-dom";
1
+ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
+ import ReactDOM from 'react-dom';
3
3
 
4
4
  const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
5
- const [dropdownPosition, setDropdownPosition] = useState("bottom-position");
5
+ const [dropdownPosition, setDropdownPosition] = useState('bottom-position');
6
6
  const dropRef = useRef(null);
7
7
  const menuButtonRef = useRef<HTMLDivElement>(null);
8
8
  const [visible, setVisible] = useState(false);
@@ -20,16 +20,16 @@ const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
20
20
  const spaceBelow = viewportHeight - inputBoxRect.bottom;
21
21
  if (spaceAbove > spaceBelow) {
22
22
  if (spaceAbove > 90 && spaceBelow < 120) {
23
- return "top-position";
23
+ return 'top-position';
24
24
  } else {
25
- return "bottom-position";
25
+ return 'bottom-position';
26
26
  }
27
27
  } else {
28
28
  const diff: number = spaceBelow - spaceAbove;
29
29
  if (spaceAbove > 90 && spaceBelow > 90 && diff < 90) {
30
- return "top-position";
30
+ return 'top-position';
31
31
  } else {
32
- return "bottom-position";
32
+ return 'bottom-position';
33
33
  }
34
34
  }
35
35
  }
@@ -44,7 +44,7 @@ const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
44
44
  let left = rect.left + window.scrollX;
45
45
  const height = rect.height;
46
46
  const width = dropRef?.current?.offsetWidth;
47
- if (dropPosition === "bottom-position") {
47
+ if (dropPosition === 'bottom-position') {
48
48
  top = top + height / 2 - 5;
49
49
  } else {
50
50
  top = top - height * 2 + 15;
@@ -77,7 +77,7 @@ const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
77
77
  : prevStyle.left + boxWidth / 2 - tooltipWidth / 2,
78
78
  width: tooltipWidth,
79
79
  top:
80
- dropdownPosition === "bottom-position"
80
+ dropdownPosition === 'bottom-position'
81
81
  ? prevStyle.top
82
82
  : prevStyle.top - tooltipHeight,
83
83
  }));
@@ -88,10 +88,10 @@ const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
88
88
  updateTooltipPosition();
89
89
  }
90
90
 
91
- window.addEventListener("resize", updateTooltipPosition);
91
+ window.addEventListener('resize', updateTooltipPosition);
92
92
 
93
93
  return () => {
94
- window.removeEventListener("resize", updateTooltipPosition);
94
+ window.removeEventListener('resize', updateTooltipPosition);
95
95
  };
96
96
  }, [visible, dropdownPosition]);
97
97
 
@@ -102,47 +102,45 @@ const ExpandableToolTip: React.FC<any> = ({ title, children, enabled }) => {
102
102
  }
103
103
  };
104
104
 
105
- document.addEventListener("mousedown", handleClickOutside);
105
+ document.addEventListener('mousedown', handleClickOutside);
106
106
  return () => {
107
- document.removeEventListener("mousedown", handleClickOutside);
107
+ document.removeEventListener('mousedown', handleClickOutside);
108
108
  };
109
109
  }, []);
110
110
 
111
111
  return (
112
- <>
113
- <div
114
- onMouseEnter={handleMouseEnter}
115
- onMouseLeave={handleMouseLeave}
116
- ref={menuButtonRef}
117
- style={{ display: "flex" }}
118
- >
119
- {children}
112
+ <div
113
+ onMouseEnter={handleMouseEnter}
114
+ onMouseLeave={handleMouseLeave}
115
+ ref={menuButtonRef}
116
+ style={{ display: 'flex' }}
117
+ >
118
+ {children}
120
119
 
121
- {visible &&
122
- enabled &&
123
- tooltipStyle &&
124
- ReactDOM.createPortal(
125
- <span
126
- ref={(node) => (dropRef.current = node)}
127
- className={`tooltiptext ${
128
- dropdownPosition == "bottom-position" ? "down" : "up"
129
- }`}
130
- style={{
131
- top: tooltipStyle.top,
132
- left: tooltipStyle.left,
133
- opacity: 1,
134
- width: tooltipStyle.width,
135
- minWidth: "60px",
136
- maxWidth: "200px",
137
- visibility: "visible",
138
- }}
139
- >
140
- {title}
141
- </span>,
142
- document.body
143
- )}
144
- </div>
145
- </>
120
+ {visible &&
121
+ enabled &&
122
+ tooltipStyle &&
123
+ ReactDOM.createPortal(
124
+ <span
125
+ ref={(node) => (dropRef.current = node)}
126
+ className={`tooltiptext ${
127
+ dropdownPosition == 'bottom-position' ? 'down' : 'up'
128
+ }`}
129
+ style={{
130
+ top: tooltipStyle.top,
131
+ left: tooltipStyle.left,
132
+ opacity: 1,
133
+ width: tooltipStyle.width,
134
+ minWidth: '60px',
135
+ maxWidth: '200px',
136
+ visibility: 'visible',
137
+ }}
138
+ >
139
+ {title}
140
+ </span>,
141
+ document.body
142
+ )}
143
+ </div>
146
144
  );
147
145
  };
148
146