zmdms-webui 2.5.1 → 2.5.2
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/es/_virtual/_commonjsHelpers.js +29 -1
- package/dist/es/_virtual/clsx.m.js +6 -0
- package/dist/es/node_modules/react-draggable/build/cjs/Draggable.js +262 -200
- package/dist/es/node_modules/react-draggable/build/cjs/DraggableCore.js +311 -184
- package/dist/es/node_modules/react-draggable/build/cjs/cjs.js +5 -6
- package/dist/es/node_modules/react-draggable/build/cjs/utils/domFns.js +217 -93
- package/dist/es/node_modules/react-draggable/build/cjs/utils/getPrefix.js +53 -20
- package/dist/es/node_modules/react-draggable/build/cjs/utils/log.js +1 -0
- package/dist/es/node_modules/react-draggable/build/cjs/utils/positionFns.js +126 -67
- package/dist/es/node_modules/react-draggable/build/cjs/utils/shims.js +38 -7
- package/package.json +2 -2
- package/dist/es/_virtual/clsx.js +0 -3
- package/dist/es/node_modules/react-draggable/node_modules/clsx/dist/clsx.js +0 -7
|
@@ -3,14 +3,13 @@ import { __module as cjs } from '../../../../_virtual/cjs.js';
|
|
|
3
3
|
import './Draggable.js';
|
|
4
4
|
import { __exports as Draggable$2 } from '../../../../_virtual/Draggable.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = Draggable$2;
|
|
10
|
-
|
|
11
|
-
// Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
|
|
6
|
+
var _require = Draggable$2,
|
|
7
|
+
Draggable = _require.default,
|
|
8
|
+
DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
|
|
12
9
|
// See https://github.com/mzabriskie/react-draggable/pull/254
|
|
13
10
|
// and https://github.com/mzabriskie/react-draggable/issues/266
|
|
11
|
+
|
|
12
|
+
|
|
14
13
|
cjs.exports = Draggable;
|
|
15
14
|
cjs.exports.default = Draggable;
|
|
16
15
|
cjs.exports.DraggableCore = DraggableCore;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { __exports as domFns } from '../../../../../_virtual/domFns.js';
|
|
2
2
|
import './shims.js';
|
|
3
3
|
import './getPrefix.js';
|
|
4
|
-
import { __exports as getPrefix } from '../../../../../_virtual/getPrefix.js';
|
|
5
4
|
import { __exports as shims } from '../../../../../_virtual/shims.js';
|
|
5
|
+
import { __exports as getPrefix } from '../../../../../_virtual/getPrefix.js';
|
|
6
|
+
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6
8
|
|
|
7
9
|
Object.defineProperty(domFns, "__esModule", {
|
|
8
10
|
value: true
|
|
@@ -24,46 +26,84 @@ domFns.outerHeight = outerHeight;
|
|
|
24
26
|
domFns.outerWidth = outerWidth;
|
|
25
27
|
domFns.removeClassName = removeClassName;
|
|
26
28
|
domFns.removeEvent = removeEvent;
|
|
27
|
-
domFns.
|
|
29
|
+
domFns.removeUserSelectStyles = removeUserSelectStyles;
|
|
30
|
+
|
|
28
31
|
var _shims = shims;
|
|
32
|
+
|
|
29
33
|
var _getPrefix = _interopRequireWildcard(getPrefix);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function
|
|
34
|
+
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
|
+
|
|
37
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
38
|
+
|
|
39
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
40
|
+
|
|
41
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
42
|
+
|
|
43
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
44
|
+
|
|
45
|
+
var matchesSelectorFunc = '';
|
|
46
|
+
|
|
47
|
+
function matchesSelector(el
|
|
48
|
+
/*: Node*/
|
|
49
|
+
, selector
|
|
50
|
+
/*: string*/
|
|
51
|
+
)
|
|
52
|
+
/*: boolean*/
|
|
53
|
+
{
|
|
34
54
|
if (!matchesSelectorFunc) {
|
|
35
55
|
matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
|
|
36
56
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
37
57
|
return (0, _shims.isFunction)(el[method]);
|
|
38
58
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Might not be found entirely (not an Element?) - in that case, bail
|
|
59
|
+
} // Might not be found entirely (not an Element?) - in that case, bail
|
|
42
60
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
43
|
-
if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
|
|
63
|
+
if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable
|
|
64
|
+
|
|
46
65
|
return el[matchesSelectorFunc](selector);
|
|
47
|
-
}
|
|
66
|
+
} // Works up the tree to the draggable itself attempting to match selector.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
function matchesSelectorAndParentsTo(el
|
|
70
|
+
/*: Node*/
|
|
71
|
+
, selector
|
|
72
|
+
/*: string*/
|
|
73
|
+
, baseNode
|
|
74
|
+
/*: Node*/
|
|
75
|
+
)
|
|
76
|
+
/*: boolean*/
|
|
77
|
+
{
|
|
78
|
+
var node = el;
|
|
48
79
|
|
|
49
|
-
// Works up the tree to the draggable itself attempting to match selector.
|
|
50
|
-
function matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/{
|
|
51
|
-
let node = el;
|
|
52
80
|
do {
|
|
53
81
|
if (matchesSelector(node, selector)) return true;
|
|
54
82
|
if (node === baseNode) return false;
|
|
55
|
-
// $FlowIgnore[incompatible-type]
|
|
56
83
|
node = node.parentNode;
|
|
57
84
|
} while (node);
|
|
85
|
+
|
|
58
86
|
return false;
|
|
59
87
|
}
|
|
60
|
-
|
|
88
|
+
|
|
89
|
+
function addEvent(el
|
|
90
|
+
/*: ?Node*/
|
|
91
|
+
, event
|
|
92
|
+
/*: string*/
|
|
93
|
+
, handler
|
|
94
|
+
/*: Function*/
|
|
95
|
+
, inputOptions
|
|
96
|
+
/*: Object*/
|
|
97
|
+
)
|
|
98
|
+
/*: void*/
|
|
99
|
+
{
|
|
61
100
|
if (!el) return;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
|
|
101
|
+
|
|
102
|
+
var options = _objectSpread({
|
|
103
|
+
capture: true
|
|
104
|
+
}, inputOptions); // $FlowIgnore[method-unbinding]
|
|
105
|
+
|
|
106
|
+
|
|
67
107
|
if (el.addEventListener) {
|
|
68
108
|
el.addEventListener(event, handler, options);
|
|
69
109
|
} else if (el.attachEvent) {
|
|
@@ -73,13 +113,25 @@ function addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/, in
|
|
|
73
113
|
el['on' + event] = handler;
|
|
74
114
|
}
|
|
75
115
|
}
|
|
76
|
-
|
|
116
|
+
|
|
117
|
+
function removeEvent(el
|
|
118
|
+
/*: ?Node*/
|
|
119
|
+
, event
|
|
120
|
+
/*: string*/
|
|
121
|
+
, handler
|
|
122
|
+
/*: Function*/
|
|
123
|
+
, inputOptions
|
|
124
|
+
/*: Object*/
|
|
125
|
+
)
|
|
126
|
+
/*: void*/
|
|
127
|
+
{
|
|
77
128
|
if (!el) return;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
|
|
129
|
+
|
|
130
|
+
var options = _objectSpread({
|
|
131
|
+
capture: true
|
|
132
|
+
}, inputOptions); // $FlowIgnore[method-unbinding]
|
|
133
|
+
|
|
134
|
+
|
|
83
135
|
if (el.removeEventListener) {
|
|
84
136
|
el.removeEventListener(event, handler, options);
|
|
85
137
|
} else if (el.detachEvent) {
|
|
@@ -89,34 +141,54 @@ function removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/,
|
|
|
89
141
|
el['on' + event] = null;
|
|
90
142
|
}
|
|
91
143
|
}
|
|
92
|
-
|
|
144
|
+
|
|
145
|
+
function outerHeight(node
|
|
146
|
+
/*: HTMLElement*/
|
|
147
|
+
)
|
|
148
|
+
/*: number*/
|
|
149
|
+
{
|
|
93
150
|
// This is deliberately excluding margin for our calculations, since we are using
|
|
94
151
|
// offsetTop which is including margin. See getBoundPosition
|
|
95
|
-
|
|
96
|
-
|
|
152
|
+
var height = node.clientHeight;
|
|
153
|
+
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
97
154
|
height += (0, _shims.int)(computedStyle.borderTopWidth);
|
|
98
155
|
height += (0, _shims.int)(computedStyle.borderBottomWidth);
|
|
99
156
|
return height;
|
|
100
157
|
}
|
|
101
|
-
|
|
158
|
+
|
|
159
|
+
function outerWidth(node
|
|
160
|
+
/*: HTMLElement*/
|
|
161
|
+
)
|
|
162
|
+
/*: number*/
|
|
163
|
+
{
|
|
102
164
|
// This is deliberately excluding margin for our calculations, since we are using
|
|
103
165
|
// offsetLeft which is including margin. See getBoundPosition
|
|
104
|
-
|
|
105
|
-
|
|
166
|
+
var width = node.clientWidth;
|
|
167
|
+
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
106
168
|
width += (0, _shims.int)(computedStyle.borderLeftWidth);
|
|
107
169
|
width += (0, _shims.int)(computedStyle.borderRightWidth);
|
|
108
170
|
return width;
|
|
109
171
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
172
|
+
|
|
173
|
+
function innerHeight(node
|
|
174
|
+
/*: HTMLElement*/
|
|
175
|
+
)
|
|
176
|
+
/*: number*/
|
|
177
|
+
{
|
|
178
|
+
var height = node.clientHeight;
|
|
179
|
+
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
113
180
|
height -= (0, _shims.int)(computedStyle.paddingTop);
|
|
114
181
|
height -= (0, _shims.int)(computedStyle.paddingBottom);
|
|
115
182
|
return height;
|
|
116
183
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
184
|
+
|
|
185
|
+
function innerWidth(node
|
|
186
|
+
/*: HTMLElement*/
|
|
187
|
+
)
|
|
188
|
+
/*: number*/
|
|
189
|
+
{
|
|
190
|
+
var width = node.clientWidth;
|
|
191
|
+
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
120
192
|
width -= (0, _shims.int)(computedStyle.paddingLeft);
|
|
121
193
|
width -= (0, _shims.int)(computedStyle.paddingRight);
|
|
122
194
|
return width;
|
|
@@ -124,59 +196,106 @@ function innerWidth(node /*: HTMLElement*/) /*: number*/{
|
|
|
124
196
|
/*:: interface EventWithOffset {
|
|
125
197
|
clientX: number, clientY: number
|
|
126
198
|
}*/
|
|
199
|
+
|
|
200
|
+
|
|
127
201
|
// Get from offsetParent
|
|
128
|
-
function offsetXYFromParent(evt
|
|
129
|
-
|
|
130
|
-
|
|
202
|
+
function offsetXYFromParent(evt
|
|
203
|
+
/*: EventWithOffset*/
|
|
204
|
+
, offsetParent
|
|
205
|
+
/*: HTMLElement*/
|
|
206
|
+
, scale
|
|
207
|
+
/*: number*/
|
|
208
|
+
)
|
|
209
|
+
/*: ControlPosition*/
|
|
210
|
+
{
|
|
211
|
+
var isBody = offsetParent === offsetParent.ownerDocument.body;
|
|
212
|
+
var offsetParentRect = isBody ? {
|
|
131
213
|
left: 0,
|
|
132
214
|
top: 0
|
|
133
215
|
} : offsetParent.getBoundingClientRect();
|
|
134
|
-
|
|
135
|
-
|
|
216
|
+
var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
|
|
217
|
+
var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
|
|
136
218
|
return {
|
|
137
|
-
x,
|
|
138
|
-
y
|
|
219
|
+
x: x,
|
|
220
|
+
y: y
|
|
139
221
|
};
|
|
140
222
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
223
|
+
|
|
224
|
+
function createCSSTransform(controlPos
|
|
225
|
+
/*: ControlPosition*/
|
|
226
|
+
, positionOffset
|
|
227
|
+
/*: PositionOffsetControlPosition*/
|
|
228
|
+
)
|
|
229
|
+
/*: Object*/
|
|
230
|
+
{
|
|
231
|
+
var translation = getTranslation(controlPos, positionOffset, 'px');
|
|
232
|
+
return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
|
|
146
233
|
}
|
|
147
|
-
|
|
148
|
-
|
|
234
|
+
|
|
235
|
+
function createSVGTransform(controlPos
|
|
236
|
+
/*: ControlPosition*/
|
|
237
|
+
, positionOffset
|
|
238
|
+
/*: PositionOffsetControlPosition*/
|
|
239
|
+
)
|
|
240
|
+
/*: string*/
|
|
241
|
+
{
|
|
242
|
+
var translation = getTranslation(controlPos, positionOffset, '');
|
|
149
243
|
return translation;
|
|
150
244
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
245
|
+
|
|
246
|
+
function getTranslation(_ref2, positionOffset
|
|
247
|
+
/*: PositionOffsetControlPosition*/
|
|
248
|
+
, unitSuffix
|
|
249
|
+
/*: string*/
|
|
250
|
+
)
|
|
251
|
+
/*: string*/
|
|
252
|
+
{
|
|
253
|
+
var x = _ref2.x,
|
|
254
|
+
y = _ref2.y;
|
|
255
|
+
var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
|
|
256
|
+
|
|
157
257
|
if (positionOffset) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
translation =
|
|
258
|
+
var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
|
|
259
|
+
var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
|
|
260
|
+
translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
|
|
161
261
|
}
|
|
262
|
+
|
|
162
263
|
return translation;
|
|
163
264
|
}
|
|
164
|
-
|
|
165
|
-
|
|
265
|
+
|
|
266
|
+
function getTouch(e
|
|
267
|
+
/*: MouseTouchEvent*/
|
|
268
|
+
, identifier
|
|
269
|
+
/*: number*/
|
|
270
|
+
)
|
|
271
|
+
/*: ?{clientX: number, clientY: number}*/
|
|
272
|
+
{
|
|
273
|
+
return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {
|
|
274
|
+
return identifier === t.identifier;
|
|
275
|
+
}) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {
|
|
276
|
+
return identifier === t.identifier;
|
|
277
|
+
});
|
|
166
278
|
}
|
|
167
|
-
|
|
279
|
+
|
|
280
|
+
function getTouchIdentifier(e
|
|
281
|
+
/*: MouseTouchEvent*/
|
|
282
|
+
)
|
|
283
|
+
/*: ?number*/
|
|
284
|
+
{
|
|
168
285
|
if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
|
|
169
286
|
if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// User-select Hacks:
|
|
287
|
+
} // User-select Hacks:
|
|
173
288
|
//
|
|
174
289
|
// Useful for preventing blue highlights all over everything when dragging.
|
|
175
|
-
|
|
176
290
|
// Note we're passing `document` b/c we could be iframed
|
|
177
|
-
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
function addUserSelectStyles(doc
|
|
294
|
+
/*: ?Document*/
|
|
295
|
+
) {
|
|
178
296
|
if (!doc) return;
|
|
179
|
-
|
|
297
|
+
var styleEl = doc.getElementById('react-draggable-style-el');
|
|
298
|
+
|
|
180
299
|
if (!styleEl) {
|
|
181
300
|
styleEl = doc.createElement('style');
|
|
182
301
|
styleEl.type = 'text/css';
|
|
@@ -185,52 +304,57 @@ function addUserSelectStyles(doc /*: ?Document*/) {
|
|
|
185
304
|
styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n';
|
|
186
305
|
doc.getElementsByTagName('head')[0].appendChild(styleEl);
|
|
187
306
|
}
|
|
307
|
+
|
|
188
308
|
if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
|
|
189
309
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
removeUserSelectStyles(doc);
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
removeUserSelectStyles(doc);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function removeUserSelectStyles(doc /*: ?Document*/) {
|
|
310
|
+
|
|
311
|
+
function removeUserSelectStyles(doc
|
|
312
|
+
/*: ?Document*/
|
|
313
|
+
) {
|
|
201
314
|
if (!doc) return;
|
|
315
|
+
|
|
202
316
|
try {
|
|
203
|
-
if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');
|
|
204
|
-
|
|
317
|
+
if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE
|
|
318
|
+
|
|
205
319
|
if (doc.selection) {
|
|
206
320
|
// $FlowIgnore: IE
|
|
207
321
|
doc.selection.empty();
|
|
208
322
|
} else {
|
|
209
323
|
// Remove selection caused by scroll, unless it's a focused input
|
|
210
324
|
// (we use doc.defaultView in case we're in an iframe)
|
|
211
|
-
|
|
325
|
+
var selection = (doc.defaultView || window).getSelection();
|
|
326
|
+
|
|
212
327
|
if (selection && selection.type !== 'Caret') {
|
|
213
328
|
selection.removeAllRanges();
|
|
214
329
|
}
|
|
215
330
|
}
|
|
216
|
-
} catch (e) {
|
|
217
|
-
// probably IE
|
|
331
|
+
} catch (e) {// probably IE
|
|
218
332
|
}
|
|
219
333
|
}
|
|
220
|
-
|
|
334
|
+
|
|
335
|
+
function addClassName(el
|
|
336
|
+
/*: HTMLElement*/
|
|
337
|
+
, className
|
|
338
|
+
/*: string*/
|
|
339
|
+
) {
|
|
221
340
|
if (el.classList) {
|
|
222
341
|
el.classList.add(className);
|
|
223
342
|
} else {
|
|
224
|
-
if (!el.className.match(new RegExp(
|
|
225
|
-
el.className +=
|
|
343
|
+
if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
|
|
344
|
+
el.className += " ".concat(className);
|
|
226
345
|
}
|
|
227
346
|
}
|
|
228
347
|
}
|
|
229
|
-
|
|
348
|
+
|
|
349
|
+
function removeClassName(el
|
|
350
|
+
/*: HTMLElement*/
|
|
351
|
+
, className
|
|
352
|
+
/*: string*/
|
|
353
|
+
) {
|
|
230
354
|
if (el.classList) {
|
|
231
355
|
el.classList.remove(className);
|
|
232
356
|
} else {
|
|
233
|
-
el.className = el.className.replace(new RegExp(
|
|
357
|
+
el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), '');
|
|
234
358
|
}
|
|
235
359
|
}
|
|
236
360
|
|
|
@@ -7,33 +7,61 @@ getPrefix$1.browserPrefixToKey = browserPrefixToKey;
|
|
|
7
7
|
getPrefix$1.browserPrefixToStyle = browserPrefixToStyle;
|
|
8
8
|
getPrefix$1.default = void 0;
|
|
9
9
|
getPrefix$1.getPrefix = getPrefix;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var prefixes = ['Moz', 'Webkit', 'O', 'ms'];
|
|
11
|
+
|
|
12
|
+
function getPrefix()
|
|
13
|
+
/*: string*/
|
|
14
|
+
{
|
|
15
|
+
var _window$document, _window$document$docu;
|
|
16
|
+
|
|
17
|
+
var prop
|
|
18
|
+
/*: string*/
|
|
19
|
+
= arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
|
|
13
20
|
// Ensure we're running in an environment where there is actually a global
|
|
14
21
|
// `window` obj
|
|
15
|
-
if (typeof window === 'undefined') return '';
|
|
16
|
-
|
|
17
|
-
// If we're in a pseudo-browser server-side environment, this access
|
|
22
|
+
if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access
|
|
18
23
|
// path may not exist, so bail out if it doesn't.
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
|
|
20
26
|
if (!style) return '';
|
|
21
27
|
if (prop in style) return '';
|
|
22
|
-
|
|
28
|
+
|
|
29
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
23
30
|
if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
|
|
24
31
|
}
|
|
32
|
+
|
|
25
33
|
return '';
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
|
|
36
|
+
function browserPrefixToKey(prop
|
|
37
|
+
/*: string*/
|
|
38
|
+
, prefix
|
|
39
|
+
/*: string*/
|
|
40
|
+
)
|
|
41
|
+
/*: string*/
|
|
42
|
+
{
|
|
43
|
+
return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
|
|
29
44
|
}
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
|
|
46
|
+
function browserPrefixToStyle(prop
|
|
47
|
+
/*: string*/
|
|
48
|
+
, prefix
|
|
49
|
+
/*: string*/
|
|
50
|
+
)
|
|
51
|
+
/*: string*/
|
|
52
|
+
{
|
|
53
|
+
return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
|
|
32
54
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
|
|
56
|
+
function kebabToTitleCase(str
|
|
57
|
+
/*: string*/
|
|
58
|
+
)
|
|
59
|
+
/*: string*/
|
|
60
|
+
{
|
|
61
|
+
var out = '';
|
|
62
|
+
var shouldCapitalize = true;
|
|
63
|
+
|
|
64
|
+
for (var i = 0; i < str.length; i++) {
|
|
37
65
|
if (shouldCapitalize) {
|
|
38
66
|
out += str[i].toUpperCase();
|
|
39
67
|
shouldCapitalize = false;
|
|
@@ -43,10 +71,15 @@ function kebabToTitleCase(str /*: string*/) /*: string*/{
|
|
|
43
71
|
out += str[i];
|
|
44
72
|
}
|
|
45
73
|
}
|
|
46
|
-
return out;
|
|
47
|
-
}
|
|
48
74
|
|
|
49
|
-
|
|
75
|
+
return out;
|
|
76
|
+
} // Default export is the prefix itself, like 'Moz', 'Webkit', etc
|
|
50
77
|
// Note that you may have to re-test for certain things; for instance, Chrome 50
|
|
51
78
|
// can handle unprefixed `transform`, but not unprefixed `user-select`
|
|
52
|
-
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
var _default = (getPrefix()
|
|
82
|
+
/*: string*/
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
getPrefix$1.default = _default;
|