@baishuyun/ui-base 6.3.2 → 6.4.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/Amap/AmapProvider/index.js +3 -3
- package/dist/Amap/{AmapProvider-CTn2CH8s.js → AmapProvider-By5tTMAj.js} +1 -1
- package/dist/Amap/index.js +3 -3
- package/dist/Calendar/{AllDaySection-DS0Frx1p.js → AllDaySection-DwQz-p7a.js} +3 -3
- package/dist/Calendar/{Calendar-BIjk9zys.js → Calendar-CuBzeTkR.js} +84 -95
- package/dist/Calendar/{CurrentTimeIndicator-DaIywtIA.js → CurrentTimeIndicator-CUeblc9r.js} +2 -2
- package/dist/Calendar/{EventCard-D_VeOVDQ.js → EventCard-DRJrT_AG.js} +2 -2
- package/dist/Calendar/{TimeAxis-gKb8dTwY.js → TimeAxis-cK2_3FeM.js} +1 -1
- package/dist/Calendar/{TimeGrid-D8Du5vFP.js → TimeGrid-B8lvUb1W.js} +2 -2
- package/dist/Calendar/index.js +15 -16
- package/dist/Calendar/{layout-DvWx_7gn.js → layout-CaPxiRd-.js} +94 -96
- package/dist/Calendar/subcomponents/AllDaySection/index.js +8 -0
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -0
- package/dist/Calendar/subcomponents/EventCard/index.js +6 -0
- package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -0
- package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -0
- package/dist/Calendar/{style-hCRKx3m1.js → theme-BzNDRi0U.js} +19 -3
- package/dist/Calendar/utils/index.js +37 -41
- package/dist/Calendar/utils/layout/index.js +2 -2
- package/dist/Calendar/utils/theme/index.js +2 -0
- package/dist/ColorPicker/{ColorPicker-BNPxmfw_.js → ColorPicker-By-Y8Tyz.js} +3 -3
- package/dist/ColorPicker/index.js +4 -4
- package/dist/ConfigProvider/index.js +2 -2
- package/dist/DatePicker/DatePicker-B6ZFxTt6.js +114 -0
- package/dist/DatePicker/{DatePickerPanel-BaVC1tq2.js → DatePickerPanel-HoxXteK0.js} +13 -12
- package/dist/DatePicker/{ensureDayjsPlugins-DZjJnZgo.js → ensureDayjsPlugins-C3aqki6i.js} +3 -4
- package/dist/DatePicker/index.js +5 -5
- package/dist/DropDown/{DropDown-m3HT_eex.js → DropDown-C5H9UObs.js} +3 -3
- package/dist/DropDown/index.js +4 -4
- package/dist/Editor/{Buttons-BB3xV8ku.js → Buttons-B8_yDqF5.js} +3 -3
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +7 -7
- package/dist/Editor/index.js +7 -7
- package/dist/Gantt/GanttChart/index.js +15 -0
- package/dist/Gantt/GanttChart-DpmbH0GI.js +1965 -0
- package/dist/Gantt/GanttHighlightContext-AIpN3-af.js +12 -0
- package/dist/Gantt/GanttTable/index.js +10 -0
- package/dist/Gantt/GanttTable-DSTq5XmX.js +83 -0
- package/dist/Gantt/GanttToolBar/index.js +11 -0
- package/dist/Gantt/GanttToolBar-fCAi-4zZ.js +91 -0
- package/dist/Gantt/collapseKeys-BWMH5k37.js +156 -0
- package/dist/Gantt/columnResize-By_1E48E.js +46 -0
- package/dist/Gantt/constants-_vMvDXFh.js +40 -0
- package/dist/Gantt/highlightTarget-DmzCIiQb.js +25 -0
- package/dist/Gantt/index.js +374 -0
- package/dist/Gantt/timelineViewConfig-DshzoBp7.js +118 -0
- package/dist/Gantt/utils/index.js +6 -0
- package/dist/Select/{Select-Dz_xr4my.js → Select-Gkywa_sm.js} +140 -134
- package/dist/Select/{SelectInputSearch-GHYAmQ3A.js → SelectInputSearch-DXPTGSc2.js} +1 -1
- package/dist/Select/index.js +4 -4
- package/dist/Table/Table-DVTq4n2V.js +544 -0
- package/dist/Table/constants-CKqc9Os_.js +25 -0
- package/dist/Table/hooks/index.js +2 -0
- package/dist/Table/hooks-CJ2CnSep.js +108 -0
- package/dist/Table/index.js +7 -0
- package/dist/Table/processRowspan-BCzfI5un.js +144 -0
- package/dist/Table/utils/index.js +2 -0
- package/dist/Tabs/{Tabs-CPRNkfMo.js → Tabs-DVQcB3YG.js} +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/Tooltip-DW_XP13m.js +171 -0
- package/dist/Tooltip/index.js +1 -1
- package/dist/animations/index.d.ts +2 -2
- package/dist/components/Amap/__tests__/helpers.d.ts +6 -0
- package/dist/components/Calendar/__tests__/helpers/testFormatMessage.d.ts +1 -1
- package/dist/components/Calendar/context/CalendarContext.d.ts +2 -1
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Calendar/{shared → subcomponents}/AllDaySection/AllDaySection.d.ts +1 -1
- package/dist/components/Calendar/subcomponents/DayView/DayView.d.ts +3 -0
- package/dist/components/Calendar/{shared → subcomponents}/EventCard/EventCard.d.ts +1 -1
- package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthCell/MonthCellPopover/MonthCellPopover.d.ts +1 -1
- package/dist/components/Calendar/subcomponents/MonthView/MonthView.d.ts +3 -0
- package/dist/components/Calendar/{panels/WeekPanel → subcomponents}/WeekAllDaySection/WeekAllDaySection.d.ts +1 -1
- package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/WeekEventLayer/MoreButton.d.ts +1 -1
- package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/WeekEventLayer/WeekEventLayer.d.ts +1 -1
- package/dist/components/Calendar/subcomponents/WeekView/WeekView.d.ts +3 -0
- package/dist/components/Calendar/utils/dateUtils.d.ts +2 -1
- package/dist/components/Calendar/utils/eventUtils.d.ts +1 -1
- package/dist/components/Calendar/utils/layout/dayLayoutAlgorithm.d.ts +1 -1
- package/dist/components/Calendar/utils/localeKey.d.ts +2 -0
- package/dist/components/Calendar/utils/normalizeData.d.ts +1 -1
- package/dist/components/Calendar/{style → utils/theme}/index.d.ts +1 -0
- package/dist/components/Calendar/{adapters → utils/theme}/platformTheme.d.ts +1 -1
- package/dist/components/Calendar/{style → utils/theme}/resolveCalendarThemeVars.d.ts +1 -1
- package/dist/components/Calendar/{style → utils/theme}/resolveSubcomponentThemes.d.ts +3 -3
- package/dist/components/Calendar/utils/weekTimedLayout.d.ts +1 -1
- package/dist/components/DatePicker/__tests__/DatePicker.getPopupContainer.test.d.ts +1 -0
- package/dist/components/DatePicker/interface.d.ts +5 -0
- package/dist/components/Gantt/Gantt.d.ts +11 -0
- package/dist/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.d.ts +3 -0
- package/dist/components/Gantt/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/Gantt/GanttChart/GanttChartCanvas.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttChartCanvasBackground.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttInteractionContext.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttTaskBar/GanttTaskBar.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttTaskBar/useTaskBarPointer.d.ts +9 -0
- package/dist/components/Gantt/GanttChart/GanttTimelineContext.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/GanttTimelineHeader/GanttTimelineHeader.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/OffscreenTaskIndicators/OffscreenTaskIndicators.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/TodayIndicator/TodayIndicator.d.ts +3 -0
- package/dist/components/Gantt/GanttChart/hooks/__tests__/timelineFocus.contract.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttColumnVirtual.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/hooks/useBarTooltipHover.d.ts +19 -0
- package/dist/components/Gantt/GanttChart/hooks/useEdgeScroll.d.ts +7 -0
- package/dist/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.d.ts +21 -0
- package/dist/components/Gantt/GanttChart/hooks/useGanttDrag.d.ts +15 -0
- package/dist/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.d.ts +12 -0
- package/dist/components/Gantt/GanttChart/hooks/useGanttScrollbars.d.ts +2 -0
- package/dist/components/Gantt/GanttChart/hooks/useNormalizedItems.d.ts +11 -0
- package/dist/components/Gantt/GanttChart/hooks/useOffscreenIndicators.d.ts +11 -0
- package/dist/components/Gantt/GanttChart/hooks/useRowHoverHighlight.d.ts +10 -0
- package/dist/components/Gantt/GanttChart/hooks/useTimelineViewportController.d.ts +24 -0
- package/dist/components/Gantt/GanttChart/hooks/useTodayMs.d.ts +4 -0
- package/dist/components/Gantt/GanttChart/index.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/dateRangeNormalizer.subday.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.quarterMonth.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.subday.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.quarterMonth.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.subday.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/quarterMonthScale.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/subdayScale.contract.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewConfig.test.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/buildSummaryBarTooltipContent.d.ts +6 -0
- package/dist/components/Gantt/GanttChart/utils/constants.d.ts +93 -0
- package/dist/components/Gantt/GanttChart/utils/dateRangeNormalizer.d.ts +18 -0
- package/dist/components/Gantt/GanttChart/utils/dragEngine.d.ts +60 -0
- package/dist/components/Gantt/GanttChart/utils/headerBuilder.d.ts +14 -0
- package/dist/components/Gantt/GanttChart/utils/quarterMonthScale.d.ts +8 -0
- package/dist/components/Gantt/GanttChart/utils/taskBarUtils.d.ts +3 -0
- package/dist/components/Gantt/GanttChart/utils/timeScale.d.ts +35 -0
- package/dist/components/Gantt/GanttChart/utils/timelineFocus.d.ts +42 -0
- package/dist/components/Gantt/GanttChart/utils/timelineMarkers.d.ts +1 -0
- package/dist/components/Gantt/GanttChart/utils/timelineViewConfig.d.ts +106 -0
- package/dist/components/Gantt/GanttChart/utils/timezoneUtils.d.ts +11 -0
- package/dist/components/Gantt/GanttHighlightContext.d.ts +3 -0
- package/dist/components/Gantt/GanttResizeIndicator.d.ts +3 -0
- package/dist/components/Gantt/GanttTable/GanttTable.d.ts +7 -0
- package/dist/components/Gantt/GanttTable/hooks/useGanttTableHighlightDomSync.d.ts +2 -0
- package/dist/components/Gantt/GanttTable/hooks/useGanttTableLinkedScroll.d.ts +7 -0
- package/dist/components/Gantt/GanttTable/index.d.ts +1 -0
- package/dist/components/Gantt/GanttTable/utils/mapGanttColumns.d.ts +13 -0
- package/dist/components/Gantt/GanttToolBar/GanttToolBar.d.ts +3 -0
- package/dist/components/Gantt/GanttToolBar/index.d.ts +1 -0
- package/dist/components/Gantt/__tests__/Gantt.contract.test.d.ts +0 -0
- package/dist/components/Gantt/__tests__/Gantt.grouped.contract.test.d.ts +0 -0
- package/dist/components/Gantt/__tests__/GanttChart.contract.test.d.ts +0 -0
- package/dist/components/Gantt/__tests__/GanttSummaryBar.tooltip.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/GanttToolBar.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/filterItemsByCollapse.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/helpers/ganttDomSetup.d.ts +1 -0
- package/dist/components/Gantt/__tests__/helpers/ganttTestFixtures.d.ts +7 -0
- package/dist/components/Gantt/__tests__/helpers/ganttTestMocks.d.ts +8 -0
- package/dist/components/Gantt/__tests__/helpers/renderWithLocale.d.ts +3 -0
- package/dist/components/Gantt/__tests__/helpers/testFormatMessage.d.ts +2 -0
- package/dist/components/Gantt/__tests__/interface.contract.types.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/timezoneUtils.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/useBarTooltipHover.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/useGanttHighlight.test.d.ts +1 -0
- package/dist/components/Gantt/__tests__/useTaskBarPointer.test.d.ts +1 -0
- package/dist/components/Gantt/hooks/useGanttCollapseState.d.ts +6 -0
- package/dist/components/Gantt/hooks/useGanttHighlight.d.ts +10 -0
- package/dist/components/Gantt/hooks/useGanttLayout.d.ts +7 -0
- package/dist/components/Gantt/hooks/useLinkedVerticalScroll.d.ts +6 -0
- package/dist/components/Gantt/index.d.ts +9 -0
- package/dist/components/Gantt/interface.d.ts +140 -0
- package/dist/components/Gantt/internal/GanttLayout.d.ts +8 -0
- package/dist/components/Gantt/internal/GanttTableShell.d.ts +3 -0
- package/dist/components/Gantt/types.internal.d.ts +313 -0
- package/dist/components/Gantt/utils/collapseKeys.d.ts +4 -0
- package/dist/components/Gantt/utils/columnResize.d.ts +19 -0
- package/dist/components/Gantt/utils/constants.d.ts +4 -0
- package/dist/components/Gantt/utils/filterItemsByCollapse.d.ts +9 -0
- package/dist/components/Gantt/utils/highlightTarget.d.ts +13 -0
- package/dist/components/Gantt/utils/index.d.ts +8 -0
- package/dist/components/Gantt/utils/localeKey.d.ts +2 -0
- package/dist/components/Gantt/utils/tableWidthStorage.d.ts +3 -0
- package/dist/components/Select/__tests__/Select.getPopupContainer.test.d.ts +1 -0
- package/dist/components/Select/interface.d.ts +4 -0
- package/dist/components/Table/Table.d.ts +4 -0
- package/dist/components/Table/__tests__/HeaderCell.test.d.ts +1 -0
- package/dist/components/Table/__tests__/TableBody.test.d.ts +1 -0
- package/dist/components/Table/__tests__/processRowspan.test.d.ts +1 -0
- package/dist/components/Table/components/HeaderCell.d.ts +16 -0
- package/dist/components/Table/components/TableBody.d.ts +45 -0
- package/dist/components/Table/components/TableFooter.d.ts +18 -0
- package/dist/components/Table/components/TableHeader.d.ts +14 -0
- package/dist/components/Table/constants.d.ts +29 -0
- package/dist/components/Table/hooks/index.d.ts +2 -0
- package/dist/components/Table/hooks/useColumnResize.d.ts +11 -0
- package/dist/components/Table/hooks/useTableVirtual.d.ts +19 -0
- package/dist/components/Table/index.d.ts +9 -0
- package/dist/components/Table/interface.d.ts +114 -0
- package/dist/components/Table/utils/flattenColumns.d.ts +17 -0
- package/dist/components/Table/utils/index.d.ts +3 -0
- package/dist/components/Table/utils/processRowspan.d.ts +16 -0
- package/dist/components/Table/utils/tableUtils.d.ts +22 -0
- package/dist/components/Tooltip/Tooltip.type.d.ts +2 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/hooks/useLatchedPopupPortalRoot.d.ts +11 -0
- package/dist/index.js +24 -23
- package/dist/locale/lang/en-US.json.d.ts +63 -0
- package/dist/locale/lang/zh-CN.json.d.ts +63 -0
- package/dist/locale/lang/zh-TW.json.d.ts +63 -0
- package/dist/style.css +1 -1
- package/dist/vendors/{ConfigProvider-DCm-93oJ.js → ConfigProvider-BRfJ7gWc.js} +123 -1
- package/dist/vendors/{LocaleContext-CRlzP8UO.js → LocaleContext-BJdHS0sH.js} +61 -0
- package/dist/vendors/{animations-BmT0HT5q.js → animations-BeI8JZp1.js} +7 -3
- package/dist/vendors/{useFloatingOverlay-uxlI1G-V.js → useFloatingOverlay-3KB88hpZ.js} +1 -0
- package/dist/vendors/{useLocale-D9kAzQlB.js → useLocale-BTz4slNW.js} +1 -1
- package/dist/vitest-matchers.d.ts +1 -0
- package/package.json +3 -2
- package/dist/Calendar/adapters/index.js +0 -2
- package/dist/Calendar/adapters-zYR7CgzD.js +0 -20
- package/dist/Calendar/shared/AllDaySection/index.js +0 -8
- package/dist/Calendar/shared/CurrentTimeIndicator/index.js +0 -5
- package/dist/Calendar/shared/EventCard/index.js +0 -6
- package/dist/Calendar/shared/TimeAxis/index.js +0 -4
- package/dist/Calendar/shared/TimeGrid/index.js +0 -4
- package/dist/Calendar/style/index.js +0 -2
- package/dist/DatePicker/DatePicker-B2skjsiQ.js +0 -91
- package/dist/Tooltip/Tooltip-RkD8fs0B.js +0 -169
- package/dist/components/Calendar/adapters/index.d.ts +0 -1
- package/dist/components/Calendar/panels/DayPanel/DayPanel.d.ts +0 -3
- package/dist/components/Calendar/panels/MonthPanel/MonthPanel.d.ts +0 -3
- package/dist/components/Calendar/panels/WeekPanel/WeekPanel.d.ts +0 -3
- /package/dist/components/Calendar/{shared → subcomponents}/AllDaySection/index.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/CalendarHeader/CalendarHeader.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/CalendarHeaderLeft/CalendarHeaderLeft.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/CurrentTimeIndicator/index.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/DateDisplay/DateDisplay.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +0 -0
- /package/dist/components/Calendar/{panels/DayPanel → subcomponents/DayView}/__tests__/CalendarDay.dayFilter.test.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/EventCard/__tests__/EventCard.tooltip.test.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/EventCard/index.d.ts +0 -0
- /package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthCell/MonthCell.d.ts +0 -0
- /package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthHeader/MonthHeader.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/NavButton/NavButton.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/TimeAxis/TimeAxis.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/TimeAxis/index.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/TimeGrid/TimeGrid.d.ts +0 -0
- /package/dist/components/Calendar/{shared → subcomponents}/TimeGrid/index.d.ts +0 -0
- /package/dist/components/Calendar/{Header → subcomponents}/TodayButton/TodayButton.d.ts +0 -0
- /package/dist/components/Calendar/{panels/WeekPanel → subcomponents}/WeekHeader/WeekHeader.d.ts +0 -0
- /package/dist/components/Calendar/{internalTypes.d.ts → types.internal.d.ts} +0 -0
- /package/dist/components/Calendar/{adapters → utils/theme}/__tests__/platformTheme.test.d.ts +0 -0
- /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveCalendarThemeVars.test.d.ts +0 -0
- /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveScheduleColorVars.test.d.ts +0 -0
- /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveSubcomponentThemes.test.d.ts +0 -0
- /package/dist/components/Calendar/{style → utils/theme}/resolveScheduleColorVars.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
-
import { t } from "../vendors/useLocale-
|
|
3
|
-
import { n, t as r } from "../vendors/animations-
|
|
4
|
-
import { t as i } from "./SelectInputSearch-
|
|
2
|
+
import { t } from "../vendors/useLocale-BTz4slNW.js";
|
|
3
|
+
import { n, t as r } from "../vendors/animations-BeI8JZp1.js";
|
|
4
|
+
import { t as i } from "./SelectInputSearch-DXPTGSc2.js";
|
|
5
5
|
import { n as a, t as o } from "../vendors/Tree-DJpkMB5u.js";
|
|
6
6
|
import { t as s } from "../CheckBox/CheckBox-DIunYcfS.js";
|
|
7
7
|
import { t as c } from "../NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
@@ -15,47 +15,47 @@ import { useControllableValue as te, useHover as M, useToggle as ne } from "ahoo
|
|
|
15
15
|
import { AnimatePresence as re, motion as N } from "motion/react";
|
|
16
16
|
import { FloatingPortal as ie } from "@floating-ui/react";
|
|
17
17
|
import P from "fuse.js";
|
|
18
|
-
import
|
|
18
|
+
import ae from "simplebar-react";
|
|
19
19
|
//#region src/components/Select/constants.ts
|
|
20
|
-
var
|
|
20
|
+
var F = /* @__PURE__ */ function(e) {
|
|
21
21
|
return e.SINGLE = "single", e.MULTIPLE = "multiple", e;
|
|
22
|
-
}({}),
|
|
22
|
+
}({}), I = /* @__PURE__ */ function(e) {
|
|
23
23
|
return e[e.SINGLE = 0] = "SINGLE", e[e.MULTIPLE = 1] = "MULTIPLE", e[e.TREE = 2] = "TREE", e[e.TREE_TAGS = 3] = "TREE_TAGS", e[e.MEMBER = 4] = "MEMBER", e[e.DEPARTEMENT = 5] = "DEPARTEMENT", e;
|
|
24
|
-
}({}),
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
},
|
|
24
|
+
}({}), oe = {
|
|
25
|
+
[I.SINGLE]: F.SINGLE,
|
|
26
|
+
[I.TREE]: F.SINGLE,
|
|
27
|
+
[I.MULTIPLE]: F.MULTIPLE,
|
|
28
|
+
[I.TREE_TAGS]: F.MULTIPLE,
|
|
29
|
+
[I.MEMBER]: F.MULTIPLE,
|
|
30
|
+
[I.DEPARTEMENT]: F.MULTIPLE
|
|
31
|
+
}, se = {
|
|
32
32
|
label: "label",
|
|
33
33
|
value: "value",
|
|
34
34
|
children: "children"
|
|
35
|
-
},
|
|
35
|
+
}, ce = y({
|
|
36
36
|
value: void 0,
|
|
37
37
|
setValue: m,
|
|
38
38
|
isOpen: !1,
|
|
39
39
|
setIsOpen: m
|
|
40
|
-
}),
|
|
40
|
+
}), le = y({
|
|
41
41
|
fieldNames: {
|
|
42
42
|
label: "label",
|
|
43
43
|
value: "value",
|
|
44
44
|
children: "children"
|
|
45
45
|
},
|
|
46
46
|
disabled: !1
|
|
47
|
-
}),
|
|
48
|
-
let e = C(
|
|
47
|
+
}), ue = y({}), L = () => {
|
|
48
|
+
let e = C(ce);
|
|
49
49
|
if (!e) throw Error("Select.* components must be used within a SelectStateContext provider");
|
|
50
50
|
return e;
|
|
51
|
-
},
|
|
52
|
-
let e = C(
|
|
51
|
+
}, R = () => {
|
|
52
|
+
let e = C(le);
|
|
53
53
|
if (!e) throw Error("Select.* components must be used within a SelectConfigContext provider");
|
|
54
54
|
return e;
|
|
55
|
-
},
|
|
55
|
+
}, z = () => C(ue);
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/components/Select/utils/fieldAccessor.ts
|
|
58
|
-
function
|
|
58
|
+
function B(e) {
|
|
59
59
|
let t = e;
|
|
60
60
|
return {
|
|
61
61
|
getLabel: (e) => e[t.label],
|
|
@@ -74,8 +74,8 @@ function V(e) {
|
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/components/Select/SelectInput/SelectSingleInput/SelectSingleInput.tsx
|
|
77
|
-
var
|
|
78
|
-
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } =
|
|
77
|
+
var V = x((e) => {
|
|
78
|
+
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = R(), { isSelectedOtherOption: a, otherOptionValue: o } = z(), s = B(r), c = u(t), l;
|
|
79
79
|
return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ g("div", {
|
|
80
80
|
className: j("bsy-select-input-container__input-value overflow-hidden"),
|
|
81
81
|
style: n,
|
|
@@ -85,38 +85,38 @@ var H = x((e) => {
|
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
V.displayName = "BsySelectSingleInput";
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
|
|
91
|
-
var
|
|
91
|
+
var H = {
|
|
92
92
|
"bsy-input-tag__container": "_bsy-input-tag__container_znvs6_1",
|
|
93
93
|
"bsy-input-tag__item": "_bsy-input-tag__item_znvs6_7",
|
|
94
94
|
"bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_znvs6_20",
|
|
95
95
|
"bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_znvs6_24"
|
|
96
|
-
},
|
|
96
|
+
}, U = b(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ g("div", {
|
|
97
97
|
"data-bsy-input-tag": "true",
|
|
98
98
|
className: j({
|
|
99
|
-
[
|
|
100
|
-
[
|
|
99
|
+
[H["bsy-input-tag__item"]]: !0,
|
|
100
|
+
[H["bsy-input-tag__item--disabled"]]: n
|
|
101
101
|
}),
|
|
102
102
|
ref: r,
|
|
103
103
|
style: t,
|
|
104
104
|
children: e
|
|
105
105
|
}));
|
|
106
|
-
|
|
107
|
-
className: j(
|
|
106
|
+
U.Container = (e) => /* @__PURE__ */ g("div", {
|
|
107
|
+
className: j(H["bsy-input-tag__container"]),
|
|
108
108
|
children: e.children
|
|
109
|
-
}),
|
|
109
|
+
}), U.displayName = "BsyOptionTag";
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
|
|
112
|
-
var
|
|
113
|
-
select_multiple_input__container:
|
|
114
|
-
select_multiple_input__measurement_layer:
|
|
115
|
-
select_multiple_input__close_btn:
|
|
112
|
+
var W = "_select_multiple_input__container_8pd2n_1", G = "_select_multiple_input__measurement_layer_8pd2n_6", K = "_select_multiple_input__close_btn_8pd2n_14", q = "_select_multiple_input__tag_content_8pd2n_24", J = {
|
|
113
|
+
select_multiple_input__container: W,
|
|
114
|
+
select_multiple_input__measurement_layer: G,
|
|
115
|
+
select_multiple_input__close_btn: K,
|
|
116
116
|
"select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_8pd2n_21",
|
|
117
|
-
select_multiple_input__tag_content:
|
|
118
|
-
},
|
|
119
|
-
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } =
|
|
117
|
+
select_multiple_input__tag_content: q
|
|
118
|
+
}, Y = 4, X = x((t) => {
|
|
119
|
+
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = L(), { fieldNames: o, disabled: s } = R(), c = B(o), l = n?.length ?? 0, [u, d] = A(0), f = k(null), p = k(null);
|
|
120
120
|
D(() => {
|
|
121
121
|
if (!f.current) return;
|
|
122
122
|
let e = new ResizeObserver((e) => {
|
|
@@ -129,7 +129,7 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
129
129
|
}
|
|
130
130
|
let a = p.current?.offsetWidth || 65, o = 0, s = 0;
|
|
131
131
|
for (let e = 0; e < i.length; e++) {
|
|
132
|
-
let t = i[e].clientWidth +
|
|
132
|
+
let t = i[e].clientWidth + Y, n = e < l - 1 ? a : 0;
|
|
133
133
|
if (o + t + n <= r) o += t, s = e + 1;
|
|
134
134
|
else break;
|
|
135
135
|
}
|
|
@@ -142,25 +142,25 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
142
142
|
n.length
|
|
143
143
|
]);
|
|
144
144
|
let m = l - u, h = w(m), v = /* @__PURE__ */ g("div", {
|
|
145
|
-
className: `${
|
|
146
|
-
children: /* @__PURE__ */ _(
|
|
145
|
+
className: `${J.select_multiple_input__measurement_layer} measure-list`,
|
|
146
|
+
children: /* @__PURE__ */ _(U.Container, { children: [n?.map((t, n) => {
|
|
147
147
|
let a = (t) => /* @__PURE__ */ g("div", {
|
|
148
148
|
style: t,
|
|
149
|
-
className: j(
|
|
149
|
+
className: j(H["bsy-input-tag__item-icon"], "cursor-pointer"),
|
|
150
150
|
children: /* @__PURE__ */ g(e, {
|
|
151
151
|
name: "close",
|
|
152
152
|
style: { fontSize: 12 },
|
|
153
|
-
className:
|
|
153
|
+
className: J.select_multiple_input__close_btn
|
|
154
154
|
})
|
|
155
155
|
});
|
|
156
|
-
return /* @__PURE__ */ _(
|
|
156
|
+
return /* @__PURE__ */ _(U, {
|
|
157
157
|
style: i,
|
|
158
158
|
children: [r && r(t, a), !r && /* @__PURE__ */ _("div", {
|
|
159
|
-
className:
|
|
159
|
+
className: J.select_multiple_input__tag_content,
|
|
160
160
|
children: [/* @__PURE__ */ g("span", { children: c.getLabel(t) }), /* @__PURE__ */ g(a, {})]
|
|
161
161
|
})]
|
|
162
162
|
}, n);
|
|
163
|
-
}), u < l && h > 0 && /* @__PURE__ */ _(
|
|
163
|
+
}), u < l && h > 0 && /* @__PURE__ */ _(U, {
|
|
164
164
|
ref: p,
|
|
165
165
|
children: [`+ ${m}`, /* @__PURE__ */ g("span", {
|
|
166
166
|
className: "text-[#666]",
|
|
@@ -174,13 +174,13 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
174
174
|
};
|
|
175
175
|
return /* @__PURE__ */ _("div", {
|
|
176
176
|
ref: f,
|
|
177
|
-
className: j("bsy-select-input-container__input-value",
|
|
178
|
-
children: [v, /* @__PURE__ */ _(
|
|
177
|
+
className: j("bsy-select-input-container__input-value", J.select_multiple_input__container, "multiple"),
|
|
178
|
+
children: [v, /* @__PURE__ */ _(U.Container, { children: [n?.slice(0, u).map((t, n) => {
|
|
179
179
|
let a = (n) => /* @__PURE__ */ g("div", {
|
|
180
180
|
style: n,
|
|
181
|
-
className: j(
|
|
182
|
-
[
|
|
183
|
-
[
|
|
181
|
+
className: j(H["bsy-input-tag__item-icon"], {
|
|
182
|
+
[J.select_multiple_input__close_btn]: !s,
|
|
183
|
+
[J.select_multiple_input__close_btn + "--disabled"]: s
|
|
184
184
|
}),
|
|
185
185
|
onClick: (e) => {
|
|
186
186
|
e.stopPropagation(), y(t);
|
|
@@ -190,21 +190,21 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
190
190
|
style: { fontSize: 12 }
|
|
191
191
|
})
|
|
192
192
|
});
|
|
193
|
-
return /* @__PURE__ */ _(
|
|
193
|
+
return /* @__PURE__ */ _(U, {
|
|
194
194
|
style: {
|
|
195
195
|
...i,
|
|
196
196
|
flexShrink: u === 1 ? 1 : 0
|
|
197
197
|
},
|
|
198
198
|
disabled: s,
|
|
199
199
|
children: [r && r(t, a), !r && /* @__PURE__ */ _("div", {
|
|
200
|
-
className:
|
|
200
|
+
className: J.select_multiple_input__tag_content,
|
|
201
201
|
children: [/* @__PURE__ */ g("span", {
|
|
202
202
|
className: "truncate",
|
|
203
203
|
children: c.getLabel(t)
|
|
204
204
|
}), /* @__PURE__ */ g(a, {})]
|
|
205
205
|
})]
|
|
206
206
|
}, n);
|
|
207
|
-
}), u < l && h > 0 && /* @__PURE__ */ _(
|
|
207
|
+
}), u < l && h > 0 && /* @__PURE__ */ _(U, {
|
|
208
208
|
ref: p,
|
|
209
209
|
children: [`+ ${m} `, /* @__PURE__ */ g("span", {
|
|
210
210
|
className: "text-[#666]",
|
|
@@ -213,10 +213,10 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
213
213
|
})] })]
|
|
214
214
|
});
|
|
215
215
|
});
|
|
216
|
-
|
|
216
|
+
X.displayName = "BsySelectMultipleInput";
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region src/components/Select/utils/tree.ts
|
|
219
|
-
var
|
|
219
|
+
var de = (e, t) => {
|
|
220
220
|
let n = [], r = (e) => {
|
|
221
221
|
e.forEach((e) => {
|
|
222
222
|
let { [t.children]: i, ...a } = e;
|
|
@@ -224,12 +224,12 @@ var Q = (e, t) => {
|
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
return r(e), n;
|
|
227
|
-
},
|
|
228
|
-
let b = k(null), x = M(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } =
|
|
227
|
+
}, fe = ({ placeholder: t, mode: n, clearable: i, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: f, ghost: m, inputValueStyle: v, tagStyle: y }) => {
|
|
228
|
+
let b = k(null), x = M(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } = L(), { fieldNames: T } = R(), E = O(() => {
|
|
229
229
|
if (p(C)) return [];
|
|
230
230
|
let e = d(C) ? C : [C];
|
|
231
|
-
if (l ===
|
|
232
|
-
let t =
|
|
231
|
+
if (l === I.TREE) {
|
|
232
|
+
let t = B(T), n = de(c, T);
|
|
233
233
|
return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
|
|
234
234
|
}
|
|
235
235
|
return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
|
|
@@ -243,7 +243,7 @@ var Q = (e, t) => {
|
|
|
243
243
|
return /* @__PURE__ */ g("div", {
|
|
244
244
|
className: j("bsy-select-input-container", {
|
|
245
245
|
disabled: o,
|
|
246
|
-
multiple: n ===
|
|
246
|
+
multiple: n === F.MULTIPLE,
|
|
247
247
|
active: S,
|
|
248
248
|
"ghost-style": m
|
|
249
249
|
}),
|
|
@@ -255,11 +255,11 @@ var Q = (e, t) => {
|
|
|
255
255
|
className: "bsy-select-input-container-input-prefix",
|
|
256
256
|
children: u
|
|
257
257
|
}),
|
|
258
|
-
E?.length ? /* @__PURE__ */ _(h, { children: [n ===
|
|
258
|
+
E?.length ? /* @__PURE__ */ _(h, { children: [n === F.SINGLE && /* @__PURE__ */ g(V, {
|
|
259
259
|
value: E,
|
|
260
260
|
labelRender: s,
|
|
261
261
|
inputValueStyle: v
|
|
262
|
-
}), n ===
|
|
262
|
+
}), n === F.MULTIPLE && /* @__PURE__ */ g(X, {
|
|
263
263
|
value: E,
|
|
264
264
|
labelRender: s,
|
|
265
265
|
tagStyle: y
|
|
@@ -299,11 +299,11 @@ var Q = (e, t) => {
|
|
|
299
299
|
})
|
|
300
300
|
});
|
|
301
301
|
};
|
|
302
|
-
|
|
302
|
+
fe.displayName = "BsySelectInput";
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/components/Select/OptionList/SingleOptionList/SingleOptionList.tsx
|
|
305
|
-
var
|
|
306
|
-
let { options: t, value: n, onSelect: r, searchValue: i = "", fieldNames: o, optionRender: s, optionStyle: c } = e, { otherInputPosition: l } =
|
|
305
|
+
var Z = x((e) => {
|
|
306
|
+
let { options: t, value: n, onSelect: r, searchValue: i = "", fieldNames: o, optionRender: s, optionStyle: c } = e, { otherInputPosition: l } = R(), { otherOptionValue: u, setOtherOptionValue: d, onOtherInputChange: f, isSelectedOtherOption: p = !1 } = z(), m = k(null), h = B(o);
|
|
307
307
|
return /* @__PURE__ */ g("ul", {
|
|
308
308
|
role: "listbox",
|
|
309
309
|
children: t.map((e, t) => {
|
|
@@ -351,11 +351,11 @@ var $ = x((e) => {
|
|
|
351
351
|
})
|
|
352
352
|
});
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
Z.displayName = "BsySingleSelect";
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/components/Select/OptionList/MultOptionList/MultOptionList.tsx
|
|
357
|
-
var
|
|
358
|
-
let { t: n } = t(), { options: r, searchValue: i = "", value: o, onSelect: c, fieldNames: l, optionRender: u } = e, d =
|
|
357
|
+
var Q = (e) => {
|
|
358
|
+
let { t: n } = t(), { options: r, searchValue: i = "", value: o, onSelect: c, fieldNames: l, optionRender: u } = e, d = B(l), f = o || [], p = r.filter((e) => !e.isOther), m = p.length > 0 && p.every((e) => f.includes(d.getValue(e)));
|
|
359
359
|
return /* @__PURE__ */ g("div", {
|
|
360
360
|
className: "bsy-multiple-select",
|
|
361
361
|
children: /* @__PURE__ */ _("ul", {
|
|
@@ -400,10 +400,10 @@ var de = (e) => {
|
|
|
400
400
|
})
|
|
401
401
|
});
|
|
402
402
|
};
|
|
403
|
-
|
|
403
|
+
Q.displayName = "BsyMultipleSelect";
|
|
404
404
|
//#endregion
|
|
405
405
|
//#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
|
|
406
|
-
var
|
|
406
|
+
var pe = (e) => {
|
|
407
407
|
let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
|
|
408
408
|
return /* @__PURE__ */ g("div", {
|
|
409
409
|
className: "bsy-tree-select",
|
|
@@ -422,13 +422,13 @@ var fe = (e) => {
|
|
|
422
422
|
})
|
|
423
423
|
})
|
|
424
424
|
});
|
|
425
|
-
},
|
|
425
|
+
}, me = (e, t) => {
|
|
426
426
|
let n = [], r = (e) => {
|
|
427
427
|
if (e) for (let i of e) n.push(i), r(i[t.children]);
|
|
428
428
|
};
|
|
429
429
|
return r(e), n;
|
|
430
|
-
},
|
|
431
|
-
let i = r[n.children] ?
|
|
430
|
+
}, $ = (e, t, n) => e.reduce((e, r) => {
|
|
431
|
+
let i = r[n.children] ? $(r[n.children], t, n) : void 0;
|
|
432
432
|
if (t.has(r[n.value]) || i && i.length > 0) {
|
|
433
433
|
let a = t.has(r[n.value]) ? r[n.children] : i;
|
|
434
434
|
e.push({
|
|
@@ -438,7 +438,7 @@ var fe = (e) => {
|
|
|
438
438
|
}
|
|
439
439
|
return e;
|
|
440
440
|
}, []), he = (e) => {
|
|
441
|
-
let { options: n = [], searchValue: r = "", type: i, filterOption: a, optionRender: o, optionStyle: s } = e, { t: l } = t(), { value: u, setIsOpen: d, setValue: p } =
|
|
441
|
+
let { options: n = [], searchValue: r = "", type: i, filterOption: a, optionRender: o, optionStyle: s } = e, { t: l } = t(), { value: u, setIsOpen: d, setValue: p } = L(), { fieldNames: m } = R(), _ = O(() => i === I.TREE ? me(n, m) : n, [
|
|
442
442
|
n,
|
|
443
443
|
m,
|
|
444
444
|
i
|
|
@@ -455,7 +455,7 @@ var fe = (e) => {
|
|
|
455
455
|
}, [d, p]), C = () => {
|
|
456
456
|
if (!a || f(r)) return n;
|
|
457
457
|
let e = v.search(r), t = new Set(e.map((e) => e.item[m.value]));
|
|
458
|
-
return i ===
|
|
458
|
+
return i === I.TREE ? $(n, t, m) : n.filter((e) => t.has(e[m.value]));
|
|
459
459
|
};
|
|
460
460
|
return /* @__PURE__ */ g(h, { children: (() => {
|
|
461
461
|
let e = {
|
|
@@ -465,21 +465,21 @@ var fe = (e) => {
|
|
|
465
465
|
};
|
|
466
466
|
if (!f(r) && e.options.length === 0) return /* @__PURE__ */ g(c, { text: l("noDataFound") });
|
|
467
467
|
switch (i) {
|
|
468
|
-
case
|
|
468
|
+
case I.SINGLE: return /* @__PURE__ */ g(Z, {
|
|
469
469
|
...e,
|
|
470
470
|
value: u,
|
|
471
471
|
fieldNames: m,
|
|
472
472
|
onSelect: y,
|
|
473
473
|
optionRender: o
|
|
474
474
|
});
|
|
475
|
-
case
|
|
475
|
+
case I.MULTIPLE: return /* @__PURE__ */ g(Q, {
|
|
476
476
|
...e,
|
|
477
477
|
value: u,
|
|
478
478
|
fieldNames: m,
|
|
479
479
|
onSelect: b,
|
|
480
480
|
optionRender: o
|
|
481
481
|
});
|
|
482
|
-
case
|
|
482
|
+
case I.TREE: return /* @__PURE__ */ g(pe, {
|
|
483
483
|
...e,
|
|
484
484
|
value: u,
|
|
485
485
|
fieldNames: m,
|
|
@@ -489,7 +489,7 @@ var fe = (e) => {
|
|
|
489
489
|
}
|
|
490
490
|
})() });
|
|
491
491
|
}, ge = (e) => {
|
|
492
|
-
let { options: r = [], type: a =
|
|
492
|
+
let { options: r = [], type: a = I.SINGLE, filterOption: o = !0, onSearch: s, showSearch: l, searchPlaceholder: u, onPopupScroll: d } = e, { t: f } = t(), { searchValue: p = "", setSearchValue: m } = L(), h = w(p), y = (e) => {
|
|
493
493
|
m?.(e), s?.(e);
|
|
494
494
|
}, b = () => e.fetching ? /* @__PURE__ */ g(c, { text: f("dataSearching") }) : r.length === 0 && !p ? /* @__PURE__ */ g(c, { text: f("noData") }) : /* @__PURE__ */ g(he, {
|
|
495
495
|
searchValue: h,
|
|
@@ -512,7 +512,7 @@ var fe = (e) => {
|
|
|
512
512
|
searchPlaceholder: u
|
|
513
513
|
}), /* @__PURE__ */ g("div", {
|
|
514
514
|
className: j({ "pt-[4px]": l }),
|
|
515
|
-
children: /* @__PURE__ */ g(
|
|
515
|
+
children: /* @__PURE__ */ g(ae, {
|
|
516
516
|
style: { maxHeight: 300 },
|
|
517
517
|
onScroll: x,
|
|
518
518
|
children: b()
|
|
@@ -525,13 +525,13 @@ ge.displayName = "BsySelectPanel";
|
|
|
525
525
|
//#endregion
|
|
526
526
|
//#region src/components/Select/Select.tsx
|
|
527
527
|
var _e = b((e, n) => {
|
|
528
|
-
let { options: r = [], type: i =
|
|
529
|
-
defaultValue:
|
|
528
|
+
let { options: r = [], type: i = I.SINGLE, fieldNames: a, clearable: o = !0, disabled: s = !1, placeholder: c, labelRender: u, onOtherInputChange: d, onOpenChange: f, onPopupScroll: p, prefix: m, suffixIcon: v, ghost: y, inputValueStyle: b, tagStyle: x, zIndex: C = 1101, zIndexMask: w = 1100, otherInputPosition: D = "bottom", popupMinWidth: ee, getPopupContainer: M } = e, N = oe[i], { t: P } = t(), ae = T(), { onChange: L } = e, R = a || se, [z, B] = te(e, {
|
|
529
|
+
defaultValue: N === F.SINGLE ? void 0 : [],
|
|
530
530
|
defaultValuePropName: "defaultValue",
|
|
531
531
|
valuePropName: "value",
|
|
532
532
|
trigger: "__NO_CUSTOM_CHANGE__"
|
|
533
533
|
}), [V, H] = A(""), U = k(/* @__PURE__ */ new Map()), [W, G] = A(() => {
|
|
534
|
-
if (
|
|
534
|
+
if (N === F.SINGLE) {
|
|
535
535
|
let e = r.every((e) => e[R.value] !== z), t = r.find((e) => e.isOther === !0);
|
|
536
536
|
return e && t ? z : void 0;
|
|
537
537
|
}
|
|
@@ -547,9 +547,9 @@ var _e = b((e, n) => {
|
|
|
547
547
|
} else e !== null && !Array.isArray(t) && n.set(e, t);
|
|
548
548
|
U.current = n;
|
|
549
549
|
}
|
|
550
|
-
|
|
550
|
+
L && L(e, t);
|
|
551
551
|
}, [
|
|
552
|
-
|
|
552
|
+
L,
|
|
553
553
|
B,
|
|
554
554
|
R
|
|
555
555
|
]), [q, { set: J }] = ne(!1), Y = S((e) => {
|
|
@@ -558,8 +558,8 @@ var _e = b((e, n) => {
|
|
|
558
558
|
J,
|
|
559
559
|
f,
|
|
560
560
|
q
|
|
561
|
-
]), { isSelectedOtherOption: X, shouldShowOtherInput:
|
|
562
|
-
if (
|
|
561
|
+
]), { isSelectedOtherOption: X, shouldShowOtherInput: de } = O(() => {
|
|
562
|
+
if (N === F.MULTIPLE) return {
|
|
563
563
|
isSelectedOtherOption: !1,
|
|
564
564
|
shouldShowOtherInput: !1
|
|
565
565
|
};
|
|
@@ -578,10 +578,10 @@ var _e = b((e, n) => {
|
|
|
578
578
|
z,
|
|
579
579
|
r,
|
|
580
580
|
R,
|
|
581
|
-
|
|
582
|
-
]),
|
|
581
|
+
N
|
|
582
|
+
]), Z = S(() => {
|
|
583
583
|
if (z) {
|
|
584
|
-
if (
|
|
584
|
+
if (N === F.SINGLE) {
|
|
585
585
|
let e = r.every((e) => e[R.value] !== z), t = r.find((e) => e.isOther === !0);
|
|
586
586
|
if (e && t) return t[R.value];
|
|
587
587
|
}
|
|
@@ -591,9 +591,9 @@ var _e = b((e, n) => {
|
|
|
591
591
|
z,
|
|
592
592
|
r,
|
|
593
593
|
R,
|
|
594
|
-
|
|
595
|
-
]),
|
|
596
|
-
value:
|
|
594
|
+
N
|
|
595
|
+
]), Q = O(() => ({
|
|
596
|
+
value: Z(),
|
|
597
597
|
setValue: K,
|
|
598
598
|
isOpen: q,
|
|
599
599
|
setIsOpen: Y,
|
|
@@ -601,20 +601,20 @@ var _e = b((e, n) => {
|
|
|
601
601
|
searchValue: V,
|
|
602
602
|
setSearchValue: H
|
|
603
603
|
}), [
|
|
604
|
-
|
|
604
|
+
Z,
|
|
605
605
|
K,
|
|
606
606
|
q,
|
|
607
607
|
Y,
|
|
608
608
|
V
|
|
609
|
-
]),
|
|
610
|
-
fieldNames: a ||
|
|
609
|
+
]), pe = O(() => ({
|
|
610
|
+
fieldNames: a || se,
|
|
611
611
|
disabled: s,
|
|
612
612
|
otherInputPosition: D
|
|
613
613
|
}), [
|
|
614
614
|
a,
|
|
615
615
|
s,
|
|
616
616
|
D
|
|
617
|
-
]),
|
|
617
|
+
]), me = O(() => ({
|
|
618
618
|
isSelectedOtherOption: X,
|
|
619
619
|
otherOptionValue: W,
|
|
620
620
|
setOtherOptionValue: G,
|
|
@@ -624,7 +624,7 @@ var _e = b((e, n) => {
|
|
|
624
624
|
W,
|
|
625
625
|
G,
|
|
626
626
|
d
|
|
627
|
-
]), { refs:
|
|
627
|
+
]), { refs: $, floatingStyles: he, getReferenceProps: _e, getFloatingProps: ve, referenceStyle: ye } = l({
|
|
628
628
|
isOpen: q,
|
|
629
629
|
close: () => {
|
|
630
630
|
Y(!1);
|
|
@@ -637,13 +637,16 @@ var _e = b((e, n) => {
|
|
|
637
637
|
x: 0,
|
|
638
638
|
y: 4
|
|
639
639
|
}
|
|
640
|
-
}),
|
|
641
|
-
|
|
640
|
+
}), be = O(() => {
|
|
641
|
+
let e = q ? M?.() : void 0;
|
|
642
|
+
return e?.nodeType === 1 ? e : void 0;
|
|
643
|
+
}, [q, M]), xe = be ? "custom-popup-container" : "default-popup-container", Se = S(() => {
|
|
644
|
+
X && (G(""), d?.("")), Y(!1), U.current.clear(), K(N === F.SINGLE ? void 0 : []);
|
|
642
645
|
}, [
|
|
643
646
|
X,
|
|
644
647
|
d,
|
|
645
648
|
K,
|
|
646
|
-
|
|
649
|
+
N,
|
|
647
650
|
Y
|
|
648
651
|
]);
|
|
649
652
|
return E(n, () => ({
|
|
@@ -651,34 +654,34 @@ var _e = b((e, n) => {
|
|
|
651
654
|
setOtherOptionValue: (e) => {
|
|
652
655
|
G(e), d?.(e);
|
|
653
656
|
}
|
|
654
|
-
}), [W, d]), /* @__PURE__ */ g(
|
|
655
|
-
value:
|
|
656
|
-
children: /* @__PURE__ */ g(
|
|
657
|
-
value:
|
|
658
|
-
children: /* @__PURE__ */ g(
|
|
659
|
-
value:
|
|
657
|
+
}), [W, d]), /* @__PURE__ */ g(ce.Provider, {
|
|
658
|
+
value: Q,
|
|
659
|
+
children: /* @__PURE__ */ g(le.Provider, {
|
|
660
|
+
value: pe,
|
|
661
|
+
children: /* @__PURE__ */ g(ue.Provider, {
|
|
662
|
+
value: me,
|
|
660
663
|
children: /* @__PURE__ */ _("div", {
|
|
661
664
|
className: j("bsy-select-container text-sm", e.className),
|
|
662
665
|
style: e.style,
|
|
663
666
|
children: [
|
|
664
667
|
/* @__PURE__ */ g("div", {
|
|
665
|
-
ref:
|
|
668
|
+
ref: $.setReference,
|
|
666
669
|
className: j("bsy-select-input-event", e.inputClassName),
|
|
667
|
-
...
|
|
668
|
-
style:
|
|
670
|
+
..._e(),
|
|
671
|
+
style: ye,
|
|
669
672
|
onClick: () => {
|
|
670
673
|
e.disabled || Y(!0);
|
|
671
674
|
},
|
|
672
675
|
role: "combobox",
|
|
673
676
|
"aria-expanded": q,
|
|
674
677
|
"aria-haspopup": "listbox",
|
|
675
|
-
"aria-controls":
|
|
678
|
+
"aria-controls": ae,
|
|
676
679
|
"aria-disabled": s,
|
|
677
|
-
children: /* @__PURE__ */ g(
|
|
678
|
-
mode:
|
|
680
|
+
children: /* @__PURE__ */ g(fe, {
|
|
681
|
+
mode: N,
|
|
679
682
|
clearable: o,
|
|
680
683
|
disabled: s,
|
|
681
|
-
placeholder: c ||
|
|
684
|
+
placeholder: c || P("select"),
|
|
682
685
|
labelRender: u,
|
|
683
686
|
options: r,
|
|
684
687
|
type: i,
|
|
@@ -687,24 +690,27 @@ var _e = b((e, n) => {
|
|
|
687
690
|
ghost: y,
|
|
688
691
|
inputValueStyle: b,
|
|
689
692
|
tagStyle: x,
|
|
690
|
-
onClear:
|
|
693
|
+
onClear: Se
|
|
691
694
|
})
|
|
692
695
|
}),
|
|
693
|
-
/* @__PURE__ */ g(ie, {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
696
|
+
/* @__PURE__ */ g(ie, {
|
|
697
|
+
root: be,
|
|
698
|
+
children: /* @__PURE__ */ g(re, { children: q && /* @__PURE__ */ _(h, { children: [e.showMask && /* @__PURE__ */ g("div", {
|
|
699
|
+
className: "bsy-select-mask",
|
|
700
|
+
style: { zIndex: w }
|
|
701
|
+
}), /* @__PURE__ */ g("div", {
|
|
702
|
+
ref: $.setFloating,
|
|
703
|
+
style: he,
|
|
704
|
+
...ve(),
|
|
705
|
+
id: ae,
|
|
706
|
+
children: /* @__PURE__ */ g(ge, {
|
|
707
|
+
...e,
|
|
708
|
+
options: r,
|
|
709
|
+
onPopupScroll: p
|
|
710
|
+
})
|
|
711
|
+
})] }) })
|
|
712
|
+
}, xe),
|
|
713
|
+
de && D === "bottom" ? e.otherOptionRender ? e.otherOptionRender(W, r) : /* @__PURE__ */ g("div", {
|
|
708
714
|
className: j("mt-[6px] w-full px-[10px] py-[7px] bg-white rounded-[4px]", "border border-[#e0e0e0]"),
|
|
709
715
|
children: /* @__PURE__ */ g("input", {
|
|
710
716
|
value: W || "",
|
|
@@ -712,7 +718,7 @@ var _e = b((e, n) => {
|
|
|
712
718
|
G(e.target.value), d?.(e.target.value);
|
|
713
719
|
},
|
|
714
720
|
className: "w-full outline-none border-none placeholder:text-[#999]",
|
|
715
|
-
placeholder:
|
|
721
|
+
placeholder: P("context"),
|
|
716
722
|
"aria-label": "其他选项输入框",
|
|
717
723
|
role: "textbox"
|
|
718
724
|
})
|
|
@@ -725,4 +731,4 @@ var _e = b((e, n) => {
|
|
|
725
731
|
});
|
|
726
732
|
_e.displayName = "BsySelect";
|
|
727
733
|
//#endregion
|
|
728
|
-
export {
|
|
734
|
+
export { F as n, I as r, _e as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
-
import { t } from "../vendors/useLocale-
|
|
2
|
+
import { t } from "../vendors/useLocale-BTz4slNW.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Select/SelectInputSearch/SelectInputSearch.tsx
|
|
5
5
|
var i = (i) => {
|
package/dist/Select/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
-
import "../vendors/LocaleContext-
|
|
3
|
-
import "../vendors/useLocale-
|
|
4
|
-
import { n as e, r as t, t as n } from "./Select-
|
|
5
|
-
import "./SelectInputSearch-
|
|
2
|
+
import "../vendors/LocaleContext-BJdHS0sH.js";
|
|
3
|
+
import "../vendors/useLocale-BTz4slNW.js";
|
|
4
|
+
import { n as e, r as t, t as n } from "./Select-Gkywa_sm.js";
|
|
5
|
+
import "./SelectInputSearch-DXPTGSc2.js";
|
|
6
6
|
import "../vendors/Tree-DJpkMB5u.js";
|
|
7
7
|
import "../CheckBox/CheckBox-CkVe5Boq.js";
|
|
8
8
|
import "../CheckBox/CheckBox-DIunYcfS.js";
|