huanpenguin-tippy-react 1.0.1
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 +420 -0
- package/dist/tippy-react.esm.js +533 -0
- package/dist/tippy-react.esm.js.map +1 -0
- package/dist/tippy-react.umd.js +542 -0
- package/dist/tippy-react.umd.js.map +1 -0
- package/dist/tippy-react.umd.min.js +2 -0
- package/dist/tippy-react.umd.min.js.map +1 -0
- package/headless/dist/tippy-react-headless.esm.js +537 -0
- package/headless/dist/tippy-react-headless.esm.js.map +1 -0
- package/headless/dist/tippy-react-headless.umd.js +546 -0
- package/headless/dist/tippy-react-headless.umd.js.map +1 -0
- package/headless/dist/tippy-react-headless.umd.min.js +2 -0
- package/headless/dist/tippy-react-headless.umd.min.js.map +1 -0
- package/headless/index.d.ts +49 -0
- package/index.d.ts +49 -0
- package/package.json +124 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tippy.js/headless'), require('react'), require('react-dom')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'tippy.js/headless', 'react', 'react-dom'], factory) :
|
|
4
|
+
(global = global || self, factory(global.Tippy = {}, global.tippy, global.React, global.ReactDOM));
|
|
5
|
+
}(this, (function (exports, tippy, React, reactDom) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var tippy__default = 'default' in tippy ? tippy['default'] : tippy;
|
|
8
|
+
var React__default = 'default' in React ? React['default'] : React;
|
|
9
|
+
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
11
|
+
if (source == null) return {};
|
|
12
|
+
var target = {};
|
|
13
|
+
var sourceKeys = Object.keys(source);
|
|
14
|
+
var key, i;
|
|
15
|
+
|
|
16
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
17
|
+
key = sourceKeys[i];
|
|
18
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
19
|
+
target[key] = source[key];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return target;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
26
|
+
function preserveRef(ref, node) {
|
|
27
|
+
if (ref) {
|
|
28
|
+
if (typeof ref === 'function') {
|
|
29
|
+
ref(node);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ({}.hasOwnProperty.call(ref, 'current')) {
|
|
33
|
+
ref.current = node;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function ssrSafeCreateDiv() {
|
|
38
|
+
return isBrowser && document.createElement('div');
|
|
39
|
+
}
|
|
40
|
+
function toDataAttributes(attrs) {
|
|
41
|
+
var dataAttrs = {
|
|
42
|
+
'data-placement': attrs.placement
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
if (attrs.referenceHidden) {
|
|
46
|
+
dataAttrs['data-reference-hidden'] = '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (attrs.escaped) {
|
|
50
|
+
dataAttrs['data-escaped'] = '';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return dataAttrs;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function deepEqual(x, y) {
|
|
57
|
+
if (x === y) {
|
|
58
|
+
return true;
|
|
59
|
+
} else if (typeof x === 'object' && x != null && typeof y === 'object' && y != null) {
|
|
60
|
+
if (Object.keys(x).length !== Object.keys(y).length) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
for (var prop in x) {
|
|
65
|
+
if (y.hasOwnProperty(prop)) {
|
|
66
|
+
if (!deepEqual(x[prop], y[prop])) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return true;
|
|
75
|
+
} else {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function uniqueByShape(arr) {
|
|
81
|
+
var output = [];
|
|
82
|
+
arr.forEach(function (item) {
|
|
83
|
+
if (!output.find(function (outputItem) {
|
|
84
|
+
return deepEqual(item, outputItem);
|
|
85
|
+
})) {
|
|
86
|
+
output.push(item);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return output;
|
|
90
|
+
}
|
|
91
|
+
function deepPreserveProps(instanceProps, componentProps) {
|
|
92
|
+
var _instanceProps$popper, _componentProps$poppe;
|
|
93
|
+
|
|
94
|
+
return Object.assign({}, componentProps, {
|
|
95
|
+
popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
|
|
96
|
+
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var createTippyWrapper = function createTippyWrapper(Tippy, defaultProps) {
|
|
102
|
+
return /*#__PURE__*/React.forwardRef(function TippyWrapper(_ref, _ref2) {
|
|
103
|
+
var children = _ref.children,
|
|
104
|
+
props = _objectWithoutPropertiesLoose(_ref, ["children"]);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
/*#__PURE__*/
|
|
108
|
+
// If I spread them separately here, Babel adds the _extends ponyfill for
|
|
109
|
+
// some reason
|
|
110
|
+
React__default.createElement(Tippy, Object.assign({}, defaultProps, props), children ? /*#__PURE__*/React.cloneElement(children, {
|
|
111
|
+
ref: function ref(node) {
|
|
112
|
+
var _children$props;
|
|
113
|
+
|
|
114
|
+
preserveRef(_ref2, node);
|
|
115
|
+
preserveRef((_children$props = children.props) == null ? void 0 : _children$props.ref, node);
|
|
116
|
+
}
|
|
117
|
+
}) : null)
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
function updateClassName(box, action, classNames) {
|
|
123
|
+
classNames.split(/\s+/).forEach(function (name) {
|
|
124
|
+
if (name) {
|
|
125
|
+
box.classList[action](name);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
var classNamePlugin = {
|
|
131
|
+
name: 'className',
|
|
132
|
+
defaultValue: '',
|
|
133
|
+
fn: function fn(instance) {
|
|
134
|
+
var box = instance.popper.firstElementChild;
|
|
135
|
+
|
|
136
|
+
var isDefaultRenderFn = function isDefaultRenderFn() {
|
|
137
|
+
var _instance$props$rende;
|
|
138
|
+
|
|
139
|
+
return !!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
function add() {
|
|
143
|
+
if (instance.props.className && !isDefaultRenderFn()) {
|
|
144
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
145
|
+
console.warn(['@tippyjs/react: Cannot use `className` prop in conjunction with', '`render` prop. Place the className on the element you are', 'rendering.'].join(' '));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
updateClassName(box, 'add', instance.props.className);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function remove() {
|
|
155
|
+
if (isDefaultRenderFn()) {
|
|
156
|
+
updateClassName(box, 'remove', instance.props.className);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
onCreate: add,
|
|
162
|
+
onBeforeUpdate: remove,
|
|
163
|
+
onAfterUpdate: add
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect;
|
|
169
|
+
function useMutableBox(initialValue) {
|
|
170
|
+
// Using refs instead of state as it's recommended to not store imperative
|
|
171
|
+
// values in state due to memory problems in React(?)
|
|
172
|
+
var ref = React.useRef();
|
|
173
|
+
|
|
174
|
+
if (!ref.current) {
|
|
175
|
+
ref.current = typeof initialValue === 'function' ? initialValue() : initialValue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return ref.current;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function TippyGenerator(tippy) {
|
|
182
|
+
function Tippy(_ref) {
|
|
183
|
+
var children = _ref.children,
|
|
184
|
+
content = _ref.content,
|
|
185
|
+
visible = _ref.visible,
|
|
186
|
+
singleton = _ref.singleton,
|
|
187
|
+
render = _ref.render,
|
|
188
|
+
reference = _ref.reference,
|
|
189
|
+
_ref$disabled = _ref.disabled,
|
|
190
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
191
|
+
_ref$ignoreAttributes = _ref.ignoreAttributes,
|
|
192
|
+
ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes,
|
|
193
|
+
__source = _ref.__source,
|
|
194
|
+
__self = _ref.__self,
|
|
195
|
+
restOfNativeProps = _objectWithoutPropertiesLoose(_ref, ["children", "content", "visible", "singleton", "render", "reference", "disabled", "ignoreAttributes", "__source", "__self"]);
|
|
196
|
+
|
|
197
|
+
var isControlledMode = visible !== undefined;
|
|
198
|
+
var isSingletonMode = singleton !== undefined;
|
|
199
|
+
|
|
200
|
+
var _useState = React.useState(false),
|
|
201
|
+
mounted = _useState[0],
|
|
202
|
+
setMounted = _useState[1];
|
|
203
|
+
|
|
204
|
+
var _useState2 = React.useState({}),
|
|
205
|
+
attrs = _useState2[0],
|
|
206
|
+
setAttrs = _useState2[1];
|
|
207
|
+
|
|
208
|
+
var _useState3 = React.useState(),
|
|
209
|
+
singletonContent = _useState3[0],
|
|
210
|
+
setSingletonContent = _useState3[1];
|
|
211
|
+
|
|
212
|
+
var mutableBox = useMutableBox(function () {
|
|
213
|
+
return {
|
|
214
|
+
container: ssrSafeCreateDiv(),
|
|
215
|
+
renders: 1
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
var props = Object.assign({
|
|
219
|
+
ignoreAttributes: ignoreAttributes
|
|
220
|
+
}, restOfNativeProps, {
|
|
221
|
+
content: mutableBox.container
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
if (isControlledMode) {
|
|
225
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
226
|
+
['trigger', 'hideOnClick', 'showOnCreate'].forEach(function (nativeStateProp) {
|
|
227
|
+
if (props[nativeStateProp] !== undefined) {
|
|
228
|
+
console.warn(["@tippyjs/react: Cannot specify `" + nativeStateProp + "` prop in", "controlled mode (`visible` prop)"].join(' '));
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
props.trigger = 'manual';
|
|
234
|
+
props.hideOnClick = false;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (isSingletonMode) {
|
|
238
|
+
disabled = true;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var computedProps = props;
|
|
242
|
+
var plugins = props.plugins || [];
|
|
243
|
+
|
|
244
|
+
if (render) {
|
|
245
|
+
computedProps = Object.assign({}, props, {
|
|
246
|
+
plugins: isSingletonMode && singleton.data != null ? [].concat(plugins, [{
|
|
247
|
+
fn: function fn() {
|
|
248
|
+
return {
|
|
249
|
+
onTrigger: function onTrigger(instance, event) {
|
|
250
|
+
var node = singleton.data.children.find(function (_ref2) {
|
|
251
|
+
var instance = _ref2.instance;
|
|
252
|
+
return instance.reference === event.currentTarget;
|
|
253
|
+
});
|
|
254
|
+
instance.state.$$activeSingletonInstance = node.instance;
|
|
255
|
+
setSingletonContent(node.content);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}]) : plugins,
|
|
260
|
+
render: function render() {
|
|
261
|
+
return {
|
|
262
|
+
popper: mutableBox.container
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
var deps = [reference].concat(children ? [children.type] : []); // CREATE
|
|
269
|
+
|
|
270
|
+
useIsomorphicLayoutEffect(function () {
|
|
271
|
+
var element = reference;
|
|
272
|
+
|
|
273
|
+
if (reference && reference.hasOwnProperty('current')) {
|
|
274
|
+
element = reference.current;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
var instance = tippy(element || mutableBox.ref || ssrSafeCreateDiv(), Object.assign({}, computedProps, {
|
|
278
|
+
plugins: [classNamePlugin].concat(props.plugins || [])
|
|
279
|
+
}));
|
|
280
|
+
mutableBox.instance = instance;
|
|
281
|
+
|
|
282
|
+
if (disabled) {
|
|
283
|
+
instance.disable();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (visible) {
|
|
287
|
+
instance.show();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (isSingletonMode) {
|
|
291
|
+
singleton.hook({
|
|
292
|
+
instance: instance,
|
|
293
|
+
content: content,
|
|
294
|
+
props: computedProps,
|
|
295
|
+
setSingletonContent: setSingletonContent
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
setMounted(true);
|
|
300
|
+
return function () {
|
|
301
|
+
instance.destroy();
|
|
302
|
+
singleton == null ? void 0 : singleton.cleanup(instance);
|
|
303
|
+
};
|
|
304
|
+
}, deps); // UPDATE
|
|
305
|
+
|
|
306
|
+
useIsomorphicLayoutEffect(function () {
|
|
307
|
+
var _instance$popperInsta;
|
|
308
|
+
|
|
309
|
+
// Prevent this effect from running on 1st render
|
|
310
|
+
if (mutableBox.renders === 1) {
|
|
311
|
+
mutableBox.renders++;
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
var instance = mutableBox.instance;
|
|
316
|
+
instance.setProps(deepPreserveProps(instance.props, computedProps)); // Fixes #264
|
|
317
|
+
|
|
318
|
+
(_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.forceUpdate();
|
|
319
|
+
|
|
320
|
+
if (disabled) {
|
|
321
|
+
instance.disable();
|
|
322
|
+
} else {
|
|
323
|
+
instance.enable();
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (isControlledMode) {
|
|
327
|
+
if (visible) {
|
|
328
|
+
instance.show();
|
|
329
|
+
} else {
|
|
330
|
+
instance.hide();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (isSingletonMode) {
|
|
335
|
+
singleton.hook({
|
|
336
|
+
instance: instance,
|
|
337
|
+
content: content,
|
|
338
|
+
props: computedProps,
|
|
339
|
+
setSingletonContent: setSingletonContent
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
useIsomorphicLayoutEffect(function () {
|
|
344
|
+
var _instance$props$poppe;
|
|
345
|
+
|
|
346
|
+
if (!render) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
var instance = mutableBox.instance;
|
|
351
|
+
instance.setProps({
|
|
352
|
+
popperOptions: Object.assign({}, instance.props.popperOptions, {
|
|
353
|
+
modifiers: [].concat((((_instance$props$poppe = instance.props.popperOptions) == null ? void 0 : _instance$props$poppe.modifiers) || []).filter(function (_ref3) {
|
|
354
|
+
var name = _ref3.name;
|
|
355
|
+
return name !== '$$tippyReact';
|
|
356
|
+
}), [{
|
|
357
|
+
name: '$$tippyReact',
|
|
358
|
+
enabled: true,
|
|
359
|
+
phase: 'beforeWrite',
|
|
360
|
+
requires: ['computeStyles'],
|
|
361
|
+
fn: function fn(_ref4) {
|
|
362
|
+
var _state$modifiersData;
|
|
363
|
+
|
|
364
|
+
var state = _ref4.state;
|
|
365
|
+
var hideData = (_state$modifiersData = state.modifiersData) == null ? void 0 : _state$modifiersData.hide; // WARNING: this is a high-risk path that can cause an infinite
|
|
366
|
+
// loop. This expression _must_ evaluate to false when required
|
|
367
|
+
|
|
368
|
+
if (attrs.placement !== state.placement || attrs.referenceHidden !== (hideData == null ? void 0 : hideData.isReferenceHidden) || attrs.escaped !== (hideData == null ? void 0 : hideData.hasPopperEscaped)) {
|
|
369
|
+
setAttrs({
|
|
370
|
+
placement: state.placement,
|
|
371
|
+
referenceHidden: hideData == null ? void 0 : hideData.isReferenceHidden,
|
|
372
|
+
escaped: hideData == null ? void 0 : hideData.hasPopperEscaped
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
state.attributes.popper = {};
|
|
377
|
+
}
|
|
378
|
+
}])
|
|
379
|
+
})
|
|
380
|
+
});
|
|
381
|
+
}, [attrs.placement, attrs.referenceHidden, attrs.escaped].concat(deps));
|
|
382
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children ? /*#__PURE__*/React.cloneElement(children, {
|
|
383
|
+
ref: function ref(node) {
|
|
384
|
+
var _children$props;
|
|
385
|
+
|
|
386
|
+
mutableBox.ref = node;
|
|
387
|
+
preserveRef((_children$props = children.props) == null ? void 0 : _children$props.ref, node);
|
|
388
|
+
}
|
|
389
|
+
}) : null, mounted && /*#__PURE__*/reactDom.createPortal(render ? render(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content, mutableBox.container));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return Tippy;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function useSingletonGenerator(createSingleton) {
|
|
396
|
+
return function useSingleton(_temp) {
|
|
397
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
398
|
+
_ref$disabled = _ref.disabled,
|
|
399
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
400
|
+
_ref$overrides = _ref.overrides,
|
|
401
|
+
overrides = _ref$overrides === void 0 ? [] : _ref$overrides;
|
|
402
|
+
|
|
403
|
+
var _useState = React.useState(false),
|
|
404
|
+
mounted = _useState[0],
|
|
405
|
+
setMounted = _useState[1];
|
|
406
|
+
|
|
407
|
+
var mutableBox = useMutableBox({
|
|
408
|
+
children: [],
|
|
409
|
+
renders: 1
|
|
410
|
+
});
|
|
411
|
+
useIsomorphicLayoutEffect(function () {
|
|
412
|
+
if (!mounted) {
|
|
413
|
+
setMounted(true);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
var children = mutableBox.children,
|
|
418
|
+
sourceData = mutableBox.sourceData;
|
|
419
|
+
|
|
420
|
+
if (!sourceData) {
|
|
421
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
422
|
+
console.error(['@tippyjs/react: The `source` variable from `useSingleton()` has', 'not been passed to a <Tippy /> component.'].join(' '));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
var instance = createSingleton(children.map(function (child) {
|
|
429
|
+
return child.instance;
|
|
430
|
+
}), Object.assign({}, sourceData.props, {
|
|
431
|
+
popperOptions: sourceData.instance.props.popperOptions,
|
|
432
|
+
overrides: overrides,
|
|
433
|
+
plugins: [classNamePlugin].concat(sourceData.props.plugins || [])
|
|
434
|
+
}));
|
|
435
|
+
mutableBox.instance = instance;
|
|
436
|
+
|
|
437
|
+
if (disabled) {
|
|
438
|
+
instance.disable();
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return function () {
|
|
442
|
+
instance.destroy();
|
|
443
|
+
mutableBox.children = children.filter(function (_ref2) {
|
|
444
|
+
var instance = _ref2.instance;
|
|
445
|
+
return !instance.state.isDestroyed;
|
|
446
|
+
});
|
|
447
|
+
};
|
|
448
|
+
}, [mounted]);
|
|
449
|
+
useIsomorphicLayoutEffect(function () {
|
|
450
|
+
if (!mounted) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
if (mutableBox.renders === 1) {
|
|
455
|
+
mutableBox.renders++;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
var children = mutableBox.children,
|
|
460
|
+
instance = mutableBox.instance,
|
|
461
|
+
sourceData = mutableBox.sourceData;
|
|
462
|
+
|
|
463
|
+
if (!(instance && sourceData)) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
var _sourceData$props = sourceData.props,
|
|
468
|
+
content = _sourceData$props.content,
|
|
469
|
+
props = _objectWithoutPropertiesLoose(_sourceData$props, ["content"]);
|
|
470
|
+
|
|
471
|
+
instance.setProps(deepPreserveProps(instance.props, Object.assign({}, props, {
|
|
472
|
+
overrides: overrides
|
|
473
|
+
})));
|
|
474
|
+
instance.setInstances(children.map(function (child) {
|
|
475
|
+
return child.instance;
|
|
476
|
+
}));
|
|
477
|
+
|
|
478
|
+
if (disabled) {
|
|
479
|
+
instance.disable();
|
|
480
|
+
} else {
|
|
481
|
+
instance.enable();
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
return React.useMemo(function () {
|
|
485
|
+
var source = {
|
|
486
|
+
data: mutableBox,
|
|
487
|
+
hook: function hook(data) {
|
|
488
|
+
mutableBox.sourceData = data;
|
|
489
|
+
mutableBox.setSingletonContent = data.setSingletonContent;
|
|
490
|
+
},
|
|
491
|
+
cleanup: function cleanup() {
|
|
492
|
+
mutableBox.sourceData = null;
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
var target = {
|
|
496
|
+
hook: function hook(data) {
|
|
497
|
+
var _mutableBox$instance, _mutableBox$instance2;
|
|
498
|
+
|
|
499
|
+
mutableBox.children = mutableBox.children.filter(function (_ref3) {
|
|
500
|
+
var instance = _ref3.instance;
|
|
501
|
+
return data.instance !== instance;
|
|
502
|
+
});
|
|
503
|
+
mutableBox.children.push(data);
|
|
504
|
+
|
|
505
|
+
if (((_mutableBox$instance = mutableBox.instance) == null ? void 0 : _mutableBox$instance.state.isMounted) && ((_mutableBox$instance2 = mutableBox.instance) == null ? void 0 : _mutableBox$instance2.state.$$activeSingletonInstance) === data.instance) {
|
|
506
|
+
mutableBox.setSingletonContent == null ? void 0 : mutableBox.setSingletonContent(data.content);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {
|
|
510
|
+
mutableBox.instance.setInstances(mutableBox.children.map(function (child) {
|
|
511
|
+
return child.instance;
|
|
512
|
+
}));
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
cleanup: function cleanup(instance) {
|
|
516
|
+
mutableBox.children = mutableBox.children.filter(function (data) {
|
|
517
|
+
return data.instance !== instance;
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {
|
|
521
|
+
mutableBox.instance.setInstances(mutableBox.children.map(function (child) {
|
|
522
|
+
return child.instance;
|
|
523
|
+
}));
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
return [source, target];
|
|
528
|
+
}, []);
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
var useSingleton = /*#__PURE__*/useSingletonGenerator(tippy.createSingleton);
|
|
533
|
+
var headless = /*#__PURE__*/createTippyWrapper( /*#__PURE__*/TippyGenerator(tippy__default), {
|
|
534
|
+
render: function render() {
|
|
535
|
+
return '';
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
exports.tippy = tippy__default;
|
|
540
|
+
exports.default = headless;
|
|
541
|
+
exports.useSingleton = useSingleton;
|
|
542
|
+
|
|
543
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
544
|
+
|
|
545
|
+
})));
|
|
546
|
+
//# sourceMappingURL=tippy-react-headless.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tippy-react-headless.umd.js","sources":["../../src/utils.js","../../src/forwardRef.js","../../src/className-plugin.js","../../src/util-hooks.js","../../src/Tippy.js","../../src/useSingleton.js","../../src/headless.js"],"sourcesContent":["export const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'\n\nexport function preserveRef(ref, node) {\n if (ref) {\n if (typeof ref === 'function') {\n ref(node)\n }\n if ({}.hasOwnProperty.call(ref, 'current')) {\n ref.current = node\n }\n }\n}\n\nexport function ssrSafeCreateDiv() {\n return isBrowser && document.createElement('div')\n}\n\nexport function toDataAttributes(attrs) {\n const dataAttrs = {\n 'data-placement': attrs.placement,\n }\n\n if (attrs.referenceHidden) {\n dataAttrs['data-reference-hidden'] = ''\n }\n\n if (attrs.escaped) {\n dataAttrs['data-escaped'] = ''\n }\n\n return dataAttrs\n}\n\nfunction deepEqual(x, y) {\n if (x === y) {\n return true\n } else if (typeof x === 'object' && x != null && typeof y === 'object' && y != null) {\n if (Object.keys(x).length !== Object.keys(y).length) {\n return false\n }\n\n for (const prop in x) {\n if (y.hasOwnProperty(prop)) {\n if (!deepEqual(x[prop], y[prop])) {\n return false\n }\n } else {\n return false\n }\n }\n\n return true\n } else {\n return false\n }\n}\n\nexport function uniqueByShape(arr) {\n const output = []\n\n arr.forEach((item) => {\n if (!output.find((outputItem) => deepEqual(item, outputItem))) {\n output.push(item)\n }\n })\n\n return output\n}\n\nexport function deepPreserveProps(instanceProps, componentProps) {\n return {\n ...componentProps,\n popperOptions: {\n ...instanceProps.popperOptions,\n ...componentProps.popperOptions,\n modifiers: uniqueByShape([\n ...(instanceProps.popperOptions?.modifiers || []),\n ...(componentProps.popperOptions?.modifiers || []),\n ]),\n },\n }\n}\n","import React, { cloneElement, forwardRef } from 'react'\n\nimport { preserveRef } from './utils'\n\nconst createTippyWrapper = (Tippy, defaultProps) =>\n forwardRef(function TippyWrapper({ children, ...props }, ref) {\n return (\n // If I spread them separately here, Babel adds the _extends ponyfill for\n // some reason\n <Tippy {...{ ...defaultProps, ...props }}>\n {children\n ? cloneElement(children, {\n ref(node) {\n preserveRef(ref, node)\n preserveRef(children.props?.ref, node)\n },\n })\n : null}\n </Tippy>\n )\n })\n\nexport default createTippyWrapper\n","function updateClassName(box, action, classNames) {\n classNames.split(/\\s+/).forEach((name) => {\n if (name) {\n box.classList[action](name)\n }\n })\n}\n\nexport const classNamePlugin = {\n name: 'className',\n defaultValue: '',\n fn(instance) {\n const box = instance.popper.firstElementChild\n const isDefaultRenderFn = () => !!instance.props.render?.$$tippy\n\n function add() {\n if (instance.props.className && !isDefaultRenderFn()) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n [\n '@tippyjs/react: Cannot use `className` prop in conjunction with',\n '`render` prop. Place the className on the element you are',\n 'rendering.',\n ].join(' '),\n )\n }\n\n return\n }\n\n updateClassName(box, 'add', instance.props.className)\n }\n\n function remove() {\n if (isDefaultRenderFn()) {\n updateClassName(box, 'remove', instance.props.className)\n }\n }\n\n return {\n onCreate: add,\n onBeforeUpdate: remove,\n onAfterUpdate: add,\n }\n },\n}\n","import { useEffect, useLayoutEffect, useRef } from 'react'\n\nimport { isBrowser } from './utils'\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n\nexport function useMutableBox(initialValue) {\n // Using refs instead of state as it's recommended to not store imperative\n // values in state due to memory problems in React(?)\n const ref = useRef()\n\n if (!ref.current) {\n ref.current = typeof initialValue === 'function' ? initialValue() : initialValue\n }\n\n return ref.current\n}\n","import React, { cloneElement, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { classNamePlugin } from './className-plugin'\nimport { useIsomorphicLayoutEffect, useMutableBox } from './util-hooks'\nimport { deepPreserveProps, preserveRef, ssrSafeCreateDiv, toDataAttributes } from './utils'\n\nexport default function TippyGenerator(tippy) {\n function Tippy({\n children,\n content,\n visible,\n singleton,\n render,\n reference,\n disabled = false,\n ignoreAttributes = true,\n // Filter React development reserved props\n // added by babel-preset-react dev plugins:\n // transform-react-jsx-self and transform-react-jsx-source\n __source,\n __self,\n ...restOfNativeProps\n }) {\n const isControlledMode = visible !== undefined\n const isSingletonMode = singleton !== undefined\n\n const [mounted, setMounted] = useState(false)\n const [attrs, setAttrs] = useState({})\n const [singletonContent, setSingletonContent] = useState()\n const mutableBox = useMutableBox(() => ({\n container: ssrSafeCreateDiv(),\n renders: 1,\n }))\n\n const props = {\n ignoreAttributes,\n ...restOfNativeProps,\n content: mutableBox.container,\n }\n\n if (isControlledMode) {\n if (process.env.NODE_ENV !== 'production') {\n ;['trigger', 'hideOnClick', 'showOnCreate'].forEach((nativeStateProp) => {\n if (props[nativeStateProp] !== undefined) {\n console.warn(\n [\n `@tippyjs/react: Cannot specify \\`${nativeStateProp}\\` prop in`,\n `controlled mode (\\`visible\\` prop)`,\n ].join(' '),\n )\n }\n })\n }\n\n props.trigger = 'manual'\n props.hideOnClick = false\n }\n\n if (isSingletonMode) {\n disabled = true\n }\n\n let computedProps = props\n const plugins = props.plugins || []\n\n if (render) {\n computedProps = {\n ...props,\n plugins:\n isSingletonMode && singleton.data != null\n ? [\n ...plugins,\n {\n fn() {\n return {\n onTrigger(instance, event) {\n const node = singleton.data.children.find(\n ({ instance }) => instance.reference === event.currentTarget,\n )\n instance.state.$$activeSingletonInstance = node.instance\n setSingletonContent(node.content)\n },\n }\n },\n },\n ]\n : plugins,\n render: () => ({ popper: mutableBox.container }),\n }\n }\n\n const deps = [reference].concat(children ? [children.type] : [])\n\n // CREATE\n useIsomorphicLayoutEffect(() => {\n let element = reference\n if (reference && reference.hasOwnProperty('current')) {\n element = reference.current\n }\n\n const instance = tippy(element || mutableBox.ref || ssrSafeCreateDiv(), {\n ...computedProps,\n plugins: [classNamePlugin, ...(props.plugins || [])],\n })\n\n mutableBox.instance = instance\n\n if (disabled) {\n instance.disable()\n }\n\n if (visible) {\n instance.show()\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance,\n content,\n props: computedProps,\n setSingletonContent,\n })\n }\n\n setMounted(true)\n\n return () => {\n instance.destroy()\n singleton?.cleanup(instance)\n }\n }, deps)\n\n // UPDATE\n useIsomorphicLayoutEffect(() => {\n // Prevent this effect from running on 1st render\n if (mutableBox.renders === 1) {\n mutableBox.renders++\n return\n }\n\n const { instance } = mutableBox\n\n instance.setProps(deepPreserveProps(instance.props, computedProps))\n\n // Fixes #264\n instance.popperInstance?.forceUpdate()\n\n if (disabled) {\n instance.disable()\n } else {\n instance.enable()\n }\n\n if (isControlledMode) {\n if (visible) {\n instance.show()\n } else {\n instance.hide()\n }\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance,\n content,\n props: computedProps,\n setSingletonContent,\n })\n }\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!render) {\n return\n }\n\n const { instance } = mutableBox\n\n instance.setProps({\n popperOptions: {\n ...instance.props.popperOptions,\n modifiers: [\n ...(instance.props.popperOptions?.modifiers || []).filter(\n ({ name }) => name !== '$$tippyReact',\n ),\n {\n name: '$$tippyReact',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn({ state }) {\n const hideData = state.modifiersData?.hide\n\n // WARNING: this is a high-risk path that can cause an infinite\n // loop. This expression _must_ evaluate to false when required\n if (\n attrs.placement !== state.placement ||\n attrs.referenceHidden !== hideData?.isReferenceHidden ||\n attrs.escaped !== hideData?.hasPopperEscaped\n ) {\n setAttrs({\n placement: state.placement,\n referenceHidden: hideData?.isReferenceHidden,\n escaped: hideData?.hasPopperEscaped,\n })\n }\n\n state.attributes.popper = {}\n },\n },\n ],\n },\n })\n }, [attrs.placement, attrs.referenceHidden, attrs.escaped, ...deps])\n\n return (\n <>\n {children\n ? cloneElement(children, {\n ref(node) {\n mutableBox.ref = node\n preserveRef(children.props?.ref, node)\n },\n })\n : null}\n {mounted &&\n createPortal(\n render ? render(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content,\n mutableBox.container,\n )}\n </>\n )\n }\n\n return Tippy\n}\n","import { useMemo, useState } from 'react'\n\nimport { classNamePlugin } from './className-plugin'\nimport { useIsomorphicLayoutEffect, useMutableBox } from './util-hooks'\nimport { deepPreserveProps } from './utils'\n\nexport default function useSingletonGenerator(createSingleton) {\n return function useSingleton({ disabled = false, overrides = [] } = {}) {\n const [mounted, setMounted] = useState(false)\n const mutableBox = useMutableBox({\n children: [],\n renders: 1,\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!mounted) {\n setMounted(true)\n return\n }\n\n const { children, sourceData } = mutableBox\n\n if (!sourceData) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n [\n '@tippyjs/react: The `source` variable from `useSingleton()` has',\n 'not been passed to a <Tippy /> component.',\n ].join(' '),\n )\n }\n\n return\n }\n\n const instance = createSingleton(\n children.map((child) => child.instance),\n {\n ...sourceData.props,\n popperOptions: sourceData.instance.props.popperOptions,\n overrides,\n plugins: [classNamePlugin, ...(sourceData.props.plugins || [])],\n },\n )\n\n mutableBox.instance = instance\n\n if (disabled) {\n instance.disable()\n }\n\n return () => {\n instance.destroy()\n mutableBox.children = children.filter(({ instance }) => !instance.state.isDestroyed)\n }\n }, [mounted])\n\n useIsomorphicLayoutEffect(() => {\n if (!mounted) {\n return\n }\n\n if (mutableBox.renders === 1) {\n mutableBox.renders++\n return\n }\n\n const { children, instance, sourceData } = mutableBox\n\n if (!(instance && sourceData)) {\n return\n }\n\n const { content, ...props } = sourceData.props\n\n instance.setProps(\n deepPreserveProps(instance.props, {\n ...props,\n overrides,\n }),\n )\n\n instance.setInstances(children.map((child) => child.instance))\n\n if (disabled) {\n instance.disable()\n } else {\n instance.enable()\n }\n })\n\n return useMemo(() => {\n const source = {\n data: mutableBox,\n hook(data) {\n mutableBox.sourceData = data\n mutableBox.setSingletonContent = data.setSingletonContent\n },\n cleanup() {\n mutableBox.sourceData = null\n },\n }\n\n const target = {\n hook(data) {\n mutableBox.children = mutableBox.children.filter(({ instance }) => data.instance !== instance)\n mutableBox.children.push(data)\n\n if (\n mutableBox.instance?.state.isMounted &&\n mutableBox.instance?.state.$$activeSingletonInstance === data.instance\n ) {\n mutableBox.setSingletonContent?.(data.content)\n }\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map((child) => child.instance))\n }\n },\n cleanup(instance) {\n mutableBox.children = mutableBox.children.filter((data) => data.instance !== instance)\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map((child) => child.instance))\n }\n },\n }\n\n return [source, target]\n }, [])\n }\n}\n","import tippy, { createSingleton } from 'tippy.js/headless'\n\nimport forwardRef from './forwardRef'\nimport TippyGenerator from './Tippy'\nimport useSingletonGenerator from './useSingleton'\n\nconst useSingleton = useSingletonGenerator(createSingleton)\n\nexport default forwardRef(TippyGenerator(tippy), { render: () => '' })\nexport { tippy, useSingleton }\n"],"names":["isBrowser","window","document","preserveRef","ref","node","hasOwnProperty","call","current","ssrSafeCreateDiv","createElement","toDataAttributes","attrs","dataAttrs","placement","referenceHidden","escaped","deepEqual","x","y","Object","keys","length","prop","uniqueByShape","arr","output","forEach","item","find","outputItem","push","deepPreserveProps","instanceProps","componentProps","popperOptions","modifiers","createTippyWrapper","Tippy","defaultProps","forwardRef","TippyWrapper","children","props","cloneElement","updateClassName","box","action","classNames","split","name","classList","classNamePlugin","defaultValue","fn","instance","popper","firstElementChild","isDefaultRenderFn","render","$$tippy","add","className","process","env","NODE_ENV","console","warn","join","remove","onCreate","onBeforeUpdate","onAfterUpdate","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useMutableBox","initialValue","useRef","TippyGenerator","tippy","content","visible","singleton","reference","disabled","ignoreAttributes","__source","__self","restOfNativeProps","isControlledMode","undefined","isSingletonMode","useState","mounted","setMounted","setAttrs","singletonContent","setSingletonContent","mutableBox","container","renders","nativeStateProp","trigger","hideOnClick","computedProps","plugins","data","onTrigger","event","currentTarget","state","$$activeSingletonInstance","deps","concat","type","element","disable","show","hook","destroy","cleanup","setProps","popperInstance","forceUpdate","enable","hide","filter","enabled","phase","requires","hideData","modifiersData","isReferenceHidden","hasPopperEscaped","attributes","React","createPortal","useSingletonGenerator","createSingleton","useSingleton","overrides","sourceData","error","map","child","isDestroyed","setInstances","useMemo","source","target","isMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,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ACC,KAAD;EAAA,qBAAWA,KAAK,CAAC1F,QAAjB;EAAA,aAAxB,CAAjC;EACH;EACJ,SAfU;EAgBXkE,QAAAA,OAhBW,mBAgBHlE,QAhBG,EAgBO;EACd4C,UAAAA,UAAU,CAACzD,QAAX,GAAsByD,UAAU,CAACzD,QAAX,CAAoBqF,MAApB,CAA2B,UAACpB,IAAD;EAAA,mBAAUA,IAAI,CAACpD,QAAL,KAAkBA,QAA5B;EAAA,WAA3B,CAAtB;;EAEA,cAAI4C,UAAU,CAAC5C,QAAX,IAAuB,CAAC4C,UAAU,CAAC5C,QAAX,CAAoBwD,KAApB,CAA0BmC,WAAtD,EAAmE;EAC/D/C,YAAAA,UAAU,CAAC5C,QAAX,CAAoB4F,YAApB,CAAiChD,UAAU,CAACzD,QAAX,CAAoBsG,GAApB,CAAwB,UAACC,KAAD;EAAA,qBAAWA,KAAK,CAAC1F,QAAjB;EAAA,aAAxB,CAAjC;EACH;EACJ;EAtBU,OAAf;EAyBA,aAAO,CAAC8F,MAAD,EAASC,MAAT,CAAP;EACH,KAtCa,EAsCX,EAtCW,CAAd;EAuCH,GA3HD;EA4HH;;MC7HKV,YAAY,gBAAGF,qBAAqB,CAACC,qBAAD,CAA1C;AAEA,8BAAenG,kBAAU,eAACuC,cAAc,CAACC,cAAD,CAAf,EAAwB;EAAErB,EAAAA,MAAM,EAAE;EAAA,WAAM,EAAN;EAAA;EAAV,CAAxB,CAAzB;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tippy.js/headless"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","tippy.js/headless","react","react-dom"],n):n((e=e||self).Tippy={},e.tippy,e.React,e.ReactDOM)}(this,(function(e,n,t,r){"use strict";var i="default"in n?n.default:n,o="default"in t?t.default:t;function c(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var s="undefined"!=typeof window&&"undefined"!=typeof document;function a(e,n){e&&("function"==typeof e&&e(n),{}.hasOwnProperty.call(e,"current")&&(e.current=n))}function u(){return s&&document.createElement("div")}function p(e){var n=[];return e.forEach((function(e){n.find((function(n){return function e(n,t){if(n===t)return!0;if("object"==typeof n&&null!=n&&"object"==typeof t&&null!=t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(var r in n){if(!t.hasOwnProperty(r))return!1;if(!e(n[r],t[r]))return!1}return!0}return!1}(e,n)}))||n.push(e)})),n}function l(e,n){var t,r;return Object.assign({},n,{popperOptions:Object.assign({},e.popperOptions,n.popperOptions,{modifiers:p([].concat((null==(t=e.popperOptions)?void 0:t.modifiers)||[],(null==(r=n.popperOptions)?void 0:r.modifiers)||[]))})})}var f=function(e,n){return t.forwardRef((function(r,i){var s=r.children,u=c(r,["children"]);return o.createElement(e,Object.assign({},n,u),s?t.cloneElement(s,{ref:function(e){var n;a(i,e),a(null==(n=s.props)?void 0:n.ref,e)}}):null)}))};function d(e,n,t){t.split(/\s+/).forEach((function(t){t&&e.classList[n](t)}))}var v={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,t=function(){var n;return!!(null==(n=e.props.render)?void 0:n.$$tippy)};function r(){e.props.className&&!t()||d(n,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){t()&&d(n,"remove",e.props.className)},onAfterUpdate:r}}},h=s?t.useLayoutEffect:t.useEffect;function m(e){var n=t.useRef();return n.current||(n.current="function"==typeof e?e():e),n.current}function g(e){return function(n){var i=n.children,s=n.content,p=n.visible,f=n.singleton,d=n.render,g=n.reference,b=n.disabled,y=void 0!==b&&b,O=n.ignoreAttributes,j=void 0===O||O,S=(n.__source,n.__self,c(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),E=void 0!==p,P=void 0!==f,$=t.useState(!1),_=$[0],C=$[1],D=t.useState({}),k=D[0],w=D[1],R=t.useState(),H=R[0],I=R[1],q=m((function(){return{container:u(),renders:1}})),x=Object.assign({ignoreAttributes:j},S,{content:q.container});E&&(x.trigger="manual",x.hideOnClick=!1),P&&(y=!0);var A=x,M=x.plugins||[];d&&(A=Object.assign({},x,{plugins:P&&null!=f.data?[].concat(M,[{fn:function(){return{onTrigger:function(e,n){var t=f.data.children.find((function(e){return e.instance.reference===n.currentTarget}));e.state.$$activeSingletonInstance=t.instance,I(t.content)}}}}]):M,render:function(){return{popper:q.container}}}));var N=[g].concat(i?[i.type]:[]);return h((function(){var n=g;g&&g.hasOwnProperty("current")&&(n=g.current);var t=e(n||q.ref||u(),Object.assign({},A,{plugins:[v].concat(x.plugins||[])}));return q.instance=t,y&&t.disable(),p&&t.show(),P&&f.hook({instance:t,content:s,props:A,setSingletonContent:I}),C(!0),function(){t.destroy(),null==f||f.cleanup(t)}}),N),h((function(){var e;if(1!==q.renders){var n=q.instance;n.setProps(l(n.props,A)),null==(e=n.popperInstance)||e.forceUpdate(),y?n.disable():n.enable(),E&&(p?n.show():n.hide()),P&&f.hook({instance:n,content:s,props:A,setSingletonContent:I})}else q.renders++})),h((function(){var e;if(d){var n=q.instance;n.setProps({popperOptions:Object.assign({},n.props.popperOptions,{modifiers:[].concat(((null==(e=n.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var n,t=e.state,r=null==(n=t.modifiersData)?void 0:n.hide;k.placement===t.placement&&k.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&k.escaped===(null==r?void 0:r.hasPopperEscaped)||w({placement:t.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),t.attributes.popper={}}}])})})}}),[k.placement,k.referenceHidden,k.escaped].concat(N)),o.createElement(o.Fragment,null,i?t.cloneElement(i,{ref:function(e){var n;q.ref=e,a(null==(n=i.props)?void 0:n.ref,e)}}):null,_&&r.createPortal(d?d(function(e){var n={"data-placement":e.placement};return e.referenceHidden&&(n["data-reference-hidden"]=""),e.escaped&&(n["data-escaped"]=""),n}(k),H,q.instance):s,q.container))}}function b(e){return function(n){var r=void 0===n?{}:n,i=r.disabled,o=void 0!==i&&i,s=r.overrides,a=void 0===s?[]:s,u=t.useState(!1),p=u[0],f=u[1],d=m({children:[],renders:1});return h((function(){if(p){var n=d.children,t=d.sourceData;if(t){var r=e(n.map((function(e){return e.instance})),Object.assign({},t.props,{popperOptions:t.instance.props.popperOptions,overrides:a,plugins:[v].concat(t.props.plugins||[])}));return d.instance=r,o&&r.disable(),function(){r.destroy(),d.children=n.filter((function(e){return!e.instance.state.isDestroyed}))}}}else f(!0)}),[p]),h((function(){if(p)if(1!==d.renders){var e=d.children,n=d.instance,t=d.sourceData;if(n&&t){var r=t.props,i=(r.content,c(r,["content"]));n.setProps(l(n.props,Object.assign({},i,{overrides:a}))),n.setInstances(e.map((function(e){return e.instance}))),o?n.disable():n.enable()}}else d.renders++})),t.useMemo((function(){return[{data:d,hook:function(e){d.sourceData=e,d.setSingletonContent=e.setSingletonContent},cleanup:function(){d.sourceData=null}},{hook:function(e){var n,t;d.children=d.children.filter((function(n){var t=n.instance;return e.instance!==t})),d.children.push(e),(null==(n=d.instance)?void 0:n.state.isMounted)&&(null==(t=d.instance)?void 0:t.state.$$activeSingletonInstance)===e.instance&&(null==d.setSingletonContent||d.setSingletonContent(e.content)),d.instance&&!d.instance.state.isDestroyed&&d.instance.setInstances(d.children.map((function(e){return e.instance})))},cleanup:function(e){d.children=d.children.filter((function(n){return n.instance!==e})),d.instance&&!d.instance.state.isDestroyed&&d.instance.setInstances(d.children.map((function(e){return e.instance})))}}]}),[])}}var y=b(n.createSingleton),O=f(g(i),{render:function(){return""}});e.tippy=i,e.default=O,e.useSingleton=y,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
+
//# sourceMappingURL=tippy-react-headless.umd.min.js.map
|