@baishuyun/ui-base 6.7.2 → 6.8.2
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/{Amap-Dnvu_pUP.js → Amap-BNnmSPnl.js} +1 -1
- package/dist/Amap/AmapCircle/index.js +4 -3
- package/dist/Amap/{AmapCircle-Wfn43qco.js → AmapCircle-BDW6pnNR.js} +1 -1
- package/dist/Amap/AmapMarker/index.js +5 -4
- package/dist/Amap/{AmapMarker-CMlzx_nj.js → AmapMarker-CdoPWdff.js} +2 -2
- package/dist/Amap/AmapMarkerCluster/index.js +5 -4
- package/dist/Amap/{AmapMarkerCluster-MDUfcIqP.js → AmapMarkerCluster-CSIxiVC5.js} +2 -2
- package/dist/Amap/AmapProvider/index.js +5 -4
- package/dist/Amap/{AmapProvider-CGedZdvQ.js → AmapProvider-Cwi6WOe0.js} +2 -2
- package/dist/Amap/hooks/index.js +3 -2
- package/dist/Amap/{hooks-DwRvpafb.js → hooks-DAN31s_-.js} +1 -1
- package/dist/Amap/index.js +11 -10
- package/dist/Calendar/{AllDaySection-Bd5Po_DI.js → AllDaySection-a96dIzs3.js} +4 -4
- package/dist/Calendar/{Calendar-Bs4S-6rW.js → Calendar-DnQrN8KB.js} +13 -13
- package/dist/Calendar/{CurrentTimeIndicator-twXtFHIp.js → CurrentTimeIndicator-CNKsVEXH.js} +1 -1
- package/dist/Calendar/{EventCard-CvEnWcKd.js → EventCard-B1LoBxth.js} +3 -3
- package/dist/Calendar/{TimeGrid-DPtU6Qvo.js → TimeGrid-DIw8oCqY.js} +2 -2
- package/dist/Calendar/context/index.js +2 -1
- package/dist/Calendar/index.js +21 -20
- package/dist/Calendar/subcomponents/AllDaySection/index.js +8 -7
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -4
- package/dist/Calendar/subcomponents/EventCard/index.js +6 -5
- package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -3
- package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -3
- package/dist/Calendar/{theme-BRVmxhqD.js → theme-xnrMsnkg.js} +2 -2
- package/dist/Calendar/utils/index.js +4 -3
- package/dist/Calendar/utils/layout/index.js +3 -2
- package/dist/Calendar/utils/theme/index.js +2 -1
- package/dist/Card/{Card-BjWdQRjq.js → Card-CtKLNh3n.js} +1 -1
- package/dist/Card/index.js +3 -2
- package/dist/CheckBox/{CheckBox-D7bCjlkU.js → CheckBox-ByWSy9Yr.js} +1 -1
- package/dist/CheckBox/{CheckBox-GtT43IQ8.js → CheckBox-nBm0u6zX.js} +1 -1
- package/dist/CheckBox/index.js +4 -3
- package/dist/ColorPicker/{ColorPicker-Hjs4Vp5a.js → ColorPicker-CL57cSDG.js} +7 -6
- package/dist/ColorPicker/index.js +8 -7
- package/dist/ConfigProvider/index.js +3 -2
- package/dist/DatePicker/{DatePicker-C_ssCNGN.js → DatePicker-C0XbZmrZ.js} +7 -7
- package/dist/DatePicker/{DatePickerPanel-DNDw-H39.js → DatePickerPanel-BEn16cat.js} +6 -5
- package/dist/DatePicker/index.js +9 -8
- package/dist/DatePicker/style/index.js +2 -1
- package/dist/DatePicker/{style-BwmM26RP.js → style-CNtPPsZp.js} +1 -1
- package/dist/DropDown/{DropDown-DYhDwsNm.js → DropDown-yDH9V_9Y.js} +8 -8
- package/dist/DropDown/index.js +12 -10
- package/dist/DropDown/style/index.js +2 -1
- package/dist/DropDown/{style-BSgosymi.js → style-Fdp-U4md.js} +1 -1
- package/dist/Editor/{Buttons-D1fP8aYo.js → Buttons-BivKInBV.js} +147 -127
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +19 -17
- package/dist/Editor/constants/index.js +1 -0
- package/dist/Editor/index.js +286 -174
- package/dist/Gantt/GanttChart/index.js +19 -17
- package/dist/Gantt/{GanttChart-VoKzDvu-.js → GanttChart-CDw1IQ4F.js} +9 -9
- package/dist/Gantt/GanttTable/index.js +12 -10
- package/dist/Gantt/{GanttTable-l-pMVjWe.js → GanttTable-xbXD_PWI.js} +5 -5
- package/dist/Gantt/GanttToolBar/index.js +15 -13
- package/dist/Gantt/{GanttToolBar-Bm_4cVHF.js → GanttToolBar-BTeTsR6Z.js} +4 -4
- package/dist/Gantt/{collapseKeys-_ShTXPKt.js → collapseKeys-B4SOVHjd.js} +2 -2
- package/dist/Gantt/index.js +27 -24
- package/dist/Gantt/{theme-CiMD9Y6i.js → theme-DLNvgM9X.js} +1 -1
- package/dist/Gantt/{timelineViewConfig-CLIpppp0.js → timelineViewConfig-9HArvbmb.js} +1 -1
- package/dist/Gantt/utils/index.js +6 -5
- package/dist/Gantt/utils/theme/index.js +2 -1
- package/dist/Icon/index.js +2 -1
- package/dist/InputTag/InputTag-hzCCJQ1z.js +144 -0
- package/dist/InputTag/index.js +7 -4
- package/dist/Loading/Loading-DiywS7ex.js +19 -0
- package/dist/Loading/index.js +4 -1
- package/dist/Modal/{Modal-GGHNlZv3.js → Modal-LiztSF7x.js} +1 -1
- package/dist/Modal/index.js +3 -2
- package/dist/NotFoundContent/index.js +2 -1
- package/dist/Radio/{Radio-CMAwZdP7.js → Radio-CX9cUqb7.js} +12 -12
- package/dist/Radio/index.js +2 -1
- package/dist/ScrollBar/{ScrollBar-CnwYQfXM.js → ScrollBar-QhXVe8zd.js} +1 -1
- package/dist/ScrollBar/index.js +3 -2
- package/dist/Segmented/{Segmented-Ck2ZmfF7.js → Segmented-BDz1hMDT.js} +1 -1
- package/dist/Segmented/index.js +2 -1
- package/dist/Select/{Select-CwABtVnS.js → Select-D6EK7whJ.js} +202 -201
- package/dist/Select/{SelectInputSearch-dfBUnTCY.js → SelectInputSearch-COUzreau.js} +2 -2
- package/dist/Select/index.js +15 -14
- package/dist/Table/{Table-ByNcMkaT.js → Table-yQXQEk6d.js} +5 -5
- package/dist/Table/hooks/index.js +2 -1
- package/dist/Table/{hooks-uCDY9dqx.js → hooks-BceUZQQm.js} +1 -1
- package/dist/Table/index.js +9 -8
- package/dist/Table/{processRowspan-nIGqGyHh.js → processRowspan-B0WELhG2.js} +1 -1
- package/dist/Table/style/index.js +2 -1
- package/dist/Table/{style-x9xfw6te.js → style-DgiPEsSp.js} +1 -1
- package/dist/Table/utils/index.js +2 -1
- package/dist/Tabs/Tabs-BiKW70CL.js +398 -0
- package/dist/Tabs/index.js +7 -4
- package/dist/Tooltip/{Tooltip-DWWWYn1a.js → Tooltip-Ch9lti_7.js} +1 -1
- package/dist/Tooltip/index.js +2 -1
- package/dist/Tree/index.js +5 -4
- package/dist/Tree/utils/index.js +1 -0
- package/dist/components/DropDown/interface.d.ts +167 -169
- package/dist/components/Editor/LengthBadge.d.ts +6 -0
- package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +1 -1
- package/dist/components/Editor/ToolbarPlugin/ToolbarPlugin.d.ts +5 -1
- package/dist/components/Editor/ToolbarPlugin/context/EditorToolbarThemeContext.d.ts +6 -0
- package/dist/components/Editor/ToolbarPlugin/interface.d.ts +30 -32
- package/dist/components/Editor/index.d.ts +1 -1
- package/dist/components/Editor/interface.d.ts +118 -60
- package/dist/components/Editor/plugins/MaxLengthPlugin.d.ts +7 -0
- package/dist/components/Editor/utils/resolveEditorToolbarThemeVars.d.ts +5 -0
- package/dist/components/Editor/utils/textLength.d.ts +4 -0
- package/dist/components/InputTag/interface.d.ts +32 -32
- package/dist/components/Radio/interface.d.ts +95 -97
- package/dist/components/Tabs/TabSelect/interface.d.ts +23 -25
- package/dist/components/Tabs/interface.d.ts +58 -60
- package/dist/components/Tree/types/node.d.ts +19 -19
- package/dist/components/Tree/types/tree.d.ts +81 -83
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +54 -51
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/lang/en-US.json.d.ts +177 -166
- package/dist/locale/lang/zh-CN.json.d.ts +177 -166
- package/dist/locale/lang/zh-TW.json.d.ts +177 -166
- package/dist/style.css +1 -1
- package/dist/vendors/{ConfigProvider-AQTr7T_c.js → ConfigProvider-DxrZpdIb.js} +23 -1
- package/dist/vendors/{LocaleContext-CBcJzvUD.js → LocaleContext-Dcw6C1LX.js} +11 -0
- package/dist/vendors/{Tree-DMC_MSw1.js → Tree-DXmVRDn0.js} +10 -9
- package/dist/vendors/{useLocale-DZ8XW2VL.js → useLocale-BKZX2_zw.js} +1 -1
- package/dist/vendors/version-4HBYLKDL.js +6 -0
- package/dist/vite-env.d.ts +13 -10
- package/dist/vitest-matchers.d.ts +0 -1
- package/package.json +8 -8
- package/dist/InputTag/InputTag-25vFChWE.js +0 -143
- package/dist/Loading/Loading--cdn92gm.js +0 -15
- package/dist/Tabs/Tabs-ZRWBbBdF.js +0 -410
- package/dist/components/Amap/AmapMarker/__tests__/AmapMarker.test.d.ts +0 -1
- package/dist/components/Amap/AmapMarkerCluster/__tests__/AmapMarkerCluster.test.d.ts +0 -1
- package/dist/components/Amap/AmapProvider/__tests__/AmapProvider.test.d.ts +0 -1
- package/dist/components/Amap/__tests__/Amap.test.d.ts +0 -1
- package/dist/components/Amap/hooks/__tests__/useCurrentLocation.test.d.ts +0 -1
- package/dist/components/Calendar/__tests__/Calendar.contract.test.d.ts +0 -1
- package/dist/components/Calendar/__tests__/algorithm/monthLayoutAlgorithm.test.d.ts +0 -1
- package/dist/components/Calendar/subcomponents/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +0 -1
- package/dist/components/Calendar/subcomponents/DayView/__tests__/CalendarDay.dayFilter.test.d.ts +0 -1
- package/dist/components/Calendar/subcomponents/EventCard/__tests__/EventCard.tooltip.test.d.ts +0 -1
- package/dist/components/Calendar/utils/__tests__/dateUtils.test.d.ts +0 -1
- package/dist/components/Calendar/utils/__tests__/eventUtils.contract.test.d.ts +0 -1
- package/dist/components/Calendar/utils/__tests__/normalizeData.test.d.ts +0 -1
- package/dist/components/Calendar/utils/theme/__tests__/platformTheme.test.d.ts +0 -1
- package/dist/components/Calendar/utils/theme/__tests__/resolveCalendarThemeVars.test.d.ts +0 -1
- package/dist/components/Calendar/utils/theme/__tests__/resolveScheduleColorVars.test.d.ts +0 -1
- package/dist/components/Calendar/utils/theme/__tests__/resolveSubcomponentThemes.test.d.ts +0 -1
- package/dist/components/ConfigProvider/__tests__/ConfigProvider.test.d.ts +0 -1
- package/dist/components/DatePicker/__tests__/DatePicker.getPopupContainer.test.d.ts +0 -1
- package/dist/components/DatePicker/__tests__/DatePicker.triggerActiveClassName.test.d.ts +0 -1
- package/dist/components/DatePicker/__tests__/DatePickerPanel.dom.test.d.ts +0 -1
- package/dist/components/DatePicker/style/__tests__/resolveDatePickerThemeVars.test.d.ts +0 -1
- package/dist/components/DatePicker/utils/__tests__/normalizePickerValue.test.d.ts +0 -1
- package/dist/components/DropDown/__tests__/DropDown.test.d.ts +0 -1
- package/dist/components/DropDown/style/__tests__/resolveDropDownThemeVars.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/OffscreenTaskIndicators/__tests__/OffscreenTaskIndicators.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/hooks/__tests__/timelineFocus.contract.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttColumnVirtual.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttDrag.clippedQuarterMonth.test.d.ts +0 -0
- package/dist/components/Gantt/GanttChart/hooks/__tests__/useOffscreenIndicators.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/hooks/__tests__/useTimelineViewportController.test.d.ts +0 -0
- package/dist/components/Gantt/GanttChart/utils/__tests__/dateRangeNormalizer.subday.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.quarterMonth.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.subday.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.quarterMonth.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.subday.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/quarterMonthScale.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/subdayScale.contract.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/timelineMarkers.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/timelineRange.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewConfig.test.d.ts +0 -1
- package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewportEngine.test.d.ts +0 -1
- 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__/GanttBars.renderWindow.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/GanttChart.contract.test.d.ts +0 -0
- package/dist/components/Gantt/__tests__/GanttSummaryBar.tooltip.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/GanttToolBar.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/filterItemsByCollapse.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/interface.contract.types.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/timezoneUtils.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/useBarTooltipHover.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/useGanttHighlight.test.d.ts +0 -1
- package/dist/components/Gantt/__tests__/useTaskBarPointer.test.d.ts +0 -1
- package/dist/components/Gantt/utils/theme/__tests__/resolveGanttTheme.test.d.ts +0 -1
- package/dist/components/Gantt/utils/theme/__tests__/resolveGanttThemeVars.test.d.ts +0 -1
- package/dist/components/Gantt/utils/theme/__tests__/resolveTableThemeFromGantt.test.d.ts +0 -1
- package/dist/components/ScrollBar/__tests__/ScrollBar.test.d.ts +0 -1
- package/dist/components/Select/__tests__/Select.getPopupContainer.test.d.ts +0 -1
- package/dist/components/Select/__tests__/Select.optionDisabled.test.d.ts +0 -1
- package/dist/components/Table/__tests__/HeaderCell.test.d.ts +0 -1
- package/dist/components/Table/__tests__/TableBody.test.d.ts +0 -1
- package/dist/components/Table/__tests__/processRowspan.test.d.ts +0 -1
- package/dist/components/Table/style/__tests__/resolveTableThemeVars.test.d.ts +0 -1
- package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
- package/dist/components/Tree/Tree.test.d.ts +0 -1
- package/dist/locale/__tests__/locale.test.d.ts +0 -1
- /package/dist/Amap/{AmapContext-CFmsMycg.js → AmapContext-D7Njjm5a.js} +0 -0
- /package/dist/Amap/{useMarkerInfoWindowController-BvP2jo7K.js → useMarkerInfoWindowController-BQmhR0N7.js} +0 -0
- /package/dist/Calendar/{TimeAxis-D7bgZDKs.js → TimeAxis-C9e2BdYs.js} +0 -0
- /package/dist/Calendar/{colorUtils-lXNjGoCk.js → colorUtils-CBLTsDX0.js} +0 -0
- /package/dist/Calendar/{context-CBJnz0IH.js → context-4tCN5X33.js} +0 -0
- /package/dist/Calendar/{layout-BglMom3m.js → layout-Dz-grtu9.js} +0 -0
- /package/dist/DatePicker/{ensureDayjsPlugins-CVL-fnAl.js → ensureDayjsPlugins-Cn9Bkjkj.js} +0 -0
- /package/dist/DatePicker/{pickerLocale-BeMlfhKu.js → pickerLocale-BRnNjLcv.js} +0 -0
- /package/dist/Gantt/{GanttHighlightContext-grda5bhd.js → GanttHighlightContext-ChThr8ia.js} +0 -0
- /package/dist/Gantt/{columnResize-DV1tSBx_.js → columnResize-jG0Wy2PC.js} +0 -0
- /package/dist/Gantt/{constants-BObDP0h6.js → constants-LIz5jwed.js} +0 -0
- /package/dist/Gantt/{highlightTarget-DrP0_NrM.js → highlightTarget-BpkYTonb.js} +0 -0
- /package/dist/Icon/{Icon-SQ5tu-yG.js → Icon-BBDcb-yw.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-J-TEnljc.js → NotFoundContent-BLmzWNBi.js} +0 -0
- /package/dist/ScrollBar/{style-B1NkMGtS.js → style-D26azwz6.js} +0 -0
- /package/dist/Table/{constants-CcwjDbe7.js → constants-kRpjsoet.js} +0 -0
- /package/dist/vendors/{animations-Mlw78WYo.js → animations-rwUbyoT0.js} +0 -0
- /package/dist/vendors/{color-BQYy0Wgy.js → color-D6XBXROa.js} +0 -0
- /package/dist/vendors/{cssVars-B8o94Yao.js → cssVars-BYg1matG.js} +0 -0
- /package/dist/vendors/{mergeRefs-Bai1cIzv.js → mergeRefs-Bsywq1Vo.js} +0 -0
- /package/dist/vendors/{useFloatingOverlay-WbbHmuT-.js → useFloatingOverlay-BApqkHSu.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-C8V67X0v.js → useFloatingPortal-CmVJbuRm.js} +0 -0
- /package/dist/vendors/{useLatchedPopupPortalRoot-hwf14FJ5.js → useLatchedPopupPortalRoot-4fVhqVT4.js} +0 -0
- /package/dist/{components/Amap/AmapCircle/__tests__/AmapCircle.test.d.ts → version.d.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-
|
|
2
|
-
import { t } from "../vendors/useLocale-
|
|
3
|
-
import { n, t as r } from "../vendors/animations-
|
|
4
|
-
import { t as i } from "../vendors/useLatchedPopupPortalRoot-
|
|
5
|
-
import { t as a } from "./SelectInputSearch-
|
|
6
|
-
import { n as o, t as s } from "../vendors/Tree-
|
|
7
|
-
import { t as c } from "../CheckBox/CheckBox-
|
|
8
|
-
import { t as l } from "../NotFoundContent/NotFoundContent-
|
|
9
|
-
import { t as u } from "../ScrollBar/ScrollBar-
|
|
10
|
-
import { t as d } from "../vendors/useFloatingPortal-
|
|
1
|
+
import { t as e } from "../Icon/Icon-BBDcb-yw.js";
|
|
2
|
+
import { t } from "../vendors/useLocale-BKZX2_zw.js";
|
|
3
|
+
import { n, t as r } from "../vendors/animations-rwUbyoT0.js";
|
|
4
|
+
import { t as i } from "../vendors/useLatchedPopupPortalRoot-4fVhqVT4.js";
|
|
5
|
+
import { t as a } from "./SelectInputSearch-COUzreau.js";
|
|
6
|
+
import { n as o, t as s } from "../vendors/Tree-DXmVRDn0.js";
|
|
7
|
+
import { t as c } from "../CheckBox/CheckBox-nBm0u6zX.js";
|
|
8
|
+
import { t as l } from "../NotFoundContent/NotFoundContent-BLmzWNBi.js";
|
|
9
|
+
import { t as u } from "../ScrollBar/ScrollBar-QhXVe8zd.js";
|
|
10
|
+
import { t as d } from "../vendors/useFloatingPortal-CmVJbuRm.js";
|
|
11
11
|
import { first as f, isArray as p, isEmpty as m, isNil as h, noop as g } from "lodash-es";
|
|
12
12
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
13
|
import { Suspense as b, createContext as x, forwardRef as S, memo as C, useCallback as w, useContext as T, useDeferredValue as E, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as D, useRef as O, useState as k } from "react";
|
|
@@ -16,47 +16,47 @@ import A from "clsx";
|
|
|
16
16
|
import { useControllableValue as ie, useHover as j, useToggle as ae } from "ahooks";
|
|
17
17
|
import { AnimatePresence as oe, motion as M } from "motion/react";
|
|
18
18
|
import { FloatingPortal as se } from "@floating-ui/react";
|
|
19
|
-
import
|
|
19
|
+
import N from "fuse.js";
|
|
20
20
|
//#region src/components/Select/constants.ts
|
|
21
|
-
var
|
|
21
|
+
var P = /* @__PURE__ */ function(e) {
|
|
22
22
|
return e.SINGLE = "single", e.MULTIPLE = "multiple", e;
|
|
23
|
-
}({}),
|
|
23
|
+
}({}), F = /* @__PURE__ */ function(e) {
|
|
24
24
|
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;
|
|
25
|
-
}({}),
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
},
|
|
25
|
+
}({}), ce = {
|
|
26
|
+
[F.SINGLE]: P.SINGLE,
|
|
27
|
+
[F.TREE]: P.SINGLE,
|
|
28
|
+
[F.MULTIPLE]: P.MULTIPLE,
|
|
29
|
+
[F.TREE_TAGS]: P.MULTIPLE,
|
|
30
|
+
[F.MEMBER]: P.MULTIPLE,
|
|
31
|
+
[F.DEPARTEMENT]: P.MULTIPLE
|
|
32
|
+
}, le = {
|
|
33
33
|
label: "label",
|
|
34
34
|
value: "value",
|
|
35
35
|
children: "children"
|
|
36
|
-
},
|
|
36
|
+
}, ue = x({
|
|
37
37
|
value: void 0,
|
|
38
38
|
setValue: g,
|
|
39
39
|
isOpen: !1,
|
|
40
40
|
setIsOpen: g
|
|
41
|
-
}),
|
|
41
|
+
}), de = x({
|
|
42
42
|
fieldNames: {
|
|
43
43
|
label: "label",
|
|
44
44
|
value: "value",
|
|
45
45
|
children: "children"
|
|
46
46
|
},
|
|
47
47
|
disabled: !1
|
|
48
|
-
}),
|
|
49
|
-
let e = T(
|
|
48
|
+
}), fe = x({}), I = () => {
|
|
49
|
+
let e = T(ue);
|
|
50
50
|
if (!e) throw Error("Select.* components must be used within a SelectStateContext provider");
|
|
51
51
|
return e;
|
|
52
|
-
},
|
|
53
|
-
let e = T(
|
|
52
|
+
}, L = () => {
|
|
53
|
+
let e = T(de);
|
|
54
54
|
if (!e) throw Error("Select.* components must be used within a SelectConfigContext provider");
|
|
55
55
|
return e;
|
|
56
|
-
},
|
|
56
|
+
}, R = () => T(fe);
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/components/Select/utils/fieldAccessor.ts
|
|
59
|
-
function
|
|
59
|
+
function z(e) {
|
|
60
60
|
let t = e;
|
|
61
61
|
return {
|
|
62
62
|
getLabel: (e) => e[t.label],
|
|
@@ -75,8 +75,8 @@ function R(e) {
|
|
|
75
75
|
}
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/components/Select/SelectInput/SelectSingleInput/SelectSingleInput.tsx
|
|
78
|
-
var
|
|
79
|
-
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } =
|
|
78
|
+
var B = C((e) => {
|
|
79
|
+
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = L(), { isSelectedOtherOption: a, otherOptionValue: o } = R(), s = z(r), c = f(t), l;
|
|
80
80
|
return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ v("div", {
|
|
81
81
|
className: A("bsy-select-input-container__input-value overflow-hidden"),
|
|
82
82
|
style: n,
|
|
@@ -86,38 +86,38 @@ var z = C((e) => {
|
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
B.displayName = "BsySelectSingleInput";
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
|
|
92
|
-
var
|
|
92
|
+
var V = {
|
|
93
93
|
"bsy-input-tag__container": "_bsy-input-tag__container_znvs6_1",
|
|
94
94
|
"bsy-input-tag__item": "_bsy-input-tag__item_znvs6_7",
|
|
95
95
|
"bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_znvs6_20",
|
|
96
96
|
"bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_znvs6_24"
|
|
97
|
-
},
|
|
97
|
+
}, H = S(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ v("div", {
|
|
98
98
|
"data-bsy-input-tag": "true",
|
|
99
99
|
className: A({
|
|
100
|
-
[
|
|
101
|
-
[
|
|
100
|
+
[V["bsy-input-tag__item"]]: !0,
|
|
101
|
+
[V["bsy-input-tag__item--disabled"]]: n
|
|
102
102
|
}),
|
|
103
103
|
ref: r,
|
|
104
104
|
style: t,
|
|
105
105
|
children: e
|
|
106
106
|
}));
|
|
107
|
-
|
|
108
|
-
className: A(
|
|
107
|
+
H.Container = (e) => /* @__PURE__ */ v("div", {
|
|
108
|
+
className: A(V["bsy-input-tag__container"]),
|
|
109
109
|
children: e.children
|
|
110
|
-
}),
|
|
110
|
+
}), H.displayName = "BsyOptionTag";
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
|
|
113
|
-
var
|
|
114
|
-
select_multiple_input__container:
|
|
115
|
-
select_multiple_input__measurement_layer:
|
|
116
|
-
select_multiple_input__close_btn:
|
|
113
|
+
var U = "_select_multiple_input__container_8pd2n_1", W = "_select_multiple_input__measurement_layer_8pd2n_6", G = "_select_multiple_input__close_btn_8pd2n_14", K = "_select_multiple_input__tag_content_8pd2n_24", q = {
|
|
114
|
+
select_multiple_input__container: U,
|
|
115
|
+
select_multiple_input__measurement_layer: W,
|
|
116
|
+
select_multiple_input__close_btn: G,
|
|
117
117
|
"select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_8pd2n_21",
|
|
118
|
-
select_multiple_input__tag_content:
|
|
119
|
-
},
|
|
120
|
-
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } =
|
|
118
|
+
select_multiple_input__tag_content: K
|
|
119
|
+
}, J = 4, Y = C((t) => {
|
|
120
|
+
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = I(), { fieldNames: o, disabled: s } = L(), c = z(o), l = n?.length ?? 0, [u, d] = k(0), f = O(null), p = O(null);
|
|
121
121
|
ne(() => {
|
|
122
122
|
if (!f.current) return;
|
|
123
123
|
let e = new ResizeObserver((e) => {
|
|
@@ -130,7 +130,7 @@ var H = "_select_multiple_input__container_8pd2n_1", U = "_select_multiple_input
|
|
|
130
130
|
}
|
|
131
131
|
let a = p.current?.offsetWidth || 65, o = 0, s = 0;
|
|
132
132
|
for (let e = 0; e < i.length; e++) {
|
|
133
|
-
let t = i[e].clientWidth +
|
|
133
|
+
let t = i[e].clientWidth + J, n = e < l - 1 ? a : 0;
|
|
134
134
|
if (o + t + n <= r) o += t, s = e + 1;
|
|
135
135
|
else break;
|
|
136
136
|
}
|
|
@@ -143,25 +143,25 @@ var H = "_select_multiple_input__container_8pd2n_1", U = "_select_multiple_input
|
|
|
143
143
|
n.length
|
|
144
144
|
]);
|
|
145
145
|
let m = l - u, h = E(m), g = /* @__PURE__ */ v("div", {
|
|
146
|
-
className: `${
|
|
147
|
-
children: /* @__PURE__ */ y(
|
|
146
|
+
className: `${q.select_multiple_input__measurement_layer} measure-list`,
|
|
147
|
+
children: /* @__PURE__ */ y(H.Container, { children: [n?.map((t, n) => {
|
|
148
148
|
let a = (t) => /* @__PURE__ */ v("div", {
|
|
149
149
|
style: t,
|
|
150
|
-
className: A(
|
|
150
|
+
className: A(V["bsy-input-tag__item-icon"], "cursor-pointer"),
|
|
151
151
|
children: /* @__PURE__ */ v(e, {
|
|
152
152
|
name: "close",
|
|
153
153
|
style: { fontSize: 12 },
|
|
154
|
-
className:
|
|
154
|
+
className: q.select_multiple_input__close_btn
|
|
155
155
|
})
|
|
156
156
|
});
|
|
157
|
-
return /* @__PURE__ */ y(
|
|
157
|
+
return /* @__PURE__ */ y(H, {
|
|
158
158
|
style: i,
|
|
159
159
|
children: [r && r(t, a), !r && /* @__PURE__ */ y("div", {
|
|
160
|
-
className:
|
|
160
|
+
className: q.select_multiple_input__tag_content,
|
|
161
161
|
children: [/* @__PURE__ */ v("span", { children: c.getLabel(t) }), /* @__PURE__ */ v(a, {})]
|
|
162
162
|
})]
|
|
163
163
|
}, n);
|
|
164
|
-
}), u < l && h > 0 && /* @__PURE__ */ y(
|
|
164
|
+
}), u < l && h > 0 && /* @__PURE__ */ y(H, {
|
|
165
165
|
ref: p,
|
|
166
166
|
children: [`+ ${m}`, /* @__PURE__ */ v("span", {
|
|
167
167
|
className: "text-[#666]",
|
|
@@ -175,13 +175,13 @@ var H = "_select_multiple_input__container_8pd2n_1", U = "_select_multiple_input
|
|
|
175
175
|
};
|
|
176
176
|
return /* @__PURE__ */ y("div", {
|
|
177
177
|
ref: f,
|
|
178
|
-
className: A("bsy-select-input-container__input-value",
|
|
179
|
-
children: [g, /* @__PURE__ */ y(
|
|
178
|
+
className: A("bsy-select-input-container__input-value", q.select_multiple_input__container, "multiple"),
|
|
179
|
+
children: [g, /* @__PURE__ */ y(H.Container, { children: [n?.slice(0, u).map((t, n) => {
|
|
180
180
|
let a = (n) => /* @__PURE__ */ v("div", {
|
|
181
181
|
style: n,
|
|
182
|
-
className: A(
|
|
183
|
-
[
|
|
184
|
-
[
|
|
182
|
+
className: A(V["bsy-input-tag__item-icon"], {
|
|
183
|
+
[q.select_multiple_input__close_btn]: !s,
|
|
184
|
+
[q.select_multiple_input__close_btn + "--disabled"]: s
|
|
185
185
|
}),
|
|
186
186
|
onClick: (e) => {
|
|
187
187
|
e.stopPropagation(), _(t);
|
|
@@ -191,21 +191,21 @@ var H = "_select_multiple_input__container_8pd2n_1", U = "_select_multiple_input
|
|
|
191
191
|
style: { fontSize: 12 }
|
|
192
192
|
})
|
|
193
193
|
});
|
|
194
|
-
return /* @__PURE__ */ y(
|
|
194
|
+
return /* @__PURE__ */ y(H, {
|
|
195
195
|
style: {
|
|
196
196
|
...i,
|
|
197
197
|
flexShrink: u === 1 ? 1 : 0
|
|
198
198
|
},
|
|
199
199
|
disabled: s,
|
|
200
200
|
children: [r && r(t, a), !r && /* @__PURE__ */ y("div", {
|
|
201
|
-
className:
|
|
201
|
+
className: q.select_multiple_input__tag_content,
|
|
202
202
|
children: [/* @__PURE__ */ v("span", {
|
|
203
203
|
className: "truncate",
|
|
204
204
|
children: c.getLabel(t)
|
|
205
205
|
}), /* @__PURE__ */ v(a, {})]
|
|
206
206
|
})]
|
|
207
207
|
}, n);
|
|
208
|
-
}), u < l && h > 0 && /* @__PURE__ */ y(
|
|
208
|
+
}), u < l && h > 0 && /* @__PURE__ */ y(H, {
|
|
209
209
|
ref: p,
|
|
210
210
|
children: [`+ ${m} `, /* @__PURE__ */ v("span", {
|
|
211
211
|
className: "text-[#666]",
|
|
@@ -214,10 +214,10 @@ var H = "_select_multiple_input__container_8pd2n_1", U = "_select_multiple_input
|
|
|
214
214
|
})] })]
|
|
215
215
|
});
|
|
216
216
|
});
|
|
217
|
-
|
|
217
|
+
Y.displayName = "BsySelectMultipleInput";
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region src/components/Select/utils/tree.ts
|
|
220
|
-
var
|
|
220
|
+
var X = (e, t) => {
|
|
221
221
|
let n = [], r = (e) => {
|
|
222
222
|
e.forEach((e) => {
|
|
223
223
|
let { [t.children]: i, ...a } = e;
|
|
@@ -225,12 +225,12 @@ var Y = (e, t) => {
|
|
|
225
225
|
});
|
|
226
226
|
};
|
|
227
227
|
return r(e), n;
|
|
228
|
-
},
|
|
229
|
-
let b = O(null), x = j(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } =
|
|
228
|
+
}, pe = ({ placeholder: t, mode: n, clearable: i, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: d, ghost: f, inputValueStyle: m, tagStyle: g }) => {
|
|
229
|
+
let b = O(null), x = j(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } = I(), { fieldNames: T } = L(), E = D(() => {
|
|
230
230
|
if (h(C)) return [];
|
|
231
231
|
let e = p(C) ? C : [C];
|
|
232
|
-
if (l ===
|
|
233
|
-
let t =
|
|
232
|
+
if (l === F.TREE) {
|
|
233
|
+
let t = z(T), n = X(c, T);
|
|
234
234
|
return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
|
|
235
235
|
}
|
|
236
236
|
return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
|
|
@@ -244,7 +244,7 @@ var Y = (e, t) => {
|
|
|
244
244
|
return /* @__PURE__ */ v("div", {
|
|
245
245
|
className: A("bsy-select-input-container", {
|
|
246
246
|
disabled: o,
|
|
247
|
-
multiple: n ===
|
|
247
|
+
multiple: n === P.MULTIPLE,
|
|
248
248
|
active: S,
|
|
249
249
|
"ghost-style": f
|
|
250
250
|
}),
|
|
@@ -256,11 +256,11 @@ var Y = (e, t) => {
|
|
|
256
256
|
className: "bsy-select-input-container-input-prefix",
|
|
257
257
|
children: u
|
|
258
258
|
}),
|
|
259
|
-
E?.length ? /* @__PURE__ */ y(_, { children: [n ===
|
|
259
|
+
E?.length ? /* @__PURE__ */ y(_, { children: [n === P.SINGLE && /* @__PURE__ */ v(B, {
|
|
260
260
|
value: E,
|
|
261
261
|
labelRender: s,
|
|
262
262
|
inputValueStyle: m
|
|
263
|
-
}), n ===
|
|
263
|
+
}), n === P.MULTIPLE && /* @__PURE__ */ v(Y, {
|
|
264
264
|
value: E,
|
|
265
265
|
labelRender: s,
|
|
266
266
|
tagStyle: g
|
|
@@ -300,67 +300,68 @@ var Y = (e, t) => {
|
|
|
300
300
|
})
|
|
301
301
|
});
|
|
302
302
|
};
|
|
303
|
-
|
|
303
|
+
pe.displayName = "BsySelectInput";
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/components/Select/OptionList/SingleOptionList/SingleOptionList.tsx
|
|
306
|
-
var
|
|
307
|
-
let { options:
|
|
306
|
+
var Z = C((e) => {
|
|
307
|
+
let { options: n, value: r, onSelect: i, searchValue: a = "", fieldNames: s, optionRender: c, optionStyle: l } = e, { t: u } = t(), { otherInputPosition: d } = L(), { otherOptionValue: f, setOtherOptionValue: p, onOtherInputChange: m, isSelectedOtherOption: h = !1 } = R(), g = O(null), _ = z(s);
|
|
308
308
|
return /* @__PURE__ */ v("ul", {
|
|
309
309
|
role: "listbox",
|
|
310
|
-
children:
|
|
311
|
-
let
|
|
310
|
+
children: n.map((e, t) => {
|
|
311
|
+
let n = _.getValue(e), s = _.getLabel(e), b = e.systemField || !1, x = e.isOther === !0, S = e.disabled === !0, C = x && d === "inline" && s.length > 6 ? s.slice(0, 6) + "..." : s, w = x ? h : n === r;
|
|
312
312
|
return /* @__PURE__ */ y("li", {
|
|
313
313
|
role: "option",
|
|
314
|
-
"aria-selected":
|
|
315
|
-
"aria-disabled":
|
|
314
|
+
"aria-selected": w,
|
|
315
|
+
"aria-disabled": S,
|
|
316
316
|
className: A("rounded-[4px] py-[7px] px-[10px] min-h-[34px]", {
|
|
317
|
-
"cursor-pointer": !
|
|
318
|
-
"cursor-not-allowed text-[#999] bg-transparent":
|
|
319
|
-
"hover:bg-[#eff0f6]": !
|
|
320
|
-
"text-[#4d609f]": !
|
|
321
|
-
"text-[#0265ff] bg-[#f0f6ff]": !
|
|
322
|
-
"flex items-center":
|
|
317
|
+
"cursor-pointer": !S,
|
|
318
|
+
"cursor-not-allowed text-[#999] bg-transparent": S,
|
|
319
|
+
"hover:bg-[#eff0f6]": !S && !w,
|
|
320
|
+
"text-[#4d609f]": !S && b && !w,
|
|
321
|
+
"text-[#0265ff] bg-[#f0f6ff]": !S && w,
|
|
322
|
+
"flex items-center": x && d === "inline"
|
|
323
323
|
}),
|
|
324
|
-
style:
|
|
324
|
+
style: l,
|
|
325
325
|
onClick: () => {
|
|
326
|
-
|
|
326
|
+
S || i(n, e);
|
|
327
327
|
},
|
|
328
328
|
children: [/* @__PURE__ */ v("div", {
|
|
329
|
-
title:
|
|
330
|
-
children:
|
|
331
|
-
text:
|
|
332
|
-
highlight:
|
|
329
|
+
title: s,
|
|
330
|
+
children: c ? c(e, { index: t }, w) : /* @__PURE__ */ v(o, {
|
|
331
|
+
text: C,
|
|
332
|
+
highlight: a
|
|
333
333
|
})
|
|
334
|
-
}),
|
|
334
|
+
}), x && d === "inline" && /* @__PURE__ */ v("div", {
|
|
335
335
|
className: "ml-2 flex-1",
|
|
336
336
|
onClick: (e) => e.stopPropagation(),
|
|
337
337
|
style: { minWidth: "146px" },
|
|
338
338
|
children: /* @__PURE__ */ v(re, {
|
|
339
|
-
ref:
|
|
340
|
-
value:
|
|
341
|
-
disabled:
|
|
339
|
+
ref: g,
|
|
340
|
+
value: f,
|
|
341
|
+
disabled: S,
|
|
342
342
|
onChange: (e) => {
|
|
343
343
|
let t = e.target.value;
|
|
344
|
-
|
|
344
|
+
p?.(t), m?.(t);
|
|
345
345
|
},
|
|
346
346
|
onPressEnter: () => {
|
|
347
|
-
!
|
|
347
|
+
!S && f && i(n, e);
|
|
348
348
|
},
|
|
349
349
|
onBlur: () => {
|
|
350
|
-
!
|
|
350
|
+
!S && f && i(n, e);
|
|
351
351
|
},
|
|
352
|
-
placeholder: "
|
|
352
|
+
placeholder: u("context"),
|
|
353
|
+
"aria-label": u("otherOptionInput")
|
|
353
354
|
})
|
|
354
355
|
})]
|
|
355
|
-
}, `${
|
|
356
|
+
}, `${n}-${t}`);
|
|
356
357
|
})
|
|
357
358
|
});
|
|
358
359
|
});
|
|
359
|
-
|
|
360
|
+
Z.displayName = "BsySingleSelect";
|
|
360
361
|
//#endregion
|
|
361
362
|
//#region src/components/Select/OptionList/MultOptionList/MultOptionList.tsx
|
|
362
|
-
var
|
|
363
|
-
let { t: n } = t(), { options: r, searchValue: i = "", value: a, onSelect: s, fieldNames: l, optionRender: u } = e, d =
|
|
363
|
+
var Q = (e) => {
|
|
364
|
+
let { t: n } = t(), { options: r, searchValue: i = "", value: a, onSelect: s, fieldNames: l, optionRender: u } = e, d = z(l), f = a || [], p = r.filter((e) => !e.isOther), m = p.filter((e) => !e.disabled), h = m.map((e) => d.getValue(e)), g = m.length > 0 && m.every((e) => f.includes(d.getValue(e)));
|
|
364
365
|
return /* @__PURE__ */ v("div", {
|
|
365
366
|
className: "bsy-multiple-select",
|
|
366
367
|
children: /* @__PURE__ */ y("ul", {
|
|
@@ -411,10 +412,10 @@ var Z = (e) => {
|
|
|
411
412
|
})
|
|
412
413
|
});
|
|
413
414
|
};
|
|
414
|
-
|
|
415
|
+
Q.displayName = "BsyMultipleSelect";
|
|
415
416
|
//#endregion
|
|
416
417
|
//#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
|
|
417
|
-
var
|
|
418
|
+
var me = (e) => {
|
|
418
419
|
let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
|
|
419
420
|
return /* @__PURE__ */ v("div", {
|
|
420
421
|
className: "bsy-tree-select",
|
|
@@ -433,13 +434,13 @@ var he = (e) => {
|
|
|
433
434
|
})
|
|
434
435
|
})
|
|
435
436
|
});
|
|
436
|
-
},
|
|
437
|
+
}, he = (e, t) => {
|
|
437
438
|
let n = [], r = (e) => {
|
|
438
439
|
if (e) for (let i of e) n.push(i), r(i[t.children]);
|
|
439
440
|
};
|
|
440
441
|
return r(e), n;
|
|
441
|
-
},
|
|
442
|
-
let i = r[n.children] ?
|
|
442
|
+
}, $ = (e, t, n) => e.reduce((e, r) => {
|
|
443
|
+
let i = r[n.children] ? $(r[n.children], t, n) : void 0;
|
|
443
444
|
if (t.has(r[n.value]) || i && i.length > 0) {
|
|
444
445
|
let a = t.has(r[n.value]) ? r[n.children] : i;
|
|
445
446
|
e.push({
|
|
@@ -448,12 +449,12 @@ var he = (e) => {
|
|
|
448
449
|
});
|
|
449
450
|
}
|
|
450
451
|
return e;
|
|
451
|
-
}, []),
|
|
452
|
-
let { options: n = [], searchValue: r = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: u } = t(), { value: d, setIsOpen: f, setValue: p } =
|
|
452
|
+
}, []), ge = (e) => {
|
|
453
|
+
let { options: n = [], searchValue: r = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: u } = t(), { value: d, setIsOpen: f, setValue: p } = I(), { fieldNames: h } = L(), g = D(() => i === F.TREE ? he(n, h) : n, [
|
|
453
454
|
n,
|
|
454
455
|
h,
|
|
455
456
|
i
|
|
456
|
-
]), y = D(() => new
|
|
457
|
+
]), y = D(() => new N(g, {
|
|
457
458
|
keys: [h.label],
|
|
458
459
|
ignoreLocation: !0,
|
|
459
460
|
threshold: .3
|
|
@@ -466,7 +467,7 @@ var he = (e) => {
|
|
|
466
467
|
}, [f, p]), C = () => {
|
|
467
468
|
if (!a || m(r)) return n;
|
|
468
469
|
let e = y.search(r), t = new Set(e.map((e) => e.item[h.value]));
|
|
469
|
-
return i ===
|
|
470
|
+
return i === F.TREE ? $(n, t, h) : n.filter((e) => t.has(e[h.value]));
|
|
470
471
|
};
|
|
471
472
|
return /* @__PURE__ */ v(_, { children: (() => {
|
|
472
473
|
let e = {
|
|
@@ -476,21 +477,21 @@ var he = (e) => {
|
|
|
476
477
|
};
|
|
477
478
|
if (!m(r) && e.options.length === 0) return c === void 0 ? /* @__PURE__ */ v(l, { text: u("noDataFound") }) : c;
|
|
478
479
|
switch (i) {
|
|
479
|
-
case
|
|
480
|
+
case F.SINGLE: return /* @__PURE__ */ v(Z, {
|
|
480
481
|
...e,
|
|
481
482
|
value: d,
|
|
482
483
|
fieldNames: h,
|
|
483
484
|
onSelect: b,
|
|
484
485
|
optionRender: o
|
|
485
486
|
});
|
|
486
|
-
case
|
|
487
|
+
case F.MULTIPLE: return /* @__PURE__ */ v(Q, {
|
|
487
488
|
...e,
|
|
488
489
|
value: d,
|
|
489
490
|
fieldNames: h,
|
|
490
491
|
onSelect: x,
|
|
491
492
|
optionRender: o
|
|
492
493
|
});
|
|
493
|
-
case
|
|
494
|
+
case F.TREE: return /* @__PURE__ */ v(me, {
|
|
494
495
|
...e,
|
|
495
496
|
value: d,
|
|
496
497
|
fieldNames: h,
|
|
@@ -500,9 +501,9 @@ var he = (e) => {
|
|
|
500
501
|
}
|
|
501
502
|
})() });
|
|
502
503
|
}, _e = (e) => {
|
|
503
|
-
let { options: n = [], type: r =
|
|
504
|
+
let { options: n = [], type: r = F.SINGLE, filterOption: i = !0, onSearch: o, showSearch: s, searchPlaceholder: c, onPopupScroll: d, notFoundContent: f } = e, { t: p } = t(), { searchValue: m = "", setSearchValue: h } = I(), g = E(m), _ = (e) => {
|
|
504
505
|
h?.(e), o?.(e);
|
|
505
|
-
}, x = () => e.fetching ? /* @__PURE__ */ v(l, { text: p("dataSearching") }) : n.length === 0 && !m ? f === void 0 ? /* @__PURE__ */ v(l, { text: p("noData") }) : f : /* @__PURE__ */ v(
|
|
506
|
+
}, x = () => e.fetching ? /* @__PURE__ */ v(l, { text: p("dataSearching") }) : n.length === 0 && !m ? f === void 0 ? /* @__PURE__ */ v(l, { text: p("noData") }) : f : /* @__PURE__ */ v(ge, {
|
|
506
507
|
searchValue: g,
|
|
507
508
|
options: n,
|
|
508
509
|
type: r,
|
|
@@ -533,49 +534,49 @@ _e.displayName = "BsySelectPanel";
|
|
|
533
534
|
//#endregion
|
|
534
535
|
//#region src/components/Select/Select.tsx
|
|
535
536
|
var ve = S((e, r) => {
|
|
536
|
-
let { options: a = [], type: o =
|
|
537
|
-
defaultValue: j ===
|
|
537
|
+
let { options: a = [], type: o = F.SINGLE, fieldNames: s, clearable: c = !0, disabled: l = !1, placeholder: u, labelRender: f, onOtherInputChange: p, onOpenChange: m, onPopupScroll: h, prefix: g, suffixIcon: _, ghost: b, inputValueStyle: x, tagStyle: S, zIndex: C = 1101, zIndexMask: T = 1100, otherInputPosition: E = "bottom", popupMinWidth: ne, getPopupContainer: re } = e, j = ce[o], { t: N } = t(), I = ee(), { onChange: L } = e, R = s || le, [z, B] = ie(e, {
|
|
538
|
+
defaultValue: j === P.SINGLE ? void 0 : [],
|
|
538
539
|
defaultValuePropName: "defaultValue",
|
|
539
540
|
valuePropName: "value",
|
|
540
541
|
trigger: "__NO_CUSTOM_CHANGE__"
|
|
541
|
-
}), [
|
|
542
|
-
if (j ===
|
|
543
|
-
let e = a.every((e) => e[
|
|
544
|
-
return e && t ?
|
|
542
|
+
}), [V, H] = k(""), U = O(/* @__PURE__ */ new Map()), [W, G] = k(() => {
|
|
543
|
+
if (j === P.SINGLE) {
|
|
544
|
+
let e = a.every((e) => e[R.value] !== z), t = a.find((e) => e.isOther === !0);
|
|
545
|
+
return e && t ? z : void 0;
|
|
545
546
|
}
|
|
546
|
-
}),
|
|
547
|
-
if (
|
|
547
|
+
}), K = w((e, t) => {
|
|
548
|
+
if (B(e), t) {
|
|
548
549
|
let n = /* @__PURE__ */ new Map();
|
|
549
550
|
if (Array.isArray(e)) {
|
|
550
551
|
let r = Array.isArray(t) ? t : [];
|
|
551
552
|
e.forEach((e) => {
|
|
552
|
-
let t = r.find((t) => t?.[
|
|
553
|
+
let t = r.find((t) => t?.[R.value] === e);
|
|
553
554
|
e !== null && t && n.set(e, t);
|
|
554
555
|
});
|
|
555
556
|
} else e !== null && !Array.isArray(t) && n.set(e, t);
|
|
556
|
-
|
|
557
|
+
U.current = n;
|
|
557
558
|
}
|
|
558
|
-
|
|
559
|
+
L && L(e, t);
|
|
559
560
|
}, [
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
]), [
|
|
564
|
-
e !==
|
|
561
|
+
L,
|
|
562
|
+
B,
|
|
563
|
+
R
|
|
564
|
+
]), [q, { set: J }] = ae(!1), Y = w((e) => {
|
|
565
|
+
e !== q && (J(e), m?.(e));
|
|
565
566
|
}, [
|
|
566
|
-
|
|
567
|
+
J,
|
|
567
568
|
m,
|
|
568
|
-
|
|
569
|
-
]), { isSelectedOtherOption:
|
|
570
|
-
if (j ===
|
|
569
|
+
q
|
|
570
|
+
]), { isSelectedOtherOption: X, shouldShowOtherInput: Z } = D(() => {
|
|
571
|
+
if (j === P.MULTIPLE) return {
|
|
571
572
|
isSelectedOtherOption: !1,
|
|
572
573
|
shouldShowOtherInput: !1
|
|
573
574
|
};
|
|
574
|
-
let e = a.find((e) => e[
|
|
575
|
+
let e = a.find((e) => e[R.value] === z);
|
|
575
576
|
return e ? {
|
|
576
577
|
isSelectedOtherOption: e.isOther === !0,
|
|
577
578
|
shouldShowOtherInput: e.isOther === !0
|
|
578
|
-
} : a.find((e) => e.isOther === !0) &&
|
|
579
|
+
} : a.find((e) => e.isOther === !0) && z ? {
|
|
579
580
|
isSelectedOtherOption: !0,
|
|
580
581
|
shouldShowOtherInput: !0
|
|
581
582
|
} : {
|
|
@@ -583,59 +584,59 @@ var ve = S((e, r) => {
|
|
|
583
584
|
shouldShowOtherInput: !1
|
|
584
585
|
};
|
|
585
586
|
}, [
|
|
586
|
-
|
|
587
|
+
z,
|
|
587
588
|
a,
|
|
588
|
-
|
|
589
|
+
R,
|
|
589
590
|
j
|
|
590
|
-
]),
|
|
591
|
-
if (
|
|
592
|
-
if (j ===
|
|
593
|
-
let e = a.every((e) => e[
|
|
594
|
-
if (e && t) return t[
|
|
591
|
+
]), Q = w(() => {
|
|
592
|
+
if (z) {
|
|
593
|
+
if (j === P.SINGLE) {
|
|
594
|
+
let e = a.every((e) => e[R.value] !== z), t = a.find((e) => e.isOther === !0);
|
|
595
|
+
if (e && t) return t[R.value];
|
|
595
596
|
}
|
|
596
|
-
return
|
|
597
|
-
} else return
|
|
597
|
+
return z;
|
|
598
|
+
} else return z;
|
|
598
599
|
}, [
|
|
599
|
-
|
|
600
|
+
z,
|
|
600
601
|
a,
|
|
601
|
-
|
|
602
|
+
R,
|
|
602
603
|
j
|
|
603
|
-
]),
|
|
604
|
-
value:
|
|
605
|
-
setValue:
|
|
606
|
-
isOpen:
|
|
607
|
-
setIsOpen:
|
|
608
|
-
getCachedOptionByValue: (e) =>
|
|
609
|
-
searchValue:
|
|
610
|
-
setSearchValue:
|
|
604
|
+
]), me = D(() => ({
|
|
605
|
+
value: Q(),
|
|
606
|
+
setValue: K,
|
|
607
|
+
isOpen: q,
|
|
608
|
+
setIsOpen: Y,
|
|
609
|
+
getCachedOptionByValue: (e) => U.current.get(e),
|
|
610
|
+
searchValue: V,
|
|
611
|
+
setSearchValue: H
|
|
611
612
|
}), [
|
|
612
|
-
|
|
613
|
-
G,
|
|
613
|
+
Q,
|
|
614
614
|
K,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
q,
|
|
616
|
+
Y,
|
|
617
|
+
V
|
|
618
|
+
]), he = D(() => ({
|
|
619
|
+
fieldNames: s || le,
|
|
619
620
|
disabled: l,
|
|
620
621
|
otherInputPosition: E
|
|
621
622
|
}), [
|
|
622
623
|
s,
|
|
623
624
|
l,
|
|
624
625
|
E
|
|
625
|
-
]),
|
|
626
|
-
isSelectedOtherOption:
|
|
627
|
-
otherOptionValue:
|
|
628
|
-
setOtherOptionValue:
|
|
626
|
+
]), $ = D(() => ({
|
|
627
|
+
isSelectedOtherOption: X,
|
|
628
|
+
otherOptionValue: W,
|
|
629
|
+
setOtherOptionValue: G,
|
|
629
630
|
onOtherInputChange: p
|
|
630
631
|
}), [
|
|
631
|
-
|
|
632
|
-
U,
|
|
632
|
+
X,
|
|
633
633
|
W,
|
|
634
|
+
G,
|
|
634
635
|
p
|
|
635
|
-
]), { refs:
|
|
636
|
-
isOpen:
|
|
636
|
+
]), { refs: ge, floatingStyles: ve, getReferenceProps: ye, getFloatingProps: be, referenceStyle: xe } = d({
|
|
637
|
+
isOpen: q,
|
|
637
638
|
close: () => {
|
|
638
|
-
|
|
639
|
+
Y(!1);
|
|
639
640
|
},
|
|
640
641
|
showMask: e.showMask,
|
|
641
642
|
zIndex: C,
|
|
@@ -645,48 +646,48 @@ var ve = S((e, r) => {
|
|
|
645
646
|
x: 0,
|
|
646
647
|
y: 4
|
|
647
648
|
}
|
|
648
|
-
}), { portalRoot: Se, portalMountKey: Ce, handleExitComplete: we } = i(
|
|
649
|
-
|
|
649
|
+
}), { portalRoot: Se, portalMountKey: Ce, handleExitComplete: we } = i(q, re), Te = w(() => {
|
|
650
|
+
X && (G(""), p?.("")), Y(!1), U.current.clear(), K(j === P.SINGLE ? void 0 : []);
|
|
650
651
|
}, [
|
|
651
|
-
|
|
652
|
+
X,
|
|
652
653
|
p,
|
|
653
|
-
|
|
654
|
+
K,
|
|
654
655
|
j,
|
|
655
|
-
|
|
656
|
+
Y
|
|
656
657
|
]);
|
|
657
658
|
return te(r, () => ({
|
|
658
|
-
getOtherOptionValue: () =>
|
|
659
|
+
getOtherOptionValue: () => W,
|
|
659
660
|
setOtherOptionValue: (e) => {
|
|
660
|
-
|
|
661
|
+
G(e), p?.(e);
|
|
661
662
|
}
|
|
662
|
-
}), [
|
|
663
|
-
value:
|
|
664
|
-
children: /* @__PURE__ */ v(
|
|
665
|
-
value:
|
|
666
|
-
children: /* @__PURE__ */ v(
|
|
667
|
-
value:
|
|
663
|
+
}), [W, p]), /* @__PURE__ */ v(ue.Provider, {
|
|
664
|
+
value: me,
|
|
665
|
+
children: /* @__PURE__ */ v(de.Provider, {
|
|
666
|
+
value: he,
|
|
667
|
+
children: /* @__PURE__ */ v(fe.Provider, {
|
|
668
|
+
value: $,
|
|
668
669
|
children: /* @__PURE__ */ y("div", {
|
|
669
670
|
className: A("bsy-select-container text-sm", e.className),
|
|
670
671
|
style: e.style,
|
|
671
672
|
children: [
|
|
672
673
|
/* @__PURE__ */ v("div", {
|
|
673
|
-
ref:
|
|
674
|
+
ref: ge.setReference,
|
|
674
675
|
className: A("bsy-select-input-event", e.inputClassName),
|
|
675
676
|
...ye(),
|
|
676
677
|
style: xe,
|
|
677
678
|
onClick: () => {
|
|
678
|
-
e.disabled ||
|
|
679
|
+
e.disabled || Y(!q);
|
|
679
680
|
},
|
|
680
681
|
role: "combobox",
|
|
681
|
-
"aria-expanded":
|
|
682
|
+
"aria-expanded": q,
|
|
682
683
|
"aria-haspopup": "listbox",
|
|
683
|
-
"aria-controls":
|
|
684
|
+
"aria-controls": I,
|
|
684
685
|
"aria-disabled": l,
|
|
685
|
-
children: /* @__PURE__ */ v(
|
|
686
|
+
children: /* @__PURE__ */ v(pe, {
|
|
686
687
|
mode: j,
|
|
687
688
|
clearable: c,
|
|
688
689
|
disabled: l,
|
|
689
|
-
placeholder: u ||
|
|
690
|
+
placeholder: u || N("select"),
|
|
690
691
|
labelRender: f,
|
|
691
692
|
options: a,
|
|
692
693
|
type: o,
|
|
@@ -700,16 +701,16 @@ var ve = S((e, r) => {
|
|
|
700
701
|
}),
|
|
701
702
|
/* @__PURE__ */ y(se, {
|
|
702
703
|
root: Se,
|
|
703
|
-
children: [
|
|
704
|
+
children: [q && e.showMask ? /* @__PURE__ */ v("div", {
|
|
704
705
|
className: "bsy-select-mask",
|
|
705
706
|
style: { zIndex: T }
|
|
706
707
|
}) : null, /* @__PURE__ */ v(oe, {
|
|
707
708
|
onExitComplete: we,
|
|
708
|
-
children:
|
|
709
|
-
ref:
|
|
709
|
+
children: q ? /* @__PURE__ */ v(M.div, {
|
|
710
|
+
ref: ge.setFloating,
|
|
710
711
|
style: ve,
|
|
711
712
|
...be(),
|
|
712
|
-
id:
|
|
713
|
+
id: I,
|
|
713
714
|
...n,
|
|
714
715
|
children: /* @__PURE__ */ v(_e, {
|
|
715
716
|
...e,
|
|
@@ -719,16 +720,16 @@ var ve = S((e, r) => {
|
|
|
719
720
|
}, "bsy-select-panel") : null
|
|
720
721
|
})]
|
|
721
722
|
}, Ce),
|
|
722
|
-
|
|
723
|
+
Z && E === "bottom" ? e.otherOptionRender ? e.otherOptionRender(W, a) : /* @__PURE__ */ v("div", {
|
|
723
724
|
className: A("mt-[6px] w-full px-[10px] py-[7px] bg-white rounded-[4px]", "border border-[#e0e0e0]"),
|
|
724
725
|
children: /* @__PURE__ */ v("input", {
|
|
725
|
-
value:
|
|
726
|
+
value: W || "",
|
|
726
727
|
onChange: (e) => {
|
|
727
|
-
|
|
728
|
+
G(e.target.value), p?.(e.target.value);
|
|
728
729
|
},
|
|
729
730
|
className: "w-full outline-none border-none placeholder:text-[#999]",
|
|
730
|
-
placeholder:
|
|
731
|
-
"aria-label": "
|
|
731
|
+
placeholder: N("context"),
|
|
732
|
+
"aria-label": N("otherOptionInput"),
|
|
732
733
|
role: "textbox"
|
|
733
734
|
})
|
|
734
735
|
}) : null
|
|
@@ -740,4 +741,4 @@ var ve = S((e, r) => {
|
|
|
740
741
|
});
|
|
741
742
|
ve.displayName = "BsySelect";
|
|
742
743
|
//#endregion
|
|
743
|
-
export {
|
|
744
|
+
export { P as n, F as r, ve as t };
|