@baishuyun/ui-base 6.16.0 → 6.17.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/Amap-CNsoge6e.js +826 -0
- package/dist/Amap/index.js +3 -10
- package/dist/Calendar/Calendar-BlsUX2vX.js +1608 -0
- package/dist/Calendar/index.js +10 -20
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/{CheckBox-B92dxWNo.js → CheckBox-CM24-quL.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/{ColorPicker-CPr5j6ZN.js → ColorPicker-B_wLqurt.js} +5 -5
- package/dist/ColorPicker/index.js +5 -5
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/DatePicker-BRwPZeui.js +111 -0
- package/dist/DatePicker/{DatePickerPanel-CRnLvIwc.js → DatePickerPanel-UwjSXS-U.js} +3 -4
- package/dist/DatePicker/index.js +6 -8
- package/dist/DatePicker/pickerLocale-Brf7_Tnd.js +30 -0
- package/dist/DropDown/{DropDown-CvG9IFVk.js → DropDown-B_szM67V.js} +86 -82
- package/dist/DropDown/index.js +8 -9
- package/dist/Editor/index.js +2839 -880
- package/dist/Gantt/index.js +3055 -197
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-BfZycXw4.js → InputTag-C_5nm0eo.js} +2 -2
- package/dist/InputTag/index.js +4 -4
- package/dist/Loading/{Loading-DpbJSRYf.js → Loading-Cherk9Ax.js} +1 -1
- package/dist/Loading/index.js +3 -3
- package/dist/Modal/index.js +2 -2
- package/dist/NotFoundContent/index.js +2 -2
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +2 -2
- package/dist/ScrollBar/{ScrollBar-N2pOLv-8.js → ScrollBar-IMTuAOF5.js} +1 -1
- package/dist/ScrollBar/index.js +2 -2
- package/dist/Segmented/{Segmented-BCQRrc65.js → Segmented-DpmwFerw.js} +1 -1
- package/dist/Segmented/index.js +2 -2
- package/dist/Select/{Select-Bla1mQ8v.js → Select-VIy6OKEj.js} +262 -259
- package/dist/Select/{SelectInputSearch-CRgBcsq2.js → SelectInputSearch-MApQHnU9.js} +21 -10
- package/dist/Select/index.js +12 -13
- package/dist/Table/Table-8ac6xLZv.js +808 -0
- package/dist/Table/index.js +4 -8
- package/dist/Tabs/{Tabs-B9uCGlxM.js → Tabs-DnoZ8BO0.js} +3 -3
- package/dist/Tabs/index.js +4 -4
- package/dist/Tooltip/{Tooltip-nJU13gX4.js → Tooltip-DBrt3t2r.js} +3 -3
- package/dist/Tooltip/index.js +3 -3
- package/dist/Tree/index.js +4 -4
- package/dist/components/Editor/EditorHtmlPreview.d.ts +3 -0
- package/dist/components/Editor/Preview/HtmlPreview.d.ts +2 -3
- package/dist/components/Editor/__tests__/createTestEditor.d.ts +1 -0
- package/dist/components/Editor/constants/portableEditorStyles.d.ts +2 -0
- package/dist/components/Editor/hooks/useEditorFocus.d.ts +1 -0
- package/dist/components/Editor/hooks/useTextFormatsState.d.ts +1 -2
- package/dist/components/Editor/index.d.ts +1 -0
- package/dist/components/Editor/nodes/ExtendedLinkNode.d.ts +9 -0
- package/dist/components/Editor/utils/getToolbarItems.d.ts +14 -0
- package/dist/components/Editor/utils/placeProgrammaticCaret.d.ts +5 -0
- package/dist/components/Editor/utils/readTextFormats.d.ts +6 -0
- package/dist/components/Editor/utils/retainCodeSelection.d.ts +3 -0
- package/dist/components/Select/SelectInputSearch/SelectInputSearch.d.ts +2 -0
- package/dist/index.js +28 -50
- package/dist/style.css +1 -1
- package/dist/vendors/Tree-D0Q1IZ2D.js +267 -0
- package/dist/vendors/{version-CFii9VTt.js → version-CfjNx5v2.js} +1 -1
- package/package.json +1 -1
- package/dist/Amap/Amap-BLSziesG.js +0 -77
- package/dist/Amap/AmapCircle/index.js +0 -5
- package/dist/Amap/AmapCircle-2qupysHe.js +0 -55
- package/dist/Amap/AmapContext-CJBe6lld.js +0 -11
- package/dist/Amap/AmapMarker/index.js +0 -6
- package/dist/Amap/AmapMarker-xEqoVnFR.js +0 -153
- package/dist/Amap/AmapMarkerCluster/index.js +0 -6
- package/dist/Amap/AmapMarkerCluster-CvEQa3o9.js +0 -240
- package/dist/Amap/AmapProvider/index.js +0 -7
- package/dist/Amap/AmapProvider-B-R2DrkJ.js +0 -107
- package/dist/Amap/hooks/index.js +0 -4
- package/dist/Amap/hooks-BTcFpdd0.js +0 -121
- package/dist/Amap/useMarkerInfoWindowController-Cjx0xQXw.js +0 -94
- package/dist/Calendar/AllDaySection-pO7suGJM.js +0 -53
- package/dist/Calendar/Calendar-DUD4iffO.js +0 -795
- package/dist/Calendar/CurrentTimeIndicator-BF3_INSL.js +0 -65
- package/dist/Calendar/EventCard-DKEZQRTp.js +0 -155
- package/dist/Calendar/TimeAxis-DUc6EL-j.js +0 -13
- package/dist/Calendar/TimeGrid-BV8x9VnF.js +0 -47
- package/dist/Calendar/colorUtils-BbeSMnOs.js +0 -55
- package/dist/Calendar/context/index.js +0 -3
- package/dist/Calendar/context-CamSpkj3.js +0 -21
- package/dist/Calendar/layout-CpOabFQ2.js +0 -300
- package/dist/Calendar/subcomponents/AllDaySection/index.js +0 -11
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +0 -8
- package/dist/Calendar/subcomponents/EventCard/index.js +0 -9
- package/dist/Calendar/subcomponents/TimeAxis/index.js +0 -5
- package/dist/Calendar/subcomponents/TimeGrid/index.js +0 -7
- package/dist/Calendar/theme-Dc8hjcdo.js +0 -71
- package/dist/Calendar/utils/index.js +0 -111
- package/dist/Calendar/utils/layout/index.js +0 -4
- package/dist/Calendar/utils/theme/index.js +0 -3
- package/dist/DatePicker/DatePicker-BWMmI6rl.js +0 -101
- package/dist/DatePicker/ensureDayjsPlugins-CSqhjLS7.js +0 -15
- package/dist/DatePicker/pickerLocale-CcPLUbZO.js +0 -15
- package/dist/DatePicker/style/index.js +0 -3
- package/dist/DatePicker/style-W7f5wyUb.js +0 -15
- package/dist/DropDown/style/index.js +0 -3
- package/dist/DropDown/style-DZpkarne.js +0 -9
- package/dist/Editor/Buttons-vt3gwedu.js +0 -1841
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +0 -21
- package/dist/Editor/constants/index.js +0 -61
- package/dist/Gantt/GanttChart/index.js +0 -21
- package/dist/Gantt/GanttChart-DRzJdEm-.js +0 -2292
- package/dist/Gantt/GanttHighlightContext-dtyoq-oj.js +0 -12
- package/dist/Gantt/GanttTable/index.js +0 -13
- package/dist/Gantt/GanttTable-fOv1Zn2-.js +0 -84
- package/dist/Gantt/GanttToolBar/index.js +0 -17
- package/dist/Gantt/GanttToolBar-4kxZP6oS.js +0 -120
- package/dist/Gantt/collapseKeys-BV_8sIA-.js +0 -160
- package/dist/Gantt/columnResize-Bkenlbab.js +0 -46
- package/dist/Gantt/constants-mEGQ1U1Q.js +0 -39
- package/dist/Gantt/highlightTarget-D3Nf9_7S.js +0 -25
- package/dist/Gantt/theme-B7Iap-tZ.js +0 -31
- package/dist/Gantt/timelineViewConfig-DNt7yi83.js +0 -118
- package/dist/Gantt/utils/index.js +0 -7
- package/dist/Gantt/utils/theme/index.js +0 -3
- package/dist/Select/style/index.js +0 -3
- package/dist/Select/style-C4A8kUd1.js +0 -9
- package/dist/Table/Table-3LSO0xSH.js +0 -545
- package/dist/Table/constants-D7wLH8Qy.js +0 -25
- package/dist/Table/hooks/index.js +0 -3
- package/dist/Table/hooks-DSBl2e4O.js +0 -108
- package/dist/Table/processRowspan-B6HMqw0Q.js +0 -144
- package/dist/Table/style/index.js +0 -3
- package/dist/Table/style-B8Cw8HJe.js +0 -9
- package/dist/Table/utils/index.js +0 -3
- package/dist/Tree/utils/index.js +0 -26
- package/dist/vendors/Tree-DSl4lDjx.js +0 -248
- /package/dist/Card/{Card-rJeWgxu5.js → Card-DAz0dvA3.js} +0 -0
- /package/dist/CheckBox/{CheckBox-DOK5N7z6.js → CheckBox-CcHskTz_.js} +0 -0
- /package/dist/Modal/{Modal-CRKitOOj.js → Modal-eZijJ7CB.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-BLmzWNBi.js → NotFoundContent-DJUQ0_2D.js} +0 -0
- /package/dist/Radio/{Radio-CX9cUqb7.js → Radio-D9jhW7K6.js} +0 -0
- /package/dist/vendors/{animations-Dn_5xJ7B.js → animations-ISccYUE3.js} +0 -0
- /package/dist/vendors/{cssVars-l4-kP_14.js → cssVars-UpriQzph.js} +0 -0
- /package/dist/vendors/{mergeRefs-TiJ0xjUN.js → mergeRefs-mEH9TBYV.js} +0 -0
- /package/dist/vendors/{useFloatingOverlay-B3M9k8nj.js → useFloatingOverlay-B66lOL8v.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-VpzL-EPh.js → useFloatingPortal-DJ1iKmW-.js} +0 -0
- /package/dist/vendors/{useLatchedPopupPortalRoot-4fVhqVT4.js → useLatchedPopupPortalRoot-CC6af8t-.js} +0 -0
- /package/dist/vendors/{useLocale-D31qCCff.js → useLocale-Be4e7Xfn.js} +0 -0
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-DrdQOEJE.js";
|
|
2
2
|
import { a as t, i as n } from "../Overlay/OverlayContext-CVSFoyqN.js";
|
|
3
|
-
import { t as r } from "../vendors/useLocale-
|
|
4
|
-
import { n as i, r as a } from "../vendors/animations-
|
|
5
|
-
import { t as o } from "../vendors/useLatchedPopupPortalRoot-
|
|
6
|
-
import { t as s } from "
|
|
7
|
-
import {
|
|
8
|
-
import { t as u } from "../
|
|
9
|
-
import { t as d } from "../
|
|
10
|
-
import { t as f } from "../
|
|
11
|
-
import { t as p } from "../
|
|
12
|
-
import { t as m } from "
|
|
3
|
+
import { t as r } from "../vendors/useLocale-Be4e7Xfn.js";
|
|
4
|
+
import { n as i, r as a } from "../vendors/animations-ISccYUE3.js";
|
|
5
|
+
import { t as o } from "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
|
|
6
|
+
import { t as s } from "../vendors/cssVars-UpriQzph.js";
|
|
7
|
+
import { t as c } from "./SelectInputSearch-MApQHnU9.js";
|
|
8
|
+
import { n as l, t as u } from "../vendors/Tree-D0Q1IZ2D.js";
|
|
9
|
+
import { t as d } from "../CheckBox/CheckBox-CM24-quL.js";
|
|
10
|
+
import { t as f } from "../NotFoundContent/NotFoundContent-DJUQ0_2D.js";
|
|
11
|
+
import { t as p } from "../ScrollBar/ScrollBar-IMTuAOF5.js";
|
|
12
|
+
import { t as m } from "../vendors/useFloatingPortal-DJ1iKmW-.js";
|
|
13
13
|
import { first as h, isArray as g, isEmpty as _, isNil as v, noop as y } from "lodash-es";
|
|
14
14
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
15
|
-
import { Suspense as C, createContext as w, forwardRef as T, memo as E, useCallback as D, useContext as O, useDeferredValue as k, useId as ee, useImperativeHandle as te, useLayoutEffect as
|
|
16
|
-
import { Input as
|
|
17
|
-
import
|
|
18
|
-
import { useControllableValue as
|
|
19
|
-
import { AnimatePresence as
|
|
20
|
-
import { FloatingPortal as
|
|
21
|
-
import
|
|
15
|
+
import { Suspense as C, createContext as w, forwardRef as T, memo as E, useCallback as D, useContext as O, useDeferredValue as k, useId as ee, useImperativeHandle as te, useLayoutEffect as A, useMemo as j, useRef as M, useState as N } from "react";
|
|
16
|
+
import { Input as P } from "antd";
|
|
17
|
+
import F from "clsx";
|
|
18
|
+
import { useControllableValue as ne, useHover as re, useToggle as ie } from "ahooks";
|
|
19
|
+
import { AnimatePresence as ae, motion as I } from "motion/react";
|
|
20
|
+
import { FloatingPortal as oe } from "@floating-ui/react";
|
|
21
|
+
import L from "fuse.js";
|
|
22
22
|
//#region src/components/Select/constants.ts
|
|
23
|
-
var
|
|
23
|
+
var R = /* @__PURE__ */ function(e) {
|
|
24
24
|
return e.SINGLE = "single", e.MULTIPLE = "multiple", e;
|
|
25
|
-
}({}),
|
|
25
|
+
}({}), z = /* @__PURE__ */ function(e) {
|
|
26
26
|
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;
|
|
27
|
-
}({}),
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
},
|
|
27
|
+
}({}), se = {
|
|
28
|
+
[z.SINGLE]: R.SINGLE,
|
|
29
|
+
[z.TREE]: R.SINGLE,
|
|
30
|
+
[z.MULTIPLE]: R.MULTIPLE,
|
|
31
|
+
[z.TREE_TAGS]: R.MULTIPLE,
|
|
32
|
+
[z.MEMBER]: R.MULTIPLE,
|
|
33
|
+
[z.DEPARTEMENT]: R.MULTIPLE
|
|
34
|
+
}, ce = {
|
|
35
35
|
label: "label",
|
|
36
36
|
value: "value",
|
|
37
37
|
children: "children"
|
|
38
|
-
},
|
|
38
|
+
}, le = w({
|
|
39
39
|
value: void 0,
|
|
40
40
|
setValue: y,
|
|
41
41
|
isOpen: !1,
|
|
42
42
|
setIsOpen: y
|
|
43
|
-
}),
|
|
43
|
+
}), ue = w({
|
|
44
44
|
fieldNames: {
|
|
45
45
|
label: "label",
|
|
46
46
|
value: "value",
|
|
47
47
|
children: "children"
|
|
48
48
|
},
|
|
49
49
|
disabled: !1
|
|
50
|
-
}),
|
|
51
|
-
let e = O(
|
|
50
|
+
}), de = w({}), B = () => {
|
|
51
|
+
let e = O(le);
|
|
52
52
|
if (!e) throw Error("Select.* components must be used within a SelectStateContext provider");
|
|
53
53
|
return e;
|
|
54
|
-
},
|
|
55
|
-
let e = O(
|
|
54
|
+
}, V = () => {
|
|
55
|
+
let e = O(ue);
|
|
56
56
|
if (!e) throw Error("Select.* components must be used within a SelectConfigContext provider");
|
|
57
57
|
return e;
|
|
58
|
-
},
|
|
58
|
+
}, H = () => O(de);
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/Select/utils/fieldAccessor.ts
|
|
61
|
-
function
|
|
61
|
+
function U(e) {
|
|
62
62
|
let t = e;
|
|
63
63
|
return {
|
|
64
64
|
getLabel: (e) => e[t.label],
|
|
@@ -77,10 +77,10 @@ function z(e) {
|
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/components/Select/SelectInput/SelectSingleInput/SelectSingleInput.tsx
|
|
80
|
-
var
|
|
81
|
-
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } =
|
|
80
|
+
var W = E((e) => {
|
|
81
|
+
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = V(), { isSelectedOtherOption: a, otherOptionValue: o } = H(), s = U(r), c = h(t), l;
|
|
82
82
|
return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ x("div", {
|
|
83
|
-
className:
|
|
83
|
+
className: F("bsy-select-input-container__input-value overflow-hidden"),
|
|
84
84
|
style: n,
|
|
85
85
|
children: /* @__PURE__ */ x("div", {
|
|
86
86
|
className: "bsy-select-input-container__input-value-text",
|
|
@@ -88,40 +88,40 @@ var B = E((e) => {
|
|
|
88
88
|
})
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
|
-
|
|
91
|
+
W.displayName = "BsySelectSingleInput";
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
|
|
94
|
-
var
|
|
94
|
+
var G = {
|
|
95
95
|
"bsy-input-tag__container": "_bsy-input-tag__container_1bb6m_1",
|
|
96
96
|
"bsy-input-tag__item": "_bsy-input-tag__item_1bb6m_7",
|
|
97
97
|
"bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_1bb6m_20",
|
|
98
98
|
"bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_1bb6m_24"
|
|
99
|
-
},
|
|
99
|
+
}, K = T(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ x("div", {
|
|
100
100
|
"data-bsy-input-tag": "true",
|
|
101
|
-
className:
|
|
102
|
-
[
|
|
103
|
-
[
|
|
101
|
+
className: F({
|
|
102
|
+
[G["bsy-input-tag__item"]]: !0,
|
|
103
|
+
[G["bsy-input-tag__item--disabled"]]: n
|
|
104
104
|
}),
|
|
105
105
|
ref: r,
|
|
106
106
|
style: t,
|
|
107
107
|
children: e
|
|
108
108
|
}));
|
|
109
|
-
|
|
110
|
-
className:
|
|
109
|
+
K.Container = (e) => /* @__PURE__ */ x("div", {
|
|
110
|
+
className: F(G["bsy-input-tag__container"]),
|
|
111
111
|
children: e.children
|
|
112
|
-
}),
|
|
112
|
+
}), K.displayName = "BsyOptionTag";
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
|
|
115
|
-
var
|
|
116
|
-
select_multiple_input__container:
|
|
117
|
-
select_multiple_input__measurement_layer:
|
|
118
|
-
select_multiple_input__close_btn:
|
|
115
|
+
var fe = "_select_multiple_input__container_15izh_1", pe = "_select_multiple_input__measurement_layer_15izh_6", me = "_select_multiple_input__close_btn_15izh_14", q = "_select_multiple_input__ellipsis_15izh_24", J = "_select_multiple_input__tag_content_15izh_27", Y = {
|
|
116
|
+
select_multiple_input__container: fe,
|
|
117
|
+
select_multiple_input__measurement_layer: pe,
|
|
118
|
+
select_multiple_input__close_btn: me,
|
|
119
119
|
"select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_15izh_21",
|
|
120
|
-
select_multiple_input__ellipsis:
|
|
121
|
-
select_multiple_input__tag_content:
|
|
122
|
-
},
|
|
123
|
-
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } =
|
|
124
|
-
|
|
120
|
+
select_multiple_input__ellipsis: q,
|
|
121
|
+
select_multiple_input__tag_content: J
|
|
122
|
+
}, X = 4, Z = E((t) => {
|
|
123
|
+
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = B(), { fieldNames: o, disabled: s } = V(), c = U(o), l = n?.length ?? 0, [u, d] = N(0), f = M(null), p = M(null);
|
|
124
|
+
A(() => {
|
|
125
125
|
if (!f.current) return;
|
|
126
126
|
let e = new ResizeObserver((e) => {
|
|
127
127
|
let t = e[0];
|
|
@@ -133,7 +133,7 @@ var U = "_select_multiple_input__container_15izh_1", ge = "_select_multiple_inpu
|
|
|
133
133
|
}
|
|
134
134
|
let a = p.current?.offsetWidth || 65, o = 0, s = 0;
|
|
135
135
|
for (let e = 0; e < i.length; e++) {
|
|
136
|
-
let t = i[e].clientWidth +
|
|
136
|
+
let t = i[e].clientWidth + X, n = e < l - 1 ? a : 0;
|
|
137
137
|
if (o + t + n <= r) o += t, s = e + 1;
|
|
138
138
|
else break;
|
|
139
139
|
}
|
|
@@ -146,28 +146,28 @@ var U = "_select_multiple_input__container_15izh_1", ge = "_select_multiple_inpu
|
|
|
146
146
|
n.length
|
|
147
147
|
]);
|
|
148
148
|
let m = l - u, h = k(m), g = /* @__PURE__ */ x("div", {
|
|
149
|
-
className: `${
|
|
150
|
-
children: /* @__PURE__ */ S(
|
|
149
|
+
className: `${Y.select_multiple_input__measurement_layer} measure-list`,
|
|
150
|
+
children: /* @__PURE__ */ S(K.Container, { children: [n?.map((t, n) => {
|
|
151
151
|
let a = (t) => /* @__PURE__ */ x("div", {
|
|
152
152
|
style: t,
|
|
153
|
-
className:
|
|
153
|
+
className: F(G["bsy-input-tag__item-icon"], "cursor-pointer"),
|
|
154
154
|
children: /* @__PURE__ */ x(e, {
|
|
155
155
|
name: "close",
|
|
156
156
|
style: { fontSize: 12 },
|
|
157
|
-
className:
|
|
157
|
+
className: Y.select_multiple_input__close_btn
|
|
158
158
|
})
|
|
159
159
|
});
|
|
160
|
-
return /* @__PURE__ */ S(
|
|
160
|
+
return /* @__PURE__ */ S(K, {
|
|
161
161
|
style: i,
|
|
162
162
|
children: [r && r(t, a), !r && /* @__PURE__ */ S("div", {
|
|
163
|
-
className:
|
|
163
|
+
className: Y.select_multiple_input__tag_content,
|
|
164
164
|
children: [/* @__PURE__ */ x("span", { children: c.getLabel(t) }), /* @__PURE__ */ x(a, {})]
|
|
165
165
|
})]
|
|
166
166
|
}, n);
|
|
167
|
-
}), u < l && h > 0 && /* @__PURE__ */ S(
|
|
167
|
+
}), u < l && h > 0 && /* @__PURE__ */ S(K, {
|
|
168
168
|
ref: p,
|
|
169
169
|
children: [`+ ${m}`, /* @__PURE__ */ x("span", {
|
|
170
|
-
className:
|
|
170
|
+
className: Y.select_multiple_input__ellipsis,
|
|
171
171
|
children: "..."
|
|
172
172
|
})]
|
|
173
173
|
})] })
|
|
@@ -178,13 +178,13 @@ var U = "_select_multiple_input__container_15izh_1", ge = "_select_multiple_inpu
|
|
|
178
178
|
};
|
|
179
179
|
return /* @__PURE__ */ S("div", {
|
|
180
180
|
ref: f,
|
|
181
|
-
className:
|
|
182
|
-
children: [g, /* @__PURE__ */ S(
|
|
181
|
+
className: F("bsy-select-input-container__input-value", Y.select_multiple_input__container, "multiple"),
|
|
182
|
+
children: [g, /* @__PURE__ */ S(K.Container, { children: [n?.slice(0, u).map((t, n) => {
|
|
183
183
|
let a = (n) => /* @__PURE__ */ x("div", {
|
|
184
184
|
style: n,
|
|
185
|
-
className:
|
|
186
|
-
[
|
|
187
|
-
[
|
|
185
|
+
className: F(G["bsy-input-tag__item-icon"], {
|
|
186
|
+
[Y.select_multiple_input__close_btn]: !s,
|
|
187
|
+
[Y.select_multiple_input__close_btn + "--disabled"]: s
|
|
188
188
|
}),
|
|
189
189
|
onClick: (e) => {
|
|
190
190
|
e.stopPropagation(), _(t);
|
|
@@ -194,33 +194,33 @@ var U = "_select_multiple_input__container_15izh_1", ge = "_select_multiple_inpu
|
|
|
194
194
|
style: { fontSize: 12 }
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
|
-
return /* @__PURE__ */ S(
|
|
197
|
+
return /* @__PURE__ */ S(K, {
|
|
198
198
|
style: {
|
|
199
199
|
...i,
|
|
200
200
|
flexShrink: u === 1 ? 1 : 0
|
|
201
201
|
},
|
|
202
202
|
disabled: s,
|
|
203
203
|
children: [r && r(t, a), !r && /* @__PURE__ */ S("div", {
|
|
204
|
-
className:
|
|
204
|
+
className: Y.select_multiple_input__tag_content,
|
|
205
205
|
children: [/* @__PURE__ */ x("span", {
|
|
206
206
|
className: "truncate",
|
|
207
207
|
children: c.getLabel(t)
|
|
208
208
|
}), /* @__PURE__ */ x(a, {})]
|
|
209
209
|
})]
|
|
210
210
|
}, n);
|
|
211
|
-
}), u < l && h > 0 && /* @__PURE__ */ S(
|
|
211
|
+
}), u < l && h > 0 && /* @__PURE__ */ S(K, {
|
|
212
212
|
ref: p,
|
|
213
213
|
children: [`+ ${m} `, /* @__PURE__ */ x("span", {
|
|
214
|
-
className:
|
|
214
|
+
className: Y.select_multiple_input__ellipsis,
|
|
215
215
|
children: "..."
|
|
216
216
|
})]
|
|
217
217
|
})] })]
|
|
218
218
|
});
|
|
219
219
|
});
|
|
220
|
-
|
|
220
|
+
Z.displayName = "BsySelectMultipleInput";
|
|
221
221
|
//#endregion
|
|
222
222
|
//#region src/components/Select/utils/tree.ts
|
|
223
|
-
var
|
|
223
|
+
var he = (e, t) => {
|
|
224
224
|
let n = [], r = (e) => {
|
|
225
225
|
e.forEach((e) => {
|
|
226
226
|
let { [t.children]: i, ...a } = e;
|
|
@@ -228,12 +228,12 @@ var J = (e, t) => {
|
|
|
228
228
|
});
|
|
229
229
|
};
|
|
230
230
|
return r(e), n;
|
|
231
|
-
},
|
|
232
|
-
let h =
|
|
231
|
+
}, ge = ({ placeholder: t, mode: n, clearable: r, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: d, ghost: f, inputValueStyle: p, tagStyle: m }) => {
|
|
232
|
+
let h = M(null), _ = re(o ? null : h), { isOpen: y, value: C, getCachedOptionByValue: w } = B(), { fieldNames: T } = V(), E = j(() => {
|
|
233
233
|
if (v(C)) return [];
|
|
234
234
|
let e = g(C) ? C : [C];
|
|
235
|
-
if (l ===
|
|
236
|
-
let t =
|
|
235
|
+
if (l === z.TREE) {
|
|
236
|
+
let t = U(T), n = he(c, T);
|
|
237
237
|
return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
|
|
238
238
|
}
|
|
239
239
|
return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
|
|
@@ -245,25 +245,25 @@ var J = (e, t) => {
|
|
|
245
245
|
w
|
|
246
246
|
]);
|
|
247
247
|
return /* @__PURE__ */ x("div", {
|
|
248
|
-
className:
|
|
248
|
+
className: F("bsy-select-input-container", {
|
|
249
249
|
disabled: o,
|
|
250
|
-
multiple: n ===
|
|
250
|
+
multiple: n === R.MULTIPLE,
|
|
251
251
|
active: y,
|
|
252
252
|
"ghost-style": f
|
|
253
253
|
}),
|
|
254
254
|
ref: h,
|
|
255
255
|
children: /* @__PURE__ */ S("div", {
|
|
256
|
-
className:
|
|
256
|
+
className: F("bsy-select-input-container-input"),
|
|
257
257
|
children: [
|
|
258
258
|
u && /* @__PURE__ */ x("div", {
|
|
259
259
|
className: "bsy-select-input-container-input-prefix",
|
|
260
260
|
children: u
|
|
261
261
|
}),
|
|
262
|
-
E?.length ? /* @__PURE__ */ S(b, { children: [n ===
|
|
262
|
+
E?.length ? /* @__PURE__ */ S(b, { children: [n === R.SINGLE && /* @__PURE__ */ x(W, {
|
|
263
263
|
value: E,
|
|
264
264
|
labelRender: s,
|
|
265
265
|
inputValueStyle: p
|
|
266
|
-
}), n ===
|
|
266
|
+
}), n === R.MULTIPLE && /* @__PURE__ */ x(Z, {
|
|
267
267
|
value: E,
|
|
268
268
|
labelRender: s,
|
|
269
269
|
tagStyle: m
|
|
@@ -272,10 +272,10 @@ var J = (e, t) => {
|
|
|
272
272
|
children: t
|
|
273
273
|
}),
|
|
274
274
|
/* @__PURE__ */ x("div", {
|
|
275
|
-
className:
|
|
276
|
-
children: /* @__PURE__ */ x(
|
|
275
|
+
className: F("bsy-select-input-container__icon"),
|
|
276
|
+
children: /* @__PURE__ */ x(ae, {
|
|
277
277
|
mode: "wait",
|
|
278
|
-
children: E?.length && r && _ ? /* @__PURE__ */ x(
|
|
278
|
+
children: E?.length && r && _ ? /* @__PURE__ */ x(I.div, {
|
|
279
279
|
className: "bsy-select-input-container__icon-motion",
|
|
280
280
|
...i,
|
|
281
281
|
children: /* @__PURE__ */ x(e, {
|
|
@@ -287,12 +287,12 @@ var J = (e, t) => {
|
|
|
287
287
|
e.stopPropagation(), a?.();
|
|
288
288
|
}
|
|
289
289
|
})
|
|
290
|
-
}, "cancel") : /* @__PURE__ */ x(
|
|
290
|
+
}, "cancel") : /* @__PURE__ */ x(I.div, {
|
|
291
291
|
className: "bsy-select-input-container__icon-motion",
|
|
292
292
|
...i,
|
|
293
293
|
children: d ? d(y, o) : /* @__PURE__ */ x(e, {
|
|
294
294
|
name: "arrow-down",
|
|
295
|
-
className:
|
|
295
|
+
className: F("icon", { active: y })
|
|
296
296
|
})
|
|
297
297
|
}, "arrow")
|
|
298
298
|
})
|
|
@@ -301,11 +301,11 @@ var J = (e, t) => {
|
|
|
301
301
|
})
|
|
302
302
|
});
|
|
303
303
|
};
|
|
304
|
-
|
|
304
|
+
ge.displayName = "BsySelectInput";
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/components/Select/OptionList/SingleOptionList/SingleOptionList.tsx
|
|
307
|
-
var
|
|
308
|
-
let { options: t, value: n, onSelect: i, searchValue: a = "", fieldNames: o, optionRender: s, optionStyle:
|
|
307
|
+
var Q = E((e) => {
|
|
308
|
+
let { options: t, value: n, onSelect: i, searchValue: a = "", fieldNames: o, optionRender: s, optionStyle: c } = e, { t: u } = r(), { otherInputPosition: d } = V(), { otherOptionValue: f, setOtherOptionValue: p, onOtherInputChange: m, isSelectedOtherOption: h = !1 } = H(), g = M(null), _ = U(o);
|
|
309
309
|
return /* @__PURE__ */ x("ul", {
|
|
310
310
|
role: "listbox",
|
|
311
311
|
children: t.map((e, t) => {
|
|
@@ -314,7 +314,7 @@ var Y = E((e) => {
|
|
|
314
314
|
role: "option",
|
|
315
315
|
"aria-selected": w,
|
|
316
316
|
"aria-disabled": b,
|
|
317
|
-
className:
|
|
317
|
+
className: F("rounded-[4px] py-[7px] px-[10px] min-h-[34px]", {
|
|
318
318
|
"cursor-pointer": !b,
|
|
319
319
|
"cursor-not-allowed bg-transparent": b,
|
|
320
320
|
"bsy-select-option--disabled": b,
|
|
@@ -323,13 +323,13 @@ var Y = E((e) => {
|
|
|
323
323
|
"bsy-select-option--selected": !b && w,
|
|
324
324
|
"flex items-center": y && d === "inline"
|
|
325
325
|
}),
|
|
326
|
-
style:
|
|
326
|
+
style: c,
|
|
327
327
|
onClick: () => {
|
|
328
328
|
b || i(r, e);
|
|
329
329
|
},
|
|
330
330
|
children: [/* @__PURE__ */ x("div", {
|
|
331
331
|
title: o,
|
|
332
|
-
children: s ? s(e, { index: t }, w) : /* @__PURE__ */ x(
|
|
332
|
+
children: s ? s(e, { index: t }, w) : /* @__PURE__ */ x(l, {
|
|
333
333
|
text: C,
|
|
334
334
|
highlight: a
|
|
335
335
|
})
|
|
@@ -337,7 +337,7 @@ var Y = E((e) => {
|
|
|
337
337
|
className: "ml-2 flex-1",
|
|
338
338
|
onClick: (e) => e.stopPropagation(),
|
|
339
339
|
style: { minWidth: "146px" },
|
|
340
|
-
children: /* @__PURE__ */ x(
|
|
340
|
+
children: /* @__PURE__ */ x(P, {
|
|
341
341
|
ref: g,
|
|
342
342
|
value: f,
|
|
343
343
|
disabled: b,
|
|
@@ -359,52 +359,52 @@ var Y = E((e) => {
|
|
|
359
359
|
})
|
|
360
360
|
});
|
|
361
361
|
});
|
|
362
|
-
|
|
362
|
+
Q.displayName = "BsySingleSelect";
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Select/OptionList/MultOptionList/MultOptionList.tsx
|
|
365
|
-
var
|
|
366
|
-
let { t } = r(), { options: n, searchValue: i = "", value: a, onSelect: o, fieldNames: s, optionRender:
|
|
365
|
+
var $ = (e) => {
|
|
366
|
+
let { t } = r(), { options: n, searchValue: i = "", value: a, onSelect: o, fieldNames: s, optionRender: c } = e, u = U(s), f = a || [], p = n.filter((e) => !e.isOther), m = p.filter((e) => !e.disabled), h = m.map((e) => u.getValue(e)), g = m.length > 0 && m.every((e) => f.includes(u.getValue(e)));
|
|
367
367
|
return /* @__PURE__ */ x("div", {
|
|
368
368
|
className: "bsy-multiple-select",
|
|
369
369
|
children: /* @__PURE__ */ S("ul", {
|
|
370
370
|
className: "bsy-multiple-select-list",
|
|
371
371
|
children: [/* @__PURE__ */ x("li", {
|
|
372
|
-
className:
|
|
373
|
-
children: /* @__PURE__ */ x(
|
|
372
|
+
className: F("flex items-center gap-[8px]", "cursor-pointer rounded-[4px] min-h-[34px]", "bsy-select-option--hoverable", "bsy-multiple-select-item"),
|
|
373
|
+
children: /* @__PURE__ */ x(d, {
|
|
374
374
|
checked: g,
|
|
375
375
|
disabled: m.length === 0,
|
|
376
376
|
onChange: () => {
|
|
377
377
|
let e = g ? f.filter((e) => !h.includes(e)) : [...f, ...h.filter((e) => !f.includes(e))];
|
|
378
|
-
o(e, p.filter((t) => e.includes(
|
|
378
|
+
o(e, p.filter((t) => e.includes(u.getValue(t))));
|
|
379
379
|
},
|
|
380
|
-
indeterminate: m.some((e) => f.includes(
|
|
380
|
+
indeterminate: m.some((e) => f.includes(u.getValue(e))) && !g,
|
|
381
381
|
style: { padding: "7px 10px" },
|
|
382
382
|
children: /* @__PURE__ */ x("span", {
|
|
383
383
|
className: "font-bold bsy-select-option--all",
|
|
384
384
|
children: t(i ? "allSelectedBySearch" : "allSelect")
|
|
385
385
|
})
|
|
386
386
|
})
|
|
387
|
-
}), /* @__PURE__ */ x(
|
|
387
|
+
}), /* @__PURE__ */ x(d.Group, {
|
|
388
388
|
value: f,
|
|
389
389
|
onChange: (e) => {
|
|
390
|
-
o(e, p.filter((t) => e.includes(
|
|
390
|
+
o(e, p.filter((t) => e.includes(u.getValue(t))));
|
|
391
391
|
},
|
|
392
392
|
children: p.map((e, t) => {
|
|
393
|
-
let n =
|
|
393
|
+
let n = u.getValue(e), r = u.getLabel(e), a = f.includes(n), o = e.systemField || !1, s = e.disabled === !0;
|
|
394
394
|
return /* @__PURE__ */ x("li", {
|
|
395
395
|
"aria-disabled": s,
|
|
396
|
-
className:
|
|
396
|
+
className: F("flex items-center gap-[8px] min-h-[34px]", "rounded-[4px]", "bsy-multiple-select-item", {
|
|
397
397
|
"cursor-pointer": !s,
|
|
398
398
|
"cursor-not-allowed bg-transparent": s,
|
|
399
399
|
"bsy-select-option--disabled": s,
|
|
400
400
|
"bsy-select-option--hoverable": !s,
|
|
401
401
|
"bsy-select-option--system": !s && o && !a
|
|
402
402
|
}),
|
|
403
|
-
children: /* @__PURE__ */ x(
|
|
403
|
+
children: /* @__PURE__ */ x(d, {
|
|
404
404
|
value: n,
|
|
405
405
|
disabled: s,
|
|
406
406
|
style: { padding: "7px 10px" },
|
|
407
|
-
children:
|
|
407
|
+
children: c ? c(e, { index: t }, a) : /* @__PURE__ */ x(l, {
|
|
408
408
|
text: r,
|
|
409
409
|
highlight: i
|
|
410
410
|
})
|
|
@@ -415,16 +415,16 @@ var X = (e) => {
|
|
|
415
415
|
})
|
|
416
416
|
});
|
|
417
417
|
};
|
|
418
|
-
|
|
418
|
+
$.displayName = "BsyMultipleSelect";
|
|
419
419
|
//#endregion
|
|
420
420
|
//#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
|
|
421
|
-
var
|
|
421
|
+
var _e = (e) => {
|
|
422
422
|
let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
|
|
423
423
|
return /* @__PURE__ */ x("div", {
|
|
424
424
|
className: "bsy-tree-select",
|
|
425
425
|
children: /* @__PURE__ */ x("div", {
|
|
426
426
|
className: "bsy-tree-select-nodes",
|
|
427
|
-
children: /* @__PURE__ */ x(
|
|
427
|
+
children: /* @__PURE__ */ x(u, {
|
|
428
428
|
data: t,
|
|
429
429
|
searchValue: n,
|
|
430
430
|
fieldNames: a ? {
|
|
@@ -437,13 +437,13 @@ var Z = (e) => {
|
|
|
437
437
|
})
|
|
438
438
|
})
|
|
439
439
|
});
|
|
440
|
-
},
|
|
440
|
+
}, ve = (e, t) => {
|
|
441
441
|
let n = [], r = (e) => {
|
|
442
442
|
if (e) for (let i of e) n.push(i), r(i[t.children]);
|
|
443
443
|
};
|
|
444
444
|
return r(e), n;
|
|
445
|
-
},
|
|
446
|
-
let i = r[n.children] ?
|
|
445
|
+
}, ye = (e, t, n) => e.reduce((e, r) => {
|
|
446
|
+
let i = r[n.children] ? ye(r[n.children], t, n) : void 0;
|
|
447
447
|
if (t.has(r[n.value]) || i && i.length > 0) {
|
|
448
448
|
let a = t.has(r[n.value]) ? r[n.children] : i;
|
|
449
449
|
e.push({
|
|
@@ -452,25 +452,25 @@ var Z = (e) => {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
return e;
|
|
455
|
-
}, []),
|
|
456
|
-
let { options: t = [], searchValue: n = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: l } = r(), { value: u, setIsOpen:
|
|
455
|
+
}, []), be = (e) => {
|
|
456
|
+
let { options: t = [], searchValue: n = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: l } = r(), { value: u, setIsOpen: d, setValue: p } = B(), { fieldNames: m } = V(), h = j(() => i === z.TREE ? ve(t, m) : t, [
|
|
457
457
|
t,
|
|
458
458
|
m,
|
|
459
459
|
i
|
|
460
|
-
]), g =
|
|
460
|
+
]), g = j(() => new L(h, {
|
|
461
461
|
keys: [m.label],
|
|
462
462
|
ignoreLocation: !0,
|
|
463
463
|
threshold: .3
|
|
464
464
|
}), [h, m]), v = D((e, t) => {
|
|
465
|
-
|
|
466
|
-
}, [
|
|
465
|
+
d?.(!1), p(e, t);
|
|
466
|
+
}, [d, p]), y = D((e, t) => {
|
|
467
467
|
p(e, t);
|
|
468
468
|
}, [p]), S = D((e, t) => {
|
|
469
|
-
|
|
470
|
-
}, [
|
|
469
|
+
d?.(!1), p(e, t);
|
|
470
|
+
}, [d, p]), C = () => {
|
|
471
471
|
if (!a || _(n)) return t;
|
|
472
472
|
let e = g.search(n), r = new Set(e.map((e) => e.item[m.value]));
|
|
473
|
-
return i ===
|
|
473
|
+
return i === z.TREE ? ye(t, r, m) : t.filter((e) => r.has(e[m.value]));
|
|
474
474
|
};
|
|
475
475
|
return /* @__PURE__ */ x(b, { children: (() => {
|
|
476
476
|
let e = {
|
|
@@ -478,26 +478,26 @@ var Z = (e) => {
|
|
|
478
478
|
searchValue: n,
|
|
479
479
|
optionStyle: s
|
|
480
480
|
};
|
|
481
|
-
if (!_(n) && e.options.length === 0) return c === void 0 ? /* @__PURE__ */ x(
|
|
481
|
+
if (!_(n) && e.options.length === 0) return c === void 0 ? /* @__PURE__ */ x(f, {
|
|
482
482
|
className: "bsy-select-empty",
|
|
483
483
|
text: l("noDataFound")
|
|
484
484
|
}) : c;
|
|
485
485
|
switch (i) {
|
|
486
|
-
case
|
|
486
|
+
case z.SINGLE: return /* @__PURE__ */ x(Q, {
|
|
487
487
|
...e,
|
|
488
488
|
value: u,
|
|
489
489
|
fieldNames: m,
|
|
490
490
|
onSelect: v,
|
|
491
491
|
optionRender: o
|
|
492
492
|
});
|
|
493
|
-
case
|
|
493
|
+
case z.MULTIPLE: return /* @__PURE__ */ x($, {
|
|
494
494
|
...e,
|
|
495
495
|
value: u,
|
|
496
496
|
fieldNames: m,
|
|
497
497
|
onSelect: y,
|
|
498
498
|
optionRender: o
|
|
499
499
|
});
|
|
500
|
-
case
|
|
500
|
+
case z.TREE: return /* @__PURE__ */ x(_e, {
|
|
501
501
|
...e,
|
|
502
502
|
value: u,
|
|
503
503
|
fieldNames: m,
|
|
@@ -506,16 +506,14 @@ var Z = (e) => {
|
|
|
506
506
|
default: return null;
|
|
507
507
|
}
|
|
508
508
|
})() });
|
|
509
|
-
},
|
|
510
|
-
let { options: t = [], type: n =
|
|
511
|
-
g?.(e), a?.(e);
|
|
512
|
-
}, y = () => e.fetching ? /* @__PURE__ */ x(d, {
|
|
509
|
+
}, xe = (e) => {
|
|
510
|
+
let { options: t = [], type: n = z.SINGLE, filterOption: i = !0, onSearch: a, showSearch: o, searchPlaceholder: s, onPopupScroll: l, notFoundContent: u, themeStyle: d } = e, { t: m } = r(), { searchValue: h = "", setSearchValue: g } = B(), _ = k(h), v = () => e.fetching ? /* @__PURE__ */ x(f, {
|
|
513
511
|
className: "bsy-select-empty",
|
|
514
512
|
text: m("dataSearching")
|
|
515
|
-
}) : t.length === 0 && !h ? u === void 0 ? /* @__PURE__ */ x(
|
|
513
|
+
}) : t.length === 0 && !h ? u === void 0 ? /* @__PURE__ */ x(f, {
|
|
516
514
|
className: "bsy-select-empty",
|
|
517
515
|
text: m("noData")
|
|
518
|
-
}) : u : /* @__PURE__ */ x(
|
|
516
|
+
}) : u : /* @__PURE__ */ x(be, {
|
|
519
517
|
searchValue: _,
|
|
520
518
|
options: t,
|
|
521
519
|
type: n,
|
|
@@ -523,73 +521,78 @@ var Z = (e) => {
|
|
|
523
521
|
optionRender: e.optionRender,
|
|
524
522
|
optionStyle: e.optionStyle,
|
|
525
523
|
notFoundContent: u
|
|
526
|
-
}),
|
|
524
|
+
}), y = D((e) => {
|
|
527
525
|
l?.(e);
|
|
528
526
|
}, [l]);
|
|
529
527
|
return /* @__PURE__ */ x("div", {
|
|
530
528
|
className: "bsy-select-panel",
|
|
531
|
-
style:
|
|
532
|
-
children: /* @__PURE__ */ S(C, { children: [o && /* @__PURE__ */ x(
|
|
529
|
+
style: d,
|
|
530
|
+
children: /* @__PURE__ */ S(C, { children: [o && /* @__PURE__ */ x(c, {
|
|
533
531
|
value: h,
|
|
534
|
-
onChange:
|
|
535
|
-
|
|
532
|
+
onChange: (e) => g?.(e),
|
|
533
|
+
onSearch: a,
|
|
534
|
+
searchPlaceholder: s
|
|
536
535
|
}), /* @__PURE__ */ x("div", {
|
|
537
|
-
className:
|
|
538
|
-
children: /* @__PURE__ */ x(
|
|
536
|
+
className: F({ "pt-[4px]": o }),
|
|
537
|
+
children: /* @__PURE__ */ x(p, {
|
|
539
538
|
style: { maxHeight: 300 },
|
|
540
|
-
onScroll:
|
|
541
|
-
children:
|
|
539
|
+
onScroll: y,
|
|
540
|
+
children: v()
|
|
542
541
|
})
|
|
543
542
|
})] })
|
|
544
543
|
});
|
|
545
544
|
};
|
|
546
|
-
|
|
545
|
+
xe.displayName = "BsySelectPanel";
|
|
547
546
|
//#endregion
|
|
548
|
-
//#region src/components/Select/
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
|
|
547
|
+
//#region src/components/Select/style/resolveSelectThemeVars.ts
|
|
548
|
+
var Se = (e) => {
|
|
549
|
+
if (!e) return {};
|
|
550
|
+
let t = {}, n = e.colorPrimary;
|
|
551
|
+
return s(t, "--bsy-select-color-bg", e.colorBgContainer), s(t, "--bsy-select-color-bg-elevated", e.colorBgElevated ?? e.colorBgContainer), s(t, "--bsy-select-color-text", e.colorText), s(t, "--bsy-select-color-text-placeholder", e.colorTextPlaceholder), s(t, "--bsy-select-color-icon", e.colorIcon), s(t, "--bsy-select-color-icon-hover", e.colorIconHover ?? n), s(t, "--bsy-select-color-border", e.colorBorder), s(t, "--bsy-select-color-border-hover", e.colorBorderHover ?? n), s(t, "--bsy-select-color-bg-disabled", e.colorBgDisabled), s(t, "--bsy-select-color-text-disabled", e.colorTextDisabled), s(t, "--bsy-select-color-border-disabled", e.colorBorderDisabled), s(t, "--bsy-select-item-hover-bg", e.itemHoverBg), s(t, "--bsy-select-item-active-bg", e.itemActiveBg), s(t, "--bsy-select-item-active-color", e.itemActiveColor ?? n), s(t, "--bsy-select-item-color-disabled", e.itemColorDisabled), s(t, "--bsy-select-item-system-color", e.itemSystemColor), s(t, "--bsy-select-color-highlight", e.colorHighlight ?? n), s(t, "--bsy-select-tag-bg", e.tagBg), s(t, "--bsy-select-tag-color", e.tagColor), s(t, "--bsy-select-tag-bg-disabled", e.tagBgDisabled), s(t, "--bsy-select-tag-color-disabled", e.tagColorDisabled), t;
|
|
552
|
+
}, Ce = T((e, i) => {
|
|
553
|
+
let { options: s = [], type: c = z.SINGLE, fieldNames: l, clearable: u = !0, disabled: d = !1, placeholder: f, labelRender: p, onOtherInputChange: h, onOpenChange: g, onPopupScroll: _, prefix: v, suffixIcon: y, ghost: b, inputValueStyle: C, tagStyle: w, zIndex: T, zIndexMask: E, otherInputPosition: O = "bottom", getPopupContainer: k, theme: A } = e, P = Number.parseFloat(e.popupMinWidth ?? ""), re = e.popupMatchSelectWidth ?? (Number.isFinite(P) ? P : !0), L = se[c], B = t(T), V = E ?? B - 1, { t: H } = r(), U = ee(), { onChange: W } = e, G = l || ce, [K, fe] = ne(e, {
|
|
554
|
+
defaultValue: L === R.SINGLE ? void 0 : [],
|
|
552
555
|
defaultValuePropName: "defaultValue",
|
|
553
556
|
valuePropName: "value",
|
|
554
557
|
trigger: "__NO_CUSTOM_CHANGE__"
|
|
555
|
-
}), [
|
|
556
|
-
if (
|
|
557
|
-
let e = s.every((e) => e[
|
|
558
|
-
return e && t ?
|
|
558
|
+
}), [pe, me] = N(""), q = M(/* @__PURE__ */ new Map()), [J, Y] = N(() => {
|
|
559
|
+
if (L === R.SINGLE) {
|
|
560
|
+
let e = s.every((e) => e[G.value] !== K), t = s.find((e) => e.isOther === !0);
|
|
561
|
+
return e && t ? K : void 0;
|
|
559
562
|
}
|
|
560
|
-
}),
|
|
561
|
-
if (
|
|
563
|
+
}), X = D((e, t) => {
|
|
564
|
+
if (fe(e), t) {
|
|
562
565
|
let n = /* @__PURE__ */ new Map();
|
|
563
566
|
if (Array.isArray(e)) {
|
|
564
567
|
let r = Array.isArray(t) ? t : [];
|
|
565
568
|
e.forEach((e) => {
|
|
566
|
-
let t = r.find((t) => t?.[
|
|
569
|
+
let t = r.find((t) => t?.[G.value] === e);
|
|
567
570
|
e !== null && t && n.set(e, t);
|
|
568
571
|
});
|
|
569
572
|
} else e !== null && !Array.isArray(t) && n.set(e, t);
|
|
570
|
-
|
|
573
|
+
q.current = n;
|
|
571
574
|
}
|
|
572
|
-
|
|
575
|
+
W && W(e, t);
|
|
573
576
|
}, [
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
]), [
|
|
578
|
-
e !==
|
|
577
|
+
W,
|
|
578
|
+
fe,
|
|
579
|
+
G
|
|
580
|
+
]), [Z, { set: he }] = ie(!1), Q = D((e) => {
|
|
581
|
+
e !== Z && (he(e), g?.(e));
|
|
579
582
|
}, [
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
]), { isSelectedOtherOption:
|
|
584
|
-
if (
|
|
583
|
+
he,
|
|
584
|
+
g,
|
|
585
|
+
Z
|
|
586
|
+
]), { isSelectedOtherOption: $, shouldShowOtherInput: _e } = j(() => {
|
|
587
|
+
if (L === R.MULTIPLE) return {
|
|
585
588
|
isSelectedOtherOption: !1,
|
|
586
589
|
shouldShowOtherInput: !1
|
|
587
590
|
};
|
|
588
|
-
let e = s.find((e) => e[
|
|
591
|
+
let e = s.find((e) => e[G.value] === K);
|
|
589
592
|
return e ? {
|
|
590
593
|
isSelectedOtherOption: e.isOther === !0,
|
|
591
594
|
shouldShowOtherInput: e.isOther === !0
|
|
592
|
-
} : s.find((e) => e.isOther === !0) &&
|
|
595
|
+
} : s.find((e) => e.isOther === !0) && K ? {
|
|
593
596
|
isSelectedOtherOption: !0,
|
|
594
597
|
shouldShowOtherInput: !0
|
|
595
598
|
} : {
|
|
@@ -597,162 +600,162 @@ var $ = T((e, i) => {
|
|
|
597
600
|
shouldShowOtherInput: !1
|
|
598
601
|
};
|
|
599
602
|
}, [
|
|
600
|
-
|
|
603
|
+
K,
|
|
601
604
|
s,
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
]),
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
let e = s.every((e) => e[
|
|
608
|
-
if (e && t) return t[
|
|
605
|
+
G,
|
|
606
|
+
L
|
|
607
|
+
]), ve = D(() => {
|
|
608
|
+
if (K) {
|
|
609
|
+
if (L === R.SINGLE) {
|
|
610
|
+
let e = s.every((e) => e[G.value] !== K), t = s.find((e) => e.isOther === !0);
|
|
611
|
+
if (e && t) return t[G.value];
|
|
609
612
|
}
|
|
610
|
-
return
|
|
611
|
-
} else return
|
|
613
|
+
return K;
|
|
614
|
+
} else return K;
|
|
612
615
|
}, [
|
|
613
|
-
|
|
616
|
+
K,
|
|
614
617
|
s,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
]),
|
|
618
|
-
value:
|
|
619
|
-
setValue:
|
|
620
|
-
isOpen:
|
|
621
|
-
setIsOpen:
|
|
622
|
-
getCachedOptionByValue: (e) =>
|
|
623
|
-
searchValue:
|
|
624
|
-
setSearchValue:
|
|
618
|
+
G,
|
|
619
|
+
L
|
|
620
|
+
]), ye = j(() => ({
|
|
621
|
+
value: ve(),
|
|
622
|
+
setValue: X,
|
|
623
|
+
isOpen: Z,
|
|
624
|
+
setIsOpen: Q,
|
|
625
|
+
getCachedOptionByValue: (e) => q.current.get(e),
|
|
626
|
+
searchValue: pe,
|
|
627
|
+
setSearchValue: me
|
|
625
628
|
}), [
|
|
626
|
-
|
|
627
|
-
q,
|
|
628
|
-
J,
|
|
629
|
+
ve,
|
|
629
630
|
X,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
631
|
+
Z,
|
|
632
|
+
Q,
|
|
633
|
+
pe
|
|
634
|
+
]), be = j(() => Se(A), [A]), Ce = j(() => ({
|
|
635
|
+
fieldNames: l || ce,
|
|
633
636
|
disabled: d,
|
|
634
|
-
otherInputPosition:
|
|
637
|
+
otherInputPosition: O
|
|
635
638
|
}), [
|
|
636
639
|
l,
|
|
637
640
|
d,
|
|
638
|
-
|
|
639
|
-
]), we =
|
|
640
|
-
isSelectedOtherOption:
|
|
641
|
-
otherOptionValue:
|
|
642
|
-
setOtherOptionValue:
|
|
643
|
-
onOtherInputChange:
|
|
641
|
+
O
|
|
642
|
+
]), we = j(() => ({
|
|
643
|
+
isSelectedOtherOption: $,
|
|
644
|
+
otherOptionValue: J,
|
|
645
|
+
setOtherOptionValue: Y,
|
|
646
|
+
onOtherInputChange: h
|
|
644
647
|
}), [
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
]), { refs: Te, floatingStyles: Ee, getReferenceProps: De, getFloatingProps: Oe, referenceStyle: ke } =
|
|
650
|
-
isOpen:
|
|
648
|
+
$,
|
|
649
|
+
J,
|
|
650
|
+
Y,
|
|
651
|
+
h
|
|
652
|
+
]), { refs: Te, floatingStyles: Ee, getReferenceProps: De, getFloatingProps: Oe, referenceStyle: ke } = m({
|
|
653
|
+
isOpen: Z,
|
|
651
654
|
close: () => {
|
|
652
|
-
|
|
655
|
+
Q(!1);
|
|
653
656
|
},
|
|
654
657
|
showMask: e.showMask,
|
|
655
|
-
zIndex:
|
|
656
|
-
zIndexMask:
|
|
657
|
-
popupMatchSelectWidth:
|
|
658
|
+
zIndex: B,
|
|
659
|
+
zIndexMask: V,
|
|
660
|
+
popupMatchSelectWidth: re,
|
|
658
661
|
offset: {
|
|
659
662
|
x: 0,
|
|
660
663
|
y: 4
|
|
661
664
|
}
|
|
662
|
-
}), { portalRoot: Ae, portalMountKey: je, handleExitComplete: Me } = o(
|
|
663
|
-
|
|
665
|
+
}), { portalRoot: Ae, portalMountKey: je, handleExitComplete: Me } = o(Z, k), Ne = D(() => {
|
|
666
|
+
$ && (Y(""), h?.("")), Q(!1), q.current.clear(), X(L === R.SINGLE ? void 0 : []);
|
|
664
667
|
}, [
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
$,
|
|
669
|
+
h,
|
|
670
|
+
X,
|
|
671
|
+
L,
|
|
672
|
+
Q
|
|
670
673
|
]);
|
|
671
674
|
return te(i, () => ({
|
|
672
|
-
getOtherOptionValue: () =>
|
|
675
|
+
getOtherOptionValue: () => J,
|
|
673
676
|
setOtherOptionValue: (e) => {
|
|
674
|
-
|
|
677
|
+
Y(e), h?.(e);
|
|
675
678
|
}
|
|
676
|
-
}), [
|
|
677
|
-
value:
|
|
678
|
-
children: /* @__PURE__ */ x(
|
|
679
|
+
}), [J, h]), /* @__PURE__ */ x(le.Provider, {
|
|
680
|
+
value: ye,
|
|
681
|
+
children: /* @__PURE__ */ x(ue.Provider, {
|
|
679
682
|
value: Ce,
|
|
680
|
-
children: /* @__PURE__ */ x(
|
|
683
|
+
children: /* @__PURE__ */ x(de.Provider, {
|
|
681
684
|
value: we,
|
|
682
685
|
children: /* @__PURE__ */ S("div", {
|
|
683
|
-
className:
|
|
686
|
+
className: F("bsy-select-container text-sm", e.className),
|
|
684
687
|
style: {
|
|
685
|
-
|
|
688
|
+
...be,
|
|
686
689
|
...e.style
|
|
687
690
|
},
|
|
688
691
|
children: [
|
|
689
692
|
/* @__PURE__ */ x("div", {
|
|
690
693
|
ref: Te.setReference,
|
|
691
|
-
className:
|
|
694
|
+
className: F("bsy-select-input-event", e.inputClassName),
|
|
692
695
|
...De(),
|
|
693
696
|
style: ke,
|
|
694
697
|
onClick: () => {
|
|
695
|
-
e.disabled ||
|
|
698
|
+
e.disabled || Q(!Z);
|
|
696
699
|
},
|
|
697
700
|
role: "combobox",
|
|
698
|
-
"aria-expanded":
|
|
701
|
+
"aria-expanded": Z,
|
|
699
702
|
"aria-haspopup": "listbox",
|
|
700
|
-
"aria-controls":
|
|
703
|
+
"aria-controls": U,
|
|
701
704
|
"aria-disabled": d,
|
|
702
|
-
children: /* @__PURE__ */ x(
|
|
703
|
-
mode:
|
|
705
|
+
children: /* @__PURE__ */ x(ge, {
|
|
706
|
+
mode: L,
|
|
704
707
|
clearable: u,
|
|
705
708
|
disabled: d,
|
|
706
|
-
placeholder: f ||
|
|
707
|
-
labelRender:
|
|
709
|
+
placeholder: f || H("select"),
|
|
710
|
+
labelRender: p,
|
|
708
711
|
options: s,
|
|
709
712
|
type: c,
|
|
710
|
-
prefix:
|
|
711
|
-
suffixIcon:
|
|
712
|
-
ghost:
|
|
713
|
-
inputValueStyle:
|
|
714
|
-
tagStyle:
|
|
713
|
+
prefix: v,
|
|
714
|
+
suffixIcon: y,
|
|
715
|
+
ghost: b,
|
|
716
|
+
inputValueStyle: C,
|
|
717
|
+
tagStyle: w,
|
|
715
718
|
onClear: Ne
|
|
716
719
|
})
|
|
717
720
|
}),
|
|
718
|
-
/* @__PURE__ */ S(
|
|
721
|
+
/* @__PURE__ */ S(oe, {
|
|
719
722
|
root: Ae,
|
|
720
|
-
children: [
|
|
723
|
+
children: [Z && e.showMask ? /* @__PURE__ */ x("div", {
|
|
721
724
|
className: "bsy-select-mask",
|
|
722
|
-
style: { zIndex:
|
|
725
|
+
style: { zIndex: V }
|
|
723
726
|
}) : null, /* @__PURE__ */ x(n, {
|
|
724
|
-
zIndex:
|
|
725
|
-
children: /* @__PURE__ */ x(
|
|
727
|
+
zIndex: B,
|
|
728
|
+
children: /* @__PURE__ */ x(ae, {
|
|
726
729
|
onExitComplete: Me,
|
|
727
|
-
children:
|
|
730
|
+
children: Z ? /* @__PURE__ */ x(I.div, {
|
|
728
731
|
ref: Te.setFloating,
|
|
729
732
|
style: {
|
|
730
733
|
...Ee,
|
|
731
|
-
zIndex:
|
|
734
|
+
zIndex: B
|
|
732
735
|
},
|
|
733
736
|
...Oe(),
|
|
734
|
-
id:
|
|
737
|
+
id: U,
|
|
735
738
|
...a,
|
|
736
|
-
children: /* @__PURE__ */ x(
|
|
739
|
+
children: /* @__PURE__ */ x(xe, {
|
|
737
740
|
...e,
|
|
738
741
|
options: s,
|
|
739
|
-
onPopupScroll:
|
|
740
|
-
themeStyle:
|
|
742
|
+
onPopupScroll: _,
|
|
743
|
+
themeStyle: be
|
|
741
744
|
})
|
|
742
745
|
}, "bsy-select-panel") : null
|
|
743
746
|
})
|
|
744
747
|
})]
|
|
745
748
|
}, je),
|
|
746
|
-
|
|
749
|
+
_e && O === "bottom" ? e.otherOptionRender ? e.otherOptionRender(J, s) : /* @__PURE__ */ x("div", {
|
|
747
750
|
className: "bsy-select-other-input",
|
|
748
751
|
children: /* @__PURE__ */ x("input", {
|
|
749
|
-
value:
|
|
752
|
+
value: J || "",
|
|
750
753
|
onChange: (e) => {
|
|
751
|
-
|
|
754
|
+
Y(e.target.value), h?.(e.target.value);
|
|
752
755
|
},
|
|
753
756
|
className: "w-full outline-none border-none",
|
|
754
|
-
placeholder:
|
|
755
|
-
"aria-label":
|
|
757
|
+
placeholder: H("context"),
|
|
758
|
+
"aria-label": H("otherOptionInput"),
|
|
756
759
|
role: "textbox"
|
|
757
760
|
})
|
|
758
761
|
}) : null
|
|
@@ -762,6 +765,6 @@ var $ = T((e, i) => {
|
|
|
762
765
|
})
|
|
763
766
|
});
|
|
764
767
|
});
|
|
765
|
-
|
|
768
|
+
Ce.displayName = "BsySelect";
|
|
766
769
|
//#endregion
|
|
767
|
-
export {
|
|
770
|
+
export { R as n, z as r, Ce as t };
|