@itcase/ui 1.0.3 → 1.0.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/components/Accordion.js +1 -1
- package/dist/components/Avatar.js +1 -1
- package/dist/components/Background.js +1 -1
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Caption.js +1 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Cell.js +1 -1
- package/dist/components/Checkbox.js +4 -4
- package/dist/components/Chips.js +2 -2
- package/dist/components/ContextMenu.js +4 -2
- package/dist/components/CookiesWarning.js +1 -1
- package/dist/components/Counter.js +1 -1
- package/dist/components/Divider.js +1 -1
- package/dist/components/Dropdown.js +87 -27
- package/dist/components/Emoji.js +1 -1
- package/dist/components/Fader.js +1 -1
- package/dist/components/Flex.js +1 -1
- package/dist/components/FormField.js +1 -1
- package/dist/components/Grid.js +1 -1
- package/dist/components/Group.js +1 -1
- package/dist/components/Icon.js +1 -1
- package/dist/components/Image.js +1 -1
- package/dist/components/Label.js +3 -2
- package/dist/components/LanguageSelector.js +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/List.js +1 -1
- package/dist/components/Loader.js +1 -1
- package/dist/components/Logo.js +13 -11
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuItem.js +1 -1
- package/dist/components/Notification.js +1 -1
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Popup.js +3 -2
- package/dist/components/Profile.js +1 -1
- package/dist/components/RangeSlider.js +18 -10
- package/dist/components/Search.js +2 -18301
- package/dist/components/Select.js +217 -110
- package/dist/components/SiteMenu.js +1 -1
- package/dist/components/Swiper.js +3 -2
- package/dist/components/Switch.js +20 -5
- package/dist/components/Text.js +1 -1
- package/dist/components/Tile.js +1 -1
- package/dist/components/Title.js +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Video.js +1 -1
- package/dist/components/Wrapper.js +1 -1
- package/dist/hooks/useStyles.js +1 -1
- package/dist/{useStyles-77c3b520.js → useStyles-e4accb53.js} +1 -1
- package/package.json +1 -1
- package/dist/_commonjsHelpers-facfc6d6.js +0 -7
|
@@ -20,7 +20,7 @@ require('../constants/componentProps/iconSize.js');
|
|
|
20
20
|
require('../constants/componentProps/shape.js');
|
|
21
21
|
require('../constants/componentProps/strokeColor.js');
|
|
22
22
|
require('./Link.js');
|
|
23
|
-
require('../useStyles-
|
|
23
|
+
require('../useStyles-e4accb53.js');
|
|
24
24
|
require('lodash/maxBy');
|
|
25
25
|
require('lodash/upperFirst');
|
|
26
26
|
require('../hooks/styleAttributes.js');
|
|
@@ -320,6 +320,7 @@ var RULESET = 'rule';
|
|
|
320
320
|
var DECLARATION = 'decl';
|
|
321
321
|
var IMPORT = '@import';
|
|
322
322
|
var KEYFRAMES = '@keyframes';
|
|
323
|
+
var LAYER = '@layer';
|
|
323
324
|
|
|
324
325
|
/**
|
|
325
326
|
* @param {number}
|
|
@@ -749,8 +750,8 @@ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, decl
|
|
|
749
750
|
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
750
751
|
else
|
|
751
752
|
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
752
|
-
// d m s
|
|
753
|
-
case 100: case 109: case 115:
|
|
753
|
+
// d l m s
|
|
754
|
+
case 100: case 108: case 109: case 115:
|
|
754
755
|
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
755
756
|
break
|
|
756
757
|
default:
|
|
@@ -869,6 +870,7 @@ function serialize (children, callback) {
|
|
|
869
870
|
*/
|
|
870
871
|
function stringify (element, index, children, callback) {
|
|
871
872
|
switch (element.type) {
|
|
873
|
+
case LAYER: if (element.children.length) break
|
|
872
874
|
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
873
875
|
case COMMENT: return ''
|
|
874
876
|
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
@@ -1924,6 +1926,7 @@ function murmur2(str) {
|
|
|
1924
1926
|
|
|
1925
1927
|
var unitlessKeys = {
|
|
1926
1928
|
animationIterationCount: 1,
|
|
1929
|
+
aspectRatio: 1,
|
|
1927
1930
|
borderImageOutset: 1,
|
|
1928
1931
|
borderImageSlice: 1,
|
|
1929
1932
|
borderImageWidth: 1,
|
|
@@ -2290,12 +2293,12 @@ var syncFallback = function syncFallback(create) {
|
|
|
2290
2293
|
|
|
2291
2294
|
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
2292
2295
|
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : useInsertionEffect || syncFallback;
|
|
2293
|
-
var useInsertionEffectWithLayoutFallback = useInsertionEffect ||
|
|
2296
|
+
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect;
|
|
2294
2297
|
|
|
2295
2298
|
var isBrowser$1 = typeof document !== 'undefined';
|
|
2296
2299
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
2297
2300
|
|
|
2298
|
-
var EmotionCacheContext = /* #__PURE__ */
|
|
2301
|
+
var EmotionCacheContext = /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2299
2302
|
// because this module is primarily intended for the browser and node
|
|
2300
2303
|
// but it's also required in react native and similar environments sometimes
|
|
2301
2304
|
// and we could have a special build just for that
|
|
@@ -2334,7 +2337,7 @@ if (!isBrowser$1) {
|
|
|
2334
2337
|
cache = createCache({
|
|
2335
2338
|
key: 'css'
|
|
2336
2339
|
});
|
|
2337
|
-
return /*#__PURE__*/
|
|
2340
|
+
return /*#__PURE__*/React__namespace.createElement(EmotionCacheContext.Provider, {
|
|
2338
2341
|
value: cache
|
|
2339
2342
|
}, func(props, cache));
|
|
2340
2343
|
} else {
|
|
@@ -2344,7 +2347,7 @@ if (!isBrowser$1) {
|
|
|
2344
2347
|
};
|
|
2345
2348
|
}
|
|
2346
2349
|
|
|
2347
|
-
var ThemeContext = /* #__PURE__ */
|
|
2350
|
+
var ThemeContext = /* #__PURE__ */React__namespace.createContext({});
|
|
2348
2351
|
|
|
2349
2352
|
if (process.env.NODE_ENV !== 'production') {
|
|
2350
2353
|
ThemeContext.displayName = 'EmotionThemeContext';
|
|
@@ -2440,7 +2443,7 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
2440
2443
|
next = next.next;
|
|
2441
2444
|
}
|
|
2442
2445
|
|
|
2443
|
-
return /*#__PURE__*/
|
|
2446
|
+
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
2444
2447
|
__html: rules
|
|
2445
2448
|
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
2446
2449
|
}
|
|
@@ -2467,7 +2470,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2467
2470
|
className = props.className + " ";
|
|
2468
2471
|
}
|
|
2469
2472
|
|
|
2470
|
-
var serialized = serializeStyles(registeredStyles, undefined,
|
|
2473
|
+
var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext));
|
|
2471
2474
|
|
|
2472
2475
|
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
2473
2476
|
var labelFromStack = props[labelPropName];
|
|
@@ -2488,20 +2491,22 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2488
2491
|
|
|
2489
2492
|
newProps.ref = ref;
|
|
2490
2493
|
newProps.className = className;
|
|
2491
|
-
return /*#__PURE__*/
|
|
2494
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion$1, {
|
|
2492
2495
|
cache: cache,
|
|
2493
2496
|
serialized: serialized,
|
|
2494
2497
|
isStringTag: typeof WrappedComponent === 'string'
|
|
2495
|
-
}), /*#__PURE__*/
|
|
2498
|
+
}), /*#__PURE__*/React__namespace.createElement(WrappedComponent, newProps));
|
|
2496
2499
|
});
|
|
2497
2500
|
|
|
2498
2501
|
if (process.env.NODE_ENV !== 'production') {
|
|
2499
2502
|
Emotion.displayName = 'EmotionCssPropInternal';
|
|
2500
2503
|
}
|
|
2501
2504
|
|
|
2505
|
+
var Emotion$1 = Emotion;
|
|
2506
|
+
|
|
2502
2507
|
var pkg = {
|
|
2503
2508
|
name: "@emotion/react",
|
|
2504
|
-
version: "11.
|
|
2509
|
+
version: "11.11.1",
|
|
2505
2510
|
main: "dist/emotion-react.cjs.js",
|
|
2506
2511
|
module: "dist/emotion-react.esm.js",
|
|
2507
2512
|
browser: {
|
|
@@ -2514,6 +2519,7 @@ var pkg = {
|
|
|
2514
2519
|
browser: "./dist/emotion-react.browser.esm.js",
|
|
2515
2520
|
"default": "./dist/emotion-react.esm.js"
|
|
2516
2521
|
},
|
|
2522
|
+
"import": "./dist/emotion-react.cjs.mjs",
|
|
2517
2523
|
"default": "./dist/emotion-react.cjs.js"
|
|
2518
2524
|
},
|
|
2519
2525
|
"./jsx-runtime": {
|
|
@@ -2522,6 +2528,7 @@ var pkg = {
|
|
|
2522
2528
|
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
2523
2529
|
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
2524
2530
|
},
|
|
2531
|
+
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
|
|
2525
2532
|
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
2526
2533
|
},
|
|
2527
2534
|
"./_isolated-hnrs": {
|
|
@@ -2530,6 +2537,7 @@ var pkg = {
|
|
|
2530
2537
|
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
2531
2538
|
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
2532
2539
|
},
|
|
2540
|
+
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
|
|
2533
2541
|
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
2534
2542
|
},
|
|
2535
2543
|
"./jsx-dev-runtime": {
|
|
@@ -2538,11 +2546,18 @@ var pkg = {
|
|
|
2538
2546
|
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
2539
2547
|
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
2540
2548
|
},
|
|
2549
|
+
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
|
|
2541
2550
|
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
2542
2551
|
},
|
|
2543
2552
|
"./package.json": "./package.json",
|
|
2544
2553
|
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2545
|
-
"./macro":
|
|
2554
|
+
"./macro": {
|
|
2555
|
+
types: {
|
|
2556
|
+
"import": "./macro.d.mts",
|
|
2557
|
+
"default": "./macro.d.ts"
|
|
2558
|
+
},
|
|
2559
|
+
"default": "./macro.js"
|
|
2560
|
+
}
|
|
2546
2561
|
},
|
|
2547
2562
|
types: "types/index.d.ts",
|
|
2548
2563
|
files: [
|
|
@@ -2552,9 +2567,7 @@ var pkg = {
|
|
|
2552
2567
|
"jsx-dev-runtime",
|
|
2553
2568
|
"_isolated-hnrs",
|
|
2554
2569
|
"types/*.d.ts",
|
|
2555
|
-
"macro
|
|
2556
|
-
"macro.d.ts",
|
|
2557
|
-
"macro.js.flow"
|
|
2570
|
+
"macro.*"
|
|
2558
2571
|
],
|
|
2559
2572
|
sideEffects: false,
|
|
2560
2573
|
author: "Emotion Contributors",
|
|
@@ -2564,12 +2577,12 @@ var pkg = {
|
|
|
2564
2577
|
},
|
|
2565
2578
|
dependencies: {
|
|
2566
2579
|
"@babel/runtime": "^7.18.3",
|
|
2567
|
-
"@emotion/babel-plugin": "^11.
|
|
2568
|
-
"@emotion/cache": "^11.
|
|
2569
|
-
"@emotion/serialize": "^1.1.
|
|
2570
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.
|
|
2571
|
-
"@emotion/utils": "^1.2.
|
|
2572
|
-
"@emotion/weak-memoize": "^0.3.
|
|
2580
|
+
"@emotion/babel-plugin": "^11.11.0",
|
|
2581
|
+
"@emotion/cache": "^11.11.0",
|
|
2582
|
+
"@emotion/serialize": "^1.1.2",
|
|
2583
|
+
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
2584
|
+
"@emotion/utils": "^1.2.1",
|
|
2585
|
+
"@emotion/weak-memoize": "^0.3.1",
|
|
2573
2586
|
"hoist-non-react-statics": "^3.3.1"
|
|
2574
2587
|
},
|
|
2575
2588
|
peerDependencies: {
|
|
@@ -2582,10 +2595,10 @@ var pkg = {
|
|
|
2582
2595
|
},
|
|
2583
2596
|
devDependencies: {
|
|
2584
2597
|
"@definitelytyped/dtslint": "0.0.112",
|
|
2585
|
-
"@emotion/css": "11.
|
|
2586
|
-
"@emotion/css-prettifier": "1.1.
|
|
2587
|
-
"@emotion/server": "11.
|
|
2588
|
-
"@emotion/styled": "11.
|
|
2598
|
+
"@emotion/css": "11.11.0",
|
|
2599
|
+
"@emotion/css-prettifier": "1.1.3",
|
|
2600
|
+
"@emotion/server": "11.11.0",
|
|
2601
|
+
"@emotion/styled": "11.11.0",
|
|
2589
2602
|
"html-tag-names": "^1.1.2",
|
|
2590
2603
|
react: "16.14.0",
|
|
2591
2604
|
"svg-tag-names": "^1.1.1",
|
|
@@ -2611,7 +2624,13 @@ var pkg = {
|
|
|
2611
2624
|
],
|
|
2612
2625
|
extra: {
|
|
2613
2626
|
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2614
|
-
"./macro":
|
|
2627
|
+
"./macro": {
|
|
2628
|
+
types: {
|
|
2629
|
+
"import": "./macro.d.mts",
|
|
2630
|
+
"default": "./macro.d.ts"
|
|
2631
|
+
},
|
|
2632
|
+
"default": "./macro.js"
|
|
2633
|
+
}
|
|
2615
2634
|
}
|
|
2616
2635
|
}
|
|
2617
2636
|
}
|
|
@@ -2622,12 +2641,12 @@ var jsx = function jsx(type, props) {
|
|
|
2622
2641
|
|
|
2623
2642
|
if (props == null || !hasOwnProperty.call(props, 'css')) {
|
|
2624
2643
|
// $FlowFixMe
|
|
2625
|
-
return
|
|
2644
|
+
return React__namespace.createElement.apply(undefined, args);
|
|
2626
2645
|
}
|
|
2627
2646
|
|
|
2628
2647
|
var argsLength = args.length;
|
|
2629
2648
|
var createElementArgArray = new Array(argsLength);
|
|
2630
|
-
createElementArgArray[0] = Emotion;
|
|
2649
|
+
createElementArgArray[0] = Emotion$1;
|
|
2631
2650
|
createElementArgArray[1] = createEmotionProps(type, props);
|
|
2632
2651
|
|
|
2633
2652
|
for (var i = 2; i < argsLength; i++) {
|
|
@@ -2635,7 +2654,7 @@ var jsx = function jsx(type, props) {
|
|
|
2635
2654
|
} // $FlowFixMe
|
|
2636
2655
|
|
|
2637
2656
|
|
|
2638
|
-
return
|
|
2657
|
+
return React__namespace.createElement.apply(null, createElementArgArray);
|
|
2639
2658
|
};
|
|
2640
2659
|
|
|
2641
2660
|
var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
|
|
@@ -2653,7 +2672,7 @@ var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
2653
2672
|
}
|
|
2654
2673
|
|
|
2655
2674
|
var styles = props.styles;
|
|
2656
|
-
var serialized = serializeStyles([styles], undefined,
|
|
2675
|
+
var serialized = serializeStyles([styles], undefined, React__namespace.useContext(ThemeContext));
|
|
2657
2676
|
|
|
2658
2677
|
if (!isBrowser$1) {
|
|
2659
2678
|
var _ref;
|
|
@@ -2678,7 +2697,7 @@ var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
2678
2697
|
return null;
|
|
2679
2698
|
}
|
|
2680
2699
|
|
|
2681
|
-
return /*#__PURE__*/
|
|
2700
|
+
return /*#__PURE__*/React__namespace.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
|
|
2682
2701
|
__html: rules
|
|
2683
2702
|
}, _ref.nonce = cache.sheet.nonce, _ref));
|
|
2684
2703
|
} // yes, i know these hooks are used conditionally
|
|
@@ -2687,7 +2706,7 @@ var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
2687
2706
|
// so it's not actually breaking anything
|
|
2688
2707
|
|
|
2689
2708
|
|
|
2690
|
-
var sheetRef =
|
|
2709
|
+
var sheetRef = React__namespace.useRef();
|
|
2691
2710
|
useInsertionEffectWithLayoutFallback(function () {
|
|
2692
2711
|
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
2693
2712
|
|
|
@@ -2854,7 +2873,7 @@ var Insertion = function Insertion(_ref) {
|
|
|
2854
2873
|
if (!isBrowser$1 && rules.length !== 0) {
|
|
2855
2874
|
var _ref2;
|
|
2856
2875
|
|
|
2857
|
-
return /*#__PURE__*/
|
|
2876
|
+
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
2858
2877
|
return serialized.name;
|
|
2859
2878
|
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
2860
2879
|
__html: rules
|
|
@@ -2899,11 +2918,11 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
2899
2918
|
var content = {
|
|
2900
2919
|
css: css,
|
|
2901
2920
|
cx: cx,
|
|
2902
|
-
theme:
|
|
2921
|
+
theme: React__namespace.useContext(ThemeContext)
|
|
2903
2922
|
};
|
|
2904
2923
|
var ele = props.children(content);
|
|
2905
2924
|
hasRendered = true;
|
|
2906
|
-
return /*#__PURE__*/
|
|
2925
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
2907
2926
|
cache: cache,
|
|
2908
2927
|
serializedArr: serializedArr
|
|
2909
2928
|
}), ele);
|
|
@@ -2967,20 +2986,13 @@ function isNode(value) {
|
|
|
2967
2986
|
return value instanceof getWindow(value).Node;
|
|
2968
2987
|
}
|
|
2969
2988
|
function getNodeName(node) {
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
let uaString;
|
|
2974
|
-
function getUAString() {
|
|
2975
|
-
if (uaString) {
|
|
2976
|
-
return uaString;
|
|
2989
|
+
if (isNode(node)) {
|
|
2990
|
+
return (node.nodeName || '').toLowerCase();
|
|
2977
2991
|
}
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
}
|
|
2983
|
-
return navigator.userAgent;
|
|
2992
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
2993
|
+
// returning `#document` an infinite loop won't occur.
|
|
2994
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
2995
|
+
return '#document';
|
|
2984
2996
|
}
|
|
2985
2997
|
|
|
2986
2998
|
function isHTMLElement(value) {
|
|
@@ -2994,8 +3006,7 @@ function isShadowRoot(node) {
|
|
|
2994
3006
|
if (typeof ShadowRoot === 'undefined') {
|
|
2995
3007
|
return false;
|
|
2996
3008
|
}
|
|
2997
|
-
|
|
2998
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
3009
|
+
return node instanceof getWindow(node).ShadowRoot || node instanceof ShadowRoot;
|
|
2999
3010
|
}
|
|
3000
3011
|
function isOverflowElement(element) {
|
|
3001
3012
|
const {
|
|
@@ -3006,32 +3017,29 @@ function isOverflowElement(element) {
|
|
|
3006
3017
|
} = getComputedStyle$1(element);
|
|
3007
3018
|
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
3008
3019
|
}
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
* viewport offsets. In Safari, the `x`/`y` offsets are values relative to the
|
|
3013
|
-
* visual viewport, while in other engines, they are values relative to the
|
|
3014
|
-
* layout viewport.
|
|
3015
|
-
*/
|
|
3016
|
-
function isClientRectVisualViewportBased() {
|
|
3017
|
-
// TODO: Try to use feature detection here instead. Feature detection for
|
|
3018
|
-
// this can fail in various ways, making the userAgent check the most
|
|
3019
|
-
// reliable:
|
|
3020
|
-
// • Always-visible scrollbar or not
|
|
3021
|
-
// • Width of <html>
|
|
3022
|
-
|
|
3023
|
-
// Is Safari.
|
|
3024
|
-
return /^((?!chrome|android).)*safari/i.test(getUAString());
|
|
3020
|
+
function isSafari() {
|
|
3021
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
3022
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
3025
3023
|
}
|
|
3026
3024
|
function isLastTraversableNode(node) {
|
|
3027
3025
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
3028
3026
|
}
|
|
3027
|
+
|
|
3028
|
+
const min = Math.min;
|
|
3029
|
+
const max = Math.max;
|
|
3029
3030
|
const round = Math.round;
|
|
3031
|
+
const floor = Math.floor;
|
|
3032
|
+
const createEmptyCoords = v => ({
|
|
3033
|
+
x: v,
|
|
3034
|
+
y: v
|
|
3035
|
+
});
|
|
3030
3036
|
|
|
3031
3037
|
function getCssDimensions(element) {
|
|
3032
3038
|
const css = getComputedStyle$1(element);
|
|
3033
|
-
|
|
3034
|
-
|
|
3039
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
3040
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
3041
|
+
let width = parseFloat(css.width) || 0;
|
|
3042
|
+
let height = parseFloat(css.height) || 0;
|
|
3035
3043
|
const hasOffset = isHTMLElement(element);
|
|
3036
3044
|
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
3037
3045
|
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
@@ -3043,7 +3051,7 @@ function getCssDimensions(element) {
|
|
|
3043
3051
|
return {
|
|
3044
3052
|
width,
|
|
3045
3053
|
height,
|
|
3046
|
-
|
|
3054
|
+
$: shouldFallback
|
|
3047
3055
|
};
|
|
3048
3056
|
}
|
|
3049
3057
|
|
|
@@ -3051,23 +3059,19 @@ function unwrapElement(element) {
|
|
|
3051
3059
|
return !isElement(element) ? element.contextElement : element;
|
|
3052
3060
|
}
|
|
3053
3061
|
|
|
3054
|
-
const FALLBACK_SCALE = {
|
|
3055
|
-
x: 1,
|
|
3056
|
-
y: 1
|
|
3057
|
-
};
|
|
3058
3062
|
function getScale(element) {
|
|
3059
3063
|
const domElement = unwrapElement(element);
|
|
3060
3064
|
if (!isHTMLElement(domElement)) {
|
|
3061
|
-
return
|
|
3065
|
+
return createEmptyCoords(1);
|
|
3062
3066
|
}
|
|
3063
3067
|
const rect = domElement.getBoundingClientRect();
|
|
3064
3068
|
const {
|
|
3065
3069
|
width,
|
|
3066
3070
|
height,
|
|
3067
|
-
|
|
3071
|
+
$
|
|
3068
3072
|
} = getCssDimensions(domElement);
|
|
3069
|
-
let x = (
|
|
3070
|
-
let y = (
|
|
3073
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
3074
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
3071
3075
|
|
|
3072
3076
|
// 0, NaN, or Infinity should always fallback to 1.
|
|
3073
3077
|
|
|
@@ -3083,8 +3087,26 @@ function getScale(element) {
|
|
|
3083
3087
|
};
|
|
3084
3088
|
}
|
|
3085
3089
|
|
|
3086
|
-
|
|
3090
|
+
const noOffsets = /*#__PURE__*/createEmptyCoords(0);
|
|
3091
|
+
function getVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
3087
3092
|
var _win$visualViewport, _win$visualViewport2;
|
|
3093
|
+
if (isFixed === void 0) {
|
|
3094
|
+
isFixed = true;
|
|
3095
|
+
}
|
|
3096
|
+
if (!isSafari()) {
|
|
3097
|
+
return noOffsets;
|
|
3098
|
+
}
|
|
3099
|
+
const win = element ? getWindow(element) : window;
|
|
3100
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) {
|
|
3101
|
+
return noOffsets;
|
|
3102
|
+
}
|
|
3103
|
+
return {
|
|
3104
|
+
x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0,
|
|
3105
|
+
y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0
|
|
3106
|
+
};
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
3088
3110
|
if (includeScale === void 0) {
|
|
3089
3111
|
includeScale = false;
|
|
3090
3112
|
}
|
|
@@ -3093,7 +3115,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3093
3115
|
}
|
|
3094
3116
|
const clientRect = element.getBoundingClientRect();
|
|
3095
3117
|
const domElement = unwrapElement(element);
|
|
3096
|
-
let scale =
|
|
3118
|
+
let scale = createEmptyCoords(1);
|
|
3097
3119
|
if (includeScale) {
|
|
3098
3120
|
if (offsetParent) {
|
|
3099
3121
|
if (isElement(offsetParent)) {
|
|
@@ -3103,10 +3125,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3103
3125
|
scale = getScale(element);
|
|
3104
3126
|
}
|
|
3105
3127
|
}
|
|
3106
|
-
const
|
|
3107
|
-
|
|
3108
|
-
let
|
|
3109
|
-
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
|
|
3128
|
+
const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent);
|
|
3129
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
3130
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
3110
3131
|
let width = clientRect.width / scale.x;
|
|
3111
3132
|
let height = clientRect.height / scale.y;
|
|
3112
3133
|
if (domElement) {
|
|
@@ -3117,14 +3138,14 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3117
3138
|
const iframeScale = getScale(currentIFrame);
|
|
3118
3139
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
3119
3140
|
const css = getComputedStyle(currentIFrame);
|
|
3120
|
-
iframeRect.
|
|
3121
|
-
iframeRect.
|
|
3141
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
3142
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
3122
3143
|
x *= iframeScale.x;
|
|
3123
3144
|
y *= iframeScale.y;
|
|
3124
3145
|
width *= iframeScale.x;
|
|
3125
3146
|
height *= iframeScale.y;
|
|
3126
|
-
x +=
|
|
3127
|
-
y +=
|
|
3147
|
+
x += left;
|
|
3148
|
+
y += top;
|
|
3128
3149
|
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
3129
3150
|
}
|
|
3130
3151
|
}
|
|
@@ -3159,9 +3180,7 @@ function getParentNode(node) {
|
|
|
3159
3180
|
function getNearestOverflowAncestor(node) {
|
|
3160
3181
|
const parentNode = getParentNode(node);
|
|
3161
3182
|
if (isLastTraversableNode(parentNode)) {
|
|
3162
|
-
|
|
3163
|
-
// check, so it's either the <html> or <body> element.
|
|
3164
|
-
return parentNode.ownerDocument.body;
|
|
3183
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
3165
3184
|
}
|
|
3166
3185
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
3167
3186
|
return parentNode;
|
|
@@ -3183,6 +3202,80 @@ function getOverflowAncestors(node, list) {
|
|
|
3183
3202
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
3184
3203
|
}
|
|
3185
3204
|
|
|
3205
|
+
// https://samthor.au/2021/observing-dom/
|
|
3206
|
+
function observeMove(element, onMove) {
|
|
3207
|
+
let io = null;
|
|
3208
|
+
let timeoutId;
|
|
3209
|
+
const root = getDocumentElement(element);
|
|
3210
|
+
function cleanup() {
|
|
3211
|
+
clearTimeout(timeoutId);
|
|
3212
|
+
io && io.disconnect();
|
|
3213
|
+
io = null;
|
|
3214
|
+
}
|
|
3215
|
+
function refresh(skip, threshold) {
|
|
3216
|
+
if (skip === void 0) {
|
|
3217
|
+
skip = false;
|
|
3218
|
+
}
|
|
3219
|
+
if (threshold === void 0) {
|
|
3220
|
+
threshold = 1;
|
|
3221
|
+
}
|
|
3222
|
+
cleanup();
|
|
3223
|
+
const {
|
|
3224
|
+
left,
|
|
3225
|
+
top,
|
|
3226
|
+
width,
|
|
3227
|
+
height
|
|
3228
|
+
} = element.getBoundingClientRect();
|
|
3229
|
+
if (!skip) {
|
|
3230
|
+
onMove();
|
|
3231
|
+
}
|
|
3232
|
+
if (!width || !height) {
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
const insetTop = floor(top);
|
|
3236
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
3237
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
3238
|
+
const insetLeft = floor(left);
|
|
3239
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
3240
|
+
const options = {
|
|
3241
|
+
rootMargin,
|
|
3242
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
3243
|
+
};
|
|
3244
|
+
let isFirstUpdate = true;
|
|
3245
|
+
function handleObserve(entries) {
|
|
3246
|
+
const ratio = entries[0].intersectionRatio;
|
|
3247
|
+
if (ratio !== threshold) {
|
|
3248
|
+
if (!isFirstUpdate) {
|
|
3249
|
+
return refresh();
|
|
3250
|
+
}
|
|
3251
|
+
if (!ratio) {
|
|
3252
|
+
timeoutId = setTimeout(() => {
|
|
3253
|
+
refresh(false, 1e-7);
|
|
3254
|
+
}, 100);
|
|
3255
|
+
} else {
|
|
3256
|
+
refresh(false, ratio);
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
isFirstUpdate = false;
|
|
3260
|
+
}
|
|
3261
|
+
|
|
3262
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
3263
|
+
// error.
|
|
3264
|
+
try {
|
|
3265
|
+
io = new IntersectionObserver(handleObserve, {
|
|
3266
|
+
...options,
|
|
3267
|
+
// Handle <iframe>s
|
|
3268
|
+
root: root.ownerDocument
|
|
3269
|
+
});
|
|
3270
|
+
} catch (e) {
|
|
3271
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
3272
|
+
}
|
|
3273
|
+
io.observe(element);
|
|
3274
|
+
}
|
|
3275
|
+
refresh(true);
|
|
3276
|
+
return cleanup;
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3186
3279
|
/**
|
|
3187
3280
|
* Automatically updates the position of the floating element when necessary.
|
|
3188
3281
|
* Should only be called when the floating element is mounted on the DOM or
|
|
@@ -3198,30 +3291,39 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3198
3291
|
const {
|
|
3199
3292
|
ancestorScroll = true,
|
|
3200
3293
|
ancestorResize = true,
|
|
3201
|
-
elementResize =
|
|
3294
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
3295
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
3202
3296
|
animationFrame = false
|
|
3203
3297
|
} = options;
|
|
3204
|
-
const
|
|
3298
|
+
const referenceEl = unwrapElement(reference);
|
|
3299
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
3205
3300
|
ancestors.forEach(ancestor => {
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
ancestor.addEventListener('scroll', update, {
|
|
3210
|
-
passive: true
|
|
3211
|
-
});
|
|
3212
|
-
}
|
|
3301
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
3302
|
+
passive: true
|
|
3303
|
+
});
|
|
3213
3304
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
3214
3305
|
});
|
|
3215
|
-
|
|
3306
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
3307
|
+
let reobserveFrame = -1;
|
|
3308
|
+
let resizeObserver = null;
|
|
3216
3309
|
if (elementResize) {
|
|
3217
|
-
|
|
3310
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
3311
|
+
let [firstEntry] = _ref;
|
|
3312
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
3313
|
+
// Prevent update loops when using the `size` middleware.
|
|
3314
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
3315
|
+
resizeObserver.unobserve(floating);
|
|
3316
|
+
cancelAnimationFrame(reobserveFrame);
|
|
3317
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
3318
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3218
3321
|
update();
|
|
3219
3322
|
});
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
observer.observe(reference.contextElement);
|
|
3323
|
+
if (referenceEl && !animationFrame) {
|
|
3324
|
+
resizeObserver.observe(referenceEl);
|
|
3223
3325
|
}
|
|
3224
|
-
|
|
3326
|
+
resizeObserver.observe(floating);
|
|
3225
3327
|
}
|
|
3226
3328
|
let frameId;
|
|
3227
3329
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
@@ -3238,13 +3340,13 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3238
3340
|
}
|
|
3239
3341
|
update();
|
|
3240
3342
|
return () => {
|
|
3241
|
-
var _observer;
|
|
3242
3343
|
ancestors.forEach(ancestor => {
|
|
3243
3344
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
3244
3345
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
3245
3346
|
});
|
|
3246
|
-
|
|
3247
|
-
|
|
3347
|
+
cleanupIo && cleanupIo();
|
|
3348
|
+
resizeObserver && resizeObserver.disconnect();
|
|
3349
|
+
resizeObserver = null;
|
|
3248
3350
|
if (animationFrame) {
|
|
3249
3351
|
cancelAnimationFrame(frameId);
|
|
3250
3352
|
}
|
|
@@ -7539,6 +7641,7 @@ function SelectContainer(props) {
|
|
|
7539
7641
|
clearIcon = props.clearIcon,
|
|
7540
7642
|
clearIconFill = props.clearIconFill,
|
|
7541
7643
|
clearIconStroke = props.clearIconStroke,
|
|
7644
|
+
closeMenuOnSelect = props.closeMenuOnSelect,
|
|
7542
7645
|
dropdownIcon = props.dropdownIcon,
|
|
7543
7646
|
dropdownIconFill = props.dropdownIconFill,
|
|
7544
7647
|
dropdownIconStroke = props.dropdownIconStroke,
|
|
@@ -7547,6 +7650,7 @@ function SelectContainer(props) {
|
|
|
7547
7650
|
inputBefore = props.inputBefore,
|
|
7548
7651
|
isClearable = props.isClearable,
|
|
7549
7652
|
isCreatable = props.isCreatable,
|
|
7653
|
+
isMulti = props.isMulti,
|
|
7550
7654
|
isSearchable = props.isSearchable,
|
|
7551
7655
|
noOptionsText = props.noOptionsText,
|
|
7552
7656
|
openMenuOnClick = props.openMenuOnClick,
|
|
@@ -7658,11 +7762,12 @@ function SelectContainer(props) {
|
|
|
7658
7762
|
openMenuOnClick: openMenuOnClick,
|
|
7659
7763
|
clearIconFill: clearIconFill,
|
|
7660
7764
|
clearIconStroke: clearIconStroke,
|
|
7661
|
-
closeMenuOnSelect: false,
|
|
7765
|
+
closeMenuOnSelect: closeMenuOnSelect != null ? closeMenuOnSelect : false,
|
|
7662
7766
|
defaultValue: initialValue,
|
|
7663
7767
|
dropdownIcon: dropdownIcon,
|
|
7664
7768
|
dropdownIconFill: dropdownIconFill,
|
|
7665
7769
|
dropdownIconStroke: dropdownIconStroke,
|
|
7770
|
+
isMulti: isMulti,
|
|
7666
7771
|
isSearchable: isSearchable,
|
|
7667
7772
|
set: set,
|
|
7668
7773
|
optionFill: optionFillClass,
|
|
@@ -7711,12 +7816,14 @@ SelectContainer.propTypes = {
|
|
|
7711
7816
|
clearIconFill: PropTypes__default.default.string,
|
|
7712
7817
|
clearIconStroke: PropTypes__default.default.string,
|
|
7713
7818
|
className: PropTypes__default.default.string,
|
|
7819
|
+
closeMenuOnSelect: PropTypes__default.default.bool,
|
|
7714
7820
|
dropdownIcon: PropTypes__default.default.string,
|
|
7715
7821
|
dropdownIconFill: PropTypes__default.default.string,
|
|
7716
7822
|
dropdownIconStroke: PropTypes__default.default.string,
|
|
7717
7823
|
initialValue: PropTypes__default.default.any,
|
|
7718
7824
|
set: PropTypes__default.default.string,
|
|
7719
7825
|
onChange: PropTypes__default.default.func,
|
|
7826
|
+
openMenuOnClick: PropTypes__default.default.func,
|
|
7720
7827
|
// optionBefore: PropTypes.any,
|
|
7721
7828
|
// optionAfter: PropTypes.any,
|
|
7722
7829
|
options: PropTypes__default.default.arrayOf(PropTypes__default.default.object),
|