@speakapbv/dough-component-library 10.12.2 → 10.12.4
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/THIRD_PARTY_LICENSES.txt +203 -0
- package/dist/index.es.js +51 -33
- package/dist/index.js +51 -33
- package/package.json +2 -2
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
THIRD-PARTY LICENSES
|
|
2
|
+
|
|
3
|
+
This file contains license notices for third-party software bundled
|
|
4
|
+
in this package. Each section is separated by a line of '=' characters.
|
|
5
|
+
|
|
6
|
+
========================================================================
|
|
7
|
+
roboto
|
|
8
|
+
========================================================================
|
|
9
|
+
|
|
10
|
+
Roboto Font
|
|
11
|
+
Version 2.137 (2017)
|
|
12
|
+
Copyright 2011 Google Inc. All Rights Reserved.
|
|
13
|
+
|
|
14
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
you may not use this file except in compliance with the License.
|
|
16
|
+
You may obtain a copy of the License at
|
|
17
|
+
|
|
18
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
|
|
20
|
+
Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
See the License for the specific language governing permissions and
|
|
24
|
+
limitations under the License.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
Apache License
|
|
29
|
+
Version 2.0, January 2004
|
|
30
|
+
http://www.apache.org/licenses/
|
|
31
|
+
|
|
32
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
33
|
+
|
|
34
|
+
1. Definitions.
|
|
35
|
+
|
|
36
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
37
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
38
|
+
|
|
39
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
40
|
+
the copyright owner that is granting the License.
|
|
41
|
+
|
|
42
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
43
|
+
other entities that control, are controlled by, or are under common
|
|
44
|
+
control with that entity. For the purposes of this definition,
|
|
45
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
46
|
+
direction or management of such entity, whether by contract or
|
|
47
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
48
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
49
|
+
|
|
50
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
51
|
+
exercising permissions granted by this License.
|
|
52
|
+
|
|
53
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
54
|
+
including but not limited to software source code, documentation
|
|
55
|
+
source, and configuration files.
|
|
56
|
+
|
|
57
|
+
"Object" form shall mean any form resulting from mechanical
|
|
58
|
+
transformation or translation of a Source form, including but
|
|
59
|
+
not limited to compiled object code, generated documentation,
|
|
60
|
+
and conversions to other media types.
|
|
61
|
+
|
|
62
|
+
"Work" shall mean the work of authorship, whether in Source or Object
|
|
63
|
+
form, made available under the License, as indicated by a copyright
|
|
64
|
+
notice that is included in or attached to the work (an example is
|
|
65
|
+
provided in the Appendix below).
|
|
66
|
+
|
|
67
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
68
|
+
form, that is based on (or derived from) the Work and for which the
|
|
69
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
70
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
71
|
+
of this License, Derivative Works shall not include works that remain
|
|
72
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
73
|
+
the Work and Derivative Works thereof.
|
|
74
|
+
|
|
75
|
+
"Contribution" shall mean any work of authorship, including
|
|
76
|
+
the original version of the Work and any modifications or additions
|
|
77
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
78
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
79
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
80
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
81
|
+
means any form of electronic, verbal, or written communication sent
|
|
82
|
+
to the Licensor or its representatives, including but not limited to
|
|
83
|
+
communication on electronic mailing lists, source code control systems,
|
|
84
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
85
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
86
|
+
excluding communication that is conspicuously marked or otherwise
|
|
87
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
88
|
+
|
|
89
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
90
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
91
|
+
subsequently incorporated within the Work.
|
|
92
|
+
|
|
93
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
94
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
95
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
96
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
97
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
98
|
+
Work and such Derivative Works in Source or Object form.
|
|
99
|
+
|
|
100
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
101
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
102
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
103
|
+
(except as stated in this section) patent license to make, have made,
|
|
104
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
105
|
+
where such license applies only to those patent claims licensable
|
|
106
|
+
by such Contributor that are necessarily infringed by their
|
|
107
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
108
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
109
|
+
institute patent litigation against any entity (including a
|
|
110
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
111
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
112
|
+
or contributory patent infringement, then any patent licenses
|
|
113
|
+
granted to You under this License for that Work shall terminate
|
|
114
|
+
as of the date such litigation is filed.
|
|
115
|
+
|
|
116
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
117
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
118
|
+
modifications, and in Source or Object form, provided that You
|
|
119
|
+
meet the following conditions:
|
|
120
|
+
|
|
121
|
+
(a) You must give any other recipients of the Work or
|
|
122
|
+
Derivative Works a copy of this License; and
|
|
123
|
+
|
|
124
|
+
(b) You must cause any modified files to carry prominent notices
|
|
125
|
+
stating that You changed the files; and
|
|
126
|
+
|
|
127
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
128
|
+
that You distribute, all copyright, patent, trademark, and
|
|
129
|
+
attribution notices from the Source form of the Work,
|
|
130
|
+
excluding those notices that do not pertain to any part of
|
|
131
|
+
the Derivative Works; and
|
|
132
|
+
|
|
133
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
134
|
+
distribution, then any Derivative Works that You distribute must
|
|
135
|
+
include a readable copy of the attribution notices contained
|
|
136
|
+
within such NOTICE file, excluding those notices that do not
|
|
137
|
+
pertain to any part of the Derivative Works, in at least one
|
|
138
|
+
of the following places: within a NOTICE text file distributed
|
|
139
|
+
as part of the Derivative Works; within the Source form or
|
|
140
|
+
documentation, if provided along with the Derivative Works; or,
|
|
141
|
+
within a display generated by the Derivative Works, if and
|
|
142
|
+
wherever such third-party notices normally appear. The contents
|
|
143
|
+
of the NOTICE file are for informational purposes only and
|
|
144
|
+
do not modify the License. You may add Your own attribution
|
|
145
|
+
notices within Derivative Works that You distribute, alongside
|
|
146
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
147
|
+
that such additional attribution notices cannot be construed
|
|
148
|
+
as modifying the License.
|
|
149
|
+
|
|
150
|
+
You may add Your own copyright statement to Your modifications and
|
|
151
|
+
may provide additional or different license terms and conditions
|
|
152
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
153
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
154
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
155
|
+
the conditions stated in this License.
|
|
156
|
+
|
|
157
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
158
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
159
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
160
|
+
this License, without any additional terms or conditions.
|
|
161
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
162
|
+
the terms of any separate license agreement you may have executed
|
|
163
|
+
with Licensor regarding such Contributions.
|
|
164
|
+
|
|
165
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
166
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
167
|
+
except as required for reasonable and customary use in describing the
|
|
168
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
169
|
+
|
|
170
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
171
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
172
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
173
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
174
|
+
implied, including, without limitation, any warranties or conditions
|
|
175
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
176
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
177
|
+
appropriateness of using or redistributing the Work and assume any
|
|
178
|
+
risks associated with Your exercise of permissions under this License.
|
|
179
|
+
|
|
180
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
181
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
182
|
+
unless required by applicable law (such as deliberate and grossly
|
|
183
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
184
|
+
liable to You for damages, including any direct, indirect, special,
|
|
185
|
+
incidental, or exemplary, or consequential damages of any character
|
|
186
|
+
arising as a result of this License or out of the use or inability
|
|
187
|
+
to use the Work (including but not limited to damages for loss of
|
|
188
|
+
goodwill, work stoppage, computer failure or malfunction, or all
|
|
189
|
+
other commercial damages or losses), even if such Contributor has
|
|
190
|
+
been advised of the possibility of such damages.
|
|
191
|
+
|
|
192
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
193
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
194
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
195
|
+
or other liability obligations and/or rights consistent with this
|
|
196
|
+
License. However, in accepting such obligations, You may act only
|
|
197
|
+
on Your own behalf and on your sole responsibility, not on behalf
|
|
198
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
199
|
+
defend, and hold each Contributor harmless for any liability
|
|
200
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
201
|
+
of your accepting any such warranty or additional liability.
|
|
202
|
+
|
|
203
|
+
END OF TERMS AND CONDITIONS
|
package/dist/index.es.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Roboto Font v2.137 (2017)
|
|
3
|
+
* Copyright 2011 Google Inc. All Rights Reserved.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Full third-party license texts are available in THIRD_PARTY_LICENSES.txt
|
|
8
|
+
* distributed alongside this package.
|
|
9
|
+
*/
|
|
1
10
|
import { __spreadArray, __assign } from 'tslib';
|
|
2
11
|
import React, { forwardRef, useState, useRef, useEffect, useImperativeHandle, Children, Fragment } from 'react';
|
|
3
12
|
import { createPortal } from 'react-dom';
|
|
@@ -1393,7 +1402,7 @@ var DropArea = function (props) {
|
|
|
1393
1402
|
var updateReferencePosition = function () {
|
|
1394
1403
|
var _a;
|
|
1395
1404
|
if (dropAreaContainerRef.current && props.referenceElement.current) {
|
|
1396
|
-
var
|
|
1405
|
+
var overlayRect_1 = {
|
|
1397
1406
|
top: 0,
|
|
1398
1407
|
left: 0,
|
|
1399
1408
|
width: windowWidth,
|
|
@@ -1403,47 +1412,56 @@ var DropArea = function (props) {
|
|
|
1403
1412
|
var realyOverlayItemRect = (_a = document
|
|
1404
1413
|
.querySelector(props.overlaySelector)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1405
1414
|
if (realyOverlayItemRect) {
|
|
1406
|
-
|
|
1415
|
+
overlayRect_1 = realyOverlayItemRect;
|
|
1407
1416
|
}
|
|
1408
1417
|
}
|
|
1409
1418
|
var dropAreaContentHeight = dropAreaContainerRef.current.getBoundingClientRect()
|
|
1410
1419
|
.height;
|
|
1411
|
-
var
|
|
1412
|
-
var leftPosition =
|
|
1420
|
+
var rect_1 = props.referenceElement.current.getBoundingClientRect();
|
|
1421
|
+
var leftPosition = rect_1.left;
|
|
1413
1422
|
if (props.alignToCenter && typeof props.width === "number") {
|
|
1414
|
-
leftPosition =
|
|
1423
|
+
leftPosition = rect_1.left + 20 - props.width / 2;
|
|
1415
1424
|
}
|
|
1416
1425
|
var rightPosition = 0;
|
|
1417
1426
|
if (props.alignFromRight && !props.alignToCenter) {
|
|
1418
1427
|
rightPosition =
|
|
1419
|
-
|
|
1428
|
+
overlayRect_1.width - (rect_1.left + rect_1.width + rightShift);
|
|
1420
1429
|
}
|
|
1421
|
-
var widthPercentage = (
|
|
1430
|
+
var widthPercentage = (rect_1.width * 100) / overlayRect_1.width;
|
|
1422
1431
|
var topPosition = props.alwaysTop
|
|
1423
|
-
?
|
|
1424
|
-
:
|
|
1432
|
+
? rect_1.top - dropAreaContentHeight - TOP_MARGIN + topShift
|
|
1433
|
+
: rect_1.top +
|
|
1425
1434
|
topShift +
|
|
1426
|
-
|
|
1435
|
+
rect_1.height +
|
|
1427
1436
|
TOP_MARGIN +
|
|
1428
1437
|
(props.showCaret ? 8 : 0);
|
|
1429
1438
|
var bottomPosition = void 0;
|
|
1439
|
+
var calculateBottomPosition = function () {
|
|
1440
|
+
return overlayRect_1.height -
|
|
1441
|
+
(rect_1.top - overlayRect_1.top) +
|
|
1442
|
+
TOP_MARGIN +
|
|
1443
|
+
(props.showCaret ? 8 : 0) -
|
|
1444
|
+
topShift;
|
|
1445
|
+
};
|
|
1430
1446
|
if (props.alwaysTop) {
|
|
1447
|
+
bottomPosition = calculateBottomPosition();
|
|
1431
1448
|
setDirection(TOUP);
|
|
1432
1449
|
}
|
|
1433
1450
|
else if (topPosition + dropAreaContentHeight >
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1451
|
+
overlayRect_1.height) {
|
|
1452
|
+
var spaceAboveInOverlay = rect_1.top - overlayRect_1.top;
|
|
1453
|
+
var requiredSpace = dropAreaContentHeight +
|
|
1454
|
+
TOP_MARGIN +
|
|
1455
|
+
(props.showCaret ? 8 : 0);
|
|
1456
|
+
var spaceAbove = rect_1.top -
|
|
1457
|
+
dropAreaContentHeight -
|
|
1458
|
+
TOP_MARGIN -
|
|
1459
|
+
(props.showCaret ? 8 : 0);
|
|
1460
|
+
if (spaceAboveInOverlay < requiredSpace || spaceAbove < 20) {
|
|
1444
1461
|
bottomPosition = null;
|
|
1445
1462
|
}
|
|
1446
1463
|
else {
|
|
1464
|
+
bottomPosition = calculateBottomPosition();
|
|
1447
1465
|
setDirection(TOUP);
|
|
1448
1466
|
}
|
|
1449
1467
|
}
|
|
@@ -1452,23 +1470,23 @@ var DropArea = function (props) {
|
|
|
1452
1470
|
}
|
|
1453
1471
|
setPositionStyle({
|
|
1454
1472
|
bottom: bottomPosition
|
|
1455
|
-
? "".concat(bottomPosition +
|
|
1473
|
+
? "".concat(bottomPosition + overlayRect_1.top, "px")
|
|
1456
1474
|
: "initial!important",
|
|
1457
1475
|
left: props.alignFromRight
|
|
1458
1476
|
? null
|
|
1459
|
-
: "".concat(leftPosition -
|
|
1477
|
+
: "".concat(leftPosition - overlayRect_1.left, "px"),
|
|
1460
1478
|
minWidth: props.strictToReferenceWidth === false &&
|
|
1461
1479
|
props.width !== undefined
|
|
1462
1480
|
? "".concat(props.width, "px")
|
|
1463
|
-
: "".concat(
|
|
1481
|
+
: "".concat(rect_1.width, "px"),
|
|
1464
1482
|
right: props.alignFromRight && !props.alignToCenter
|
|
1465
|
-
? "".concat(rightPosition +
|
|
1483
|
+
? "".concat(rightPosition + overlayRect_1.left, "px")
|
|
1466
1484
|
: null,
|
|
1467
1485
|
top: bottomPosition
|
|
1468
1486
|
? "initial!important"
|
|
1469
|
-
: "".concat(topPosition -
|
|
1487
|
+
: "".concat(topPosition - overlayRect_1.top, "px"),
|
|
1470
1488
|
width: props.strictToReferenceWidth
|
|
1471
|
-
? "".concat(
|
|
1489
|
+
? "".concat(rect_1.width, "px")
|
|
1472
1490
|
: props.width
|
|
1473
1491
|
? typeof props.width === "string"
|
|
1474
1492
|
? props.width
|
|
@@ -1477,15 +1495,15 @@ var DropArea = function (props) {
|
|
|
1477
1495
|
}, dropAreaContainerRef);
|
|
1478
1496
|
setPositionStyle({
|
|
1479
1497
|
bottom: bottomPosition
|
|
1480
|
-
? "".concat(bottomPosition +
|
|
1498
|
+
? "".concat(bottomPosition + overlayRect_1.top, "px")
|
|
1481
1499
|
: "initial!important",
|
|
1482
|
-
left: "".concat(
|
|
1500
|
+
left: "".concat(rect_1.left -
|
|
1483
1501
|
12 +
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
top:
|
|
1487
|
-
? ""
|
|
1488
|
-
: "
|
|
1502
|
+
rect_1.width / 2 -
|
|
1503
|
+
overlayRect_1.left, "px"),
|
|
1504
|
+
top: bottomPosition
|
|
1505
|
+
? "initial!important"
|
|
1506
|
+
: "".concat(topPosition - overlayRect_1.top, "px"),
|
|
1489
1507
|
}, dropAreaArrowRef);
|
|
1490
1508
|
}
|
|
1491
1509
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Roboto Font v2.137 (2017)
|
|
3
|
+
* Copyright 2011 Google Inc. All Rights Reserved.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
|
5
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Full third-party license texts are available in THIRD_PARTY_LICENSES.txt
|
|
8
|
+
* distributed alongside this package.
|
|
9
|
+
*/
|
|
1
10
|
'use strict';
|
|
2
11
|
|
|
3
12
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -1377,7 +1386,7 @@ var DropArea = function (props) {
|
|
|
1377
1386
|
var updateReferencePosition = function () {
|
|
1378
1387
|
var _a;
|
|
1379
1388
|
if (dropAreaContainerRef.current && props.referenceElement.current) {
|
|
1380
|
-
var
|
|
1389
|
+
var overlayRect_1 = {
|
|
1381
1390
|
top: 0,
|
|
1382
1391
|
left: 0,
|
|
1383
1392
|
width: windowWidth,
|
|
@@ -1387,47 +1396,56 @@ var DropArea = function (props) {
|
|
|
1387
1396
|
var realyOverlayItemRect = (_a = document
|
|
1388
1397
|
.querySelector(props.overlaySelector)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1389
1398
|
if (realyOverlayItemRect) {
|
|
1390
|
-
|
|
1399
|
+
overlayRect_1 = realyOverlayItemRect;
|
|
1391
1400
|
}
|
|
1392
1401
|
}
|
|
1393
1402
|
var dropAreaContentHeight = dropAreaContainerRef.current.getBoundingClientRect()
|
|
1394
1403
|
.height;
|
|
1395
|
-
var
|
|
1396
|
-
var leftPosition =
|
|
1404
|
+
var rect_1 = props.referenceElement.current.getBoundingClientRect();
|
|
1405
|
+
var leftPosition = rect_1.left;
|
|
1397
1406
|
if (props.alignToCenter && typeof props.width === "number") {
|
|
1398
|
-
leftPosition =
|
|
1407
|
+
leftPosition = rect_1.left + 20 - props.width / 2;
|
|
1399
1408
|
}
|
|
1400
1409
|
var rightPosition = 0;
|
|
1401
1410
|
if (props.alignFromRight && !props.alignToCenter) {
|
|
1402
1411
|
rightPosition =
|
|
1403
|
-
|
|
1412
|
+
overlayRect_1.width - (rect_1.left + rect_1.width + rightShift);
|
|
1404
1413
|
}
|
|
1405
|
-
var widthPercentage = (
|
|
1414
|
+
var widthPercentage = (rect_1.width * 100) / overlayRect_1.width;
|
|
1406
1415
|
var topPosition = props.alwaysTop
|
|
1407
|
-
?
|
|
1408
|
-
:
|
|
1416
|
+
? rect_1.top - dropAreaContentHeight - TOP_MARGIN + topShift
|
|
1417
|
+
: rect_1.top +
|
|
1409
1418
|
topShift +
|
|
1410
|
-
|
|
1419
|
+
rect_1.height +
|
|
1411
1420
|
TOP_MARGIN +
|
|
1412
1421
|
(props.showCaret ? 8 : 0);
|
|
1413
1422
|
var bottomPosition = void 0;
|
|
1423
|
+
var calculateBottomPosition = function () {
|
|
1424
|
+
return overlayRect_1.height -
|
|
1425
|
+
(rect_1.top - overlayRect_1.top) +
|
|
1426
|
+
TOP_MARGIN +
|
|
1427
|
+
(props.showCaret ? 8 : 0) -
|
|
1428
|
+
topShift;
|
|
1429
|
+
};
|
|
1414
1430
|
if (props.alwaysTop) {
|
|
1431
|
+
bottomPosition = calculateBottomPosition();
|
|
1415
1432
|
setDirection(TOUP);
|
|
1416
1433
|
}
|
|
1417
1434
|
else if (topPosition + dropAreaContentHeight >
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1435
|
+
overlayRect_1.height) {
|
|
1436
|
+
var spaceAboveInOverlay = rect_1.top - overlayRect_1.top;
|
|
1437
|
+
var requiredSpace = dropAreaContentHeight +
|
|
1438
|
+
TOP_MARGIN +
|
|
1439
|
+
(props.showCaret ? 8 : 0);
|
|
1440
|
+
var spaceAbove = rect_1.top -
|
|
1441
|
+
dropAreaContentHeight -
|
|
1442
|
+
TOP_MARGIN -
|
|
1443
|
+
(props.showCaret ? 8 : 0);
|
|
1444
|
+
if (spaceAboveInOverlay < requiredSpace || spaceAbove < 20) {
|
|
1428
1445
|
bottomPosition = null;
|
|
1429
1446
|
}
|
|
1430
1447
|
else {
|
|
1448
|
+
bottomPosition = calculateBottomPosition();
|
|
1431
1449
|
setDirection(TOUP);
|
|
1432
1450
|
}
|
|
1433
1451
|
}
|
|
@@ -1436,23 +1454,23 @@ var DropArea = function (props) {
|
|
|
1436
1454
|
}
|
|
1437
1455
|
setPositionStyle({
|
|
1438
1456
|
bottom: bottomPosition
|
|
1439
|
-
? "".concat(bottomPosition +
|
|
1457
|
+
? "".concat(bottomPosition + overlayRect_1.top, "px")
|
|
1440
1458
|
: "initial!important",
|
|
1441
1459
|
left: props.alignFromRight
|
|
1442
1460
|
? null
|
|
1443
|
-
: "".concat(leftPosition -
|
|
1461
|
+
: "".concat(leftPosition - overlayRect_1.left, "px"),
|
|
1444
1462
|
minWidth: props.strictToReferenceWidth === false &&
|
|
1445
1463
|
props.width !== undefined
|
|
1446
1464
|
? "".concat(props.width, "px")
|
|
1447
|
-
: "".concat(
|
|
1465
|
+
: "".concat(rect_1.width, "px"),
|
|
1448
1466
|
right: props.alignFromRight && !props.alignToCenter
|
|
1449
|
-
? "".concat(rightPosition +
|
|
1467
|
+
? "".concat(rightPosition + overlayRect_1.left, "px")
|
|
1450
1468
|
: null,
|
|
1451
1469
|
top: bottomPosition
|
|
1452
1470
|
? "initial!important"
|
|
1453
|
-
: "".concat(topPosition -
|
|
1471
|
+
: "".concat(topPosition - overlayRect_1.top, "px"),
|
|
1454
1472
|
width: props.strictToReferenceWidth
|
|
1455
|
-
? "".concat(
|
|
1473
|
+
? "".concat(rect_1.width, "px")
|
|
1456
1474
|
: props.width
|
|
1457
1475
|
? typeof props.width === "string"
|
|
1458
1476
|
? props.width
|
|
@@ -1461,15 +1479,15 @@ var DropArea = function (props) {
|
|
|
1461
1479
|
}, dropAreaContainerRef);
|
|
1462
1480
|
setPositionStyle({
|
|
1463
1481
|
bottom: bottomPosition
|
|
1464
|
-
? "".concat(bottomPosition +
|
|
1482
|
+
? "".concat(bottomPosition + overlayRect_1.top, "px")
|
|
1465
1483
|
: "initial!important",
|
|
1466
|
-
left: "".concat(
|
|
1484
|
+
left: "".concat(rect_1.left -
|
|
1467
1485
|
12 +
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
top:
|
|
1471
|
-
? ""
|
|
1472
|
-
: "
|
|
1486
|
+
rect_1.width / 2 -
|
|
1487
|
+
overlayRect_1.left, "px"),
|
|
1488
|
+
top: bottomPosition
|
|
1489
|
+
? "initial!important"
|
|
1490
|
+
: "".concat(topPosition - overlayRect_1.top, "px"),
|
|
1473
1491
|
}, dropAreaArrowRef);
|
|
1474
1492
|
}
|
|
1475
1493
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speakapbv/dough-component-library",
|
|
3
|
-
"version": "10.12.
|
|
3
|
+
"version": "10.12.4",
|
|
4
4
|
"description": "DOUGH: Speakap React Component Library",
|
|
5
5
|
"author": "Speakap",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test": "cross-env BABEL_ENV=test jest",
|
|
19
19
|
"testclean": "cross-env BABEL_ENV=test jest -u",
|
|
20
20
|
"lint": "eslint --ext=.ts,.tsx .",
|
|
21
|
-
"build": "cross-env BABEL_ENV=production rollup -c",
|
|
21
|
+
"build": "cross-env BABEL_ENV=production rollup -c && node scripts/build-notices.js",
|
|
22
22
|
"start": "cross-env BABEL_ENV=production rollup -c -w",
|
|
23
23
|
"format": "prettier --write \"src/**/*.{scss,js,json,md}\"",
|
|
24
24
|
"changelog": "git fetch && auto-changelog -p --commit-limit false",
|