@ck-ui/component-library 0.2.0 → 1.0.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/dist/DropdownFooter-CYkg2g5d.js +89 -0
- package/dist/Grow-D08Iq1uH.js +794 -0
- package/dist/IconSlot-CFKmSU2_.js +33 -0
- package/dist/OptionList-DN1xZbnV.js +951 -0
- package/dist/Select-Cw96VEHD.js +6411 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/DateRangePicker-BKND6jiD.css +1 -0
- package/dist/assets/DropdownFooter-DjdPf69A.css +1 -0
- package/dist/assets/IconSlot-CLpdZgmb.css +1 -0
- package/dist/assets/ReactToastify-tlSLHgLC.css +1 -0
- package/dist/assets/{ToastContent-DpF5zCks.css → ToastContent-PGkBxPUW.css} +1 -1
- package/dist/assets/index-B81zpOpq.css +1 -0
- package/dist/assets/index-BLz-9Nuk.css +1 -0
- package/dist/assets/index-BkNXS5fR.css +1 -0
- package/dist/assets/index-BmQOtMhS.css +1 -0
- package/dist/assets/index-BoQKDmZt.css +1 -0
- package/dist/assets/index-Cdmws__2.css +1 -0
- package/dist/assets/index-CiQd_iRw.css +1 -0
- package/dist/assets/index-CtR-jzNi.css +1 -0
- package/dist/assets/index-DNhNBxL9.css +1 -0
- package/dist/assets/index-DvlnFLG-.css +1 -0
- package/dist/assets/index-PKpDB4Cl.css +1 -0
- package/dist/assets/index-YHUWVH17.css +1 -0
- package/dist/assets/index-_Kh8p9R0.css +1 -0
- package/dist/assets/index-i-aBFBOq.css +1 -0
- package/dist/assets/index-nXJu3Pq0.css +1 -0
- package/dist/assets/index-rrYSS2rl.css +1 -0
- package/dist/assets/{main-3OqLSdPm.css → main-Dv8QUU_o.css} +1 -1
- package/dist/assets/styles-BTZL03H2.css +1 -0
- package/dist/assets/styles-Be-tqCP9.css +1 -0
- package/dist/assets/styles-Bqfs9eXV.css +1 -0
- package/dist/assets/styles-CYxKrBqL.css +1 -0
- package/dist/assets/styles-CZCmGNUn.css +1 -0
- package/dist/assets/{styles-C5uYY4fL.css → styles-Chhklrps.css} +1 -1
- package/dist/assets/styles-D8sahtFb.css +1 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.js +53 -47
- package/dist/components/CKButton/_helper/ComboLayout.js +1 -1
- package/dist/components/CKButton/_helper/IconSlot.js +1 -1
- package/dist/components/CKButton/_helper/StandardLayout.js +1 -1
- package/dist/components/CKButton/_types/button.types.d.ts +2 -0
- package/dist/components/CKButton/_types/button.types.d.ts.map +1 -1
- package/dist/components/CKButton/index.d.ts.map +1 -1
- package/dist/components/CKButton/index.js +32 -30
- package/dist/components/CKCheckbox/_types/type.d.ts +4 -0
- package/dist/components/CKCheckbox/_types/type.d.ts.map +1 -1
- package/dist/components/CKCheckbox/index.d.ts +1 -1
- package/dist/components/CKCheckbox/index.d.ts.map +1 -1
- package/dist/components/CKCheckbox/index.js +40 -24
- package/dist/components/CKTag/_types/type.d.ts +1 -1
- package/dist/components/CKTag/_types/type.d.ts.map +1 -1
- package/dist/components/CKTag/index.d.ts +1 -1
- package/dist/components/CKTag/index.d.ts.map +1 -1
- package/dist/components/CKTag/index.js +33 -24
- package/dist/components/CostComparatorTable/_helpers/CostCell.d.ts +38 -0
- package/dist/components/CostComparatorTable/_helpers/CostCell.d.ts.map +1 -0
- package/dist/components/CostComparatorTable/_helpers/CostCell.js +54 -0
- package/dist/components/CostComparatorTable/_helpers/HeaderCheckbox.d.ts +14 -0
- package/dist/components/CostComparatorTable/_helpers/HeaderCheckbox.d.ts.map +1 -0
- package/dist/components/CostComparatorTable/_helpers/HeaderCheckbox.js +19 -0
- package/dist/components/CostComparatorTable/_types/costComparatorTable.types.d.ts +90 -0
- package/dist/components/CostComparatorTable/_types/costComparatorTable.types.d.ts.map +1 -0
- package/dist/components/CostComparatorTable/_types/costComparatorTable.types.js +1 -0
- package/dist/components/CostComparatorTable/_utils/costComparator.utils.d.ts +22 -0
- package/dist/components/CostComparatorTable/_utils/costComparator.utils.d.ts.map +1 -0
- package/dist/components/CostComparatorTable/_utils/costComparator.utils.js +50 -0
- package/dist/components/CostComparatorTable/index.d.ts +23 -0
- package/dist/components/CostComparatorTable/index.d.ts.map +1 -0
- package/dist/components/CostComparatorTable/index.js +185 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +5 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +6061 -0
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts +51 -0
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts.map +1 -0
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.js +1 -0
- package/dist/components/DateRangePicker/helper/util.d.ts +26 -0
- package/dist/components/DateRangePicker/helper/util.d.ts.map +1 -0
- package/dist/components/DateRangePicker/helper/util.js +54 -0
- package/dist/components/DeviationTag/index.d.ts.map +1 -1
- package/dist/components/DeviationTag/index.js +42 -29
- package/dist/components/EmptyState/index.js +7 -7
- package/dist/components/FusionChart/_config/builders.d.ts +10 -0
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -0
- package/dist/components/FusionChart/_config/builders.js +573 -0
- package/dist/components/FusionChart/_config/events.d.ts +7 -0
- package/dist/components/FusionChart/_config/events.d.ts.map +1 -0
- package/dist/components/FusionChart/_config/events.js +40 -0
- package/dist/components/FusionChart/_config/helpers.d.ts +288 -0
- package/dist/components/FusionChart/_config/helpers.d.ts.map +1 -0
- package/dist/components/FusionChart/_config/helpers.js +452 -0
- package/dist/components/FusionChart/_constant/chartTestData.d.ts +33 -0
- package/dist/components/FusionChart/_constant/chartTestData.d.ts.map +1 -0
- package/dist/components/FusionChart/_constant/chartTestData.js +460 -0
- package/dist/components/FusionChart/_constant/constants.d.ts +16 -0
- package/dist/components/FusionChart/_constant/constants.d.ts.map +1 -0
- package/dist/components/FusionChart/_constant/constants.js +18 -0
- package/dist/components/FusionChart/_helpers/doughnutHelper.d.ts +17 -0
- package/dist/components/FusionChart/_helpers/doughnutHelper.d.ts.map +1 -0
- package/dist/components/FusionChart/_helpers/doughnutHelper.js +70 -0
- package/dist/components/FusionChart/_helpers/multiAxisHelper.d.ts +8 -0
- package/dist/components/FusionChart/_helpers/multiAxisHelper.d.ts.map +1 -0
- package/dist/components/FusionChart/_helpers/multiAxisHelper.js +21 -0
- package/dist/components/FusionChart/_helpers/multiLineHelper.d.ts +8 -0
- package/dist/components/FusionChart/_helpers/multiLineHelper.d.ts.map +1 -0
- package/dist/components/FusionChart/_helpers/multiLineHelper.js +23 -0
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts +128 -0
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -0
- package/dist/components/FusionChart/_types/fusionChart.types.js +1 -0
- package/dist/components/FusionChart/_utils/chartHelpers.d.ts +45 -0
- package/dist/components/FusionChart/_utils/chartHelpers.d.ts.map +1 -0
- package/dist/components/FusionChart/_utils/chartHelpers.js +25 -0
- package/dist/components/FusionChart/index.d.ts +7 -0
- package/dist/components/FusionChart/index.d.ts.map +1 -0
- package/dist/components/FusionChart/index.js +1059 -0
- package/dist/components/GroupedMultiSelect/_helpers/DropdownFooter.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/DropdownFooter.js +20 -11
- package/dist/components/GroupedMultiSelect/_helpers/MenuItem.d.ts +4 -0
- package/dist/components/GroupedMultiSelect/_helpers/MenuItem.d.ts.map +1 -0
- package/dist/components/GroupedMultiSelect/_helpers/MenuItem.js +28 -0
- package/dist/components/GroupedMultiSelect/_helpers/MenuList.d.ts +2 -9
- package/dist/components/GroupedMultiSelect/_helpers/MenuList.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/MenuList.js +5 -14
- package/dist/components/GroupedMultiSelect/_helpers/OptionRow.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/OptionRow.js +21 -14
- package/dist/components/GroupedMultiSelect/_helpers/OptionsList.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/OptionsList.js +46 -26
- package/dist/components/GroupedMultiSelect/_helpers/SearchResult.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/SearchResult.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/SearchResult.js +20 -12
- package/dist/components/GroupedMultiSelect/_helpers/TagContent.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/TagContent.js +33 -30
- package/dist/components/GroupedMultiSelect/_helpers/TriggerButton.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_helpers/TriggerButton.js +41 -32
- package/dist/components/GroupedMultiSelect/_types/type.d.ts +23 -16
- package/dist/components/GroupedMultiSelect/_types/type.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_utils/computeApplyDisabled.d.ts +7 -0
- package/dist/components/GroupedMultiSelect/_utils/computeApplyDisabled.d.ts.map +1 -0
- package/dist/components/GroupedMultiSelect/_utils/computeApplyDisabled.js +8 -0
- package/dist/components/GroupedMultiSelect/_utils/filterSeachedGroups.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/_utils/filterSeachedGroups.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_utils/filterSeachedGroups.js +2 -2
- package/dist/components/GroupedMultiSelect/_utils/getDefaultSelected.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/_utils/getDefaultSelected.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_utils/getDefaultSelected.js +1 -1
- package/dist/components/GroupedMultiSelect/_utils/getResponsePayload.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/_utils/getResponsePayload.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/_utils/selectAllOptions.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/_utils/selectAllOptions.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/index.d.ts +1 -1
- package/dist/components/GroupedMultiSelect/index.d.ts.map +1 -1
- package/dist/components/GroupedMultiSelect/index.js +122 -112
- package/dist/components/GroupedSingleSelect/_helpers/DropdownFooter.d.ts.map +1 -1
- package/dist/components/GroupedSingleSelect/_helpers/DropdownFooter.js +28 -19
- package/dist/components/GroupedSingleSelect/_helpers/OptionRow.d.ts.map +1 -1
- package/dist/components/GroupedSingleSelect/_helpers/OptionRow.js +22 -12
- package/dist/components/GroupedSingleSelect/_helpers/OptionsList.d.ts.map +1 -1
- package/dist/components/GroupedSingleSelect/_helpers/OptionsList.js +35 -24
- package/dist/components/GroupedSingleSelect/_helpers/TriggerButton.d.ts.map +1 -1
- package/dist/components/GroupedSingleSelect/_helpers/TriggerButton.js +42 -24
- package/dist/components/GroupedSingleSelect/index.d.ts.map +1 -1
- package/dist/components/GroupedSingleSelect/index.js +61 -51
- package/dist/components/Loader/_types/loader.types.d.ts +10 -0
- package/dist/components/Loader/_types/loader.types.d.ts.map +1 -0
- package/dist/components/Loader/_types/loader.types.js +1 -0
- package/dist/components/Loader/index.d.ts +6 -0
- package/dist/components/Loader/index.d.ts.map +1 -0
- package/dist/components/Loader/index.js +37 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.d.ts +27 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.d.ts.map +1 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.js +1 -0
- package/dist/components/MAVDropdown/index.d.ts +6 -0
- package/dist/components/MAVDropdown/index.d.ts.map +1 -0
- package/dist/components/MAVDropdown/index.js +162 -0
- package/dist/components/MenuOptions/_types/menuOptions.types.d.ts +1 -7
- package/dist/components/MenuOptions/_types/menuOptions.types.d.ts.map +1 -1
- package/dist/components/MenuOptions/_utils/computeMenuPosition.js +1 -1
- package/dist/components/MenuOptions/_utils/computeSubmenuPosition.js +1 -1
- package/dist/components/MenuOptions/index.d.ts +1 -1
- package/dist/components/MenuOptions/index.d.ts.map +1 -1
- package/dist/components/MenuOptions/index.js +41 -35
- package/dist/components/MetricCards/Component/CardWithIconAndForecast/index.js +43 -43
- package/dist/components/MultiSelect/SimpleMultiSelect.d.ts +22 -0
- package/dist/components/MultiSelect/SimpleMultiSelect.d.ts.map +1 -0
- package/dist/components/MultiSelect/SimpleMultiSelect.js +221 -0
- package/dist/components/MultiSelect/_helpers/DropdownFooter.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/DropdownFooter.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/DropdownFooter.js +72 -0
- package/dist/components/MultiSelect/_helpers/OptionRow.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/OptionRow.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/OptionRow.js +40 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenu.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenu.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenu.js +7 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +30 -0
- package/dist/components/MultiSelect/_helpers/SearchResult.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/SearchResult.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/SearchResult.js +33 -0
- package/dist/components/MultiSelect/_helpers/TagContent.d.ts +5 -0
- package/dist/components/MultiSelect/_helpers/TagContent.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/TagContent.js +48 -0
- package/dist/components/MultiSelect/_helpers/TriggerButton.d.ts +4 -0
- package/dist/components/MultiSelect/_helpers/TriggerButton.d.ts.map +1 -0
- package/dist/components/MultiSelect/_helpers/TriggerButton.js +82 -0
- package/dist/components/MultiSelect/_types/type.d.ts +106 -0
- package/dist/components/MultiSelect/_types/type.d.ts.map +1 -0
- package/dist/components/MultiSelect/_types/type.js +1 -0
- package/dist/components/MultiSelect/_utils/computeApplyDisabled.d.ts +9 -0
- package/dist/components/MultiSelect/_utils/computeApplyDisabled.d.ts.map +1 -0
- package/dist/components/MultiSelect/_utils/computeApplyDisabled.js +9 -0
- package/dist/components/MultiSelect/_utils/filterOptions.d.ts +6 -0
- package/dist/components/MultiSelect/_utils/filterOptions.d.ts.map +1 -0
- package/dist/components/MultiSelect/_utils/filterOptions.js +7 -0
- package/dist/components/MultiSelect/_utils/getInitialSelected.d.ts +6 -0
- package/dist/components/MultiSelect/_utils/getInitialSelected.d.ts.map +1 -0
- package/dist/components/MultiSelect/_utils/getInitialSelected.js +6 -0
- package/dist/components/MultiSelect/index.d.ts +4 -0
- package/dist/components/MultiSelect/index.d.ts.map +1 -0
- package/dist/components/MultiSelect/index.js +234 -0
- package/dist/components/Pagination/_types/pagination.types.d.ts +21 -0
- package/dist/components/Pagination/_types/pagination.types.d.ts.map +1 -0
- package/dist/components/Pagination/_types/pagination.types.js +1 -0
- package/dist/components/Pagination/_utils/computePageSizeOptions.d.ts +5 -0
- package/dist/components/Pagination/_utils/computePageSizeOptions.d.ts.map +1 -0
- package/dist/components/Pagination/_utils/computePageSizeOptions.js +10 -0
- package/dist/components/Pagination/_utils/generatePageNumbers.d.ts +4 -0
- package/dist/components/Pagination/_utils/generatePageNumbers.d.ts.map +1 -0
- package/dist/components/Pagination/_utils/generatePageNumbers.js +18 -0
- package/dist/components/Pagination/index.d.ts +6 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +164 -0
- package/dist/components/Popover/_types/popover.types.d.ts +13 -0
- package/dist/components/Popover/_types/popover.types.d.ts.map +1 -0
- package/dist/components/Popover/_types/popover.types.js +1 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Popover/index.js +91 -0
- package/dist/components/PopupAndDialogBox/components/DialogContent.js +1 -1
- package/dist/components/PopupAndDialogBox/components/DialogFooter.js +1 -1
- package/dist/components/PopupAndDialogBox/components/DialogHeader.js +1 -1
- package/dist/components/PopupAndDialogBox/index.js +1 -1
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.d.ts +28 -0
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.js +13 -0
- package/dist/components/ProfileDropdown/constants.d.ts +3 -0
- package/dist/components/ProfileDropdown/constants.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/constants.js +8 -0
- package/dist/components/ProfileDropdown/index.d.ts +6 -0
- package/dist/components/ProfileDropdown/index.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/index.js +154 -0
- package/dist/components/ProgressBar/_types/progressBar.types.d.ts +34 -0
- package/dist/components/ProgressBar/_types/progressBar.types.d.ts.map +1 -0
- package/dist/components/ProgressBar/_types/progressBar.types.js +1 -0
- package/dist/components/ProgressBar/index.d.ts +3 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.js +48 -0
- package/dist/components/RadioButton/index.js +24 -24
- package/dist/components/RadioGroup/_types/radioGroup.types.d.ts +15 -0
- package/dist/components/RadioGroup/_types/radioGroup.types.d.ts.map +1 -0
- package/dist/components/RadioGroup/_types/radioGroup.types.js +1 -0
- package/dist/components/RadioGroup/index.d.ts +3 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.js +44 -0
- package/dist/components/Search/index.d.ts.map +1 -1
- package/dist/components/Search/index.js +72 -62
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.d.ts +2 -1
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +15 -4
- package/dist/components/SingleSelectDropdown/_types/singleSelectDropdown.types.d.ts +2 -2
- package/dist/components/SingleSelectDropdown/_types/singleSelectDropdown.types.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/index.d.ts +1 -1
- package/dist/components/SingleSelectDropdown/index.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/index.js +81 -70
- package/dist/components/Switch/index.js +3 -3
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.d.ts +5 -0
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.d.ts.map +1 -0
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.js +84 -0
- package/dist/components/Table/_helpers/ColumnManager/index.d.ts +4 -0
- package/dist/components/Table/_helpers/ColumnManager/index.d.ts.map +1 -0
- package/dist/components/Table/_helpers/ColumnManager/index.js +2456 -0
- package/dist/components/Table/_helpers/ExpandableRow/index.d.ts +16 -0
- package/dist/components/Table/_helpers/ExpandableRow/index.d.ts.map +1 -0
- package/dist/components/Table/_helpers/ExpandableRow/index.js +54 -0
- package/dist/components/Table/_helpers/FilterColumnToolbar.d.ts +14 -0
- package/dist/components/Table/_helpers/FilterColumnToolbar.d.ts.map +1 -0
- package/dist/components/Table/_helpers/FilterColumnToolbar.js +121 -0
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts +24 -0
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts.map +1 -0
- package/dist/components/Table/_helpers/GroupedHeader/index.js +193 -0
- package/dist/components/Table/_helpers/SelectionCell/index.d.ts +19 -0
- package/dist/components/Table/_helpers/SelectionCell/index.d.ts.map +1 -0
- package/dist/components/Table/_helpers/SelectionCell/index.js +50 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.d.ts +3 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.d.ts.map +1 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.js +11 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionListItems.d.ts +3 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionListItems.d.ts.map +1 -0
- package/dist/components/Table/_helpers/TableFilterModal/OptionListItems.js +75 -0
- package/dist/components/Table/_helpers/TableFilterModal/RangeSelector.d.ts +3 -0
- package/dist/components/Table/_helpers/TableFilterModal/RangeSelector.d.ts.map +1 -0
- package/dist/components/Table/_helpers/TableFilterModal/RangeSelector.js +1544 -0
- package/dist/components/Table/_helpers/TableFilterModal/index.d.ts +4 -0
- package/dist/components/Table/_helpers/TableFilterModal/index.d.ts.map +1 -0
- package/dist/components/Table/_helpers/TableFilterModal/index.js +115 -0
- package/dist/components/Table/_helpers/TableRows.d.ts +3 -0
- package/dist/components/Table/_helpers/TableRows.d.ts.map +1 -0
- package/dist/components/Table/_helpers/TableRows.js +408 -0
- package/dist/components/Table/_hooks/useExpansion.d.ts +20 -0
- package/dist/components/Table/_hooks/useExpansion.d.ts.map +1 -0
- package/dist/components/Table/_hooks/useExpansion.js +46 -0
- package/dist/components/Table/_hooks/useFilterColumnState.d.ts +17 -0
- package/dist/components/Table/_hooks/useFilterColumnState.d.ts.map +1 -0
- package/dist/components/Table/_hooks/useFilterColumnState.js +94 -0
- package/dist/components/Table/_hooks/useSelection.d.ts +12 -0
- package/dist/components/Table/_hooks/useSelection.d.ts.map +1 -0
- package/dist/components/Table/_hooks/useSelection.js +45 -0
- package/dist/components/Table/_types/table.types.d.ts +286 -0
- package/dist/components/Table/_types/table.types.d.ts.map +1 -0
- package/dist/components/Table/_types/table.types.js +1 -0
- package/dist/components/Table/_utils/formatCellValue.d.ts +13 -0
- package/dist/components/Table/_utils/formatCellValue.d.ts.map +1 -0
- package/dist/components/Table/_utils/formatCellValue.js +17 -0
- package/dist/components/Table/_utils/table.utils.d.ts +10 -0
- package/dist/components/Table/_utils/table.utils.d.ts.map +1 -0
- package/dist/components/Table/_utils/table.utils.js +87 -0
- package/dist/components/Table/constants.d.ts +6 -0
- package/dist/components/Table/constants.d.ts.map +1 -0
- package/dist/components/Table/constants.js +13 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/index.js +543 -0
- package/dist/components/TextField/index.js +685 -6956
- package/dist/components/Toast/_helper/ToastContent.js +25 -25
- package/dist/components/Toast/_helper/ToastProvider.js +9 -9
- package/dist/components/Toast/_hooks/useToast.js +1 -1
- package/dist/components/Tooltip/index.js +699 -781
- package/dist/components/Typography/_types/typography.types.d.ts +28 -0
- package/dist/components/Typography/_types/typography.types.d.ts.map +1 -0
- package/dist/components/Typography/_types/typography.types.js +1 -0
- package/dist/components/Typography/index.d.ts +3 -0
- package/dist/components/Typography/index.d.ts.map +1 -0
- package/dist/components/Typography/index.js +45 -0
- package/dist/contains-kLLEGdNH.js +41 -0
- package/dist/index-C8cPPHJD.js +1196 -0
- package/dist/index-f7TB87Mf.js +1846 -0
- package/dist/isFocusVisible-BzX3wEi7.js +12 -0
- package/dist/main.d.ts +17 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +128 -96
- package/dist/reset-icon-YxMt3Ozp.js +5 -0
- package/dist/search-B_cup-NN.js +5 -0
- package/dist/styles.module-BXby6f8d.js +16 -0
- package/dist/styles.module-BZaUJMlf.js +14 -0
- package/dist/styles.module-Dojg5FTS.js +41 -0
- package/dist/styles.module-ZyeVE7KZ.js +39 -0
- package/dist/table-filter-C0zetUfo.js +6 -0
- package/dist/useSlot-ylt7_lTY.js +4698 -0
- package/package.json +17 -3
- package/dist/DropdownFooter-De6BYlLK.js +0 -77
- package/dist/Grow-Bsrwqfek.js +0 -5468
- package/dist/IconSlot-CbpGCbaA.js +0 -32
- package/dist/assets/DropdownFooter-C7Cml53c.css +0 -1
- package/dist/assets/IconSlot-Ct_SZh2X.css +0 -1
- package/dist/assets/ReactToastify-GNLSjkBZ.css +0 -1
- package/dist/assets/index-0R9p-l95.css +0 -1
- package/dist/assets/index-BbJZjGLb.css +0 -1
- package/dist/assets/index-Bu-eyi44.css +0 -1
- package/dist/assets/index-DAtOlGx5.css +0 -1
- package/dist/assets/index-Dudb2XKF.css +0 -1
- package/dist/assets/index-fvceox3b.css +0 -1
- package/dist/assets/index-w7AdSPwF.css +0 -1
- package/dist/assets/styles-CGTFG68B.css +0 -1
- package/dist/index-BR6M9zUI.js +0 -382
- package/dist/styles.module-BpAF4ufQ.js +0 -38
- package/dist/styles.module-yNDMDNO-.js +0 -14
|
@@ -0,0 +1,2456 @@
|
|
|
1
|
+
import { jsx as m, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { createContext as $e, memo as Ge, useEffect as k, useLayoutEffect as Ye, useState as be, useCallback as Ee, useMemo as b, isValidElement as Xe, cloneElement as ae, useContext as We, useRef as ze } from "react";
|
|
4
|
+
import { CKButton as B } from "../../../CKButton/index.js";
|
|
5
|
+
import { Typography as _ } from "../../../Typography/index.js";
|
|
6
|
+
import { Switch as Qe } from "../../../Switch/index.js";
|
|
7
|
+
import { S as Ke } from "../../../../reset-icon-YxMt3Ozp.js";
|
|
8
|
+
import { S as Je } from "../../../../search-B_cup-NN.js";
|
|
9
|
+
import { ColumnConfig as Ze } from "./ColumnConfig.js";
|
|
10
|
+
import { COLUMN_ITEM_TYPE as ce } from "../../constants.js";
|
|
11
|
+
import '../../../../assets/styles-BTZL03H2.css';/* empty css */
|
|
12
|
+
import { g as et } from "../../../../_commonjsHelpers-C6fGbg64.js";
|
|
13
|
+
const Ie = $e({
|
|
14
|
+
dragDropManager: void 0
|
|
15
|
+
});
|
|
16
|
+
function O(t) {
|
|
17
|
+
return "Minified Redux error #" + t + "; visit https://redux.js.org/Errors?code=" + t + " for the full message or use the non-minified dev environment for full errors. ";
|
|
18
|
+
}
|
|
19
|
+
var ue = (function() {
|
|
20
|
+
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
21
|
+
})(), le = function() {
|
|
22
|
+
return Math.random().toString(36).substring(7).split("").join(".");
|
|
23
|
+
}, de = {
|
|
24
|
+
INIT: "@@redux/INIT" + le(),
|
|
25
|
+
REPLACE: "@@redux/REPLACE" + le()
|
|
26
|
+
};
|
|
27
|
+
function tt(t) {
|
|
28
|
+
if (typeof t != "object" || t === null) return !1;
|
|
29
|
+
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
30
|
+
e = Object.getPrototypeOf(e);
|
|
31
|
+
return Object.getPrototypeOf(t) === e;
|
|
32
|
+
}
|
|
33
|
+
function rt(t) {
|
|
34
|
+
if (t === void 0) return "undefined";
|
|
35
|
+
if (t === null) return "null";
|
|
36
|
+
var e = typeof t;
|
|
37
|
+
switch (e) {
|
|
38
|
+
case "boolean":
|
|
39
|
+
case "string":
|
|
40
|
+
case "number":
|
|
41
|
+
case "symbol":
|
|
42
|
+
case "function":
|
|
43
|
+
return e;
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(t)) return "array";
|
|
46
|
+
if (ot(t)) return "date";
|
|
47
|
+
if (it(t)) return "error";
|
|
48
|
+
var r = nt(t);
|
|
49
|
+
switch (r) {
|
|
50
|
+
case "Symbol":
|
|
51
|
+
case "Promise":
|
|
52
|
+
case "WeakMap":
|
|
53
|
+
case "WeakSet":
|
|
54
|
+
case "Map":
|
|
55
|
+
case "Set":
|
|
56
|
+
return r;
|
|
57
|
+
}
|
|
58
|
+
return e.slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
59
|
+
}
|
|
60
|
+
function nt(t) {
|
|
61
|
+
return typeof t.constructor == "function" ? t.constructor.name : null;
|
|
62
|
+
}
|
|
63
|
+
function it(t) {
|
|
64
|
+
return t instanceof Error || typeof t.message == "string" && t.constructor && typeof t.constructor.stackTraceLimit == "number";
|
|
65
|
+
}
|
|
66
|
+
function ot(t) {
|
|
67
|
+
return t instanceof Date ? !0 : typeof t.toDateString == "function" && typeof t.getDate == "function" && typeof t.setDate == "function";
|
|
68
|
+
}
|
|
69
|
+
function N(t) {
|
|
70
|
+
var e = typeof t;
|
|
71
|
+
return process.env.NODE_ENV !== "production" && (e = rt(t)), e;
|
|
72
|
+
}
|
|
73
|
+
function we(t, e, r) {
|
|
74
|
+
var n;
|
|
75
|
+
if (typeof e == "function" && typeof r == "function" || typeof r == "function" && typeof arguments[3] == "function")
|
|
76
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
|
|
77
|
+
if (typeof e == "function" && typeof r > "u" && (r = e, e = void 0), typeof r < "u") {
|
|
78
|
+
if (typeof r != "function")
|
|
79
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(1) : "Expected the enhancer to be a function. Instead, received: '" + N(r) + "'");
|
|
80
|
+
return r(we)(t, e);
|
|
81
|
+
}
|
|
82
|
+
if (typeof t != "function")
|
|
83
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(2) : "Expected the root reducer to be a function. Instead, received: '" + N(t) + "'");
|
|
84
|
+
var i = t, o = e, s = [], a = s, c = !1;
|
|
85
|
+
function d() {
|
|
86
|
+
a === s && (a = s.slice());
|
|
87
|
+
}
|
|
88
|
+
function f() {
|
|
89
|
+
if (c)
|
|
90
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
|
|
91
|
+
return o;
|
|
92
|
+
}
|
|
93
|
+
function p(h) {
|
|
94
|
+
if (typeof h != "function")
|
|
95
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(4) : "Expected the listener to be a function. Instead, received: '" + N(h) + "'");
|
|
96
|
+
if (c)
|
|
97
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
98
|
+
var v = !0;
|
|
99
|
+
return d(), a.push(h), function() {
|
|
100
|
+
if (v) {
|
|
101
|
+
if (c)
|
|
102
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
103
|
+
v = !1, d();
|
|
104
|
+
var S = a.indexOf(h);
|
|
105
|
+
a.splice(S, 1), s = null;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function g(h) {
|
|
110
|
+
if (!tt(h))
|
|
111
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(7) : "Actions must be plain objects. Instead, the actual type was: '" + N(h) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
112
|
+
if (typeof h.type > "u")
|
|
113
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
114
|
+
if (c)
|
|
115
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(9) : "Reducers may not dispatch actions.");
|
|
116
|
+
try {
|
|
117
|
+
c = !0, o = i(o, h);
|
|
118
|
+
} finally {
|
|
119
|
+
c = !1;
|
|
120
|
+
}
|
|
121
|
+
for (var v = s = a, y = 0; y < v.length; y++) {
|
|
122
|
+
var S = v[y];
|
|
123
|
+
S();
|
|
124
|
+
}
|
|
125
|
+
return h;
|
|
126
|
+
}
|
|
127
|
+
function u(h) {
|
|
128
|
+
if (typeof h != "function")
|
|
129
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(10) : "Expected the nextReducer to be a function. Instead, received: '" + N(h));
|
|
130
|
+
i = h, g({
|
|
131
|
+
type: de.REPLACE
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function D() {
|
|
135
|
+
var h, v = p;
|
|
136
|
+
return h = {
|
|
137
|
+
/**
|
|
138
|
+
* The minimal observable subscription method.
|
|
139
|
+
* @param {Object} observer Any object that can be used as an observer.
|
|
140
|
+
* The observer object should have a `next` method.
|
|
141
|
+
* @returns {subscription} An object with an `unsubscribe` method that can
|
|
142
|
+
* be used to unsubscribe the observable from the store, and prevent further
|
|
143
|
+
* emission of values from the observable.
|
|
144
|
+
*/
|
|
145
|
+
subscribe: function(S) {
|
|
146
|
+
if (typeof S != "object" || S === null)
|
|
147
|
+
throw new Error(process.env.NODE_ENV === "production" ? O(11) : "Expected the observer to be an object. Instead, received: '" + N(S) + "'");
|
|
148
|
+
function I() {
|
|
149
|
+
S.next && S.next(f());
|
|
150
|
+
}
|
|
151
|
+
I();
|
|
152
|
+
var F = v(I);
|
|
153
|
+
return {
|
|
154
|
+
unsubscribe: F
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}, h[ue] = function() {
|
|
158
|
+
return this;
|
|
159
|
+
}, h;
|
|
160
|
+
}
|
|
161
|
+
return g({
|
|
162
|
+
type: de.INIT
|
|
163
|
+
}), n = {
|
|
164
|
+
dispatch: g,
|
|
165
|
+
subscribe: p,
|
|
166
|
+
getState: f,
|
|
167
|
+
replaceReducer: u
|
|
168
|
+
}, n[ue] = D, n;
|
|
169
|
+
}
|
|
170
|
+
function l(t, e, ...r) {
|
|
171
|
+
if (st() && e === void 0)
|
|
172
|
+
throw new Error("invariant requires an error message argument");
|
|
173
|
+
if (!t) {
|
|
174
|
+
let n;
|
|
175
|
+
if (e === void 0)
|
|
176
|
+
n = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
|
|
177
|
+
else {
|
|
178
|
+
let i = 0;
|
|
179
|
+
n = new Error(e.replace(/%s/g, function() {
|
|
180
|
+
return r[i++];
|
|
181
|
+
})), n.name = "Invariant Violation";
|
|
182
|
+
}
|
|
183
|
+
throw n.framesToPop = 1, n;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function st() {
|
|
187
|
+
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
188
|
+
}
|
|
189
|
+
function at(t, e, r) {
|
|
190
|
+
return e.split(".").reduce(
|
|
191
|
+
(n, i) => n && n[i] ? n[i] : r || null,
|
|
192
|
+
t
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
function ct(t, e) {
|
|
196
|
+
return t.filter(
|
|
197
|
+
(r) => r !== e
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
function Ce(t) {
|
|
201
|
+
return typeof t == "object";
|
|
202
|
+
}
|
|
203
|
+
function ut(t, e) {
|
|
204
|
+
const r = /* @__PURE__ */ new Map(), n = (o) => {
|
|
205
|
+
r.set(o, r.has(o) ? r.get(o) + 1 : 1);
|
|
206
|
+
};
|
|
207
|
+
t.forEach(n), e.forEach(n);
|
|
208
|
+
const i = [];
|
|
209
|
+
return r.forEach((o, s) => {
|
|
210
|
+
o === 1 && i.push(s);
|
|
211
|
+
}), i;
|
|
212
|
+
}
|
|
213
|
+
function lt(t, e) {
|
|
214
|
+
return t.filter(
|
|
215
|
+
(r) => e.indexOf(r) > -1
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
const ee = "dnd-core/INIT_COORDS", A = "dnd-core/BEGIN_DRAG", te = "dnd-core/PUBLISH_DRAG_SOURCE", H = "dnd-core/HOVER", j = "dnd-core/DROP", U = "dnd-core/END_DRAG";
|
|
219
|
+
function ge(t, e) {
|
|
220
|
+
return {
|
|
221
|
+
type: ee,
|
|
222
|
+
payload: {
|
|
223
|
+
sourceClientOffset: e || null,
|
|
224
|
+
clientOffset: t || null
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const dt = {
|
|
229
|
+
type: ee,
|
|
230
|
+
payload: {
|
|
231
|
+
clientOffset: null,
|
|
232
|
+
sourceClientOffset: null
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function gt(t) {
|
|
236
|
+
return function(r = [], n = {
|
|
237
|
+
publishSource: !0
|
|
238
|
+
}) {
|
|
239
|
+
const { publishSource: i = !0, clientOffset: o, getSourceClientOffset: s } = n, a = t.getMonitor(), c = t.getRegistry();
|
|
240
|
+
t.dispatch(ge(o)), ft(r, a, c);
|
|
241
|
+
const d = mt(r, a);
|
|
242
|
+
if (d == null) {
|
|
243
|
+
t.dispatch(dt);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
let f = null;
|
|
247
|
+
if (o) {
|
|
248
|
+
if (!s)
|
|
249
|
+
throw new Error("getSourceClientOffset must be defined");
|
|
250
|
+
ht(s), f = s(d);
|
|
251
|
+
}
|
|
252
|
+
t.dispatch(ge(o, f));
|
|
253
|
+
const g = c.getSource(d).beginDrag(a, d);
|
|
254
|
+
if (g == null)
|
|
255
|
+
return;
|
|
256
|
+
pt(g), c.pinSource(d);
|
|
257
|
+
const u = c.getSourceType(d);
|
|
258
|
+
return {
|
|
259
|
+
type: A,
|
|
260
|
+
payload: {
|
|
261
|
+
itemType: u,
|
|
262
|
+
item: g,
|
|
263
|
+
sourceId: d,
|
|
264
|
+
clientOffset: o || null,
|
|
265
|
+
sourceClientOffset: f || null,
|
|
266
|
+
isSourcePublic: !!i
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function ft(t, e, r) {
|
|
272
|
+
l(!e.isDragging(), "Cannot call beginDrag while dragging."), t.forEach(function(n) {
|
|
273
|
+
l(r.getSource(n), "Expected sourceIds to be registered.");
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function ht(t) {
|
|
277
|
+
l(typeof t == "function", "When clientOffset is provided, getSourceClientOffset must be a function.");
|
|
278
|
+
}
|
|
279
|
+
function pt(t) {
|
|
280
|
+
l(Ce(t), "Item must be an object.");
|
|
281
|
+
}
|
|
282
|
+
function mt(t, e) {
|
|
283
|
+
let r = null;
|
|
284
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
285
|
+
if (e.canDragSource(t[n])) {
|
|
286
|
+
r = t[n];
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
return r;
|
|
290
|
+
}
|
|
291
|
+
function vt(t, e, r) {
|
|
292
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
293
|
+
value: r,
|
|
294
|
+
enumerable: !0,
|
|
295
|
+
configurable: !0,
|
|
296
|
+
writable: !0
|
|
297
|
+
}) : t[e] = r, t;
|
|
298
|
+
}
|
|
299
|
+
function Dt(t) {
|
|
300
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
301
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
302
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(i) {
|
|
303
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
304
|
+
}))), n.forEach(function(i) {
|
|
305
|
+
vt(t, i, r[i]);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
return t;
|
|
309
|
+
}
|
|
310
|
+
function yt(t) {
|
|
311
|
+
return function(r = {}) {
|
|
312
|
+
const n = t.getMonitor(), i = t.getRegistry();
|
|
313
|
+
St(n), bt(n).forEach((s, a) => {
|
|
314
|
+
const c = Ot(s, a, i, n), d = {
|
|
315
|
+
type: j,
|
|
316
|
+
payload: {
|
|
317
|
+
dropResult: Dt({}, r, c)
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
t.dispatch(d);
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function St(t) {
|
|
325
|
+
l(t.isDragging(), "Cannot call drop while not dragging."), l(!t.didDrop(), "Cannot call drop twice during one drag operation.");
|
|
326
|
+
}
|
|
327
|
+
function Ot(t, e, r, n) {
|
|
328
|
+
const i = r.getTarget(t);
|
|
329
|
+
let o = i ? i.drop(n, t) : void 0;
|
|
330
|
+
return Tt(o), typeof o > "u" && (o = e === 0 ? {} : n.getDropResult()), o;
|
|
331
|
+
}
|
|
332
|
+
function Tt(t) {
|
|
333
|
+
l(typeof t > "u" || Ce(t), "Drop result must either be an object or undefined.");
|
|
334
|
+
}
|
|
335
|
+
function bt(t) {
|
|
336
|
+
const e = t.getTargetIds().filter(t.canDropOnTarget, t);
|
|
337
|
+
return e.reverse(), e;
|
|
338
|
+
}
|
|
339
|
+
function Et(t) {
|
|
340
|
+
return function() {
|
|
341
|
+
const r = t.getMonitor(), n = t.getRegistry();
|
|
342
|
+
It(r);
|
|
343
|
+
const i = r.getSourceId();
|
|
344
|
+
return i != null && (n.getSource(i, !0).endDrag(r, i), n.unpinSource()), {
|
|
345
|
+
type: U
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function It(t) {
|
|
350
|
+
l(t.isDragging(), "Cannot call endDrag while not dragging.");
|
|
351
|
+
}
|
|
352
|
+
function z(t, e) {
|
|
353
|
+
return e === null ? t === null : Array.isArray(t) ? t.some(
|
|
354
|
+
(r) => r === e
|
|
355
|
+
) : t === e;
|
|
356
|
+
}
|
|
357
|
+
function wt(t) {
|
|
358
|
+
return function(r, { clientOffset: n } = {}) {
|
|
359
|
+
Ct(r);
|
|
360
|
+
const i = r.slice(0), o = t.getMonitor(), s = t.getRegistry(), a = o.getItemType();
|
|
361
|
+
return Pt(i, s, a), Nt(i, o, s), xt(i, o, s), {
|
|
362
|
+
type: H,
|
|
363
|
+
payload: {
|
|
364
|
+
targetIds: i,
|
|
365
|
+
clientOffset: n || null
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function Ct(t) {
|
|
371
|
+
l(Array.isArray(t), "Expected targetIds to be an array.");
|
|
372
|
+
}
|
|
373
|
+
function Nt(t, e, r) {
|
|
374
|
+
l(e.isDragging(), "Cannot call hover while not dragging."), l(!e.didDrop(), "Cannot call hover after drop.");
|
|
375
|
+
for (let n = 0; n < t.length; n++) {
|
|
376
|
+
const i = t[n];
|
|
377
|
+
l(t.lastIndexOf(i) === n, "Expected targetIds to be unique in the passed array.");
|
|
378
|
+
const o = r.getTarget(i);
|
|
379
|
+
l(o, "Expected targetIds to be registered.");
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function Pt(t, e, r) {
|
|
383
|
+
for (let n = t.length - 1; n >= 0; n--) {
|
|
384
|
+
const i = t[n], o = e.getTargetType(i);
|
|
385
|
+
z(o, r) || t.splice(n, 1);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function xt(t, e, r) {
|
|
389
|
+
t.forEach(function(n) {
|
|
390
|
+
r.getTarget(n).hover(e, n);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
function Rt(t) {
|
|
394
|
+
return function() {
|
|
395
|
+
if (t.getMonitor().isDragging())
|
|
396
|
+
return {
|
|
397
|
+
type: te
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function Mt(t) {
|
|
402
|
+
return {
|
|
403
|
+
beginDrag: gt(t),
|
|
404
|
+
publishDragSource: Rt(t),
|
|
405
|
+
hover: wt(t),
|
|
406
|
+
drop: yt(t),
|
|
407
|
+
endDrag: Et(t)
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
class _t {
|
|
411
|
+
receiveBackend(e) {
|
|
412
|
+
this.backend = e;
|
|
413
|
+
}
|
|
414
|
+
getMonitor() {
|
|
415
|
+
return this.monitor;
|
|
416
|
+
}
|
|
417
|
+
getBackend() {
|
|
418
|
+
return this.backend;
|
|
419
|
+
}
|
|
420
|
+
getRegistry() {
|
|
421
|
+
return this.monitor.registry;
|
|
422
|
+
}
|
|
423
|
+
getActions() {
|
|
424
|
+
const e = this, { dispatch: r } = this.store;
|
|
425
|
+
function n(o) {
|
|
426
|
+
return (...s) => {
|
|
427
|
+
const a = o.apply(e, s);
|
|
428
|
+
typeof a < "u" && r(a);
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
const i = Mt(this);
|
|
432
|
+
return Object.keys(i).reduce((o, s) => {
|
|
433
|
+
const a = i[s];
|
|
434
|
+
return o[s] = n(a), o;
|
|
435
|
+
}, {});
|
|
436
|
+
}
|
|
437
|
+
dispatch(e) {
|
|
438
|
+
this.store.dispatch(e);
|
|
439
|
+
}
|
|
440
|
+
constructor(e, r) {
|
|
441
|
+
this.isSetUp = !1, this.handleRefCountChange = () => {
|
|
442
|
+
const n = this.store.getState().refCount > 0;
|
|
443
|
+
this.backend && (n && !this.isSetUp ? (this.backend.setup(), this.isSetUp = !0) : !n && this.isSetUp && (this.backend.teardown(), this.isSetUp = !1));
|
|
444
|
+
}, this.store = e, this.monitor = r, e.subscribe(this.handleRefCountChange);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function Lt(t, e) {
|
|
448
|
+
return {
|
|
449
|
+
x: t.x + e.x,
|
|
450
|
+
y: t.y + e.y
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function Ne(t, e) {
|
|
454
|
+
return {
|
|
455
|
+
x: t.x - e.x,
|
|
456
|
+
y: t.y - e.y
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function kt(t) {
|
|
460
|
+
const { clientOffset: e, initialClientOffset: r, initialSourceClientOffset: n } = t;
|
|
461
|
+
return !e || !r || !n ? null : Ne(Lt(e, n), r);
|
|
462
|
+
}
|
|
463
|
+
function At(t) {
|
|
464
|
+
const { clientOffset: e, initialClientOffset: r } = t;
|
|
465
|
+
return !e || !r ? null : Ne(e, r);
|
|
466
|
+
}
|
|
467
|
+
const R = [], re = [];
|
|
468
|
+
R.__IS_NONE__ = !0;
|
|
469
|
+
re.__IS_ALL__ = !0;
|
|
470
|
+
function Ht(t, e) {
|
|
471
|
+
return t === R ? !1 : t === re || typeof e > "u" ? !0 : lt(e, t).length > 0;
|
|
472
|
+
}
|
|
473
|
+
class jt {
|
|
474
|
+
subscribeToStateChange(e, r = {}) {
|
|
475
|
+
const { handlerIds: n } = r;
|
|
476
|
+
l(typeof e == "function", "listener must be a function."), l(typeof n > "u" || Array.isArray(n), "handlerIds, when specified, must be an array of strings.");
|
|
477
|
+
let i = this.store.getState().stateId;
|
|
478
|
+
const o = () => {
|
|
479
|
+
const s = this.store.getState(), a = s.stateId;
|
|
480
|
+
try {
|
|
481
|
+
a === i || a === i + 1 && !Ht(s.dirtyHandlerIds, n) || e();
|
|
482
|
+
} finally {
|
|
483
|
+
i = a;
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
return this.store.subscribe(o);
|
|
487
|
+
}
|
|
488
|
+
subscribeToOffsetChange(e) {
|
|
489
|
+
l(typeof e == "function", "listener must be a function.");
|
|
490
|
+
let r = this.store.getState().dragOffset;
|
|
491
|
+
const n = () => {
|
|
492
|
+
const i = this.store.getState().dragOffset;
|
|
493
|
+
i !== r && (r = i, e());
|
|
494
|
+
};
|
|
495
|
+
return this.store.subscribe(n);
|
|
496
|
+
}
|
|
497
|
+
canDragSource(e) {
|
|
498
|
+
if (!e)
|
|
499
|
+
return !1;
|
|
500
|
+
const r = this.registry.getSource(e);
|
|
501
|
+
return l(r, `Expected to find a valid source. sourceId=${e}`), this.isDragging() ? !1 : r.canDrag(this, e);
|
|
502
|
+
}
|
|
503
|
+
canDropOnTarget(e) {
|
|
504
|
+
if (!e)
|
|
505
|
+
return !1;
|
|
506
|
+
const r = this.registry.getTarget(e);
|
|
507
|
+
if (l(r, `Expected to find a valid target. targetId=${e}`), !this.isDragging() || this.didDrop())
|
|
508
|
+
return !1;
|
|
509
|
+
const n = this.registry.getTargetType(e), i = this.getItemType();
|
|
510
|
+
return z(n, i) && r.canDrop(this, e);
|
|
511
|
+
}
|
|
512
|
+
isDragging() {
|
|
513
|
+
return !!this.getItemType();
|
|
514
|
+
}
|
|
515
|
+
isDraggingSource(e) {
|
|
516
|
+
if (!e)
|
|
517
|
+
return !1;
|
|
518
|
+
const r = this.registry.getSource(e, !0);
|
|
519
|
+
if (l(r, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() || !this.isSourcePublic())
|
|
520
|
+
return !1;
|
|
521
|
+
const n = this.registry.getSourceType(e), i = this.getItemType();
|
|
522
|
+
return n !== i ? !1 : r.isDragging(this, e);
|
|
523
|
+
}
|
|
524
|
+
isOverTarget(e, r = {
|
|
525
|
+
shallow: !1
|
|
526
|
+
}) {
|
|
527
|
+
if (!e)
|
|
528
|
+
return !1;
|
|
529
|
+
const { shallow: n } = r;
|
|
530
|
+
if (!this.isDragging())
|
|
531
|
+
return !1;
|
|
532
|
+
const i = this.registry.getTargetType(e), o = this.getItemType();
|
|
533
|
+
if (o && !z(i, o))
|
|
534
|
+
return !1;
|
|
535
|
+
const s = this.getTargetIds();
|
|
536
|
+
if (!s.length)
|
|
537
|
+
return !1;
|
|
538
|
+
const a = s.indexOf(e);
|
|
539
|
+
return n ? a === s.length - 1 : a > -1;
|
|
540
|
+
}
|
|
541
|
+
getItemType() {
|
|
542
|
+
return this.store.getState().dragOperation.itemType;
|
|
543
|
+
}
|
|
544
|
+
getItem() {
|
|
545
|
+
return this.store.getState().dragOperation.item;
|
|
546
|
+
}
|
|
547
|
+
getSourceId() {
|
|
548
|
+
return this.store.getState().dragOperation.sourceId;
|
|
549
|
+
}
|
|
550
|
+
getTargetIds() {
|
|
551
|
+
return this.store.getState().dragOperation.targetIds;
|
|
552
|
+
}
|
|
553
|
+
getDropResult() {
|
|
554
|
+
return this.store.getState().dragOperation.dropResult;
|
|
555
|
+
}
|
|
556
|
+
didDrop() {
|
|
557
|
+
return this.store.getState().dragOperation.didDrop;
|
|
558
|
+
}
|
|
559
|
+
isSourcePublic() {
|
|
560
|
+
return !!this.store.getState().dragOperation.isSourcePublic;
|
|
561
|
+
}
|
|
562
|
+
getInitialClientOffset() {
|
|
563
|
+
return this.store.getState().dragOffset.initialClientOffset;
|
|
564
|
+
}
|
|
565
|
+
getInitialSourceClientOffset() {
|
|
566
|
+
return this.store.getState().dragOffset.initialSourceClientOffset;
|
|
567
|
+
}
|
|
568
|
+
getClientOffset() {
|
|
569
|
+
return this.store.getState().dragOffset.clientOffset;
|
|
570
|
+
}
|
|
571
|
+
getSourceClientOffset() {
|
|
572
|
+
return kt(this.store.getState().dragOffset);
|
|
573
|
+
}
|
|
574
|
+
getDifferenceFromInitialOffset() {
|
|
575
|
+
return At(this.store.getState().dragOffset);
|
|
576
|
+
}
|
|
577
|
+
constructor(e, r) {
|
|
578
|
+
this.store = e, this.registry = r;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const fe = typeof global < "u" ? global : self, Pe = fe.MutationObserver || fe.WebKitMutationObserver;
|
|
582
|
+
function xe(t) {
|
|
583
|
+
return function() {
|
|
584
|
+
const r = setTimeout(i, 0), n = setInterval(i, 50);
|
|
585
|
+
function i() {
|
|
586
|
+
clearTimeout(r), clearInterval(n), t();
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function Ut(t) {
|
|
591
|
+
let e = 1;
|
|
592
|
+
const r = new Pe(t), n = document.createTextNode("");
|
|
593
|
+
return r.observe(n, {
|
|
594
|
+
characterData: !0
|
|
595
|
+
}), function() {
|
|
596
|
+
e = -e, n.data = e;
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
const Vt = typeof Pe == "function" ? (
|
|
600
|
+
// reliably everywhere they are implemented.
|
|
601
|
+
// They are implemented in all modern browsers.
|
|
602
|
+
//
|
|
603
|
+
// - Android 4-4.3
|
|
604
|
+
// - Chrome 26-34
|
|
605
|
+
// - Firefox 14-29
|
|
606
|
+
// - Internet Explorer 11
|
|
607
|
+
// - iPad Safari 6-7.1
|
|
608
|
+
// - iPhone Safari 7-7.1
|
|
609
|
+
// - Safari 6-7
|
|
610
|
+
Ut
|
|
611
|
+
) : (
|
|
612
|
+
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
|
|
613
|
+
// 11-12, and in web workers in many engines.
|
|
614
|
+
// Although message channels yield to any queued rendering and IO tasks, they
|
|
615
|
+
// would be better than imposing the 4ms delay of timers.
|
|
616
|
+
// However, they do not work reliably in Internet Explorer or Safari.
|
|
617
|
+
// Internet Explorer 10 is the only browser that has setImmediate but does
|
|
618
|
+
// not have MutationObservers.
|
|
619
|
+
// Although setImmediate yields to the browser's renderer, it would be
|
|
620
|
+
// preferrable to falling back to setTimeout since it does not have
|
|
621
|
+
// the minimum 4ms penalty.
|
|
622
|
+
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
|
|
623
|
+
// Desktop to a lesser extent) that renders both setImmediate and
|
|
624
|
+
// MessageChannel useless for the purposes of ASAP.
|
|
625
|
+
// https://github.com/kriskowal/q/issues/396
|
|
626
|
+
// Timers are implemented universally.
|
|
627
|
+
// We fall back to timers in workers in most engines, and in foreground
|
|
628
|
+
// contexts in the following browsers.
|
|
629
|
+
// However, note that even this simple case requires nuances to operate in a
|
|
630
|
+
// broad spectrum of browsers.
|
|
631
|
+
//
|
|
632
|
+
// - Firefox 3-13
|
|
633
|
+
// - Internet Explorer 6-9
|
|
634
|
+
// - iPad Safari 4.3
|
|
635
|
+
// - Lynx 2.8.7
|
|
636
|
+
xe
|
|
637
|
+
);
|
|
638
|
+
class Ft {
|
|
639
|
+
// Use the fastest means possible to execute a task in its own turn, with
|
|
640
|
+
// priority over other events including IO, animation, reflow, and redraw
|
|
641
|
+
// events in browsers.
|
|
642
|
+
//
|
|
643
|
+
// An exception thrown by a task will permanently interrupt the processing of
|
|
644
|
+
// subsequent tasks. The higher level `asap` function ensures that if an
|
|
645
|
+
// exception is thrown by a task, that the task queue will continue flushing as
|
|
646
|
+
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
|
647
|
+
// either ensure that no exceptions are thrown from your task, or to manually
|
|
648
|
+
// call `rawAsap.requestFlush` if an exception is thrown.
|
|
649
|
+
enqueueTask(e) {
|
|
650
|
+
const { queue: r, requestFlush: n } = this;
|
|
651
|
+
r.length || (n(), this.flushing = !0), r[r.length] = e;
|
|
652
|
+
}
|
|
653
|
+
constructor() {
|
|
654
|
+
this.queue = [], this.pendingErrors = [], this.flushing = !1, this.index = 0, this.capacity = 1024, this.flush = () => {
|
|
655
|
+
const { queue: e } = this;
|
|
656
|
+
for (; this.index < e.length; ) {
|
|
657
|
+
const r = this.index;
|
|
658
|
+
if (this.index++, e[r].call(), this.index > this.capacity) {
|
|
659
|
+
for (let n = 0, i = e.length - this.index; n < i; n++)
|
|
660
|
+
e[n] = e[n + this.index];
|
|
661
|
+
e.length -= this.index, this.index = 0;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
e.length = 0, this.index = 0, this.flushing = !1;
|
|
665
|
+
}, this.registerPendingError = (e) => {
|
|
666
|
+
this.pendingErrors.push(e), this.requestErrorThrow();
|
|
667
|
+
}, this.requestFlush = Vt(this.flush), this.requestErrorThrow = xe(() => {
|
|
668
|
+
if (this.pendingErrors.length)
|
|
669
|
+
throw this.pendingErrors.shift();
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
class Bt {
|
|
674
|
+
call() {
|
|
675
|
+
try {
|
|
676
|
+
this.task && this.task();
|
|
677
|
+
} catch (e) {
|
|
678
|
+
this.onError(e);
|
|
679
|
+
} finally {
|
|
680
|
+
this.task = null, this.release(this);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
constructor(e, r) {
|
|
684
|
+
this.onError = e, this.release = r, this.task = null;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
class qt {
|
|
688
|
+
create(e) {
|
|
689
|
+
const r = this.freeTasks, n = r.length ? r.pop() : new Bt(
|
|
690
|
+
this.onError,
|
|
691
|
+
(i) => r[r.length] = i
|
|
692
|
+
);
|
|
693
|
+
return n.task = e, n;
|
|
694
|
+
}
|
|
695
|
+
constructor(e) {
|
|
696
|
+
this.onError = e, this.freeTasks = [];
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const Re = new Ft(), $t = new qt(Re.registerPendingError);
|
|
700
|
+
function Gt(t) {
|
|
701
|
+
Re.enqueueTask($t.create(t));
|
|
702
|
+
}
|
|
703
|
+
const ne = "dnd-core/ADD_SOURCE", ie = "dnd-core/ADD_TARGET", oe = "dnd-core/REMOVE_SOURCE", V = "dnd-core/REMOVE_TARGET";
|
|
704
|
+
function Yt(t) {
|
|
705
|
+
return {
|
|
706
|
+
type: ne,
|
|
707
|
+
payload: {
|
|
708
|
+
sourceId: t
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function Xt(t) {
|
|
713
|
+
return {
|
|
714
|
+
type: ie,
|
|
715
|
+
payload: {
|
|
716
|
+
targetId: t
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function Wt(t) {
|
|
721
|
+
return {
|
|
722
|
+
type: oe,
|
|
723
|
+
payload: {
|
|
724
|
+
sourceId: t
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function zt(t) {
|
|
729
|
+
return {
|
|
730
|
+
type: V,
|
|
731
|
+
payload: {
|
|
732
|
+
targetId: t
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
function Qt(t) {
|
|
737
|
+
l(typeof t.canDrag == "function", "Expected canDrag to be a function."), l(typeof t.beginDrag == "function", "Expected beginDrag to be a function."), l(typeof t.endDrag == "function", "Expected endDrag to be a function.");
|
|
738
|
+
}
|
|
739
|
+
function Kt(t) {
|
|
740
|
+
l(typeof t.canDrop == "function", "Expected canDrop to be a function."), l(typeof t.hover == "function", "Expected hover to be a function."), l(typeof t.drop == "function", "Expected beginDrag to be a function.");
|
|
741
|
+
}
|
|
742
|
+
function Q(t, e) {
|
|
743
|
+
if (e && Array.isArray(t)) {
|
|
744
|
+
t.forEach(
|
|
745
|
+
(r) => Q(r, !1)
|
|
746
|
+
);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
l(typeof t == "string" || typeof t == "symbol", e ? "Type can only be a string, a symbol, or an array of either." : "Type can only be a string or a symbol.");
|
|
750
|
+
}
|
|
751
|
+
var T;
|
|
752
|
+
(function(t) {
|
|
753
|
+
t.SOURCE = "SOURCE", t.TARGET = "TARGET";
|
|
754
|
+
})(T || (T = {}));
|
|
755
|
+
let Jt = 0;
|
|
756
|
+
function Zt() {
|
|
757
|
+
return Jt++;
|
|
758
|
+
}
|
|
759
|
+
function er(t) {
|
|
760
|
+
const e = Zt().toString();
|
|
761
|
+
switch (t) {
|
|
762
|
+
case T.SOURCE:
|
|
763
|
+
return `S${e}`;
|
|
764
|
+
case T.TARGET:
|
|
765
|
+
return `T${e}`;
|
|
766
|
+
default:
|
|
767
|
+
throw new Error(`Unknown Handler Role: ${t}`);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function he(t) {
|
|
771
|
+
switch (t[0]) {
|
|
772
|
+
case "S":
|
|
773
|
+
return T.SOURCE;
|
|
774
|
+
case "T":
|
|
775
|
+
return T.TARGET;
|
|
776
|
+
default:
|
|
777
|
+
throw new Error(`Cannot parse handler ID: ${t}`);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
function pe(t, e) {
|
|
781
|
+
const r = t.entries();
|
|
782
|
+
let n = !1;
|
|
783
|
+
do {
|
|
784
|
+
const { done: i, value: [, o] } = r.next();
|
|
785
|
+
if (o === e)
|
|
786
|
+
return !0;
|
|
787
|
+
n = !!i;
|
|
788
|
+
} while (!n);
|
|
789
|
+
return !1;
|
|
790
|
+
}
|
|
791
|
+
class tr {
|
|
792
|
+
addSource(e, r) {
|
|
793
|
+
Q(e), Qt(r);
|
|
794
|
+
const n = this.addHandler(T.SOURCE, e, r);
|
|
795
|
+
return this.store.dispatch(Yt(n)), n;
|
|
796
|
+
}
|
|
797
|
+
addTarget(e, r) {
|
|
798
|
+
Q(e, !0), Kt(r);
|
|
799
|
+
const n = this.addHandler(T.TARGET, e, r);
|
|
800
|
+
return this.store.dispatch(Xt(n)), n;
|
|
801
|
+
}
|
|
802
|
+
containsHandler(e) {
|
|
803
|
+
return pe(this.dragSources, e) || pe(this.dropTargets, e);
|
|
804
|
+
}
|
|
805
|
+
getSource(e, r = !1) {
|
|
806
|
+
return l(this.isSourceId(e), "Expected a valid source ID."), r && e === this.pinnedSourceId ? this.pinnedSource : this.dragSources.get(e);
|
|
807
|
+
}
|
|
808
|
+
getTarget(e) {
|
|
809
|
+
return l(this.isTargetId(e), "Expected a valid target ID."), this.dropTargets.get(e);
|
|
810
|
+
}
|
|
811
|
+
getSourceType(e) {
|
|
812
|
+
return l(this.isSourceId(e), "Expected a valid source ID."), this.types.get(e);
|
|
813
|
+
}
|
|
814
|
+
getTargetType(e) {
|
|
815
|
+
return l(this.isTargetId(e), "Expected a valid target ID."), this.types.get(e);
|
|
816
|
+
}
|
|
817
|
+
isSourceId(e) {
|
|
818
|
+
return he(e) === T.SOURCE;
|
|
819
|
+
}
|
|
820
|
+
isTargetId(e) {
|
|
821
|
+
return he(e) === T.TARGET;
|
|
822
|
+
}
|
|
823
|
+
removeSource(e) {
|
|
824
|
+
l(this.getSource(e), "Expected an existing source."), this.store.dispatch(Wt(e)), Gt(() => {
|
|
825
|
+
this.dragSources.delete(e), this.types.delete(e);
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
removeTarget(e) {
|
|
829
|
+
l(this.getTarget(e), "Expected an existing target."), this.store.dispatch(zt(e)), this.dropTargets.delete(e), this.types.delete(e);
|
|
830
|
+
}
|
|
831
|
+
pinSource(e) {
|
|
832
|
+
const r = this.getSource(e);
|
|
833
|
+
l(r, "Expected an existing source."), this.pinnedSourceId = e, this.pinnedSource = r;
|
|
834
|
+
}
|
|
835
|
+
unpinSource() {
|
|
836
|
+
l(this.pinnedSource, "No source is pinned at the time."), this.pinnedSourceId = null, this.pinnedSource = null;
|
|
837
|
+
}
|
|
838
|
+
addHandler(e, r, n) {
|
|
839
|
+
const i = er(e);
|
|
840
|
+
return this.types.set(i, r), e === T.SOURCE ? this.dragSources.set(i, n) : e === T.TARGET && this.dropTargets.set(i, n), i;
|
|
841
|
+
}
|
|
842
|
+
constructor(e) {
|
|
843
|
+
this.types = /* @__PURE__ */ new Map(), this.dragSources = /* @__PURE__ */ new Map(), this.dropTargets = /* @__PURE__ */ new Map(), this.pinnedSourceId = null, this.pinnedSource = null, this.store = e;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const rr = (t, e) => t === e;
|
|
847
|
+
function nr(t, e) {
|
|
848
|
+
return !t && !e ? !0 : !t || !e ? !1 : t.x === e.x && t.y === e.y;
|
|
849
|
+
}
|
|
850
|
+
function ir(t, e, r = rr) {
|
|
851
|
+
if (t.length !== e.length)
|
|
852
|
+
return !1;
|
|
853
|
+
for (let n = 0; n < t.length; ++n)
|
|
854
|
+
if (!r(t[n], e[n]))
|
|
855
|
+
return !1;
|
|
856
|
+
return !0;
|
|
857
|
+
}
|
|
858
|
+
function or(t = R, e) {
|
|
859
|
+
switch (e.type) {
|
|
860
|
+
case H:
|
|
861
|
+
break;
|
|
862
|
+
case ne:
|
|
863
|
+
case ie:
|
|
864
|
+
case V:
|
|
865
|
+
case oe:
|
|
866
|
+
return R;
|
|
867
|
+
case A:
|
|
868
|
+
case te:
|
|
869
|
+
case U:
|
|
870
|
+
case j:
|
|
871
|
+
default:
|
|
872
|
+
return re;
|
|
873
|
+
}
|
|
874
|
+
const { targetIds: r = [], prevTargetIds: n = [] } = e.payload, i = ut(r, n);
|
|
875
|
+
if (!(i.length > 0 || !ir(r, n)))
|
|
876
|
+
return R;
|
|
877
|
+
const s = n[n.length - 1], a = r[r.length - 1];
|
|
878
|
+
return s !== a && (s && i.push(s), a && i.push(a)), i;
|
|
879
|
+
}
|
|
880
|
+
function sr(t, e, r) {
|
|
881
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
882
|
+
value: r,
|
|
883
|
+
enumerable: !0,
|
|
884
|
+
configurable: !0,
|
|
885
|
+
writable: !0
|
|
886
|
+
}) : t[e] = r, t;
|
|
887
|
+
}
|
|
888
|
+
function ar(t) {
|
|
889
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
890
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
891
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(i) {
|
|
892
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
893
|
+
}))), n.forEach(function(i) {
|
|
894
|
+
sr(t, i, r[i]);
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
return t;
|
|
898
|
+
}
|
|
899
|
+
const me = {
|
|
900
|
+
initialSourceClientOffset: null,
|
|
901
|
+
initialClientOffset: null,
|
|
902
|
+
clientOffset: null
|
|
903
|
+
};
|
|
904
|
+
function cr(t = me, e) {
|
|
905
|
+
const { payload: r } = e;
|
|
906
|
+
switch (e.type) {
|
|
907
|
+
case ee:
|
|
908
|
+
case A:
|
|
909
|
+
return {
|
|
910
|
+
initialSourceClientOffset: r.sourceClientOffset,
|
|
911
|
+
initialClientOffset: r.clientOffset,
|
|
912
|
+
clientOffset: r.clientOffset
|
|
913
|
+
};
|
|
914
|
+
case H:
|
|
915
|
+
return nr(t.clientOffset, r.clientOffset) ? t : ar({}, t, {
|
|
916
|
+
clientOffset: r.clientOffset
|
|
917
|
+
});
|
|
918
|
+
case U:
|
|
919
|
+
case j:
|
|
920
|
+
return me;
|
|
921
|
+
default:
|
|
922
|
+
return t;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
function ur(t, e, r) {
|
|
926
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
927
|
+
value: r,
|
|
928
|
+
enumerable: !0,
|
|
929
|
+
configurable: !0,
|
|
930
|
+
writable: !0
|
|
931
|
+
}) : t[e] = r, t;
|
|
932
|
+
}
|
|
933
|
+
function P(t) {
|
|
934
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
935
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
936
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(i) {
|
|
937
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
938
|
+
}))), n.forEach(function(i) {
|
|
939
|
+
ur(t, i, r[i]);
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
return t;
|
|
943
|
+
}
|
|
944
|
+
const lr = {
|
|
945
|
+
itemType: null,
|
|
946
|
+
item: null,
|
|
947
|
+
sourceId: null,
|
|
948
|
+
targetIds: [],
|
|
949
|
+
dropResult: null,
|
|
950
|
+
didDrop: !1,
|
|
951
|
+
isSourcePublic: null
|
|
952
|
+
};
|
|
953
|
+
function dr(t = lr, e) {
|
|
954
|
+
const { payload: r } = e;
|
|
955
|
+
switch (e.type) {
|
|
956
|
+
case A:
|
|
957
|
+
return P({}, t, {
|
|
958
|
+
itemType: r.itemType,
|
|
959
|
+
item: r.item,
|
|
960
|
+
sourceId: r.sourceId,
|
|
961
|
+
isSourcePublic: r.isSourcePublic,
|
|
962
|
+
dropResult: null,
|
|
963
|
+
didDrop: !1
|
|
964
|
+
});
|
|
965
|
+
case te:
|
|
966
|
+
return P({}, t, {
|
|
967
|
+
isSourcePublic: !0
|
|
968
|
+
});
|
|
969
|
+
case H:
|
|
970
|
+
return P({}, t, {
|
|
971
|
+
targetIds: r.targetIds
|
|
972
|
+
});
|
|
973
|
+
case V:
|
|
974
|
+
return t.targetIds.indexOf(r.targetId) === -1 ? t : P({}, t, {
|
|
975
|
+
targetIds: ct(t.targetIds, r.targetId)
|
|
976
|
+
});
|
|
977
|
+
case j:
|
|
978
|
+
return P({}, t, {
|
|
979
|
+
dropResult: r.dropResult,
|
|
980
|
+
didDrop: !0,
|
|
981
|
+
targetIds: []
|
|
982
|
+
});
|
|
983
|
+
case U:
|
|
984
|
+
return P({}, t, {
|
|
985
|
+
itemType: null,
|
|
986
|
+
item: null,
|
|
987
|
+
sourceId: null,
|
|
988
|
+
dropResult: null,
|
|
989
|
+
didDrop: !1,
|
|
990
|
+
isSourcePublic: null,
|
|
991
|
+
targetIds: []
|
|
992
|
+
});
|
|
993
|
+
default:
|
|
994
|
+
return t;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
function gr(t = 0, e) {
|
|
998
|
+
switch (e.type) {
|
|
999
|
+
case ne:
|
|
1000
|
+
case ie:
|
|
1001
|
+
return t + 1;
|
|
1002
|
+
case oe:
|
|
1003
|
+
case V:
|
|
1004
|
+
return t - 1;
|
|
1005
|
+
default:
|
|
1006
|
+
return t;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function fr(t = 0) {
|
|
1010
|
+
return t + 1;
|
|
1011
|
+
}
|
|
1012
|
+
function hr(t, e, r) {
|
|
1013
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
1014
|
+
value: r,
|
|
1015
|
+
enumerable: !0,
|
|
1016
|
+
configurable: !0,
|
|
1017
|
+
writable: !0
|
|
1018
|
+
}) : t[e] = r, t;
|
|
1019
|
+
}
|
|
1020
|
+
function pr(t) {
|
|
1021
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1022
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
1023
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(i) {
|
|
1024
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
1025
|
+
}))), n.forEach(function(i) {
|
|
1026
|
+
hr(t, i, r[i]);
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
return t;
|
|
1030
|
+
}
|
|
1031
|
+
function mr(t = {}, e) {
|
|
1032
|
+
return {
|
|
1033
|
+
dirtyHandlerIds: or(t.dirtyHandlerIds, {
|
|
1034
|
+
type: e.type,
|
|
1035
|
+
payload: pr({}, e.payload, {
|
|
1036
|
+
prevTargetIds: at(t, "dragOperation.targetIds", [])
|
|
1037
|
+
})
|
|
1038
|
+
}),
|
|
1039
|
+
dragOffset: cr(t.dragOffset, e),
|
|
1040
|
+
refCount: gr(t.refCount, e),
|
|
1041
|
+
dragOperation: dr(t.dragOperation, e),
|
|
1042
|
+
stateId: fr(t.stateId)
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
function vr(t, e = void 0, r = {}, n = !1) {
|
|
1046
|
+
const i = Dr(n), o = new jt(i, new tr(i)), s = new _t(i, o), a = t(s, e, r);
|
|
1047
|
+
return s.receiveBackend(a), s;
|
|
1048
|
+
}
|
|
1049
|
+
function Dr(t) {
|
|
1050
|
+
const e = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
1051
|
+
return we(mr, t && e && e({
|
|
1052
|
+
name: "dnd-core",
|
|
1053
|
+
instanceId: "dnd-core"
|
|
1054
|
+
}));
|
|
1055
|
+
}
|
|
1056
|
+
function yr(t, e) {
|
|
1057
|
+
if (t == null) return {};
|
|
1058
|
+
var r = Sr(t, e), n, i;
|
|
1059
|
+
if (Object.getOwnPropertySymbols) {
|
|
1060
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
1061
|
+
for (i = 0; i < o.length; i++)
|
|
1062
|
+
n = o[i], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
|
|
1063
|
+
}
|
|
1064
|
+
return r;
|
|
1065
|
+
}
|
|
1066
|
+
function Sr(t, e) {
|
|
1067
|
+
if (t == null) return {};
|
|
1068
|
+
var r = {}, n = Object.keys(t), i, o;
|
|
1069
|
+
for (o = 0; o < n.length; o++)
|
|
1070
|
+
i = n[o], !(e.indexOf(i) >= 0) && (r[i] = t[i]);
|
|
1071
|
+
return r;
|
|
1072
|
+
}
|
|
1073
|
+
let ve = 0;
|
|
1074
|
+
const L = /* @__PURE__ */ Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");
|
|
1075
|
+
var Or = /* @__PURE__ */ Ge(function(e) {
|
|
1076
|
+
var { children: r } = e, n = yr(e, [
|
|
1077
|
+
"children"
|
|
1078
|
+
]);
|
|
1079
|
+
const [i, o] = Tr(n);
|
|
1080
|
+
return k(() => {
|
|
1081
|
+
if (o) {
|
|
1082
|
+
const s = Me();
|
|
1083
|
+
return ++ve, () => {
|
|
1084
|
+
--ve === 0 && (s[L] = null);
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
}, []), /* @__PURE__ */ m(Ie.Provider, {
|
|
1088
|
+
value: i,
|
|
1089
|
+
children: r
|
|
1090
|
+
});
|
|
1091
|
+
});
|
|
1092
|
+
function Tr(t) {
|
|
1093
|
+
if ("manager" in t)
|
|
1094
|
+
return [
|
|
1095
|
+
{
|
|
1096
|
+
dragDropManager: t.manager
|
|
1097
|
+
},
|
|
1098
|
+
!1
|
|
1099
|
+
];
|
|
1100
|
+
const e = br(t.backend, t.context, t.options, t.debugMode), r = !t.context;
|
|
1101
|
+
return [
|
|
1102
|
+
e,
|
|
1103
|
+
r
|
|
1104
|
+
];
|
|
1105
|
+
}
|
|
1106
|
+
function br(t, e = Me(), r, n) {
|
|
1107
|
+
const i = e;
|
|
1108
|
+
return i[L] || (i[L] = {
|
|
1109
|
+
dragDropManager: vr(t, e, r, n)
|
|
1110
|
+
}), i[L];
|
|
1111
|
+
}
|
|
1112
|
+
function Me() {
|
|
1113
|
+
return typeof global < "u" ? global : window;
|
|
1114
|
+
}
|
|
1115
|
+
var q, De;
|
|
1116
|
+
function Er() {
|
|
1117
|
+
return De || (De = 1, q = function t(e, r) {
|
|
1118
|
+
if (e === r) return !0;
|
|
1119
|
+
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
1120
|
+
if (e.constructor !== r.constructor) return !1;
|
|
1121
|
+
var n, i, o;
|
|
1122
|
+
if (Array.isArray(e)) {
|
|
1123
|
+
if (n = e.length, n != r.length) return !1;
|
|
1124
|
+
for (i = n; i-- !== 0; )
|
|
1125
|
+
if (!t(e[i], r[i])) return !1;
|
|
1126
|
+
return !0;
|
|
1127
|
+
}
|
|
1128
|
+
if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags;
|
|
1129
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === r.valueOf();
|
|
1130
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === r.toString();
|
|
1131
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(r).length) return !1;
|
|
1132
|
+
for (i = n; i-- !== 0; )
|
|
1133
|
+
if (!Object.prototype.hasOwnProperty.call(r, o[i])) return !1;
|
|
1134
|
+
for (i = n; i-- !== 0; ) {
|
|
1135
|
+
var s = o[i];
|
|
1136
|
+
if (!t(e[s], r[s])) return !1;
|
|
1137
|
+
}
|
|
1138
|
+
return !0;
|
|
1139
|
+
}
|
|
1140
|
+
return e !== e && r !== r;
|
|
1141
|
+
}), q;
|
|
1142
|
+
}
|
|
1143
|
+
var Ir = Er();
|
|
1144
|
+
const wr = /* @__PURE__ */ et(Ir), C = typeof window < "u" ? Ye : k;
|
|
1145
|
+
function Cr(t, e, r) {
|
|
1146
|
+
const [n, i] = be(
|
|
1147
|
+
() => e(t)
|
|
1148
|
+
), o = Ee(() => {
|
|
1149
|
+
const s = e(t);
|
|
1150
|
+
wr(n, s) || (i(s), r && r());
|
|
1151
|
+
}, [
|
|
1152
|
+
n,
|
|
1153
|
+
t,
|
|
1154
|
+
r
|
|
1155
|
+
]);
|
|
1156
|
+
return C(o), [
|
|
1157
|
+
n,
|
|
1158
|
+
o
|
|
1159
|
+
];
|
|
1160
|
+
}
|
|
1161
|
+
function Nr(t, e, r) {
|
|
1162
|
+
const [n, i] = Cr(t, e, r);
|
|
1163
|
+
return C(function() {
|
|
1164
|
+
const s = t.getHandlerId();
|
|
1165
|
+
if (s != null)
|
|
1166
|
+
return t.subscribeToStateChange(i, {
|
|
1167
|
+
handlerIds: [
|
|
1168
|
+
s
|
|
1169
|
+
]
|
|
1170
|
+
});
|
|
1171
|
+
}, [
|
|
1172
|
+
t,
|
|
1173
|
+
i
|
|
1174
|
+
]), n;
|
|
1175
|
+
}
|
|
1176
|
+
function _e(t, e, r) {
|
|
1177
|
+
return Nr(
|
|
1178
|
+
e,
|
|
1179
|
+
t || (() => ({})),
|
|
1180
|
+
() => r.reconnect()
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
function Le(t, e) {
|
|
1184
|
+
const r = [];
|
|
1185
|
+
return typeof t != "function" && r.push(t), b(() => typeof t == "function" ? t() : t, r);
|
|
1186
|
+
}
|
|
1187
|
+
function Pr(t) {
|
|
1188
|
+
return b(
|
|
1189
|
+
() => t.hooks.dragSource(),
|
|
1190
|
+
[
|
|
1191
|
+
t
|
|
1192
|
+
]
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
function xr(t) {
|
|
1196
|
+
return b(
|
|
1197
|
+
() => t.hooks.dragPreview(),
|
|
1198
|
+
[
|
|
1199
|
+
t
|
|
1200
|
+
]
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
let $ = !1, G = !1;
|
|
1204
|
+
class Rr {
|
|
1205
|
+
receiveHandlerId(e) {
|
|
1206
|
+
this.sourceId = e;
|
|
1207
|
+
}
|
|
1208
|
+
getHandlerId() {
|
|
1209
|
+
return this.sourceId;
|
|
1210
|
+
}
|
|
1211
|
+
canDrag() {
|
|
1212
|
+
l(!$, "You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
|
|
1213
|
+
try {
|
|
1214
|
+
return $ = !0, this.internalMonitor.canDragSource(this.sourceId);
|
|
1215
|
+
} finally {
|
|
1216
|
+
$ = !1;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
isDragging() {
|
|
1220
|
+
if (!this.sourceId)
|
|
1221
|
+
return !1;
|
|
1222
|
+
l(!G, "You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
|
|
1223
|
+
try {
|
|
1224
|
+
return G = !0, this.internalMonitor.isDraggingSource(this.sourceId);
|
|
1225
|
+
} finally {
|
|
1226
|
+
G = !1;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
subscribeToStateChange(e, r) {
|
|
1230
|
+
return this.internalMonitor.subscribeToStateChange(e, r);
|
|
1231
|
+
}
|
|
1232
|
+
isDraggingSource(e) {
|
|
1233
|
+
return this.internalMonitor.isDraggingSource(e);
|
|
1234
|
+
}
|
|
1235
|
+
isOverTarget(e, r) {
|
|
1236
|
+
return this.internalMonitor.isOverTarget(e, r);
|
|
1237
|
+
}
|
|
1238
|
+
getTargetIds() {
|
|
1239
|
+
return this.internalMonitor.getTargetIds();
|
|
1240
|
+
}
|
|
1241
|
+
isSourcePublic() {
|
|
1242
|
+
return this.internalMonitor.isSourcePublic();
|
|
1243
|
+
}
|
|
1244
|
+
getSourceId() {
|
|
1245
|
+
return this.internalMonitor.getSourceId();
|
|
1246
|
+
}
|
|
1247
|
+
subscribeToOffsetChange(e) {
|
|
1248
|
+
return this.internalMonitor.subscribeToOffsetChange(e);
|
|
1249
|
+
}
|
|
1250
|
+
canDragSource(e) {
|
|
1251
|
+
return this.internalMonitor.canDragSource(e);
|
|
1252
|
+
}
|
|
1253
|
+
canDropOnTarget(e) {
|
|
1254
|
+
return this.internalMonitor.canDropOnTarget(e);
|
|
1255
|
+
}
|
|
1256
|
+
getItemType() {
|
|
1257
|
+
return this.internalMonitor.getItemType();
|
|
1258
|
+
}
|
|
1259
|
+
getItem() {
|
|
1260
|
+
return this.internalMonitor.getItem();
|
|
1261
|
+
}
|
|
1262
|
+
getDropResult() {
|
|
1263
|
+
return this.internalMonitor.getDropResult();
|
|
1264
|
+
}
|
|
1265
|
+
didDrop() {
|
|
1266
|
+
return this.internalMonitor.didDrop();
|
|
1267
|
+
}
|
|
1268
|
+
getInitialClientOffset() {
|
|
1269
|
+
return this.internalMonitor.getInitialClientOffset();
|
|
1270
|
+
}
|
|
1271
|
+
getInitialSourceClientOffset() {
|
|
1272
|
+
return this.internalMonitor.getInitialSourceClientOffset();
|
|
1273
|
+
}
|
|
1274
|
+
getSourceClientOffset() {
|
|
1275
|
+
return this.internalMonitor.getSourceClientOffset();
|
|
1276
|
+
}
|
|
1277
|
+
getClientOffset() {
|
|
1278
|
+
return this.internalMonitor.getClientOffset();
|
|
1279
|
+
}
|
|
1280
|
+
getDifferenceFromInitialOffset() {
|
|
1281
|
+
return this.internalMonitor.getDifferenceFromInitialOffset();
|
|
1282
|
+
}
|
|
1283
|
+
constructor(e) {
|
|
1284
|
+
this.sourceId = null, this.internalMonitor = e.getMonitor();
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
let Y = !1;
|
|
1288
|
+
class Mr {
|
|
1289
|
+
receiveHandlerId(e) {
|
|
1290
|
+
this.targetId = e;
|
|
1291
|
+
}
|
|
1292
|
+
getHandlerId() {
|
|
1293
|
+
return this.targetId;
|
|
1294
|
+
}
|
|
1295
|
+
subscribeToStateChange(e, r) {
|
|
1296
|
+
return this.internalMonitor.subscribeToStateChange(e, r);
|
|
1297
|
+
}
|
|
1298
|
+
canDrop() {
|
|
1299
|
+
if (!this.targetId)
|
|
1300
|
+
return !1;
|
|
1301
|
+
l(!Y, "You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");
|
|
1302
|
+
try {
|
|
1303
|
+
return Y = !0, this.internalMonitor.canDropOnTarget(this.targetId);
|
|
1304
|
+
} finally {
|
|
1305
|
+
Y = !1;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
isOver(e) {
|
|
1309
|
+
return this.targetId ? this.internalMonitor.isOverTarget(this.targetId, e) : !1;
|
|
1310
|
+
}
|
|
1311
|
+
getItemType() {
|
|
1312
|
+
return this.internalMonitor.getItemType();
|
|
1313
|
+
}
|
|
1314
|
+
getItem() {
|
|
1315
|
+
return this.internalMonitor.getItem();
|
|
1316
|
+
}
|
|
1317
|
+
getDropResult() {
|
|
1318
|
+
return this.internalMonitor.getDropResult();
|
|
1319
|
+
}
|
|
1320
|
+
didDrop() {
|
|
1321
|
+
return this.internalMonitor.didDrop();
|
|
1322
|
+
}
|
|
1323
|
+
getInitialClientOffset() {
|
|
1324
|
+
return this.internalMonitor.getInitialClientOffset();
|
|
1325
|
+
}
|
|
1326
|
+
getInitialSourceClientOffset() {
|
|
1327
|
+
return this.internalMonitor.getInitialSourceClientOffset();
|
|
1328
|
+
}
|
|
1329
|
+
getSourceClientOffset() {
|
|
1330
|
+
return this.internalMonitor.getSourceClientOffset();
|
|
1331
|
+
}
|
|
1332
|
+
getClientOffset() {
|
|
1333
|
+
return this.internalMonitor.getClientOffset();
|
|
1334
|
+
}
|
|
1335
|
+
getDifferenceFromInitialOffset() {
|
|
1336
|
+
return this.internalMonitor.getDifferenceFromInitialOffset();
|
|
1337
|
+
}
|
|
1338
|
+
constructor(e) {
|
|
1339
|
+
this.targetId = null, this.internalMonitor = e.getMonitor();
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
function _r(t, e, r) {
|
|
1343
|
+
const n = r.getRegistry(), i = n.addTarget(t, e);
|
|
1344
|
+
return [
|
|
1345
|
+
i,
|
|
1346
|
+
() => n.removeTarget(i)
|
|
1347
|
+
];
|
|
1348
|
+
}
|
|
1349
|
+
function Lr(t, e, r) {
|
|
1350
|
+
const n = r.getRegistry(), i = n.addSource(t, e);
|
|
1351
|
+
return [
|
|
1352
|
+
i,
|
|
1353
|
+
() => n.removeSource(i)
|
|
1354
|
+
];
|
|
1355
|
+
}
|
|
1356
|
+
function K(t, e, r, n) {
|
|
1357
|
+
let i;
|
|
1358
|
+
if (i !== void 0)
|
|
1359
|
+
return !!i;
|
|
1360
|
+
if (t === e)
|
|
1361
|
+
return !0;
|
|
1362
|
+
if (typeof t != "object" || !t || typeof e != "object" || !e)
|
|
1363
|
+
return !1;
|
|
1364
|
+
const o = Object.keys(t), s = Object.keys(e);
|
|
1365
|
+
if (o.length !== s.length)
|
|
1366
|
+
return !1;
|
|
1367
|
+
const a = Object.prototype.hasOwnProperty.bind(e);
|
|
1368
|
+
for (let c = 0; c < o.length; c++) {
|
|
1369
|
+
const d = o[c];
|
|
1370
|
+
if (!a(d))
|
|
1371
|
+
return !1;
|
|
1372
|
+
const f = t[d], p = e[d];
|
|
1373
|
+
if (i = void 0, i === !1 || i === void 0 && f !== p)
|
|
1374
|
+
return !1;
|
|
1375
|
+
}
|
|
1376
|
+
return !0;
|
|
1377
|
+
}
|
|
1378
|
+
function J(t) {
|
|
1379
|
+
return (
|
|
1380
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1381
|
+
t !== null && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current")
|
|
1382
|
+
);
|
|
1383
|
+
}
|
|
1384
|
+
function kr(t) {
|
|
1385
|
+
if (typeof t.type == "string")
|
|
1386
|
+
return;
|
|
1387
|
+
const e = t.type.displayName || t.type.name || "the component";
|
|
1388
|
+
throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`);
|
|
1389
|
+
}
|
|
1390
|
+
function Ar(t) {
|
|
1391
|
+
return (e = null, r = null) => {
|
|
1392
|
+
if (!Xe(e)) {
|
|
1393
|
+
const o = e;
|
|
1394
|
+
return t(o, r), o;
|
|
1395
|
+
}
|
|
1396
|
+
const n = e;
|
|
1397
|
+
return kr(n), Hr(n, r ? (o) => t(o, r) : t);
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
function ke(t) {
|
|
1401
|
+
const e = {};
|
|
1402
|
+
return Object.keys(t).forEach((r) => {
|
|
1403
|
+
const n = t[r];
|
|
1404
|
+
if (r.endsWith("Ref"))
|
|
1405
|
+
e[r] = t[r];
|
|
1406
|
+
else {
|
|
1407
|
+
const i = Ar(n);
|
|
1408
|
+
e[r] = () => i;
|
|
1409
|
+
}
|
|
1410
|
+
}), e;
|
|
1411
|
+
}
|
|
1412
|
+
function ye(t, e) {
|
|
1413
|
+
typeof t == "function" ? t(e) : t.current = e;
|
|
1414
|
+
}
|
|
1415
|
+
function Hr(t, e) {
|
|
1416
|
+
const r = t.ref;
|
|
1417
|
+
return l(typeof r != "string", "Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"), r ? ae(t, {
|
|
1418
|
+
ref: (n) => {
|
|
1419
|
+
ye(r, n), ye(e, n);
|
|
1420
|
+
}
|
|
1421
|
+
}) : ae(t, {
|
|
1422
|
+
ref: e
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
class jr {
|
|
1426
|
+
receiveHandlerId(e) {
|
|
1427
|
+
this.handlerId !== e && (this.handlerId = e, this.reconnect());
|
|
1428
|
+
}
|
|
1429
|
+
get connectTarget() {
|
|
1430
|
+
return this.dragSource;
|
|
1431
|
+
}
|
|
1432
|
+
get dragSourceOptions() {
|
|
1433
|
+
return this.dragSourceOptionsInternal;
|
|
1434
|
+
}
|
|
1435
|
+
set dragSourceOptions(e) {
|
|
1436
|
+
this.dragSourceOptionsInternal = e;
|
|
1437
|
+
}
|
|
1438
|
+
get dragPreviewOptions() {
|
|
1439
|
+
return this.dragPreviewOptionsInternal;
|
|
1440
|
+
}
|
|
1441
|
+
set dragPreviewOptions(e) {
|
|
1442
|
+
this.dragPreviewOptionsInternal = e;
|
|
1443
|
+
}
|
|
1444
|
+
reconnect() {
|
|
1445
|
+
const e = this.reconnectDragSource();
|
|
1446
|
+
this.reconnectDragPreview(e);
|
|
1447
|
+
}
|
|
1448
|
+
reconnectDragSource() {
|
|
1449
|
+
const e = this.dragSource, r = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();
|
|
1450
|
+
return r && this.disconnectDragSource(), this.handlerId ? e ? (r && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragSource = e, this.lastConnectedDragSourceOptions = this.dragSourceOptions, this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, e, this.dragSourceOptions)), r) : (this.lastConnectedDragSource = e, r) : r;
|
|
1451
|
+
}
|
|
1452
|
+
reconnectDragPreview(e = !1) {
|
|
1453
|
+
const r = this.dragPreview, n = e || this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();
|
|
1454
|
+
if (n && this.disconnectDragPreview(), !!this.handlerId) {
|
|
1455
|
+
if (!r) {
|
|
1456
|
+
this.lastConnectedDragPreview = r;
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
n && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragPreview = r, this.lastConnectedDragPreviewOptions = this.dragPreviewOptions, this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, r, this.dragPreviewOptions));
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
didHandlerIdChange() {
|
|
1463
|
+
return this.lastConnectedHandlerId !== this.handlerId;
|
|
1464
|
+
}
|
|
1465
|
+
didConnectedDragSourceChange() {
|
|
1466
|
+
return this.lastConnectedDragSource !== this.dragSource;
|
|
1467
|
+
}
|
|
1468
|
+
didConnectedDragPreviewChange() {
|
|
1469
|
+
return this.lastConnectedDragPreview !== this.dragPreview;
|
|
1470
|
+
}
|
|
1471
|
+
didDragSourceOptionsChange() {
|
|
1472
|
+
return !K(this.lastConnectedDragSourceOptions, this.dragSourceOptions);
|
|
1473
|
+
}
|
|
1474
|
+
didDragPreviewOptionsChange() {
|
|
1475
|
+
return !K(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);
|
|
1476
|
+
}
|
|
1477
|
+
disconnectDragSource() {
|
|
1478
|
+
this.dragSourceUnsubscribe && (this.dragSourceUnsubscribe(), this.dragSourceUnsubscribe = void 0);
|
|
1479
|
+
}
|
|
1480
|
+
disconnectDragPreview() {
|
|
1481
|
+
this.dragPreviewUnsubscribe && (this.dragPreviewUnsubscribe(), this.dragPreviewUnsubscribe = void 0, this.dragPreviewNode = null, this.dragPreviewRef = null);
|
|
1482
|
+
}
|
|
1483
|
+
get dragSource() {
|
|
1484
|
+
return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;
|
|
1485
|
+
}
|
|
1486
|
+
get dragPreview() {
|
|
1487
|
+
return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;
|
|
1488
|
+
}
|
|
1489
|
+
clearDragSource() {
|
|
1490
|
+
this.dragSourceNode = null, this.dragSourceRef = null;
|
|
1491
|
+
}
|
|
1492
|
+
clearDragPreview() {
|
|
1493
|
+
this.dragPreviewNode = null, this.dragPreviewRef = null;
|
|
1494
|
+
}
|
|
1495
|
+
constructor(e) {
|
|
1496
|
+
this.hooks = ke({
|
|
1497
|
+
dragSource: (r, n) => {
|
|
1498
|
+
this.clearDragSource(), this.dragSourceOptions = n || null, J(r) ? this.dragSourceRef = r : this.dragSourceNode = r, this.reconnectDragSource();
|
|
1499
|
+
},
|
|
1500
|
+
dragPreview: (r, n) => {
|
|
1501
|
+
this.clearDragPreview(), this.dragPreviewOptions = n || null, J(r) ? this.dragPreviewRef = r : this.dragPreviewNode = r, this.reconnectDragPreview();
|
|
1502
|
+
}
|
|
1503
|
+
}), this.handlerId = null, this.dragSourceRef = null, this.dragSourceOptionsInternal = null, this.dragPreviewRef = null, this.dragPreviewOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDragSource = null, this.lastConnectedDragSourceOptions = null, this.lastConnectedDragPreview = null, this.lastConnectedDragPreviewOptions = null, this.backend = e;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
class Ur {
|
|
1507
|
+
get connectTarget() {
|
|
1508
|
+
return this.dropTarget;
|
|
1509
|
+
}
|
|
1510
|
+
reconnect() {
|
|
1511
|
+
const e = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();
|
|
1512
|
+
e && this.disconnectDropTarget();
|
|
1513
|
+
const r = this.dropTarget;
|
|
1514
|
+
if (this.handlerId) {
|
|
1515
|
+
if (!r) {
|
|
1516
|
+
this.lastConnectedDropTarget = r;
|
|
1517
|
+
return;
|
|
1518
|
+
}
|
|
1519
|
+
e && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDropTarget = r, this.lastConnectedDropTargetOptions = this.dropTargetOptions, this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, r, this.dropTargetOptions));
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
receiveHandlerId(e) {
|
|
1523
|
+
e !== this.handlerId && (this.handlerId = e, this.reconnect());
|
|
1524
|
+
}
|
|
1525
|
+
get dropTargetOptions() {
|
|
1526
|
+
return this.dropTargetOptionsInternal;
|
|
1527
|
+
}
|
|
1528
|
+
set dropTargetOptions(e) {
|
|
1529
|
+
this.dropTargetOptionsInternal = e;
|
|
1530
|
+
}
|
|
1531
|
+
didHandlerIdChange() {
|
|
1532
|
+
return this.lastConnectedHandlerId !== this.handlerId;
|
|
1533
|
+
}
|
|
1534
|
+
didDropTargetChange() {
|
|
1535
|
+
return this.lastConnectedDropTarget !== this.dropTarget;
|
|
1536
|
+
}
|
|
1537
|
+
didOptionsChange() {
|
|
1538
|
+
return !K(this.lastConnectedDropTargetOptions, this.dropTargetOptions);
|
|
1539
|
+
}
|
|
1540
|
+
disconnectDropTarget() {
|
|
1541
|
+
this.unsubscribeDropTarget && (this.unsubscribeDropTarget(), this.unsubscribeDropTarget = void 0);
|
|
1542
|
+
}
|
|
1543
|
+
get dropTarget() {
|
|
1544
|
+
return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;
|
|
1545
|
+
}
|
|
1546
|
+
clearDropTarget() {
|
|
1547
|
+
this.dropTargetRef = null, this.dropTargetNode = null;
|
|
1548
|
+
}
|
|
1549
|
+
constructor(e) {
|
|
1550
|
+
this.hooks = ke({
|
|
1551
|
+
dropTarget: (r, n) => {
|
|
1552
|
+
this.clearDropTarget(), this.dropTargetOptions = n, J(r) ? this.dropTargetRef = r : this.dropTargetNode = r, this.reconnect();
|
|
1553
|
+
}
|
|
1554
|
+
}), this.handlerId = null, this.dropTargetRef = null, this.dropTargetOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDropTarget = null, this.lastConnectedDropTargetOptions = null, this.backend = e;
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
function x() {
|
|
1558
|
+
const { dragDropManager: t } = We(Ie);
|
|
1559
|
+
return l(t != null, "Expected drag drop context"), t;
|
|
1560
|
+
}
|
|
1561
|
+
function Vr(t, e) {
|
|
1562
|
+
const r = x(), n = b(
|
|
1563
|
+
() => new jr(r.getBackend()),
|
|
1564
|
+
[
|
|
1565
|
+
r
|
|
1566
|
+
]
|
|
1567
|
+
);
|
|
1568
|
+
return C(() => (n.dragSourceOptions = t || null, n.reconnect(), () => n.disconnectDragSource()), [
|
|
1569
|
+
n,
|
|
1570
|
+
t
|
|
1571
|
+
]), C(() => (n.dragPreviewOptions = e || null, n.reconnect(), () => n.disconnectDragPreview()), [
|
|
1572
|
+
n,
|
|
1573
|
+
e
|
|
1574
|
+
]), n;
|
|
1575
|
+
}
|
|
1576
|
+
function Fr() {
|
|
1577
|
+
const t = x();
|
|
1578
|
+
return b(
|
|
1579
|
+
() => new Rr(t),
|
|
1580
|
+
[
|
|
1581
|
+
t
|
|
1582
|
+
]
|
|
1583
|
+
);
|
|
1584
|
+
}
|
|
1585
|
+
class Br {
|
|
1586
|
+
beginDrag() {
|
|
1587
|
+
const e = this.spec, r = this.monitor;
|
|
1588
|
+
let n = null;
|
|
1589
|
+
return typeof e.item == "object" ? n = e.item : typeof e.item == "function" ? n = e.item(r) : n = {}, n ?? null;
|
|
1590
|
+
}
|
|
1591
|
+
canDrag() {
|
|
1592
|
+
const e = this.spec, r = this.monitor;
|
|
1593
|
+
return typeof e.canDrag == "boolean" ? e.canDrag : typeof e.canDrag == "function" ? e.canDrag(r) : !0;
|
|
1594
|
+
}
|
|
1595
|
+
isDragging(e, r) {
|
|
1596
|
+
const n = this.spec, i = this.monitor, { isDragging: o } = n;
|
|
1597
|
+
return o ? o(i) : r === e.getSourceId();
|
|
1598
|
+
}
|
|
1599
|
+
endDrag() {
|
|
1600
|
+
const e = this.spec, r = this.monitor, n = this.connector, { end: i } = e;
|
|
1601
|
+
i && i(r.getItem(), r), n.reconnect();
|
|
1602
|
+
}
|
|
1603
|
+
constructor(e, r, n) {
|
|
1604
|
+
this.spec = e, this.monitor = r, this.connector = n;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
function qr(t, e, r) {
|
|
1608
|
+
const n = b(
|
|
1609
|
+
() => new Br(t, e, r),
|
|
1610
|
+
[
|
|
1611
|
+
e,
|
|
1612
|
+
r
|
|
1613
|
+
]
|
|
1614
|
+
);
|
|
1615
|
+
return k(() => {
|
|
1616
|
+
n.spec = t;
|
|
1617
|
+
}, [
|
|
1618
|
+
t
|
|
1619
|
+
]), n;
|
|
1620
|
+
}
|
|
1621
|
+
function $r(t) {
|
|
1622
|
+
return b(() => {
|
|
1623
|
+
const e = t.type;
|
|
1624
|
+
return l(e != null, "spec.type must be defined"), e;
|
|
1625
|
+
}, [
|
|
1626
|
+
t
|
|
1627
|
+
]);
|
|
1628
|
+
}
|
|
1629
|
+
function Gr(t, e, r) {
|
|
1630
|
+
const n = x(), i = qr(t, e, r), o = $r(t);
|
|
1631
|
+
C(function() {
|
|
1632
|
+
if (o != null) {
|
|
1633
|
+
const [a, c] = Lr(o, i, n);
|
|
1634
|
+
return e.receiveHandlerId(a), r.receiveHandlerId(a), c;
|
|
1635
|
+
}
|
|
1636
|
+
}, [
|
|
1637
|
+
n,
|
|
1638
|
+
e,
|
|
1639
|
+
r,
|
|
1640
|
+
i,
|
|
1641
|
+
o
|
|
1642
|
+
]);
|
|
1643
|
+
}
|
|
1644
|
+
function Yr(t, e) {
|
|
1645
|
+
const r = Le(t);
|
|
1646
|
+
l(!r.begin, "useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");
|
|
1647
|
+
const n = Fr(), i = Vr(r.options, r.previewOptions);
|
|
1648
|
+
return Gr(r, n, i), [
|
|
1649
|
+
_e(r.collect, n, i),
|
|
1650
|
+
Pr(i),
|
|
1651
|
+
xr(i)
|
|
1652
|
+
];
|
|
1653
|
+
}
|
|
1654
|
+
function Xr(t) {
|
|
1655
|
+
return b(
|
|
1656
|
+
() => t.hooks.dropTarget(),
|
|
1657
|
+
[
|
|
1658
|
+
t
|
|
1659
|
+
]
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
function Wr(t) {
|
|
1663
|
+
const e = x(), r = b(
|
|
1664
|
+
() => new Ur(e.getBackend()),
|
|
1665
|
+
[
|
|
1666
|
+
e
|
|
1667
|
+
]
|
|
1668
|
+
);
|
|
1669
|
+
return C(() => (r.dropTargetOptions = t || null, r.reconnect(), () => r.disconnectDropTarget()), [
|
|
1670
|
+
t
|
|
1671
|
+
]), r;
|
|
1672
|
+
}
|
|
1673
|
+
function zr() {
|
|
1674
|
+
const t = x();
|
|
1675
|
+
return b(
|
|
1676
|
+
() => new Mr(t),
|
|
1677
|
+
[
|
|
1678
|
+
t
|
|
1679
|
+
]
|
|
1680
|
+
);
|
|
1681
|
+
}
|
|
1682
|
+
function Qr(t) {
|
|
1683
|
+
const { accept: e } = t;
|
|
1684
|
+
return b(() => (l(t.accept != null, "accept must be defined"), Array.isArray(e) ? e : [
|
|
1685
|
+
e
|
|
1686
|
+
]), [
|
|
1687
|
+
e
|
|
1688
|
+
]);
|
|
1689
|
+
}
|
|
1690
|
+
class Kr {
|
|
1691
|
+
canDrop() {
|
|
1692
|
+
const e = this.spec, r = this.monitor;
|
|
1693
|
+
return e.canDrop ? e.canDrop(r.getItem(), r) : !0;
|
|
1694
|
+
}
|
|
1695
|
+
hover() {
|
|
1696
|
+
const e = this.spec, r = this.monitor;
|
|
1697
|
+
e.hover && e.hover(r.getItem(), r);
|
|
1698
|
+
}
|
|
1699
|
+
drop() {
|
|
1700
|
+
const e = this.spec, r = this.monitor;
|
|
1701
|
+
if (e.drop)
|
|
1702
|
+
return e.drop(r.getItem(), r);
|
|
1703
|
+
}
|
|
1704
|
+
constructor(e, r) {
|
|
1705
|
+
this.spec = e, this.monitor = r;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
function Jr(t, e) {
|
|
1709
|
+
const r = b(
|
|
1710
|
+
() => new Kr(t, e),
|
|
1711
|
+
[
|
|
1712
|
+
e
|
|
1713
|
+
]
|
|
1714
|
+
);
|
|
1715
|
+
return k(() => {
|
|
1716
|
+
r.spec = t;
|
|
1717
|
+
}, [
|
|
1718
|
+
t
|
|
1719
|
+
]), r;
|
|
1720
|
+
}
|
|
1721
|
+
function Zr(t, e, r) {
|
|
1722
|
+
const n = x(), i = Jr(t, e), o = Qr(t);
|
|
1723
|
+
C(function() {
|
|
1724
|
+
const [a, c] = _r(o, i, n);
|
|
1725
|
+
return e.receiveHandlerId(a), r.receiveHandlerId(a), c;
|
|
1726
|
+
}, [
|
|
1727
|
+
n,
|
|
1728
|
+
e,
|
|
1729
|
+
i,
|
|
1730
|
+
r,
|
|
1731
|
+
o.map(
|
|
1732
|
+
(s) => s.toString()
|
|
1733
|
+
).join("|")
|
|
1734
|
+
]);
|
|
1735
|
+
}
|
|
1736
|
+
function en(t, e) {
|
|
1737
|
+
const r = Le(t), n = zr(), i = Wr(r.options);
|
|
1738
|
+
return Zr(r, n, i), [
|
|
1739
|
+
_e(r.collect, n, i),
|
|
1740
|
+
Xr(i)
|
|
1741
|
+
];
|
|
1742
|
+
}
|
|
1743
|
+
function Ae(t) {
|
|
1744
|
+
let e = null;
|
|
1745
|
+
return () => (e == null && (e = t()), e);
|
|
1746
|
+
}
|
|
1747
|
+
function tn(t, e) {
|
|
1748
|
+
return t.filter(
|
|
1749
|
+
(r) => r !== e
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
function rn(t, e) {
|
|
1753
|
+
const r = /* @__PURE__ */ new Set(), n = (o) => r.add(o);
|
|
1754
|
+
t.forEach(n), e.forEach(n);
|
|
1755
|
+
const i = [];
|
|
1756
|
+
return r.forEach(
|
|
1757
|
+
(o) => i.push(o)
|
|
1758
|
+
), i;
|
|
1759
|
+
}
|
|
1760
|
+
class nn {
|
|
1761
|
+
enter(e) {
|
|
1762
|
+
const r = this.entered.length, n = (i) => this.isNodeInDocument(i) && (!i.contains || i.contains(e));
|
|
1763
|
+
return this.entered = rn(this.entered.filter(n), [
|
|
1764
|
+
e
|
|
1765
|
+
]), r === 0 && this.entered.length > 0;
|
|
1766
|
+
}
|
|
1767
|
+
leave(e) {
|
|
1768
|
+
const r = this.entered.length;
|
|
1769
|
+
return this.entered = tn(this.entered.filter(this.isNodeInDocument), e), r > 0 && this.entered.length === 0;
|
|
1770
|
+
}
|
|
1771
|
+
reset() {
|
|
1772
|
+
this.entered = [];
|
|
1773
|
+
}
|
|
1774
|
+
constructor(e) {
|
|
1775
|
+
this.entered = [], this.isNodeInDocument = e;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
class on {
|
|
1779
|
+
initializeExposedProperties() {
|
|
1780
|
+
Object.keys(this.config.exposeProperties).forEach((e) => {
|
|
1781
|
+
Object.defineProperty(this.item, e, {
|
|
1782
|
+
configurable: !0,
|
|
1783
|
+
enumerable: !0,
|
|
1784
|
+
get() {
|
|
1785
|
+
return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`), null;
|
|
1786
|
+
}
|
|
1787
|
+
});
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
loadDataTransfer(e) {
|
|
1791
|
+
if (e) {
|
|
1792
|
+
const r = {};
|
|
1793
|
+
Object.keys(this.config.exposeProperties).forEach((n) => {
|
|
1794
|
+
const i = this.config.exposeProperties[n];
|
|
1795
|
+
i != null && (r[n] = {
|
|
1796
|
+
value: i(e, this.config.matchesTypes),
|
|
1797
|
+
configurable: !0,
|
|
1798
|
+
enumerable: !0
|
|
1799
|
+
});
|
|
1800
|
+
}), Object.defineProperties(this.item, r);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
canDrag() {
|
|
1804
|
+
return !0;
|
|
1805
|
+
}
|
|
1806
|
+
beginDrag() {
|
|
1807
|
+
return this.item;
|
|
1808
|
+
}
|
|
1809
|
+
isDragging(e, r) {
|
|
1810
|
+
return r === e.getSourceId();
|
|
1811
|
+
}
|
|
1812
|
+
endDrag() {
|
|
1813
|
+
}
|
|
1814
|
+
constructor(e) {
|
|
1815
|
+
this.config = e, this.item = {}, this.initializeExposedProperties();
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
const He = "__NATIVE_FILE__", je = "__NATIVE_URL__", Ue = "__NATIVE_TEXT__", Ve = "__NATIVE_HTML__", Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1819
|
+
__proto__: null,
|
|
1820
|
+
FILE: He,
|
|
1821
|
+
HTML: Ve,
|
|
1822
|
+
TEXT: Ue,
|
|
1823
|
+
URL: je
|
|
1824
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1825
|
+
function X(t, e, r) {
|
|
1826
|
+
const n = e.reduce(
|
|
1827
|
+
(i, o) => i || t.getData(o),
|
|
1828
|
+
""
|
|
1829
|
+
);
|
|
1830
|
+
return n ?? r;
|
|
1831
|
+
}
|
|
1832
|
+
const Z = {
|
|
1833
|
+
[He]: {
|
|
1834
|
+
exposeProperties: {
|
|
1835
|
+
files: (t) => Array.prototype.slice.call(t.files),
|
|
1836
|
+
items: (t) => t.items,
|
|
1837
|
+
dataTransfer: (t) => t
|
|
1838
|
+
},
|
|
1839
|
+
matchesTypes: [
|
|
1840
|
+
"Files"
|
|
1841
|
+
]
|
|
1842
|
+
},
|
|
1843
|
+
[Ve]: {
|
|
1844
|
+
exposeProperties: {
|
|
1845
|
+
html: (t, e) => X(t, e, ""),
|
|
1846
|
+
dataTransfer: (t) => t
|
|
1847
|
+
},
|
|
1848
|
+
matchesTypes: [
|
|
1849
|
+
"Html",
|
|
1850
|
+
"text/html"
|
|
1851
|
+
]
|
|
1852
|
+
},
|
|
1853
|
+
[je]: {
|
|
1854
|
+
exposeProperties: {
|
|
1855
|
+
urls: (t, e) => X(t, e, "").split(`
|
|
1856
|
+
`),
|
|
1857
|
+
dataTransfer: (t) => t
|
|
1858
|
+
},
|
|
1859
|
+
matchesTypes: [
|
|
1860
|
+
"Url",
|
|
1861
|
+
"text/uri-list"
|
|
1862
|
+
]
|
|
1863
|
+
},
|
|
1864
|
+
[Ue]: {
|
|
1865
|
+
exposeProperties: {
|
|
1866
|
+
text: (t, e) => X(t, e, ""),
|
|
1867
|
+
dataTransfer: (t) => t
|
|
1868
|
+
},
|
|
1869
|
+
matchesTypes: [
|
|
1870
|
+
"Text",
|
|
1871
|
+
"text/plain"
|
|
1872
|
+
]
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1875
|
+
function sn(t, e) {
|
|
1876
|
+
const r = Z[t];
|
|
1877
|
+
if (!r)
|
|
1878
|
+
throw new Error(`native type ${t} has no configuration`);
|
|
1879
|
+
const n = new on(r);
|
|
1880
|
+
return n.loadDataTransfer(e), n;
|
|
1881
|
+
}
|
|
1882
|
+
function W(t) {
|
|
1883
|
+
if (!t)
|
|
1884
|
+
return null;
|
|
1885
|
+
const e = Array.prototype.slice.call(t.types || []);
|
|
1886
|
+
return Object.keys(Z).filter((r) => {
|
|
1887
|
+
const n = Z[r];
|
|
1888
|
+
return n?.matchesTypes ? n.matchesTypes.some(
|
|
1889
|
+
(i) => e.indexOf(i) > -1
|
|
1890
|
+
) : !1;
|
|
1891
|
+
})[0] || null;
|
|
1892
|
+
}
|
|
1893
|
+
const an = Ae(
|
|
1894
|
+
() => /firefox/i.test(navigator.userAgent)
|
|
1895
|
+
), Fe = Ae(
|
|
1896
|
+
() => !!window.safari
|
|
1897
|
+
);
|
|
1898
|
+
class Oe {
|
|
1899
|
+
interpolate(e) {
|
|
1900
|
+
const { xs: r, ys: n, c1s: i, c2s: o, c3s: s } = this;
|
|
1901
|
+
let a = r.length - 1;
|
|
1902
|
+
if (e === r[a])
|
|
1903
|
+
return n[a];
|
|
1904
|
+
let c = 0, d = s.length - 1, f;
|
|
1905
|
+
for (; c <= d; ) {
|
|
1906
|
+
f = Math.floor(0.5 * (c + d));
|
|
1907
|
+
const u = r[f];
|
|
1908
|
+
if (u < e)
|
|
1909
|
+
c = f + 1;
|
|
1910
|
+
else if (u > e)
|
|
1911
|
+
d = f - 1;
|
|
1912
|
+
else
|
|
1913
|
+
return n[f];
|
|
1914
|
+
}
|
|
1915
|
+
a = Math.max(0, d);
|
|
1916
|
+
const p = e - r[a], g = p * p;
|
|
1917
|
+
return n[a] + i[a] * p + o[a] * g + s[a] * p * g;
|
|
1918
|
+
}
|
|
1919
|
+
constructor(e, r) {
|
|
1920
|
+
const { length: n } = e, i = [];
|
|
1921
|
+
for (let u = 0; u < n; u++)
|
|
1922
|
+
i.push(u);
|
|
1923
|
+
i.sort(
|
|
1924
|
+
(u, D) => e[u] < e[D] ? -1 : 1
|
|
1925
|
+
);
|
|
1926
|
+
const o = [], s = [];
|
|
1927
|
+
let a, c;
|
|
1928
|
+
for (let u = 0; u < n - 1; u++)
|
|
1929
|
+
a = e[u + 1] - e[u], c = r[u + 1] - r[u], o.push(a), s.push(c / a);
|
|
1930
|
+
const d = [
|
|
1931
|
+
s[0]
|
|
1932
|
+
];
|
|
1933
|
+
for (let u = 0; u < o.length - 1; u++) {
|
|
1934
|
+
const D = s[u], h = s[u + 1];
|
|
1935
|
+
if (D * h <= 0)
|
|
1936
|
+
d.push(0);
|
|
1937
|
+
else {
|
|
1938
|
+
a = o[u];
|
|
1939
|
+
const v = o[u + 1], y = a + v;
|
|
1940
|
+
d.push(3 * y / ((y + v) / D + (y + a) / h));
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
d.push(s[s.length - 1]);
|
|
1944
|
+
const f = [], p = [];
|
|
1945
|
+
let g;
|
|
1946
|
+
for (let u = 0; u < d.length - 1; u++) {
|
|
1947
|
+
g = s[u];
|
|
1948
|
+
const D = d[u], h = 1 / o[u], v = D + d[u + 1] - g - g;
|
|
1949
|
+
f.push((g - D - v) * h), p.push(v * h * h);
|
|
1950
|
+
}
|
|
1951
|
+
this.xs = e, this.ys = r, this.c1s = d, this.c2s = f, this.c3s = p;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
const cn = 1;
|
|
1955
|
+
function Be(t) {
|
|
1956
|
+
const e = t.nodeType === cn ? t : t.parentElement;
|
|
1957
|
+
if (!e)
|
|
1958
|
+
return null;
|
|
1959
|
+
const { top: r, left: n } = e.getBoundingClientRect();
|
|
1960
|
+
return {
|
|
1961
|
+
x: n,
|
|
1962
|
+
y: r
|
|
1963
|
+
};
|
|
1964
|
+
}
|
|
1965
|
+
function M(t) {
|
|
1966
|
+
return {
|
|
1967
|
+
x: t.clientX,
|
|
1968
|
+
y: t.clientY
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
function un(t) {
|
|
1972
|
+
var e;
|
|
1973
|
+
return t.nodeName === "IMG" && (an() || !(!((e = document.documentElement) === null || e === void 0) && e.contains(t)));
|
|
1974
|
+
}
|
|
1975
|
+
function ln(t, e, r, n) {
|
|
1976
|
+
let i = t ? e.width : r, o = t ? e.height : n;
|
|
1977
|
+
return Fe() && t && (o /= window.devicePixelRatio, i /= window.devicePixelRatio), {
|
|
1978
|
+
dragPreviewWidth: i,
|
|
1979
|
+
dragPreviewHeight: o
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
function dn(t, e, r, n, i) {
|
|
1983
|
+
const o = un(e), a = Be(o ? t : e), c = {
|
|
1984
|
+
x: r.x - a.x,
|
|
1985
|
+
y: r.y - a.y
|
|
1986
|
+
}, { offsetWidth: d, offsetHeight: f } = t, { anchorX: p, anchorY: g } = n, { dragPreviewWidth: u, dragPreviewHeight: D } = ln(o, e, d, f), h = () => {
|
|
1987
|
+
let se = new Oe([
|
|
1988
|
+
0,
|
|
1989
|
+
0.5,
|
|
1990
|
+
1
|
|
1991
|
+
], [
|
|
1992
|
+
// Dock to the top
|
|
1993
|
+
c.y,
|
|
1994
|
+
// Align at the center
|
|
1995
|
+
c.y / f * D,
|
|
1996
|
+
// Dock to the bottom
|
|
1997
|
+
c.y + D - f
|
|
1998
|
+
]).interpolate(g);
|
|
1999
|
+
return Fe() && o && (se += (window.devicePixelRatio - 1) * D), se;
|
|
2000
|
+
}, v = () => new Oe([
|
|
2001
|
+
0,
|
|
2002
|
+
0.5,
|
|
2003
|
+
1
|
|
2004
|
+
], [
|
|
2005
|
+
// Dock to the left
|
|
2006
|
+
c.x,
|
|
2007
|
+
// Align at the center
|
|
2008
|
+
c.x / d * u,
|
|
2009
|
+
// Dock to the right
|
|
2010
|
+
c.x + u - d
|
|
2011
|
+
]).interpolate(p), { offsetX: y, offsetY: S } = i, I = y === 0 || y, F = S === 0 || S;
|
|
2012
|
+
return {
|
|
2013
|
+
x: I ? y : v(),
|
|
2014
|
+
y: F ? S : h()
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
class gn {
|
|
2018
|
+
get window() {
|
|
2019
|
+
if (this.globalContext)
|
|
2020
|
+
return this.globalContext;
|
|
2021
|
+
if (typeof window < "u")
|
|
2022
|
+
return window;
|
|
2023
|
+
}
|
|
2024
|
+
get document() {
|
|
2025
|
+
var e;
|
|
2026
|
+
return !((e = this.globalContext) === null || e === void 0) && e.document ? this.globalContext.document : this.window ? this.window.document : void 0;
|
|
2027
|
+
}
|
|
2028
|
+
get rootElement() {
|
|
2029
|
+
var e;
|
|
2030
|
+
return ((e = this.optionsArgs) === null || e === void 0 ? void 0 : e.rootElement) || this.window;
|
|
2031
|
+
}
|
|
2032
|
+
constructor(e, r) {
|
|
2033
|
+
this.ownerDocument = null, this.globalContext = e, this.optionsArgs = r;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
function fn(t, e, r) {
|
|
2037
|
+
return e in t ? Object.defineProperty(t, e, {
|
|
2038
|
+
value: r,
|
|
2039
|
+
enumerable: !0,
|
|
2040
|
+
configurable: !0,
|
|
2041
|
+
writable: !0
|
|
2042
|
+
}) : t[e] = r, t;
|
|
2043
|
+
}
|
|
2044
|
+
function Te(t) {
|
|
2045
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2046
|
+
var r = arguments[e] != null ? arguments[e] : {}, n = Object.keys(r);
|
|
2047
|
+
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(r).filter(function(i) {
|
|
2048
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
2049
|
+
}))), n.forEach(function(i) {
|
|
2050
|
+
fn(t, i, r[i]);
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
return t;
|
|
2054
|
+
}
|
|
2055
|
+
class hn {
|
|
2056
|
+
/**
|
|
2057
|
+
* Generate profiling statistics for the HTML5Backend.
|
|
2058
|
+
*/
|
|
2059
|
+
profile() {
|
|
2060
|
+
var e, r;
|
|
2061
|
+
return {
|
|
2062
|
+
sourcePreviewNodes: this.sourcePreviewNodes.size,
|
|
2063
|
+
sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
|
|
2064
|
+
sourceNodeOptions: this.sourceNodeOptions.size,
|
|
2065
|
+
sourceNodes: this.sourceNodes.size,
|
|
2066
|
+
dragStartSourceIds: ((e = this.dragStartSourceIds) === null || e === void 0 ? void 0 : e.length) || 0,
|
|
2067
|
+
dropTargetIds: this.dropTargetIds.length,
|
|
2068
|
+
dragEnterTargetIds: this.dragEnterTargetIds.length,
|
|
2069
|
+
dragOverTargetIds: ((r = this.dragOverTargetIds) === null || r === void 0 ? void 0 : r.length) || 0
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
// public for test
|
|
2073
|
+
get window() {
|
|
2074
|
+
return this.options.window;
|
|
2075
|
+
}
|
|
2076
|
+
get document() {
|
|
2077
|
+
return this.options.document;
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Get the root element to use for event subscriptions
|
|
2081
|
+
*/
|
|
2082
|
+
get rootElement() {
|
|
2083
|
+
return this.options.rootElement;
|
|
2084
|
+
}
|
|
2085
|
+
setup() {
|
|
2086
|
+
const e = this.rootElement;
|
|
2087
|
+
if (e !== void 0) {
|
|
2088
|
+
if (e.__isReactDndBackendSetUp)
|
|
2089
|
+
throw new Error("Cannot have two HTML5 backends at the same time.");
|
|
2090
|
+
e.__isReactDndBackendSetUp = !0, this.addEventListeners(e);
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
teardown() {
|
|
2094
|
+
const e = this.rootElement;
|
|
2095
|
+
if (e !== void 0 && (e.__isReactDndBackendSetUp = !1, this.removeEventListeners(this.rootElement), this.clearCurrentDragSourceNode(), this.asyncEndDragFrameId)) {
|
|
2096
|
+
var r;
|
|
2097
|
+
(r = this.window) === null || r === void 0 || r.cancelAnimationFrame(this.asyncEndDragFrameId);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
connectDragPreview(e, r, n) {
|
|
2101
|
+
return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, r), () => {
|
|
2102
|
+
this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
connectDragSource(e, r, n) {
|
|
2106
|
+
this.sourceNodes.set(e, r), this.sourceNodeOptions.set(e, n);
|
|
2107
|
+
const i = (s) => this.handleDragStart(s, e), o = (s) => this.handleSelectStart(s);
|
|
2108
|
+
return r.setAttribute("draggable", "true"), r.addEventListener("dragstart", i), r.addEventListener("selectstart", o), () => {
|
|
2109
|
+
this.sourceNodes.delete(e), this.sourceNodeOptions.delete(e), r.removeEventListener("dragstart", i), r.removeEventListener("selectstart", o), r.setAttribute("draggable", "false");
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
connectDropTarget(e, r) {
|
|
2113
|
+
const n = (s) => this.handleDragEnter(s, e), i = (s) => this.handleDragOver(s, e), o = (s) => this.handleDrop(s, e);
|
|
2114
|
+
return r.addEventListener("dragenter", n), r.addEventListener("dragover", i), r.addEventListener("drop", o), () => {
|
|
2115
|
+
r.removeEventListener("dragenter", n), r.removeEventListener("dragover", i), r.removeEventListener("drop", o);
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
addEventListeners(e) {
|
|
2119
|
+
e.addEventListener && (e.addEventListener("dragstart", this.handleTopDragStart), e.addEventListener("dragstart", this.handleTopDragStartCapture, !0), e.addEventListener("dragend", this.handleTopDragEndCapture, !0), e.addEventListener("dragenter", this.handleTopDragEnter), e.addEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.addEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.addEventListener("dragover", this.handleTopDragOver), e.addEventListener("dragover", this.handleTopDragOverCapture, !0), e.addEventListener("drop", this.handleTopDrop), e.addEventListener("drop", this.handleTopDropCapture, !0));
|
|
2120
|
+
}
|
|
2121
|
+
removeEventListeners(e) {
|
|
2122
|
+
e.removeEventListener && (e.removeEventListener("dragstart", this.handleTopDragStart), e.removeEventListener("dragstart", this.handleTopDragStartCapture, !0), e.removeEventListener("dragend", this.handleTopDragEndCapture, !0), e.removeEventListener("dragenter", this.handleTopDragEnter), e.removeEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.removeEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.removeEventListener("dragover", this.handleTopDragOver), e.removeEventListener("dragover", this.handleTopDragOverCapture, !0), e.removeEventListener("drop", this.handleTopDrop), e.removeEventListener("drop", this.handleTopDropCapture, !0));
|
|
2123
|
+
}
|
|
2124
|
+
getCurrentSourceNodeOptions() {
|
|
2125
|
+
const e = this.monitor.getSourceId(), r = this.sourceNodeOptions.get(e);
|
|
2126
|
+
return Te({
|
|
2127
|
+
dropEffect: this.altKeyPressed ? "copy" : "move"
|
|
2128
|
+
}, r || {});
|
|
2129
|
+
}
|
|
2130
|
+
getCurrentDropEffect() {
|
|
2131
|
+
return this.isDraggingNativeItem() ? "copy" : this.getCurrentSourceNodeOptions().dropEffect;
|
|
2132
|
+
}
|
|
2133
|
+
getCurrentSourcePreviewNodeOptions() {
|
|
2134
|
+
const e = this.monitor.getSourceId(), r = this.sourcePreviewNodeOptions.get(e);
|
|
2135
|
+
return Te({
|
|
2136
|
+
anchorX: 0.5,
|
|
2137
|
+
anchorY: 0.5,
|
|
2138
|
+
captureDraggingState: !1
|
|
2139
|
+
}, r || {});
|
|
2140
|
+
}
|
|
2141
|
+
isDraggingNativeItem() {
|
|
2142
|
+
const e = this.monitor.getItemType();
|
|
2143
|
+
return Object.keys(Se).some(
|
|
2144
|
+
(r) => Se[r] === e
|
|
2145
|
+
);
|
|
2146
|
+
}
|
|
2147
|
+
beginDragNativeItem(e, r) {
|
|
2148
|
+
this.clearCurrentDragSourceNode(), this.currentNativeSource = sn(e, r), this.currentNativeHandle = this.registry.addSource(e, this.currentNativeSource), this.actions.beginDrag([
|
|
2149
|
+
this.currentNativeHandle
|
|
2150
|
+
]);
|
|
2151
|
+
}
|
|
2152
|
+
setCurrentDragSourceNode(e) {
|
|
2153
|
+
this.clearCurrentDragSourceNode(), this.currentDragSourceNode = e;
|
|
2154
|
+
const r = 1e3;
|
|
2155
|
+
this.mouseMoveTimeoutTimer = setTimeout(() => {
|
|
2156
|
+
var n;
|
|
2157
|
+
return (n = this.rootElement) === null || n === void 0 ? void 0 : n.addEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
|
|
2158
|
+
}, r);
|
|
2159
|
+
}
|
|
2160
|
+
clearCurrentDragSourceNode() {
|
|
2161
|
+
if (this.currentDragSourceNode) {
|
|
2162
|
+
if (this.currentDragSourceNode = null, this.rootElement) {
|
|
2163
|
+
var e;
|
|
2164
|
+
(e = this.window) === null || e === void 0 || e.clearTimeout(this.mouseMoveTimeoutTimer || void 0), this.rootElement.removeEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
|
|
2165
|
+
}
|
|
2166
|
+
return this.mouseMoveTimeoutTimer = null, !0;
|
|
2167
|
+
}
|
|
2168
|
+
return !1;
|
|
2169
|
+
}
|
|
2170
|
+
handleDragStart(e, r) {
|
|
2171
|
+
e.defaultPrevented || (this.dragStartSourceIds || (this.dragStartSourceIds = []), this.dragStartSourceIds.unshift(r));
|
|
2172
|
+
}
|
|
2173
|
+
handleDragEnter(e, r) {
|
|
2174
|
+
this.dragEnterTargetIds.unshift(r);
|
|
2175
|
+
}
|
|
2176
|
+
handleDragOver(e, r) {
|
|
2177
|
+
this.dragOverTargetIds === null && (this.dragOverTargetIds = []), this.dragOverTargetIds.unshift(r);
|
|
2178
|
+
}
|
|
2179
|
+
handleDrop(e, r) {
|
|
2180
|
+
this.dropTargetIds.unshift(r);
|
|
2181
|
+
}
|
|
2182
|
+
constructor(e, r, n) {
|
|
2183
|
+
this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourceNodeOptions = /* @__PURE__ */ new Map(), this.dragStartSourceIds = null, this.dropTargetIds = [], this.dragEnterTargetIds = [], this.currentNativeSource = null, this.currentNativeHandle = null, this.currentDragSourceNode = null, this.altKeyPressed = !1, this.mouseMoveTimeoutTimer = null, this.asyncEndDragFrameId = null, this.dragOverTargetIds = null, this.lastClientOffset = null, this.hoverRafId = null, this.getSourceClientOffset = (i) => {
|
|
2184
|
+
const o = this.sourceNodes.get(i);
|
|
2185
|
+
return o && Be(o) || null;
|
|
2186
|
+
}, this.endDragNativeItem = () => {
|
|
2187
|
+
this.isDraggingNativeItem() && (this.actions.endDrag(), this.currentNativeHandle && this.registry.removeSource(this.currentNativeHandle), this.currentNativeHandle = null, this.currentNativeSource = null);
|
|
2188
|
+
}, this.isNodeInDocument = (i) => !!(i && this.document && this.document.body && this.document.body.contains(i)), this.endDragIfSourceWasRemovedFromDOM = () => {
|
|
2189
|
+
const i = this.currentDragSourceNode;
|
|
2190
|
+
i == null || this.isNodeInDocument(i) || (this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover());
|
|
2191
|
+
}, this.scheduleHover = (i) => {
|
|
2192
|
+
this.hoverRafId === null && typeof requestAnimationFrame < "u" && (this.hoverRafId = requestAnimationFrame(() => {
|
|
2193
|
+
this.monitor.isDragging() && this.actions.hover(i || [], {
|
|
2194
|
+
clientOffset: this.lastClientOffset
|
|
2195
|
+
}), this.hoverRafId = null;
|
|
2196
|
+
}));
|
|
2197
|
+
}, this.cancelHover = () => {
|
|
2198
|
+
this.hoverRafId !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(this.hoverRafId), this.hoverRafId = null);
|
|
2199
|
+
}, this.handleTopDragStartCapture = () => {
|
|
2200
|
+
this.clearCurrentDragSourceNode(), this.dragStartSourceIds = [];
|
|
2201
|
+
}, this.handleTopDragStart = (i) => {
|
|
2202
|
+
if (i.defaultPrevented)
|
|
2203
|
+
return;
|
|
2204
|
+
const { dragStartSourceIds: o } = this;
|
|
2205
|
+
this.dragStartSourceIds = null;
|
|
2206
|
+
const s = M(i);
|
|
2207
|
+
this.monitor.isDragging() && (this.actions.endDrag(), this.cancelHover()), this.actions.beginDrag(o || [], {
|
|
2208
|
+
publishSource: !1,
|
|
2209
|
+
getSourceClientOffset: this.getSourceClientOffset,
|
|
2210
|
+
clientOffset: s
|
|
2211
|
+
});
|
|
2212
|
+
const { dataTransfer: a } = i, c = W(a);
|
|
2213
|
+
if (this.monitor.isDragging()) {
|
|
2214
|
+
if (a && typeof a.setDragImage == "function") {
|
|
2215
|
+
const f = this.monitor.getSourceId(), p = this.sourceNodes.get(f), g = this.sourcePreviewNodes.get(f) || p;
|
|
2216
|
+
if (g) {
|
|
2217
|
+
const { anchorX: u, anchorY: D, offsetX: h, offsetY: v } = this.getCurrentSourcePreviewNodeOptions(), I = dn(p, g, s, {
|
|
2218
|
+
anchorX: u,
|
|
2219
|
+
anchorY: D
|
|
2220
|
+
}, {
|
|
2221
|
+
offsetX: h,
|
|
2222
|
+
offsetY: v
|
|
2223
|
+
});
|
|
2224
|
+
a.setDragImage(g, I.x, I.y);
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
try {
|
|
2228
|
+
a?.setData("application/json", {});
|
|
2229
|
+
} catch {
|
|
2230
|
+
}
|
|
2231
|
+
this.setCurrentDragSourceNode(i.target);
|
|
2232
|
+
const { captureDraggingState: d } = this.getCurrentSourcePreviewNodeOptions();
|
|
2233
|
+
d ? this.actions.publishDragSource() : setTimeout(
|
|
2234
|
+
() => this.actions.publishDragSource(),
|
|
2235
|
+
0
|
|
2236
|
+
);
|
|
2237
|
+
} else if (c)
|
|
2238
|
+
this.beginDragNativeItem(c);
|
|
2239
|
+
else {
|
|
2240
|
+
if (a && !a.types && (i.target && !i.target.hasAttribute || !i.target.hasAttribute("draggable")))
|
|
2241
|
+
return;
|
|
2242
|
+
i.preventDefault();
|
|
2243
|
+
}
|
|
2244
|
+
}, this.handleTopDragEndCapture = () => {
|
|
2245
|
+
this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
|
|
2246
|
+
}, this.handleTopDragEnterCapture = (i) => {
|
|
2247
|
+
if (this.dragEnterTargetIds = [], this.isDraggingNativeItem()) {
|
|
2248
|
+
var o;
|
|
2249
|
+
(o = this.currentNativeSource) === null || o === void 0 || o.loadDataTransfer(i.dataTransfer);
|
|
2250
|
+
}
|
|
2251
|
+
if (!this.enterLeaveCounter.enter(i.target) || this.monitor.isDragging())
|
|
2252
|
+
return;
|
|
2253
|
+
const { dataTransfer: a } = i, c = W(a);
|
|
2254
|
+
c && this.beginDragNativeItem(c, a);
|
|
2255
|
+
}, this.handleTopDragEnter = (i) => {
|
|
2256
|
+
const { dragEnterTargetIds: o } = this;
|
|
2257
|
+
if (this.dragEnterTargetIds = [], !this.monitor.isDragging())
|
|
2258
|
+
return;
|
|
2259
|
+
this.altKeyPressed = i.altKey, o.length > 0 && this.actions.hover(o, {
|
|
2260
|
+
clientOffset: M(i)
|
|
2261
|
+
}), o.some(
|
|
2262
|
+
(a) => this.monitor.canDropOnTarget(a)
|
|
2263
|
+
) && (i.preventDefault(), i.dataTransfer && (i.dataTransfer.dropEffect = this.getCurrentDropEffect()));
|
|
2264
|
+
}, this.handleTopDragOverCapture = (i) => {
|
|
2265
|
+
if (this.dragOverTargetIds = [], this.isDraggingNativeItem()) {
|
|
2266
|
+
var o;
|
|
2267
|
+
(o = this.currentNativeSource) === null || o === void 0 || o.loadDataTransfer(i.dataTransfer);
|
|
2268
|
+
}
|
|
2269
|
+
}, this.handleTopDragOver = (i) => {
|
|
2270
|
+
const { dragOverTargetIds: o } = this;
|
|
2271
|
+
if (this.dragOverTargetIds = [], !this.monitor.isDragging()) {
|
|
2272
|
+
i.preventDefault(), i.dataTransfer && (i.dataTransfer.dropEffect = "none");
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
this.altKeyPressed = i.altKey, this.lastClientOffset = M(i), this.scheduleHover(o), (o || []).some(
|
|
2276
|
+
(a) => this.monitor.canDropOnTarget(a)
|
|
2277
|
+
) ? (i.preventDefault(), i.dataTransfer && (i.dataTransfer.dropEffect = this.getCurrentDropEffect())) : this.isDraggingNativeItem() ? i.preventDefault() : (i.preventDefault(), i.dataTransfer && (i.dataTransfer.dropEffect = "none"));
|
|
2278
|
+
}, this.handleTopDragLeaveCapture = (i) => {
|
|
2279
|
+
this.isDraggingNativeItem() && i.preventDefault(), this.enterLeaveCounter.leave(i.target) && (this.isDraggingNativeItem() && setTimeout(
|
|
2280
|
+
() => this.endDragNativeItem(),
|
|
2281
|
+
0
|
|
2282
|
+
), this.cancelHover());
|
|
2283
|
+
}, this.handleTopDropCapture = (i) => {
|
|
2284
|
+
if (this.dropTargetIds = [], this.isDraggingNativeItem()) {
|
|
2285
|
+
var o;
|
|
2286
|
+
i.preventDefault(), (o = this.currentNativeSource) === null || o === void 0 || o.loadDataTransfer(i.dataTransfer);
|
|
2287
|
+
} else W(i.dataTransfer) && i.preventDefault();
|
|
2288
|
+
this.enterLeaveCounter.reset();
|
|
2289
|
+
}, this.handleTopDrop = (i) => {
|
|
2290
|
+
const { dropTargetIds: o } = this;
|
|
2291
|
+
this.dropTargetIds = [], this.actions.hover(o, {
|
|
2292
|
+
clientOffset: M(i)
|
|
2293
|
+
}), this.actions.drop({
|
|
2294
|
+
dropEffect: this.getCurrentDropEffect()
|
|
2295
|
+
}), this.isDraggingNativeItem() ? this.endDragNativeItem() : this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
|
|
2296
|
+
}, this.handleSelectStart = (i) => {
|
|
2297
|
+
const o = i.target;
|
|
2298
|
+
typeof o.dragDrop == "function" && (o.tagName === "INPUT" || o.tagName === "SELECT" || o.tagName === "TEXTAREA" || o.isContentEditable || (i.preventDefault(), o.dragDrop()));
|
|
2299
|
+
}, this.options = new gn(r, n), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.registry = e.getRegistry(), this.enterLeaveCounter = new nn(this.isNodeInDocument);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
const pn = function(e, r, n) {
|
|
2303
|
+
return new hn(e, r, n);
|
|
2304
|
+
}, mn = (t) => /* @__PURE__ */ w.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ w.createElement("circle", { cx: 6, cy: 4, r: 1.25, fill: "#2B2B2B" }), /* @__PURE__ */ w.createElement("circle", { cx: 10, cy: 4, r: 1.25, fill: "#2B2B2B" }), /* @__PURE__ */ w.createElement("circle", { cx: 6, cy: 8, r: 1.25, fill: "#2B2B2B" }), /* @__PURE__ */ w.createElement("circle", { cx: 10, cy: 8, r: 1.25, fill: "#2B2B2B" }), /* @__PURE__ */ w.createElement("circle", { cx: 6, cy: 12, r: 1.25, fill: "#2B2B2B" }), /* @__PURE__ */ w.createElement("circle", { cx: 10, cy: 12, r: 1.25, fill: "#2B2B2B" }));
|
|
2305
|
+
function vn({
|
|
2306
|
+
column: t,
|
|
2307
|
+
index: e,
|
|
2308
|
+
moveListItem: r,
|
|
2309
|
+
visibility: n,
|
|
2310
|
+
onToggleVisibility: i
|
|
2311
|
+
}) {
|
|
2312
|
+
const o = t.isDraggable !== !1, s = t.toogleVisibility !== !1 && t.toggleVisibility !== !1, a = ze(null), [, c] = en({
|
|
2313
|
+
accept: ce,
|
|
2314
|
+
hover(p) {
|
|
2315
|
+
o && p.index !== e && (r(p.index, e), p.index = e);
|
|
2316
|
+
}
|
|
2317
|
+
}), [{ isDragging: d }, f] = Yr({
|
|
2318
|
+
type: ce,
|
|
2319
|
+
item: { index: e },
|
|
2320
|
+
canDrag: o,
|
|
2321
|
+
collect: (p) => ({
|
|
2322
|
+
isDragging: p.isDragging()
|
|
2323
|
+
})
|
|
2324
|
+
});
|
|
2325
|
+
return o ? f(c(a)) : c(a), /* @__PURE__ */ E(
|
|
2326
|
+
"div",
|
|
2327
|
+
{
|
|
2328
|
+
ref: a,
|
|
2329
|
+
className: "ckds-dragable-list-item",
|
|
2330
|
+
style: { opacity: d ? 0.5 : 1 },
|
|
2331
|
+
children: [
|
|
2332
|
+
/* @__PURE__ */ m(
|
|
2333
|
+
"div",
|
|
2334
|
+
{
|
|
2335
|
+
className: "ckds-drag-handle",
|
|
2336
|
+
style: { cursor: o ? "grab" : "not-allowed", opacity: o ? 1 : 0.3 },
|
|
2337
|
+
children: /* @__PURE__ */ m(mn, { style: { color: "var(--ckcl-black-500, #2b2b2b)" } })
|
|
2338
|
+
}
|
|
2339
|
+
),
|
|
2340
|
+
/* @__PURE__ */ m(_, { variant: "body-sm", className: "ckds-dragable-list-item-label", children: t.header }),
|
|
2341
|
+
/* @__PURE__ */ m(
|
|
2342
|
+
Qe,
|
|
2343
|
+
{
|
|
2344
|
+
checked: n[t.accessorKey] !== !1,
|
|
2345
|
+
onChange: () => i(t.accessorKey),
|
|
2346
|
+
disabled: !s,
|
|
2347
|
+
className: "ckds-dragable-list-item-toggle"
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
]
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
function Pn({
|
|
2355
|
+
draftConfig: t,
|
|
2356
|
+
setDraftConfig: e,
|
|
2357
|
+
moveDraftColumn: r,
|
|
2358
|
+
handleApplyPref: n,
|
|
2359
|
+
setModalOpen: i,
|
|
2360
|
+
handleResetToDefault: o,
|
|
2361
|
+
isDefault: s,
|
|
2362
|
+
isConfigChanged: a
|
|
2363
|
+
}) {
|
|
2364
|
+
const [c, d] = be(""), f = Ee(
|
|
2365
|
+
(g) => {
|
|
2366
|
+
e((u) => ({
|
|
2367
|
+
...u,
|
|
2368
|
+
columnVisibility: {
|
|
2369
|
+
...u.columnVisibility,
|
|
2370
|
+
[g]: !(u.columnVisibility[g] ?? !0)
|
|
2371
|
+
}
|
|
2372
|
+
}));
|
|
2373
|
+
},
|
|
2374
|
+
[e]
|
|
2375
|
+
), p = t.columns.filter(
|
|
2376
|
+
(g) => g.header.toLowerCase().includes(c.toLowerCase())
|
|
2377
|
+
);
|
|
2378
|
+
return /* @__PURE__ */ E(Or, { backend: pn, children: [
|
|
2379
|
+
/* @__PURE__ */ E("div", { className: "ckds-column-manager-wrapper", children: [
|
|
2380
|
+
/* @__PURE__ */ E("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
2381
|
+
/* @__PURE__ */ m(_, { variant: "body-lg", weight: "semibold", children: "Column Manager" }),
|
|
2382
|
+
/* @__PURE__ */ m(
|
|
2383
|
+
B,
|
|
2384
|
+
{
|
|
2385
|
+
onClick: o,
|
|
2386
|
+
variant: "hyperlink",
|
|
2387
|
+
disabled: s,
|
|
2388
|
+
icons: { left: /* @__PURE__ */ m(Ke, {}) },
|
|
2389
|
+
label: "Reset to default"
|
|
2390
|
+
}
|
|
2391
|
+
)
|
|
2392
|
+
] }),
|
|
2393
|
+
/* @__PURE__ */ E("div", { style: { display: "flex", marginTop: "24px" }, children: [
|
|
2394
|
+
/* @__PURE__ */ m(Ze, { draftConfig: t, setDraftConfig: e }),
|
|
2395
|
+
/* @__PURE__ */ E("div", { style: { flex: 1, marginLeft: "28px" }, children: [
|
|
2396
|
+
/* @__PURE__ */ m(_, { variant: "body-sm", weight: "medium", children: "Visible Columns" }),
|
|
2397
|
+
/* @__PURE__ */ m(_, { variant: "body-xs", color: "secondary", children: "Toggle columns on/off and drag to reorder" }),
|
|
2398
|
+
/* @__PURE__ */ m(
|
|
2399
|
+
"div",
|
|
2400
|
+
{
|
|
2401
|
+
className: p.length > 9 ? "ckds-search-border-bottom" : "",
|
|
2402
|
+
style: { paddingBottom: "12px", marginTop: "16px" },
|
|
2403
|
+
children: /* @__PURE__ */ E("div", { className: "ckds-search-input-wrapper", children: [
|
|
2404
|
+
/* @__PURE__ */ m(Je, {}),
|
|
2405
|
+
/* @__PURE__ */ m(
|
|
2406
|
+
"input",
|
|
2407
|
+
{
|
|
2408
|
+
placeholder: "Search here",
|
|
2409
|
+
className: "ckds-table-search-input",
|
|
2410
|
+
value: c,
|
|
2411
|
+
onChange: (g) => d(g.target.value)
|
|
2412
|
+
}
|
|
2413
|
+
)
|
|
2414
|
+
] })
|
|
2415
|
+
}
|
|
2416
|
+
),
|
|
2417
|
+
/* @__PURE__ */ m("div", { children: c && p.length === 0 ? /* @__PURE__ */ m("div", { style: { display: "flex", flex: 1, alignItems: "center", justifyContent: "center", height: "318px" }, children: /* @__PURE__ */ m("p", { className: "text-sm", style: { color: "var(--ckcl-black-400, #737373)" }, children: "No columns found" }) }) : /* @__PURE__ */ m("div", { className: "ckds-dragable-list ckds-custom-scrollbar", children: p.map((g, u) => /* @__PURE__ */ m(
|
|
2418
|
+
vn,
|
|
2419
|
+
{
|
|
2420
|
+
column: g,
|
|
2421
|
+
index: u,
|
|
2422
|
+
moveListItem: r,
|
|
2423
|
+
visibility: t.columnVisibility,
|
|
2424
|
+
onToggleVisibility: f
|
|
2425
|
+
},
|
|
2426
|
+
g.accessorKey
|
|
2427
|
+
)) }) })
|
|
2428
|
+
] })
|
|
2429
|
+
] })
|
|
2430
|
+
] }),
|
|
2431
|
+
/* @__PURE__ */ E("div", { className: "ckds-column-manager-footer", children: [
|
|
2432
|
+
/* @__PURE__ */ m(
|
|
2433
|
+
B,
|
|
2434
|
+
{
|
|
2435
|
+
onClick: () => i({ open: !1, type: "columnManager", activeOption: "" }),
|
|
2436
|
+
variant: "secondary",
|
|
2437
|
+
size: "large",
|
|
2438
|
+
label: "Cancel"
|
|
2439
|
+
}
|
|
2440
|
+
),
|
|
2441
|
+
/* @__PURE__ */ m(
|
|
2442
|
+
B,
|
|
2443
|
+
{
|
|
2444
|
+
onClick: n,
|
|
2445
|
+
variant: "primary",
|
|
2446
|
+
size: "large",
|
|
2447
|
+
disabled: !a,
|
|
2448
|
+
label: "Apply"
|
|
2449
|
+
}
|
|
2450
|
+
)
|
|
2451
|
+
] })
|
|
2452
|
+
] });
|
|
2453
|
+
}
|
|
2454
|
+
export {
|
|
2455
|
+
Pn as default
|
|
2456
|
+
};
|