@nestio/pam 2.0.9 → 2.0.10-beta.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/.buildkite/docker-compose-ci.yml +1 -1
- package/.buildkite/pipeline.yaml +12 -0
- package/.buildkite/security/configs/trivy-main-scan.yaml +25 -0
- package/.buildkite/security/envs/env.conf +25 -0
- package/.buildkite/security/securitychecks.sh +18 -0
- package/.buildkite/steps/scan-repo.sh +4 -0
- package/.buildkite/{test.sh → steps/test.sh} +1 -1
- package/.github/workflows/publish.yaml +69 -0
- package/.nvmrc +1 -1
- package/.zed/settings.json +10 -0
- package/README.md +28 -5
- package/lib/components/AsyncSelect.js +13 -12
- package/lib/components/CalendarInput.js +10 -7
- package/lib/components/CalendarRangeSelectMenu.js +1 -1
- package/lib/components/CalendarSelect.js +6 -11
- package/lib/components/MultiSelect.js +8 -7
- package/lib/components/MultiSelectOption.js +7 -9
- package/lib/components/MultiSelectValue.js +18 -8
- package/lib/components/PriceSelect.js +26 -20
- package/lib/components/SingleSelect.js +15 -12
- package/lib/components/SingleSelectOption.js +7 -9
- package/lib/components/SingleSelectValue.js +16 -5
- package/lib/components/TabbedSelect.js +18 -16
- package/lib/components/TagBox.js +1 -1
- package/lib/components/TagBoxMenuSelect.js +8 -7
- package/lib/components/TagBoxValueSelect.js +8 -7
- package/package.json +6 -3
- package/src/components/AsyncSelect.jsx +11 -11
- package/src/components/CalendarInput.jsx +13 -11
- package/src/components/CalendarRangeSelectMenu.jsx +1 -1
- package/src/components/CalendarSelect.jsx +4 -8
- package/src/components/MultiSelect.jsx +8 -8
- package/src/components/MultiSelectOption.jsx +13 -12
- package/src/components/MultiSelectValue.jsx +10 -8
- package/src/components/PriceSelect.jsx +25 -24
- package/src/components/SingleSelect.jsx +13 -13
- package/src/components/SingleSelectOption.jsx +7 -13
- package/src/components/SingleSelectValue.jsx +7 -6
- package/src/components/TabbedSelect.jsx +10 -10
- package/src/components/TagBox.jsx +1 -1
- package/src/components/TagBoxMenuSelect.jsx +8 -8
- package/src/components/TagBoxValueSelect.jsx +9 -8
- package/.buildkite/pipeline.yml +0 -5
- package/jest_0/haste-map-7e9d9c62c6a662023c5d70c339d0ced6-7cc69482edc7eb47bffb62d943e851b2 +0 -1
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/06/CalendarSelectMenu_0679a734fd26e8140710c91a2af73fdc +0 -67
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/0a/MultiSelect.spec_0aefd16b0f09b26294e82fb93fe1e4b0 +0 -56
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/0e/CalendarRangeSelectValueAdapter_0e2460820b4c7f3bc73311146b33d735 +0 -38
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/10/styleMock_1054df670b2b25a407717710ad14248e +0 -2
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/17/BaseValueAdapter_17511db398391484fe4506f5fb9bd5e1 +0 -34
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/1b/SingleSelectInputValue_1b0040997a8e46813a394be3df8d4902 +0 -21
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/1e/SingleSelectOption.spec_1e96cdf77f96dbcb3c3e99ccf1e6162e +0 -48
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/21/SingleSelectValue_21803244102691ca5021420840c10377 +0 -14
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/23/Collapse_233c7ec28f5b68acaeb91eb3fe6ab4a8 +0 -29
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/23/TabbedSelect.spec_23d563a9f085b056db12caf92bdf3a6b +0 -132
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/26/BasicMenu.spec_267a046ea90c9e11ba1060c8d4296399 +0 -41
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/28/comparators_28f44e6dd602b9cf338ddf679330692a +0 -15
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/2a/TagBox.spec_2aab3c34fb4bedfb663e01ed8860b92d +0 -125
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/2c/MultiSelectOption.spec_2ce3fc75e1b935ca998f2de22a5fa1e2 +0 -100
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/30/BadgeValue_3086cf0362fc10cf60860d93d22c44e0 +0 -54
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/32/TagBoxValue_320444b52aab3fde04dd463ac15d98fe +0 -36
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/35/CalendarInput.spec_354c6add6b94157fdd3a7285d6095b54 +0 -149
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/36/CalendarRangeSelectValueAdapter.spec_3626d6dbf2a83120d5a5d862e175d843 +0 -59
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/38/SelectOption.spec_3840fafef6784d17cf7e40b17ecce88e +0 -96
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/45/TabbedMenu.spec_45955bd4d417a673c51fb3a53eaabdb2 +0 -259
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/4d/BaseValueAdapter.spec_4d1d47358891a347e7bf833a6d040ea7 +0 -30
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/4d/SelectValue.spec_4d42c95a61ecede772952464d21833e7 +0 -106
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/4d/TagBoxMenu_4d2e828a6ff7c4a9a4cc2198963a9b70 +0 -34
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/4e/CalendarInput_4ef2298695da3980204ea452b7fdb0a4 +0 -160
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/56/Collapse.spec_560240621f26d92bd3369c0d14e933f0 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/5a/MultiSelectValueAdapter.spec_5a0adb43772ad6bb7389179241874a84 +0 -104
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/5f/InputValue_5fa5b4c2a24f25c31f10553db3eca2a7 +0 -102
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/61/PriceMenu.spec_614afe08ff89b9d73123f4f3fb02a1e5 +0 -214
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/64/InputValueMenu_647f6d09be204b353c37fb7f7ae83528 +0 -30
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/65/CalendarRangeSelect_65dfcee5434a980da3608f757e45331d +0 -91
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/66/CalendarRangeSelect.spec_66a914f5794d15aee1f09b02b6196f3b +0 -93
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/68/CalendarRangeSelectMenu_68b72bc98b1ca2af1002082e02937a3a +0 -94
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/6d/MenuContainer_6d38ef91176713e8764a565c842288be +0 -20
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/74/MenuContainer.spec_743a8c2e8e0fa76429d3bd6f978bd662 +0 -14
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/75/PriceMenu_75405250d3e4f5e03f03595b38367c74 +0 -169
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/78/SingleSelectValueAdapter.spec_78efc1145a6c7b878b73046dd6c377e3 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/7a/MomentValueAdapter.spec_7a902fadac5ab558e9eab31c2efe7e62 +0 -34
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/7d/constants_7d77953ab3aab9177392ca1253527944 +0 -2
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/80/CalendarSelectMenu.spec_802d520df5723c56c5a8c3324b7481da +0 -30
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/83/setupShims_83b5988778590bd57241b8324efa72ca +0 -1
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/86/BadgeValue.spec_8672a63efcfee7da91fa15ba5a35cd01 +0 -68
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/86/PriceSelect.spec_8673730442271be421a9829646d05ce2 +0 -119
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8a/LoadingIcon_8a35f5a59768201d2879ace3aa9523a7 +0 -10
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8a/enhanceWithInputEl.spec_8a7b3d4d0425819c272ab4059e697379 +0 -95
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8b/KeyInterceptingInput.spec_8b687c9b90b903499eaf8f91d9f994b3 +0 -63
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8e/AsyncSelect_8ea6fa986adeff02b70d417e1a15218c +0 -134
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8e/keys_8e4410378373c7787da90cac9d9d60af +0 -21
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8f/PropTypes_8f855737e91f1a2770253b10397ac8ee +0 -10
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/8f/SelectValue_8ff517c39801f6615c73b22975b6447a +0 -119
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/91/SingleSelect_91b44d0827c7f15e26bc4e887823c206 +0 -83
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/93/setupEnzyme_933f67f8c39c258b9d2335cbe4e95364 +0 -4
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/97/PriceSelect_979c59a0e85681717c67156c65f9f809 +0 -109
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/98/BasicMinLengthComponent_98bb21df3528956f5cbb019301e14b94 +0 -15
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/9b/AsyncSelect.spec_9baf86a23020df3259e4fb6df8431f1d +0 -51
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/9c/TagBoxMenu.spec_9cb3bee05b20c81208feb0572bf2bd04 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/9e/TabbedSelect_9e04df7b8be41cc32cc8c50f7f5b7a48 +0 -58
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/a9/InputValueMenu.spec_a9acf02a3913b35fe24e9d3bae4089e5 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/a9/SingleSelectValueAdapter_a9bc352946e0fe578ce65f0c505bda44 +0 -41
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/ae/TagBoxValue.spec_ae6486a049d279c74e941ea760764a14 +0 -34
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/af/MultiSelectValueAdapter_af678a8270b3e04d8f158e8ac9505ca7 +0 -68
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/b0/InputValue.spec_b073e3e2e5dbce98021066a66b122b2c +0 -60
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/b5/OptionsList_b52e9f2995c75ea418697ae4f06db4f5 +0 -45
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/bc/SingleSelectOption_bcf8a7eb60900c59cc157ac55fcfb723 +0 -38
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/c0/MultiSelect_c0cfb2897119c1114c5fd6f7fd7d2e62 +0 -67
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/c4/MomentValueAdapter_c4c276e31cbde7d1dc1dc1d77a594c55 +0 -20
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/c5/StaticOption_c5f2d27b6d481b908294b6f5e0592fc2 +0 -19
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/ce/BadgeMultiSelect.spec_cec7790f84a802fb2c18c54b9a4a921a +0 -54
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/cf/OptionListSet.spec_cfb367e294a0aae3bb664eef88eb623d +0 -228
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/d3/KeyInterceptingInput_d3d304879a1492b66561fce4c7416045 +0 -82
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/d5/BasicEmptyOptionComponent_d58e7bb15fc2c2e13e6a757d28b199ac +0 -9
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/d5/SelectCore.spec_d5e3246996684e4fba29e3631f8aefac +0 -607
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/d6/BadgeMultiSelect_d6bd228b127952f6048b92c9abd3b57b +0 -53
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/de/BasicMenu_de0cecbf6799211a8fe532411d3cc873 +0 -30
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/e0/SelectOption_e0dc8f19358a9abd1be87aa601087b01 +0 -94
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/e4/TabbedMenu_e43d45a4f7ac8251d7ef028ada2db057 +0 -179
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/e6/enzyme-utils_e690f31d3397a9c58160a842e4841fc6 +0 -28
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/ee/MultiSelectValue_eed682d3f60fcaefe5dfb72897e40bc7 +0 -15
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f2/SingleSelect.spec_f2793726a47820587f4b6f4150a1b24a +0 -61
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f3/OptionListSet_f3b8e87c2a3458f2b438026d738fc523 +0 -283
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f3/SingleSelectBadgeValue_f3e3c5ab7337817ca6db6d4fcb5121f8 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f5/SelectCore_f567e49d18b5a7ff59d0ff5fe63a70e3 +0 -813
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f6/MultiSelectOption_f608cb6868889a67fc5dac232a6b8ec7 +0 -62
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/f9/enhanceWithInputEl_f9a5a0417082d5840b0e596275f4ee20 +0 -68
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/fa/OptionsList.spec_fa9ff971f8b2b9c2677afe983a25ee14 +0 -26
- package/jest_0/jest-transform-cache-7e9d9c62c6a662023c5d70c339d0ced6-cdaa23008ea48aa7daacfe6b1614ac51/fa/TagBox_fa0d3141352322432b32d7aa9686e96e +0 -151
- package/jest_0/perf-cache-7e9d9c62c6a662023c5d70c339d0ced6-1f0ac540392d6926145e8e0c6fdddd0b +0 -1
|
@@ -38,14 +38,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
38
38
|
function SingleSelectOption(props) {
|
|
39
39
|
var isSelected = props.isSelected,
|
|
40
40
|
isHighlighted = props.isHighlighted,
|
|
41
|
-
option = props.option
|
|
41
|
+
option = props.option,
|
|
42
|
+
_props$renderOptionLa = props.renderOptionLabel,
|
|
43
|
+
renderOptionLabel = _props$renderOptionLa === undefined ? function (o) {
|
|
44
|
+
return o.label;
|
|
45
|
+
} : _props$renderOptionLa;
|
|
42
46
|
|
|
43
|
-
var label =
|
|
47
|
+
var label = renderOptionLabel(props.option);
|
|
44
48
|
var optionClass = (0, _classnames5.default)(_SingleSelectOption2.default.option, _defineProperty({}, _SingleSelectOption2.default.selected, isSelected), _defineProperty({}, _SingleSelectOption2.default.disabled, option.disabled), _defineProperty({}, _SingleSelectOption2.default.highlighted, isHighlighted));
|
|
45
49
|
|
|
46
50
|
return _react2.default.createElement(
|
|
47
51
|
_SelectOption2.default,
|
|
48
|
-
_extends({ className: optionClass }, props),
|
|
52
|
+
_extends({ className: optionClass }, props, { renderOptionLabel: renderOptionLabel }),
|
|
49
53
|
_react2.default.createElement(
|
|
50
54
|
'span',
|
|
51
55
|
{ className: _SingleSelectOption2.default.label },
|
|
@@ -59,10 +63,4 @@ SingleSelectOption.propTypes = {
|
|
|
59
63
|
isHighlighted: _propTypes2.default.bool.isRequired,
|
|
60
64
|
isSelected: _propTypes2.default.bool.isRequired,
|
|
61
65
|
renderOptionLabel: _propTypes2.default.func
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
SingleSelectOption.defaultProps = {
|
|
65
|
-
renderOptionLabel: function renderOptionLabel(option) {
|
|
66
|
-
return option.label;
|
|
67
|
-
}
|
|
68
66
|
};
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
|
|
7
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
|
+
|
|
6
9
|
exports.default = SingleSelectValue;
|
|
7
10
|
|
|
8
11
|
var _react = require('react');
|
|
@@ -13,17 +16,25 @@ var _SelectValue = require('./SelectValue');
|
|
|
13
16
|
|
|
14
17
|
var _SelectValue2 = _interopRequireDefault(_SelectValue);
|
|
15
18
|
|
|
19
|
+
var _propTypes = require('prop-types');
|
|
20
|
+
|
|
21
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
22
|
+
|
|
16
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
24
|
|
|
18
25
|
/**
|
|
19
26
|
ValueComponent for Single Selects
|
|
20
27
|
*/
|
|
21
28
|
function SingleSelectValue(props) {
|
|
22
|
-
|
|
29
|
+
var _props$renderValueLab = props.renderValueLabel,
|
|
30
|
+
renderValueLabel = _props$renderValueLab === undefined ? function (currentValue) {
|
|
31
|
+
return currentValue ? currentValue.label : 'Select one';
|
|
32
|
+
} : _props$renderValueLab;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
return _react2.default.createElement(_SelectValue2.default, _extends({}, props, { renderValueLabel: renderValueLabel }));
|
|
23
36
|
}
|
|
24
37
|
|
|
25
|
-
SingleSelectValue.
|
|
26
|
-
renderValueLabel:
|
|
27
|
-
return currentValue ? currentValue.label : 'Select one';
|
|
28
|
-
}
|
|
38
|
+
SingleSelectValue.propTypes = {
|
|
39
|
+
renderValueLabel: _propTypes2.default.func
|
|
29
40
|
};
|
|
@@ -37,12 +37,26 @@ var valueAdapter = new _MultiSelectValueAdapter2.default();
|
|
|
37
37
|
* Select with options divided into multiple tabs
|
|
38
38
|
*/
|
|
39
39
|
function TabbedSelect(props) {
|
|
40
|
-
var
|
|
41
|
-
|
|
40
|
+
var _props$getTabbedOptio = props.getTabbedOptions,
|
|
41
|
+
getTabbedOptions = _props$getTabbedOptio === undefined ? function (options) {
|
|
42
|
+
return options;
|
|
43
|
+
} : _props$getTabbedOptio,
|
|
44
|
+
_props$ValueComponent = props.ValueComponent,
|
|
45
|
+
ValueComponent = _props$ValueComponent === undefined ? _BadgeValue2.default : _props$ValueComponent,
|
|
46
|
+
_props$getOptions = props.getOptions,
|
|
47
|
+
getOptions = _props$getOptions === undefined ? function (options) {
|
|
48
|
+
return options.reduce(function (acc, cur) {
|
|
49
|
+
return acc.concat(cur.choices);
|
|
50
|
+
}, []);
|
|
51
|
+
} : _props$getOptions;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var options = getOptions(props.options);
|
|
55
|
+
var tabbedOptions = getTabbedOptions(props.options);
|
|
42
56
|
|
|
43
57
|
return _react2.default.createElement(_SelectCore2.default, {
|
|
44
58
|
MenuComponent: _TabbedMenu2.default,
|
|
45
|
-
ValueComponent:
|
|
59
|
+
ValueComponent: ValueComponent,
|
|
46
60
|
ariaLabel: props.ariaLabel,
|
|
47
61
|
multiple: true,
|
|
48
62
|
closeOnSelect: false,
|
|
@@ -73,16 +87,4 @@ TabbedSelect.propTypes = {
|
|
|
73
87
|
id: _propTypes2.default.string
|
|
74
88
|
};
|
|
75
89
|
|
|
76
|
-
// Tabs -> {name: '', choices: [{label, value}]}
|
|
77
|
-
|
|
78
|
-
TabbedSelect.defaultProps = {
|
|
79
|
-
getTabbedOptions: function getTabbedOptions(options) {
|
|
80
|
-
return options;
|
|
81
|
-
},
|
|
82
|
-
ValueComponent: _BadgeValue2.default,
|
|
83
|
-
getOptions: function getOptions(options) {
|
|
84
|
-
return options.reduce(function (acc, cur) {
|
|
85
|
-
return acc.concat(cur.choices);
|
|
86
|
-
}, []);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
90
|
+
// Tabs -> {name: '', choices: [{label, value}]}
|
package/lib/components/TagBox.js
CHANGED
|
@@ -40,7 +40,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Base uncontrolled component for rendering tags, representing selected values, along with conditionally showing
|
|
43
|
-
* an input that can be used to
|
|
43
|
+
* an input that can be used to manipulate the currentText of a higher component.
|
|
44
44
|
*/
|
|
45
45
|
var TagBox = function (_Component) {
|
|
46
46
|
_inherits(TagBox, _Component);
|
|
@@ -41,6 +41,12 @@ var valueAdapter = new _MultiSelectValueAdapter2.default();
|
|
|
41
41
|
* Renders a select with a BadgeValue and a TagBoxMenu for use in Nestio-style search forms
|
|
42
42
|
*/
|
|
43
43
|
function TagBoxMenuSelect(props) {
|
|
44
|
+
var _props$filterable = props.filterable,
|
|
45
|
+
filterable = _props$filterable === undefined ? true : _props$filterable,
|
|
46
|
+
_props$ValueComponent = props.ValueComponent,
|
|
47
|
+
ValueComponent = _props$ValueComponent === undefined ? _BadgeValue2.default : _props$ValueComponent;
|
|
48
|
+
|
|
49
|
+
|
|
44
50
|
return _react2.default.createElement(_SelectCore2.default, {
|
|
45
51
|
MenuComponent: _TagBoxMenu2.default,
|
|
46
52
|
OptionComponent: _MultiSelectOption2.default,
|
|
@@ -50,7 +56,7 @@ function TagBoxMenuSelect(props) {
|
|
|
50
56
|
|
|
51
57
|
ariaLabel: props.ariaLabel,
|
|
52
58
|
collapsibleOptions: props.collapsibleOptions,
|
|
53
|
-
filterable:
|
|
59
|
+
filterable: filterable,
|
|
54
60
|
disabled: props.disabled,
|
|
55
61
|
onChange: props.onChange,
|
|
56
62
|
onOpen: props.onOpen,
|
|
@@ -59,7 +65,7 @@ function TagBoxMenuSelect(props) {
|
|
|
59
65
|
renderValueLabel: props.renderValueLabel,
|
|
60
66
|
renderOptionLabel: props.renderOptionLabel,
|
|
61
67
|
value: props.value,
|
|
62
|
-
ValueComponent:
|
|
68
|
+
ValueComponent: ValueComponent,
|
|
63
69
|
valueLabel: props.valueLabel || 'Choices',
|
|
64
70
|
id: props.id
|
|
65
71
|
});
|
|
@@ -80,9 +86,4 @@ TagBoxMenuSelect.propTypes = {
|
|
|
80
86
|
valueLabel: _propTypes2.default.string,
|
|
81
87
|
ValueComponent: _propTypes2.default.func.isRequired,
|
|
82
88
|
id: _propTypes2.default.string
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
TagBoxMenuSelect.defaultProps = {
|
|
86
|
-
filterable: true,
|
|
87
|
-
ValueComponent: _BadgeValue2.default
|
|
88
89
|
};
|
|
@@ -41,6 +41,12 @@ var valueAdapter = new _MultiSelectValueAdapter2.default();
|
|
|
41
41
|
* Renders a multiselect with a TagBoxValue
|
|
42
42
|
*/
|
|
43
43
|
function TagBoxValueSelect(props) {
|
|
44
|
+
var _props$filterable = props.filterable,
|
|
45
|
+
filterable = _props$filterable === undefined ? true : _props$filterable,
|
|
46
|
+
_props$placeholder = props.placeholder,
|
|
47
|
+
placeholder = _props$placeholder === undefined ? 'Choices' : _props$placeholder;
|
|
48
|
+
|
|
49
|
+
|
|
44
50
|
return _react2.default.createElement(_SelectCore2.default, {
|
|
45
51
|
ariaLabel: props.ariaLabel,
|
|
46
52
|
closeOnSelect: false,
|
|
@@ -51,8 +57,8 @@ function TagBoxValueSelect(props) {
|
|
|
51
57
|
valueAdapter: valueAdapter,
|
|
52
58
|
|
|
53
59
|
alwaysOpen: props.alwaysOpen,
|
|
54
|
-
placeholder:
|
|
55
|
-
filterable:
|
|
60
|
+
placeholder: placeholder,
|
|
61
|
+
filterable: filterable,
|
|
56
62
|
value: props.value,
|
|
57
63
|
menuContainerClassName: props.menuContainerClassName,
|
|
58
64
|
menuContainerText: props.menuContainerText,
|
|
@@ -86,9 +92,4 @@ TagBoxValueSelect.propTypes = {
|
|
|
86
92
|
menuContainerTextClassName: _propTypes2.default.string,
|
|
87
93
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
88
94
|
id: _propTypes2.default.string
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
TagBoxValueSelect.defaultProps = {
|
|
92
|
-
filterable: true,
|
|
93
|
-
placeholder: 'Choices'
|
|
94
95
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestio/pam",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10-beta.1",
|
|
4
4
|
"description": "Nestio UI modules",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"file-loader": "^0.11.2",
|
|
61
61
|
"identity-obj-proxy": "^3.0.0",
|
|
62
62
|
"jest": "^20.0.4",
|
|
63
|
-
"node-sass": "^4.14.1",
|
|
64
63
|
"null-loader": "^0.1.1",
|
|
65
64
|
"raf": "^3.4.0",
|
|
66
65
|
"react": "^16.2.0",
|
|
67
66
|
"react-dom": "^16.2.0",
|
|
68
67
|
"react-router-dom": "^4.1.2",
|
|
69
|
-
"sass
|
|
68
|
+
"sass": "^1.99.0",
|
|
69
|
+
"sass-loader": "^7.3.1",
|
|
70
70
|
"sinon": "^1.17.4",
|
|
71
71
|
"style-loader": "^0.13.2",
|
|
72
72
|
"tap-webpack-plugin": "^1.1.0",
|
|
@@ -92,5 +92,8 @@
|
|
|
92
92
|
"<rootDir>/test/setupShims.js",
|
|
93
93
|
"<rootDir>/test/setupEnzyme.js"
|
|
94
94
|
]
|
|
95
|
+
},
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=24 <25"
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -17,9 +17,9 @@ import SingleSelectValueAdapter from '../adapters/SingleSelectValueAdapter';
|
|
|
17
17
|
import MultiSelectValueAdapter from '../adapters/MultiSelectValueAdapter';
|
|
18
18
|
|
|
19
19
|
/*
|
|
20
|
-
Wrapper around SelectCore which
|
|
20
|
+
Wrapper around SelectCore which bundles various Async components. Can be used to render both single and multiple selects, along with normal and "search form"-styled selects.
|
|
21
21
|
*/
|
|
22
|
-
export default function AsyncSelect
|
|
22
|
+
export default function AsyncSelect(props) {
|
|
23
23
|
const components = {};
|
|
24
24
|
let valueAdapter;
|
|
25
25
|
|
|
@@ -66,6 +66,11 @@ export default function AsyncSelect (props) {
|
|
|
66
66
|
closeOnSelect = props.multiple ? false : true;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
const {
|
|
70
|
+
label = 'Search...',
|
|
71
|
+
filterOption = () => true
|
|
72
|
+
} = props;
|
|
73
|
+
|
|
69
74
|
return (
|
|
70
75
|
<SelectCore
|
|
71
76
|
{...components}
|
|
@@ -74,10 +79,10 @@ export default function AsyncSelect (props) {
|
|
|
74
79
|
valueAdapter={valueAdapter}
|
|
75
80
|
|
|
76
81
|
ariaLabel={props.ariaLabel}
|
|
77
|
-
valueLabel={
|
|
82
|
+
valueLabel={label}
|
|
78
83
|
disabled={props.disabled}
|
|
79
|
-
filterOption={
|
|
80
|
-
label={
|
|
84
|
+
filterOption={filterOption}
|
|
85
|
+
label={label}
|
|
81
86
|
loadOptions={props.loadOptions}
|
|
82
87
|
loadFromValue={props.loadFromValue}
|
|
83
88
|
minLength={props.minLength}
|
|
@@ -87,7 +92,7 @@ export default function AsyncSelect (props) {
|
|
|
87
92
|
onOpen={props.onOpen}
|
|
88
93
|
options={props.options}
|
|
89
94
|
optionSets={props.optionSets}
|
|
90
|
-
placeholder={
|
|
95
|
+
placeholder={label}
|
|
91
96
|
processLoadFromValue={props.processLoadFromValue}
|
|
92
97
|
processLoadOptions={props.processLoadOptions}
|
|
93
98
|
renderValueLabel={props.renderValueLabel}
|
|
@@ -98,11 +103,6 @@ export default function AsyncSelect (props) {
|
|
|
98
103
|
);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
|
-
AsyncSelect.defaultProps = {
|
|
102
|
-
label: 'Search',
|
|
103
|
-
filterOption: () => true
|
|
104
|
-
};
|
|
105
|
-
|
|
106
106
|
AsyncSelect.propTypes = {
|
|
107
107
|
/* Unique Props */
|
|
108
108
|
/**
|
|
@@ -16,13 +16,19 @@ const valueAdapter = new BaseValueAdapter();
|
|
|
16
16
|
Select designed for choosing a single date
|
|
17
17
|
*/
|
|
18
18
|
export const CalendarInput = (props) => {
|
|
19
|
-
const
|
|
19
|
+
const {
|
|
20
|
+
format = DEFAULT_DISPLAY_FORMAT,
|
|
21
|
+
defaultValue = moment(new Date()).format(DEFAULT_DISPLAY_FORMAT),
|
|
22
|
+
} = props;
|
|
23
|
+
const restProps = omit(props, ['valueLabel', 'format', 'defaultValue']);
|
|
20
24
|
|
|
21
25
|
return (
|
|
22
26
|
<SelectCore
|
|
23
27
|
MenuComponent={CalendarSelectMenuWrap}
|
|
24
28
|
ValueComponent={InputWrap}
|
|
25
29
|
valueAdapter={valueAdapter}
|
|
30
|
+
format={format}
|
|
31
|
+
defaultValue={defaultValue}
|
|
26
32
|
{...restProps}
|
|
27
33
|
id={props.id}
|
|
28
34
|
/>
|
|
@@ -31,10 +37,10 @@ export const CalendarInput = (props) => {
|
|
|
31
37
|
|
|
32
38
|
export class CalendarSelectMenuWrap extends PureComponent {
|
|
33
39
|
constructor(props) {
|
|
34
|
-
|
|
40
|
+
super(props);
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
this.changeValue = this.changeValue.bind(this);
|
|
43
|
+
this.parseDate = this.parseDate.bind(this);
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
parseDate() {
|
|
@@ -52,7 +58,7 @@ export class CalendarSelectMenuWrap extends PureComponent {
|
|
|
52
58
|
|
|
53
59
|
return (
|
|
54
60
|
<CalendarSelectMenu
|
|
55
|
-
{
|
|
61
|
+
{...this.props}
|
|
56
62
|
currentValue={this.parseDate()}
|
|
57
63
|
defaultValue={defaultValue}
|
|
58
64
|
changeValue={this.changeValue}
|
|
@@ -104,7 +110,7 @@ export class InputWrap extends PureComponent {
|
|
|
104
110
|
render() {
|
|
105
111
|
return (
|
|
106
112
|
<InputValue
|
|
107
|
-
{
|
|
113
|
+
{...this.props}
|
|
108
114
|
currentText={!this.props.currentValue ? this.props.defaultValue : this.props.currentValue}
|
|
109
115
|
changeText={this.changeText}
|
|
110
116
|
/>
|
|
@@ -141,6 +147,7 @@ CalendarInput.propTypes = {
|
|
|
141
147
|
Initial value
|
|
142
148
|
*/
|
|
143
149
|
value: PropTypes.string,
|
|
150
|
+
defaultValue: PropTypes.string,
|
|
144
151
|
/**
|
|
145
152
|
Label displayed if no value is selected
|
|
146
153
|
*/
|
|
@@ -152,9 +159,4 @@ CalendarInput.propTypes = {
|
|
|
152
159
|
id: PropTypes.string,
|
|
153
160
|
};
|
|
154
161
|
|
|
155
|
-
CalendarInput.defaultProps = {
|
|
156
|
-
format: DEFAULT_DISPLAY_FORMAT,
|
|
157
|
-
defaultValue: moment(new Date()).format(DEFAULT_DISPLAY_FORMAT)
|
|
158
|
-
};
|
|
159
|
-
|
|
160
162
|
export default CalendarInput;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import omit from 'lodash/omit';
|
|
4
3
|
|
|
5
4
|
import CalendarSelectMenu from './CalendarSelectMenu';
|
|
6
5
|
import MomentValueAdapter from '../adapters/MomentValueAdapter';
|
|
@@ -10,7 +9,7 @@ import { validMomentObject } from '../utils/PropTypes';
|
|
|
10
9
|
|
|
11
10
|
const DEFAULT_DISPLAY_FORMAT = 'M/D/YYYY';
|
|
12
11
|
|
|
13
|
-
const renderValueLabel = (format=DEFAULT_DISPLAY_FORMAT, valueLabel='Select Date') => momentValue => {
|
|
12
|
+
const renderValueLabel = (format = DEFAULT_DISPLAY_FORMAT, valueLabel = 'Select Date') => momentValue => {
|
|
14
13
|
return momentValue ? momentValue.format(format) : valueLabel;
|
|
15
14
|
};
|
|
16
15
|
|
|
@@ -19,8 +18,8 @@ const valueAdapter = new MomentValueAdapter();
|
|
|
19
18
|
/**
|
|
20
19
|
Select designed for choosing a single date
|
|
21
20
|
*/
|
|
22
|
-
export default function CalendarSelect
|
|
23
|
-
const { format, valueLabel, value } = props;
|
|
21
|
+
export default function CalendarSelect(props) {
|
|
22
|
+
const { format, valueLabel, value, ValueComponent = SingleSelectValue } = props;
|
|
24
23
|
const restProps = omit(props, 'format', 'value');
|
|
25
24
|
|
|
26
25
|
return (
|
|
@@ -29,6 +28,7 @@ export default function CalendarSelect (props) {
|
|
|
29
28
|
renderValueLabel={renderValueLabel(format, valueLabel)}
|
|
30
29
|
value={value || null}
|
|
31
30
|
valueAdapter={valueAdapter}
|
|
31
|
+
ValueComponent={ValueComponent}
|
|
32
32
|
{...restProps}
|
|
33
33
|
id={props.id}
|
|
34
34
|
/>
|
|
@@ -51,7 +51,3 @@ CalendarSelect.propTypes = {
|
|
|
51
51
|
ValueComponent: PropTypes.func.isRequired,
|
|
52
52
|
id: PropTypes.string
|
|
53
53
|
};
|
|
54
|
-
|
|
55
|
-
CalendarSelect.defaultProps = {
|
|
56
|
-
ValueComponent: SingleSelectValue
|
|
57
|
-
};
|
|
@@ -12,13 +12,18 @@ const valueAdapter = new MultiSelectValueAdapter();
|
|
|
12
12
|
/**
|
|
13
13
|
Wrapper around SelectCore to render a MultiSelect
|
|
14
14
|
*/
|
|
15
|
-
export default function MultiSelect
|
|
15
|
+
export default function MultiSelect(props) {
|
|
16
|
+
const {
|
|
17
|
+
ValueComponent = MultiSelectValue,
|
|
18
|
+
filterable = false
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
16
21
|
return (
|
|
17
22
|
<SelectCore
|
|
18
23
|
ariaLabel={props.ariaLabel}
|
|
19
24
|
closeOnSelect={false}
|
|
20
25
|
emptyValue={[]}
|
|
21
|
-
filterable={
|
|
26
|
+
filterable={filterable}
|
|
22
27
|
MenuComponent={BasicMenu}
|
|
23
28
|
OptionComponent={MultiSelectOption}
|
|
24
29
|
menuContainerClassName={props.menuContainerClassName}
|
|
@@ -35,7 +40,7 @@ export default function MultiSelect (props){
|
|
|
35
40
|
renderValueLabel={props.renderValueLabel}
|
|
36
41
|
value={props.value}
|
|
37
42
|
valueAdapter={valueAdapter}
|
|
38
|
-
ValueComponent={
|
|
43
|
+
ValueComponent={ValueComponent}
|
|
39
44
|
collapsibleOptions={props.collapsibleOptions}
|
|
40
45
|
id={props.id}
|
|
41
46
|
/>
|
|
@@ -61,8 +66,3 @@ MultiSelect.propTypes = {
|
|
|
61
66
|
ValueComponent: PropTypes.func.isRequired,
|
|
62
67
|
id: PropTypes.string,
|
|
63
68
|
};
|
|
64
|
-
|
|
65
|
-
MultiSelect.defaultProps = {
|
|
66
|
-
ValueComponent: MultiSelectValue,
|
|
67
|
-
filterable: false
|
|
68
|
-
};
|
|
@@ -9,10 +9,17 @@ import styles from './styles/MultiSelectOption.scss';
|
|
|
9
9
|
/**
|
|
10
10
|
OptionComponent designed for use in MultiSelects
|
|
11
11
|
*/
|
|
12
|
-
export default function MultiSelectOption
|
|
13
|
-
const {
|
|
12
|
+
export default function MultiSelectOption(props) {
|
|
13
|
+
const {
|
|
14
|
+
isSelected,
|
|
15
|
+
isHighlighted,
|
|
16
|
+
option,
|
|
17
|
+
currentText,
|
|
18
|
+
collapsibleOptions,
|
|
19
|
+
renderOptionLabel = (o) => o.label
|
|
20
|
+
} = props;
|
|
14
21
|
|
|
15
|
-
function _getCollapsibleClassName(){
|
|
22
|
+
function _getCollapsibleClassName() {
|
|
16
23
|
if (currentText) {
|
|
17
24
|
return null;
|
|
18
25
|
}
|
|
@@ -33,11 +40,11 @@ export default function MultiSelectOption (props) {
|
|
|
33
40
|
_getCollapsibleClassName()
|
|
34
41
|
);
|
|
35
42
|
|
|
36
|
-
const checkboxClass = classnames({[styles.checked]: isSelected}, {[styles.unchecked]: !isSelected});
|
|
37
|
-
const label =
|
|
43
|
+
const checkboxClass = classnames({ [styles.checked]: isSelected }, { [styles.unchecked]: !isSelected });
|
|
44
|
+
const label = renderOptionLabel(props.option);
|
|
38
45
|
|
|
39
46
|
return (
|
|
40
|
-
<SelectOption className={optionClass} {...props} >
|
|
47
|
+
<SelectOption className={optionClass} {...props} renderOptionLabel={renderOptionLabel}>
|
|
41
48
|
<span className={styles.checkbox}>
|
|
42
49
|
<i className={checkboxClass} />
|
|
43
50
|
</span>
|
|
@@ -55,9 +62,3 @@ MultiSelectOption.propTypes = {
|
|
|
55
62
|
collapsibleOptions: PropTypes.array,
|
|
56
63
|
currentText: PropTypes.string
|
|
57
64
|
};
|
|
58
|
-
|
|
59
|
-
MultiSelectOption.defaultProps = {
|
|
60
|
-
renderOptionLabel: function(option) {
|
|
61
|
-
return option.label;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import SelectValue from './SelectValue';
|
|
4
|
-
|
|
5
|
-
export default function MultiSelectValue(props){
|
|
6
|
-
return <SelectValue {...props} />;
|
|
7
|
-
}
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
ValueComponent designed for use in MultiSelects
|
|
11
8
|
*/
|
|
12
|
-
MultiSelectValue
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
export default function MultiSelectValue(props) {
|
|
10
|
+
const {
|
|
11
|
+
renderValueLabel = (v) => v.length ? `${v.length} selected` : 'Select options'
|
|
12
|
+
} = props;
|
|
13
|
+
return <SelectValue {...props} renderValueLabel={renderValueLabel} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
MultiSelectValue.propTypes = {
|
|
17
|
+
renderValueLabel: PropTypes.func,
|
|
16
18
|
};
|
|
@@ -11,7 +11,7 @@ export const DEFAULT_PRICE_MAX_GRADATIONS = [1000, 1500, 1750, 2000, 2250, 2500,
|
|
|
11
11
|
|
|
12
12
|
export const createRenderValueLabelFunction = (valueLabel, minKey, maxKey) => {
|
|
13
13
|
return (currentValue) => {
|
|
14
|
-
if (currentValue.hasOwnProperty(minKey) && currentValue.hasOwnProperty(maxKey)){
|
|
14
|
+
if (currentValue.hasOwnProperty(minKey) && currentValue.hasOwnProperty(maxKey)) {
|
|
15
15
|
return `$${currentValue[minKey].toLocaleString()} - $${currentValue[maxKey].toLocaleString()}`;
|
|
16
16
|
} else if (currentValue.hasOwnProperty(minKey)) {
|
|
17
17
|
return `$${currentValue[minKey].toLocaleString()} or more`;
|
|
@@ -23,7 +23,7 @@ export const createRenderValueLabelFunction = (valueLabel, minKey, maxKey) => {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
function sanitizeInitialValue(valObj, key){
|
|
26
|
+
function sanitizeInitialValue(valObj, key) {
|
|
27
27
|
if (valObj.hasOwnProperty(key)) {
|
|
28
28
|
const stripped = String(valObj[key]).replace(/\D/g, '');
|
|
29
29
|
if (stripped) {
|
|
@@ -36,33 +36,44 @@ function sanitizeInitialValue(valObj, key){
|
|
|
36
36
|
return valObj;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const valueAdapter = new BaseValueAdapter({emptyValue: {}});
|
|
39
|
+
const valueAdapter = new BaseValueAdapter({ emptyValue: {} });
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
Select for selecting either a minimum, maximum or range of prices
|
|
43
43
|
*/
|
|
44
|
-
export default function PriceSelect
|
|
44
|
+
export default function PriceSelect(props) {
|
|
45
|
+
const {
|
|
46
|
+
minKey = 'min',
|
|
47
|
+
maxKey = 'max',
|
|
48
|
+
priceMinGradations = DEFAULT_PRICE_MIN_GRADATIONS,
|
|
49
|
+
priceMaxGradations = DEFAULT_PRICE_MAX_GRADATIONS,
|
|
50
|
+
priceStep = 250,
|
|
51
|
+
valueLabel = 'Price',
|
|
52
|
+
ValueComponent = SingleSelectValue
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
|
|
45
56
|
const value = props.value || {};
|
|
46
|
-
sanitizeInitialValue(value,
|
|
47
|
-
sanitizeInitialValue(value,
|
|
57
|
+
sanitizeInitialValue(value, minKey);
|
|
58
|
+
sanitizeInitialValue(value, maxKey);
|
|
48
59
|
|
|
49
60
|
return (
|
|
50
61
|
<SelectCore
|
|
51
62
|
MenuComponent={PriceMenu}
|
|
52
|
-
renderValueLabel={createRenderValueLabelFunction(
|
|
63
|
+
renderValueLabel={createRenderValueLabelFunction(valueLabel, minKey, maxKey)}
|
|
53
64
|
valueAdapter={valueAdapter}
|
|
54
65
|
|
|
55
66
|
value={value}
|
|
56
|
-
valueLabel={
|
|
67
|
+
valueLabel={valueLabel}
|
|
57
68
|
onChange={props.onChange}
|
|
58
69
|
onOpen={props.onOpen}
|
|
59
70
|
onClose={props.onClose}
|
|
60
|
-
minKey={
|
|
61
|
-
maxKey={
|
|
62
|
-
priceMinGradations={
|
|
63
|
-
priceMaxGradations={
|
|
64
|
-
priceStep={
|
|
65
|
-
ValueComponent={
|
|
71
|
+
minKey={minKey}
|
|
72
|
+
maxKey={maxKey}
|
|
73
|
+
priceMinGradations={priceMinGradations}
|
|
74
|
+
priceMaxGradations={priceMaxGradations}
|
|
75
|
+
priceStep={priceStep}
|
|
76
|
+
ValueComponent={ValueComponent}
|
|
66
77
|
/>
|
|
67
78
|
);
|
|
68
79
|
}
|
|
@@ -98,13 +109,3 @@ PriceSelect.propTypes = {
|
|
|
98
109
|
ValueComponent: PropTypes.func.isRequired,
|
|
99
110
|
valueLabel: PropTypes.string
|
|
100
111
|
};
|
|
101
|
-
|
|
102
|
-
PriceSelect.defaultProps = {
|
|
103
|
-
minKey: 'min',
|
|
104
|
-
maxKey: 'max',
|
|
105
|
-
priceMinGradations: DEFAULT_PRICE_MIN_GRADATIONS,
|
|
106
|
-
priceMaxGradations: DEFAULT_PRICE_MAX_GRADATIONS,
|
|
107
|
-
priceStep: 250,
|
|
108
|
-
valueLabel: 'Price',
|
|
109
|
-
ValueComponent: SingleSelectValue
|
|
110
|
-
};
|