@rescui/select 0.15.1 → 0.15.2-RUI-291-Update-next-js-to-the-latest-version-8f54dec0a.66
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/lib/_virtual/index.css.js +12 -12
- package/lib/common-prop-types.d.ts +29 -35
- package/lib/common-prop-types.js +4 -3
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -0
- package/lib/hooks/use-a11y.d.ts +30 -0
- package/lib/hooks/use-a11y.js +56 -0
- package/lib/hooks/use-actual-size-from-css.d.ts +10 -0
- package/lib/hooks/use-actual-size-from-css.js +27 -0
- package/lib/hooks/use-focus.d.ts +10 -0
- package/lib/hooks/use-focus.js +17 -0
- package/lib/hooks/use-hover.d.ts +10 -0
- package/lib/hooks/use-hover.js +17 -0
- package/lib/hooks/use-label-focus.d.ts +9 -0
- package/lib/hooks/use-label-focus.js +22 -0
- package/lib/hooks/use-multi-handlers.d.ts +11 -0
- package/lib/hooks/use-multi-handlers.js +44 -0
- package/lib/hooks/use-options.d.ts +13 -0
- package/lib/hooks/use-options.js +90 -0
- package/lib/hooks/use-primary-contrast-css-var-transfer.d.ts +11 -0
- package/lib/hooks/use-primary-contrast-css-var-transfer.js +29 -0
- package/lib/hooks/use-safe-id.d.ts +6 -0
- package/lib/hooks/use-safe-id.js +15 -0
- package/lib/index.css +714 -305
- package/lib/index.d.ts +4 -6
- package/lib/index.js +3 -3
- package/lib/multiselect.d.ts +3 -0
- package/lib/multiselect.js +309 -0
- package/lib/native-select.d.ts +4 -0
- package/lib/native-select.js +208 -0
- package/lib/parts/foldable.d.ts +34 -33
- package/lib/parts/foldable.js +5 -7
- package/lib/parts/form-trigger-wrapper.d.ts +34 -34
- package/lib/parts/form-trigger-wrapper.js +16 -34
- package/lib/parts/hidden-select.d.ts +13 -0
- package/lib/parts/hidden-select.js +45 -0
- package/lib/parts/icons.d.ts +17 -0
- package/lib/parts/icons.js +69 -0
- package/lib/parts/list-box.d.ts +13 -0
- package/lib/parts/list-box.js +120 -0
- package/lib/parts/multi-trigger.d.ts +12 -0
- package/lib/parts/multi-trigger.js +70 -0
- package/lib/parts/native-select-options-with-groups.d.ts +8 -0
- package/lib/parts/native-select-options-with-groups.js +76 -0
- package/lib/parts/popup-content.d.ts +20 -0
- package/lib/parts/popup-content.js +68 -0
- package/lib/public-api.p.css +543 -307
- package/lib/public-api.pcss +543 -307
- package/lib/select-basic.d.ts +3 -0
- package/lib/select-basic.js +204 -0
- package/lib/select-searchable.d.ts +3 -0
- package/lib/select-searchable.js +245 -0
- package/lib/select.d.ts +28 -92
- package/lib/select.js +51 -351
- package/lib/styles/common.p.module.css.js +32 -0
- package/lib/styles/form-trigger.p.module.css.js +15 -0
- package/lib/styles/list-box.p.module.css.js +16 -0
- package/lib/types.d.ts +202 -34
- package/lib/utils/calculate-max-height-by-items.d.ts +13 -0
- package/lib/utils/calculate-max-height-by-items.js +22 -0
- package/lib/utils/get-empty-message.d.ts +6 -0
- package/lib/utils/get-empty-message.js +32 -0
- package/lib/utils/get-option-value.d.ts +2 -0
- package/lib/utils/get-option-value.js +11 -0
- package/lib/utils/get-real-items-cnt.d.ts +2 -0
- package/lib/utils/get-real-items-cnt.js +19 -0
- package/lib/utils/get-text-from-nodes.d.ts +2 -0
- package/lib/utils/get-text-from-nodes.js +26 -0
- package/lib/utils/is-option-a-group.d.ts +2 -0
- package/lib/utils/is-option-a-group.js +5 -0
- package/lib/utils/item-to-string.d.ts +2 -0
- package/lib/utils/item-to-string.js +7 -0
- package/lib/utils/merge-props.d.ts +19 -0
- package/lib/utils/merge-props.js +104 -0
- package/lib/utils/throttle.d.ts +1 -0
- package/package.json +12 -12
- package/lib/key-codes.d.ts +0 -7
- package/lib/key-codes.js +0 -8
- package/lib/parts/common-select.p.module.css.js +0 -15
- package/lib/parts/form-trigger.p.module.css.js +0 -15
- package/lib/parts/multiselect.d.ts +0 -86
- package/lib/parts/multiselect.js +0 -455
- package/lib/parts/native-select.d.ts +0 -36
- package/lib/parts/native-select.js +0 -257
- package/lib/parts/native-select.p.module.css.js +0 -9
- package/lib/parts/throttle.d.ts +0 -1
- package/lib/parts/trigger.d.ts +0 -37
- package/lib/parts/trigger.js +0 -255
- package/lib/parts/trigger.p.module.css.js +0 -31
- package/lib/parts/use-backward-compatible-id.d.ts +0 -4
- package/lib/parts/use-backward-compatible-id.js +0 -14
- package/lib/parts/use-observable-force-rerender.d.ts +0 -2
- package/lib/parts/use-observable-force-rerender.js +0 -16
- package/lib/utils.d.ts +0 -22
- package/lib/utils.js +0 -201
- /package/lib/{parts → utils}/throttle.js +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Dropdown } from '@rescui/dropdown';
|
|
3
|
+
import { useActualSizeFromCss } from '../hooks/use-actual-size-from-css.js';
|
|
4
|
+
import { usePrimaryContrastCssVarTransfer } from '../hooks/use-primary-contrast-css-var-transfer.js';
|
|
5
|
+
import styles from '../styles/common.p.module.css.js';
|
|
6
|
+
import { ListBox } from './list-box.js'; // eslint-disable-next-line complexity
|
|
7
|
+
|
|
8
|
+
const PopupContent = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme,
|
|
11
|
+
listBoxState,
|
|
12
|
+
triggerRef,
|
|
13
|
+
dropdownRef,
|
|
14
|
+
listBoxItems,
|
|
15
|
+
placement,
|
|
16
|
+
size: sizeFromProps,
|
|
17
|
+
mode,
|
|
18
|
+
emptyListMessage,
|
|
19
|
+
maxVisibleItems,
|
|
20
|
+
trigger,
|
|
21
|
+
isOpen,
|
|
22
|
+
dropdownUpdateDeps = []
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
size,
|
|
26
|
+
observableRef
|
|
27
|
+
} = useActualSizeFromCss({
|
|
28
|
+
sizeFromProps,
|
|
29
|
+
triggerRef
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
isPrimaryContrast
|
|
33
|
+
} = usePrimaryContrastCssVarTransfer({
|
|
34
|
+
isOpen,
|
|
35
|
+
triggerRef
|
|
36
|
+
});
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (dropdownRef.current) {
|
|
39
|
+
dropdownRef.current.scheduleUpdate();
|
|
40
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
|
|
42
|
+
}, [listBoxItems, size, ...dropdownUpdateDeps]);
|
|
43
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
ref: observableRef,
|
|
45
|
+
className: styles.observable
|
|
46
|
+
}), /*#__PURE__*/React.createElement(Dropdown, {
|
|
47
|
+
theme: theme,
|
|
48
|
+
ref: dropdownRef,
|
|
49
|
+
placement: placement,
|
|
50
|
+
maxWidth: "trigger",
|
|
51
|
+
minWidth: "trigger",
|
|
52
|
+
leastMaxHeight: 999999,
|
|
53
|
+
isOpen: isOpen,
|
|
54
|
+
cancelCloseAnimation: true,
|
|
55
|
+
disableFocusLock: true,
|
|
56
|
+
trigger: trigger
|
|
57
|
+
}, /*#__PURE__*/React.createElement(ListBox, {
|
|
58
|
+
state: listBoxState,
|
|
59
|
+
size: size,
|
|
60
|
+
mode: mode,
|
|
61
|
+
maxVisibleItems: maxVisibleItems,
|
|
62
|
+
emptyListMessage: emptyListMessage,
|
|
63
|
+
items: listBoxItems,
|
|
64
|
+
isPrimaryContrast: isPrimaryContrast
|
|
65
|
+
})));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { PopupContent };
|