@pixum/combobox 5.11.0 → 5.12.0
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/styles.css +1 -1
- package/package.json +2 -2
- package/lib/ComboBox.test.d.ts +0 -1
- package/lib/ComboBox.test.js +0 -33
- package/lib/ComboBox.test.js.map +0 -1
package/lib/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.combobox{position:relative;width:100%}.combobox .combobox--headline[class*=text--]+*{margin-top:var(--spacing)}.combobox .combobox--header,.combobox .combobox__options,.
|
|
1
|
+
.combobox{position:relative;width:100%}.combobox .combobox--headline[class*=text--]+*{margin-top:var(--spacing)}.combobox .combobox--header,.combobox .combobox__options,.combobox__bottom-sheet .combobox__options{position:relative}.combobox__bottom-sheet .combobox--header{align-items:flex-start;height:auto;margin:var(--spacing-5) auto var(--spacing-2);padding:0 var(--spacing-2);width:100%}.combobox .combobox__options,.combobox__bottom-sheet .combobox__options{display:flex;flex-direction:column;max-height:none;overflow:scroll;width:100%}.combobox .combobox__option-wrapper,.combobox__bottom-sheet .combobox__option-wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer;-webkit-user-select:none;user-select:none}.combobox .combobox__options .combobox__sticky-header,.combobox__bottom-sheet .combobox__options .combobox__sticky-header{background-color:var(--color-surface);border-bottom:1px solid var(--color-dim);padding:var(--spacing-1_25) var(--spacing-2);position:-webkit-sticky;position:sticky;top:0}.combobox__options .text--caption{color:var(--color-on-secondary)}.combobox .combobox__options .item-header,.combobox__bottom-sheet .combobox__options .item-header{display:flex;justify-content:space-between}.combobox .combobox__options .combobox__option-details,.combobox__bottom-sheet .combobox__options .combobox__option-details{background-color:var(--color-surface);bottom:0;padding-left:var(--spacing);padding-right:var(--spacing);position:-webkit-sticky;position:sticky}.combobox .combobox--no-results-text,.combobox__bottom-sheet .combobox--no-results-text{padding:var(--spacing-2) var(--spacing);text-align:center}@media screen and (min-width:960px){.combobox .combobox__options{border-radius:12px;margin-top:var(--spacing);max-height:330px;overflow:auto;position:absolute}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixum/combobox",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"sideEffects": [
|
|
19
19
|
"*.css"
|
|
20
20
|
],
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "b473fc42391945b78f434eb8b2c61e53fe755c35"
|
|
22
22
|
}
|
package/lib/ComboBox.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/ComboBox.test.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/// <reference types="@testing-library/jest-dom" />
|
|
3
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
4
|
-
import { ComboBox } from './ComboBox';
|
|
5
|
-
// jsdom sets window.innerWidth to 0, so useIsDesktopScreenWidth returns false.
|
|
6
|
-
// When !isDesktop, showSelectField is always true — SelectInput always renders.
|
|
7
|
-
const baseProps = {
|
|
8
|
-
isOpen: false,
|
|
9
|
-
setIsOpen: jest.fn(),
|
|
10
|
-
options: [],
|
|
11
|
-
label: 'Test',
|
|
12
|
-
};
|
|
13
|
-
describe('ComboBox disabled', () => {
|
|
14
|
-
it('does not fire onClick when disabled', () => {
|
|
15
|
-
const onClick = jest.fn();
|
|
16
|
-
const { container } = render(_jsx(ComboBox, Object.assign({}, baseProps, { disabled: true, onClick: onClick })));
|
|
17
|
-
fireEvent.click(container.querySelector('.input-inner-container'));
|
|
18
|
-
expect(onClick).not.toHaveBeenCalled();
|
|
19
|
-
});
|
|
20
|
-
it('passes disabled to the trigger input', () => {
|
|
21
|
-
const { container } = render(_jsx(ComboBox, Object.assign({}, baseProps, { disabled: true, value: "some option" })));
|
|
22
|
-
expect(container.querySelector('input')).toBeDisabled();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe('ComboBox enabled', () => {
|
|
26
|
-
it('fires onClick when not disabled', () => {
|
|
27
|
-
const onClick = jest.fn();
|
|
28
|
-
const { container } = render(_jsx(ComboBox, Object.assign({}, baseProps, { onClick: onClick })));
|
|
29
|
-
fireEvent.click(container.querySelector('.input-inner-container'));
|
|
30
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=ComboBox.test.js.map
|
package/lib/ComboBox.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.test.js","sourceRoot":"","sources":["../src/ComboBox.test.tsx"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,+EAA+E;AAC/E,gFAAgF;AAEhF,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;IACpB,OAAO,EAAE,EAA+B;IACxC,KAAK,EAAE,MAAM;CACd,CAAA;AAED,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;QACzB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,QAAQ,oBAAK,SAAS,IAAE,QAAQ,QAAC,OAAO,EAAE,OAAO,IAAI,CACvD,CAAA;QACD,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,wBAAwB,CAAE,CAAC,CA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