@baishuyun/ui-base 6.4.2 → 6.5.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-DL5dLiUm.js → Amap-Dnvu_pUP.js} +1 -1
- package/dist/Amap/AmapCircle/index.js +3 -3
- package/dist/Amap/{AmapCircle-mh92P2l6.js → AmapCircle-Wfn43qco.js} +1 -1
- package/dist/Amap/AmapMarker/index.js +4 -4
- package/dist/Amap/{AmapMarker-DYW0-8Hd.js → AmapMarker-CB66dQIG.js} +2 -2
- package/dist/Amap/AmapMarkerCluster/index.js +4 -4
- package/dist/Amap/{AmapMarkerCluster-BRVHHMbi.js → AmapMarkerCluster-DvXchCC0.js} +2 -2
- package/dist/Amap/AmapProvider/index.js +4 -4
- package/dist/Amap/{AmapProvider-CwKdpmCg.js → AmapProvider-XCrqzo9W.js} +2 -2
- package/dist/Amap/hooks/index.js +2 -2
- package/dist/Amap/{hooks-D1m8KgVM.js → hooks-DwRvpafb.js} +1 -1
- package/dist/Amap/index.js +10 -10
- package/dist/Calendar/{AllDaySection-CseF1DuB.js → AllDaySection-M-b9tRHh.js} +4 -4
- package/dist/Calendar/{Calendar-Yu2HfA5D.js → Calendar-C9PhASp0.js} +13 -13
- package/dist/Calendar/{CurrentTimeIndicator-CUeblc9r.js → CurrentTimeIndicator-Dpi36eVJ.js} +1 -1
- package/dist/Calendar/{EventCard-L6jaKgEw.js → EventCard-BIfRqCk5.js} +3 -3
- package/dist/Calendar/{TimeGrid-B8lvUb1W.js → TimeGrid-Dk3soSo4.js} +2 -2
- package/dist/Calendar/context/index.js +1 -1
- package/dist/Calendar/index.js +19 -19
- package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -4
- package/dist/Calendar/subcomponents/EventCard/index.js +5 -5
- package/dist/Calendar/subcomponents/TimeAxis/index.js +3 -3
- package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
- package/dist/Calendar/{theme-BzNDRi0U.js → theme-Cgn0zQoC.js} +2 -2
- package/dist/Calendar/utils/index.js +3 -3
- package/dist/Calendar/utils/layout/index.js +2 -2
- package/dist/Calendar/utils/theme/index.js +1 -1
- package/dist/Card/{Card-CRrtIjNT.js → Card-BjWdQRjq.js} +1 -1
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/{CheckBox-DIunYcfS.js → CheckBox-81R8QKHb.js} +1 -1
- package/dist/CheckBox/{CheckBox-CkVe5Boq.js → CheckBox-ejvbDr-a.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/{ColorPicker-By-Y8Tyz.js → ColorPicker-aj57lMA5.js} +5 -5
- package/dist/ColorPicker/index.js +6 -6
- package/dist/ConfigProvider/index.js +2 -2
- package/dist/DatePicker/{DatePicker-PCdNachD.js → DatePicker-EIFyC9zF.js} +6 -6
- package/dist/DatePicker/{DatePickerPanel-HoxXteK0.js → DatePickerPanel-BjnLfncu.js} +5 -5
- package/dist/DatePicker/index.js +7 -7
- package/dist/DatePicker/style/index.js +1 -1
- package/dist/DatePicker/{style-DZaSSoNs.js → style-BxWyBhZ3.js} +1 -1
- package/dist/DropDown/DropDown-B34vfoOs.js +172 -0
- package/dist/DropDown/index.js +8 -7
- package/dist/DropDown/style/index.js +2 -0
- package/dist/DropDown/style-4LK6rNHe.js +9 -0
- package/dist/Editor/{Buttons-DmSUkHWl.js → Buttons-Ds6bLmnl.js} +6 -6
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +15 -14
- package/dist/Editor/index.js +15 -14
- package/dist/Gantt/GanttChart/index.js +15 -14
- package/dist/Gantt/{GanttChart-BgDJOyW1.js → GanttChart-CnIWe_wk.js} +672 -590
- package/dist/Gantt/GanttTable/index.js +9 -9
- package/dist/Gantt/{GanttTable-Di_p-0M1.js → GanttTable-C3PLGmKr.js} +20 -19
- package/dist/Gantt/GanttToolBar/index.js +11 -10
- package/dist/Gantt/GanttToolBar-8jPQ9BAG.js +121 -0
- package/dist/Gantt/{collapseKeys-C8139wvy.js → collapseKeys-1N9ci2oJ.js} +2 -2
- package/dist/Gantt/index.js +195 -162
- package/dist/Gantt/theme-C197Dtjy.js +31 -0
- package/dist/Gantt/{timelineViewConfig-BXl2UkN8.js → timelineViewConfig-Dl3AXO45.js} +1 -1
- package/dist/Gantt/utils/index.js +5 -5
- package/dist/Gantt/utils/theme/index.js +2 -0
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/InputTag-CGQ5dXyf.js +143 -0
- package/dist/InputTag/index.js +3 -2
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/{Modal-D3LFqIV4.js → Modal-GGHNlZv3.js} +1 -1
- package/dist/Modal/index.js +2 -2
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/ScrollBar/ScrollBar-CSGBOE3e.js +68 -0
- package/dist/ScrollBar/index.js +2 -0
- package/dist/Segmented/{Segmented-BTW445jc.js → Segmented-CzVKrL6o.js} +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-OjCjCogR.js → Select-B0r9VgF6.js} +199 -200
- package/dist/Select/{SelectInputSearch-DXPTGSc2.js → SelectInputSearch-BDwg-Noi.js} +2 -2
- package/dist/Select/index.js +12 -11
- package/dist/Table/Table-BtH9Oa14.js +545 -0
- package/dist/Table/hooks/index.js +1 -1
- package/dist/Table/{hooks-CJ2CnSep.js → hooks-DK8Pf7iH.js} +1 -1
- package/dist/Table/index.js +8 -7
- package/dist/Table/{processRowspan-BCzfI5un.js → processRowspan-D4uv6zLk.js} +1 -1
- package/dist/Table/style/index.js +2 -0
- package/dist/Table/style-BwcnT2ee.js +9 -0
- package/dist/Table/utils/index.js +1 -1
- package/dist/Tabs/{Tabs-DVQcB3YG.js → Tabs-7wEcxUv6.js} +4 -4
- package/dist/Tabs/index.js +4 -4
- package/dist/Tooltip/{Tooltip-DW_XP13m.js → Tooltip-B_SZOy6k.js} +41 -44
- package/dist/Tooltip/index.js +1 -1
- package/dist/Tree/index.js +4 -4
- package/dist/components/DropDown/index.d.ts +1 -0
- package/dist/components/DropDown/interface.d.ts +45 -0
- package/dist/components/DropDown/style/__tests__/resolveDropDownThemeVars.test.d.ts +1 -0
- package/dist/components/DropDown/style/index.d.ts +1 -0
- package/dist/components/DropDown/style/resolveDropDownThemeVars.d.ts +2 -0
- package/dist/components/Gantt/Gantt.d.ts +1 -1
- package/dist/components/Gantt/GanttChart/hooks/useEdgeScroll.d.ts +1 -1
- package/dist/components/Gantt/GanttTable/GanttTable.d.ts +1 -1
- package/dist/components/Gantt/GanttThemeContext.d.ts +3 -0
- package/dist/components/Gantt/index.d.ts +2 -1
- package/dist/components/Gantt/interface.d.ts +39 -0
- package/dist/components/Gantt/internal/GanttLayout.d.ts +1 -1
- package/dist/components/Gantt/types.internal.d.ts +2 -0
- package/dist/components/Gantt/utils/theme/__tests__/resolveGanttTheme.test.d.ts +1 -0
- package/dist/components/Gantt/utils/theme/__tests__/resolveGanttThemeVars.test.d.ts +1 -0
- package/dist/components/Gantt/utils/theme/__tests__/resolveTableThemeFromGantt.test.d.ts +1 -0
- package/dist/components/Gantt/utils/theme/index.d.ts +3 -0
- package/dist/components/Gantt/utils/theme/resolveGanttTheme.d.ts +3 -0
- package/dist/components/Gantt/utils/theme/resolveGanttThemeVars.d.ts +5 -0
- package/dist/components/Gantt/utils/theme/resolveTableThemeFromGantt.d.ts +4 -0
- package/dist/components/ScrollBar/ScrollBar.d.ts +3 -0
- package/dist/components/ScrollBar/__tests__/ScrollBar.test.d.ts +1 -0
- package/dist/components/ScrollBar/index.d.ts +3 -0
- package/dist/components/ScrollBar/interface.d.ts +23 -0
- package/dist/components/Table/index.d.ts +2 -1
- package/dist/components/Table/interface.d.ts +17 -0
- package/dist/components/Table/style/__tests__/resolveTableThemeVars.test.d.ts +1 -0
- package/dist/components/Table/style/index.d.ts +1 -0
- package/dist/components/Table/style/resolveTableThemeVars.d.ts +3 -0
- package/dist/components/index.d.ts +5 -2
- package/dist/index.js +50 -47
- package/dist/style.css +1 -1
- package/dist/utils/mergeRefs.d.ts +1 -0
- package/dist/vendors/{ConfigProvider-DwmA94S2.js → ConfigProvider-AQTr7T_c.js} +1 -1
- package/dist/vendors/{Tree-C7BgkjCQ.js → Tree-DqnOGJtB.js} +3 -3
- package/dist/vendors/mergeRefs-TiJ0xjUN.js +9 -0
- package/dist/vendors/{useLocale-BTz4slNW.js → useLocale-DZ8XW2VL.js} +1 -1
- package/package.json +1 -2
- package/dist/DropDown/DropDown-CvQAbsEo.js +0 -168
- package/dist/Gantt/GanttToolBar-D5pQdrzv.js +0 -105
- package/dist/InputTag/InputTag-zP5QdId7.js +0 -139
- package/dist/Table/Table-3-kFIm5v.js +0 -543
- /package/dist/Amap/{AmapContext-JaYk1a3H.js → AmapContext-CFmsMycg.js} +0 -0
- /package/dist/Amap/{useMarkerInfoWindowController-CRgf2I0Q.js → useMarkerInfoWindowController-G-Bg-NDJ.js} +0 -0
- /package/dist/Calendar/{TimeAxis-cK2_3FeM.js → TimeAxis-Chwxo6Yj.js} +0 -0
- /package/dist/Calendar/{colorUtils-DcpqM3KR.js → colorUtils-FNbm3zBQ.js} +0 -0
- /package/dist/Calendar/{context-DNOJ9LW_.js → context-CzS6P3nk.js} +0 -0
- /package/dist/Calendar/{layout-CaPxiRd-.js → layout-Cb39seCc.js} +0 -0
- /package/dist/DatePicker/{ensureDayjsPlugins-C3aqki6i.js → ensureDayjsPlugins-DxqbKqon.js} +0 -0
- /package/dist/DatePicker/{pickerLocale-VqSP_iIm.js → pickerLocale-CtDOOxxD.js} +0 -0
- /package/dist/Gantt/{GanttHighlightContext-AIpN3-af.js → GanttHighlightContext-CtT98ZnK.js} +0 -0
- /package/dist/Gantt/{columnResize-By_1E48E.js → columnResize-DFe7F98O.js} +0 -0
- /package/dist/Gantt/{constants-D4ur8WRs.js → constants-CrBb5i5p.js} +0 -0
- /package/dist/Gantt/{highlightTarget-DmzCIiQb.js → highlightTarget-DtCe7zto.js} +0 -0
- /package/dist/Icon/{Icon-BQ3Whub2.js → Icon-SQ5tu-yG.js} +0 -0
- /package/dist/Loading/{Loading-WjmzBabh.js → Loading-ho-6d72M.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-7xV-zOG2.js → NotFoundContent-CV9fTylQ.js} +0 -0
- /package/dist/Radio/{Radio-DkrZHoG1.js → Radio-C2zJzZc3.js} +0 -0
- /package/dist/Table/{constants-CKqc9Os_.js → constants-CuBlYZLO.js} +0 -0
- /package/dist/vendors/{LocaleContext-BJdHS0sH.js → LocaleContext-CBcJzvUD.js} +0 -0
- /package/dist/vendors/{animations-BeI8JZp1.js → animations-Mlw78WYo.js} +0 -0
- /package/dist/vendors/{color-BeQo449h.js → color-BQYy0Wgy.js} +0 -0
- /package/dist/vendors/{cssVars-C4BlzyxA.js → cssVars-DoQgQ2CM.js} +0 -0
- /package/dist/vendors/{useFloatingOverlay-3KB88hpZ.js → useFloatingOverlay-WbbHmuT-.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-DsEtsAGW.js → useFloatingPortal-B2SDNV5C.js} +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../vendors/useLocale-BTz4slNW.js";
|
|
2
|
-
import { n as t } from "../vendors/animations-BeI8JZp1.js";
|
|
3
|
-
import { t as n } from "../Select/SelectInputSearch-DXPTGSc2.js";
|
|
4
|
-
import { t as r } from "../NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
5
|
-
import { t as i } from "../vendors/useFloatingPortal-DsEtsAGW.js";
|
|
6
|
-
import { isEmpty as a, isNumber as o } from "lodash-es";
|
|
7
|
-
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import { cloneElement as u, isValidElement as d, memo as f, useMemo as p, useState as m } from "react";
|
|
9
|
-
import { clsx as h } from "clsx";
|
|
10
|
-
import { useControllableValue as g } from "ahooks";
|
|
11
|
-
import { AnimatePresence as _, motion as v } from "motion/react";
|
|
12
|
-
import { FloatingPortal as y } from "@floating-ui/react";
|
|
13
|
-
import b from "fuse.js";
|
|
14
|
-
import x from "simplebar-react";
|
|
15
|
-
//#region src/hooks/useDropdownSearch.ts
|
|
16
|
-
var S = ({ menus: e, searchValue: t, enableInternalFilter: n, searchKey: r }) => {
|
|
17
|
-
let i = p(() => new b(e, {
|
|
18
|
-
keys: [r],
|
|
19
|
-
ignoreLocation: !0,
|
|
20
|
-
threshold: .3,
|
|
21
|
-
getFn: (e, t) => {
|
|
22
|
-
let n = e[t];
|
|
23
|
-
return t === "label" && typeof n != "string" ? "" : String(n || "");
|
|
24
|
-
}
|
|
25
|
-
}), [e, r]), o = p(() => !n || a(t) ? e : i.search(t).map((e) => e.item), [
|
|
26
|
-
e,
|
|
27
|
-
t,
|
|
28
|
-
n,
|
|
29
|
-
i
|
|
30
|
-
]);
|
|
31
|
-
return {
|
|
32
|
-
filteredMenus: o,
|
|
33
|
-
hasNoResults: p(() => n && !a(t) && o.length === 0, [
|
|
34
|
-
n,
|
|
35
|
-
t,
|
|
36
|
-
o.length
|
|
37
|
-
])
|
|
38
|
-
};
|
|
39
|
-
}, C = "_dropdown__trigger_c94j2_1", w = "_dropdown__panel_c94j2_7", T = "_dropdown__search_c94j2_15", E = "_dropdown__menu_c94j2_19", D = {
|
|
40
|
-
dropdown__trigger: C,
|
|
41
|
-
"dropdown__trigger--disabled": "_dropdown__trigger--disabled_c94j2_4",
|
|
42
|
-
dropdown__panel: w,
|
|
43
|
-
dropdown__search: T,
|
|
44
|
-
dropdown__menu: E,
|
|
45
|
-
"dropdown__menu-item": "_dropdown__menu-item_c94j2_22",
|
|
46
|
-
"dropdown__menu-item--disabled": "_dropdown__menu-item--disabled_c94j2_34",
|
|
47
|
-
"dropdown__menu-item--active": "_dropdown__menu-item--active_c94j2_34",
|
|
48
|
-
"dropdown__menu-item-icon": "_dropdown__menu-item-icon_c94j2_41",
|
|
49
|
-
"system-field": "_system-field_c94j2_52",
|
|
50
|
-
"dropdown__menu-item-label": "_dropdown__menu-item-label_c94j2_63"
|
|
51
|
-
}, O = f(({ item: e, onClick: t, isActive: n = !1 }) => {
|
|
52
|
-
let r = () => {
|
|
53
|
-
e.disabled || t(e);
|
|
54
|
-
}, i = e.systemField || !1;
|
|
55
|
-
return /* @__PURE__ */ l("div", {
|
|
56
|
-
className: h(D["dropdown__menu-item"], {
|
|
57
|
-
[D["dropdown__menu-item--disabled"]]: e.disabled,
|
|
58
|
-
[D["dropdown__menu-item--active"]]: n && !e.disabled,
|
|
59
|
-
"text-[#4d609f]": i && !e.disabled && !n
|
|
60
|
-
}),
|
|
61
|
-
onClick: r,
|
|
62
|
-
children: [e.icon && /* @__PURE__ */ c("div", {
|
|
63
|
-
className: h(D["dropdown__menu-item-icon"], { [D["system-field"]]: i }),
|
|
64
|
-
children: e.icon
|
|
65
|
-
}), /* @__PURE__ */ c("div", {
|
|
66
|
-
className: h(D["dropdown__menu-item-label"], "truncate"),
|
|
67
|
-
children: e.label
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
O.displayName = "BsyDropDownMenuItem";
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/components/DropDown/MenuList/MenuList.tsx
|
|
74
|
-
var k = ({ menus: t, onClick: n, hasNoResults: i, activeKey: a = [] }) => {
|
|
75
|
-
let { t: o } = e();
|
|
76
|
-
return t.length === 0 ? /* @__PURE__ */ c(r, {
|
|
77
|
-
text: o("noData"),
|
|
78
|
-
className: "px-3 py-6"
|
|
79
|
-
}) : i ? /* @__PURE__ */ c(r, {
|
|
80
|
-
text: o("noDataFound"),
|
|
81
|
-
className: "px-3 py-6"
|
|
82
|
-
}) : /* @__PURE__ */ c("div", {
|
|
83
|
-
className: D.dropdown__menu,
|
|
84
|
-
children: t.map((e) => /* @__PURE__ */ c(O, {
|
|
85
|
-
item: e,
|
|
86
|
-
onClick: n,
|
|
87
|
-
isActive: a.includes(e.key)
|
|
88
|
-
}, e.key))
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
k.displayName = "BsyDropDownMenuList";
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/components/DropDown/DropDown.tsx
|
|
94
|
-
var A = (r) => {
|
|
95
|
-
let { t: a } = e(), { children: f, menus: h, onClick: b, onSearch: C, searchKey: w = "label", showSearch: T = !0, closeOnSelect: E = !0, searchPlaceholder: O = a("search"), offset: A = {
|
|
96
|
-
x: 0,
|
|
97
|
-
y: 0
|
|
98
|
-
}, zIndex: j = 1101, style: M, activeKey: N = [], getPopupContainer: P } = r, [F, I] = g(r, {
|
|
99
|
-
valuePropName: "visible",
|
|
100
|
-
defaultValue: !1,
|
|
101
|
-
trigger: "onOpenChange"
|
|
102
|
-
}), [L, R] = m(""), z = () => {
|
|
103
|
-
I(!F);
|
|
104
|
-
}, B = () => {
|
|
105
|
-
I(!1);
|
|
106
|
-
}, V = (e) => {
|
|
107
|
-
e.disabled || (b?.(e), E && B());
|
|
108
|
-
}, H = (e) => {
|
|
109
|
-
R(e), C?.(e);
|
|
110
|
-
}, { filteredMenus: U, hasNoResults: W } = S({
|
|
111
|
-
menus: h,
|
|
112
|
-
searchValue: L,
|
|
113
|
-
enableInternalFilter: !C,
|
|
114
|
-
searchKey: w
|
|
115
|
-
}), { refs: G, floatingStyles: K, getReferenceProps: q, getFloatingProps: J } = i({
|
|
116
|
-
isOpen: F,
|
|
117
|
-
close: B,
|
|
118
|
-
showMask: !1,
|
|
119
|
-
zIndex: j,
|
|
120
|
-
offset: {
|
|
121
|
-
x: o(A.x) ? A.x : 0,
|
|
122
|
-
y: o(A.y) ? A.y : 0
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
return /* @__PURE__ */ l(s, { children: [d(f) ? u(f, {
|
|
126
|
-
...q(),
|
|
127
|
-
ref: G.setReference,
|
|
128
|
-
onClick: (e) => {
|
|
129
|
-
z(), f.props.onClick?.(e);
|
|
130
|
-
}
|
|
131
|
-
}) : f, /* @__PURE__ */ c(y, {
|
|
132
|
-
root: p(() => {
|
|
133
|
-
let e = F ? P?.() : void 0;
|
|
134
|
-
return e?.nodeType === 1 ? e : void 0;
|
|
135
|
-
}, [F, P]),
|
|
136
|
-
children: /* @__PURE__ */ c(_, { children: F && /* @__PURE__ */ c("div", {
|
|
137
|
-
ref: G.setFloating,
|
|
138
|
-
...J(),
|
|
139
|
-
style: K,
|
|
140
|
-
children: /* @__PURE__ */ c(v.div, {
|
|
141
|
-
...t,
|
|
142
|
-
children: /* @__PURE__ */ l("div", {
|
|
143
|
-
className: D.dropdown__panel,
|
|
144
|
-
style: M,
|
|
145
|
-
children: [T && /* @__PURE__ */ c("div", {
|
|
146
|
-
className: D.dropdown__search,
|
|
147
|
-
children: /* @__PURE__ */ c(n, {
|
|
148
|
-
value: L,
|
|
149
|
-
onChange: H,
|
|
150
|
-
searchPlaceholder: O
|
|
151
|
-
})
|
|
152
|
-
}), /* @__PURE__ */ c(x, {
|
|
153
|
-
style: { maxHeight: 300 },
|
|
154
|
-
children: /* @__PURE__ */ c(k, {
|
|
155
|
-
menus: U,
|
|
156
|
-
onClick: V,
|
|
157
|
-
hasNoResults: W,
|
|
158
|
-
activeKey: N
|
|
159
|
-
})
|
|
160
|
-
})]
|
|
161
|
-
})
|
|
162
|
-
})
|
|
163
|
-
}) })
|
|
164
|
-
})] });
|
|
165
|
-
};
|
|
166
|
-
A.displayName = "BsyDropDown";
|
|
167
|
-
//#endregion
|
|
168
|
-
export { A as t };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
-
import { t } from "../vendors/useLocale-BTz4slNW.js";
|
|
3
|
-
import { t as n } from "../DropDown/DropDown-CvQAbsEo.js";
|
|
4
|
-
import { l as r } from "./timelineViewConfig-BXl2UkN8.js";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import { useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
7
|
-
import u from "clsx";
|
|
8
|
-
//#region src/components/Gantt/utils/localeKey.ts
|
|
9
|
-
var d = (e) => e.startsWith("gantt.") ? e : `gantt.${e}`, f = ".bsy-form-view-data-manager", p = {
|
|
10
|
-
oneMinute: "mode.oneMinute",
|
|
11
|
-
tenMinute: "mode.tenMinute",
|
|
12
|
-
halfHour: "mode.halfHour",
|
|
13
|
-
hour: "mode.hour",
|
|
14
|
-
sixHour: "mode.sixHour",
|
|
15
|
-
halfDay: "mode.halfDay",
|
|
16
|
-
day: "mode.day",
|
|
17
|
-
week: "mode.week",
|
|
18
|
-
month: "mode.month",
|
|
19
|
-
quarter: "mode.quarter",
|
|
20
|
-
quarterMonth: "mode.quarterMonth",
|
|
21
|
-
year: "mode.year"
|
|
22
|
-
}, m = ({ viewMode: m = "day", availableModes: h, onViewModeChange: g, onTodayClick: _, onScrollPrev: v, onScrollNext: y, className: b = "" }) => {
|
|
23
|
-
let { t: x } = t(), S = o((e) => x(d(p[e])), [x]), C = `bsy-gantt-toolbar ${b}`.trim(), w = c(null), [T, E] = l(!1), D = o(() => {
|
|
24
|
-
let e = w.current;
|
|
25
|
-
if (!e) return document.body;
|
|
26
|
-
let t = e.closest(f);
|
|
27
|
-
return t instanceof HTMLElement ? t : document.body;
|
|
28
|
-
}, []), O = s(() => {
|
|
29
|
-
let e = new Set(h ?? r);
|
|
30
|
-
return r.filter((t) => e.has(t)).map((e) => ({
|
|
31
|
-
key: e,
|
|
32
|
-
label: S(e)
|
|
33
|
-
}));
|
|
34
|
-
}, [h, S]), k = s(() => O.find((e) => e.key === m)?.label ?? m, [O, m]), A = o((e) => {
|
|
35
|
-
e?.key && e.key !== m && g?.(e.key);
|
|
36
|
-
}, [g, m]);
|
|
37
|
-
return /* @__PURE__ */ a("div", {
|
|
38
|
-
className: C,
|
|
39
|
-
ref: w,
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ i(n, {
|
|
42
|
-
menus: O,
|
|
43
|
-
activeKey: [m],
|
|
44
|
-
showSearch: !1,
|
|
45
|
-
visible: T,
|
|
46
|
-
onOpenChange: E,
|
|
47
|
-
offset: {
|
|
48
|
-
x: 0,
|
|
49
|
-
y: 4
|
|
50
|
-
},
|
|
51
|
-
zIndex: 10001,
|
|
52
|
-
getPopupContainer: D,
|
|
53
|
-
onClick: A,
|
|
54
|
-
style: {
|
|
55
|
-
width: 100,
|
|
56
|
-
minWidth: 100
|
|
57
|
-
},
|
|
58
|
-
children: /* @__PURE__ */ a("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
className: u("bsy-gantt-toolbar__mode-trigger", { "bsy-gantt-toolbar__mode-trigger--active": T }),
|
|
61
|
-
"aria-haspopup": "listbox",
|
|
62
|
-
"aria-expanded": T,
|
|
63
|
-
children: [/* @__PURE__ */ i("span", {
|
|
64
|
-
className: "bsy-gantt-toolbar__mode-trigger-label",
|
|
65
|
-
children: k
|
|
66
|
-
}), /* @__PURE__ */ i(e, {
|
|
67
|
-
name: "arrow-down",
|
|
68
|
-
size: 16
|
|
69
|
-
})]
|
|
70
|
-
})
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ i("span", { className: "bsy-gantt-toolbar__divider" }),
|
|
73
|
-
/* @__PURE__ */ i("button", {
|
|
74
|
-
type: "button",
|
|
75
|
-
className: "bsy-gantt-toolbar__today-btn",
|
|
76
|
-
onClick: _,
|
|
77
|
-
children: x("gantt.today")
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ a("div", {
|
|
80
|
-
className: "bsy-gantt-toolbar__scroll-btns",
|
|
81
|
-
children: [/* @__PURE__ */ i("button", {
|
|
82
|
-
type: "button",
|
|
83
|
-
className: "bsy-gantt-toolbar__icon-btn bsy-gantt-toolbar__icon-btn--left",
|
|
84
|
-
"aria-label": x("gantt.aria.scrollPrev"),
|
|
85
|
-
onClick: v,
|
|
86
|
-
children: /* @__PURE__ */ i(e, {
|
|
87
|
-
name: "Pulldownleft",
|
|
88
|
-
size: 16
|
|
89
|
-
})
|
|
90
|
-
}), /* @__PURE__ */ i("button", {
|
|
91
|
-
type: "button",
|
|
92
|
-
className: "bsy-gantt-toolbar__icon-btn bsy-gantt-toolbar__icon-btn--right",
|
|
93
|
-
"aria-label": x("gantt.aria.scrollNext"),
|
|
94
|
-
onClick: y,
|
|
95
|
-
children: /* @__PURE__ */ i(e, {
|
|
96
|
-
name: "Pulldownright",
|
|
97
|
-
size: 16
|
|
98
|
-
})
|
|
99
|
-
})]
|
|
100
|
-
})
|
|
101
|
-
]
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
//#endregion
|
|
105
|
-
export { d as n, m as t };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback as r, useEffect as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
4
|
-
import c from "clsx";
|
|
5
|
-
import { useControllableValue as l } from "ahooks";
|
|
6
|
-
import { motion as u } from "motion/react";
|
|
7
|
-
import d from "simplebar-react";
|
|
8
|
-
//#region src/components/InputTag/input-tag.module.scss
|
|
9
|
-
var f = {
|
|
10
|
-
"bsy-inputTag": "_bsy-inputTag_46spj_11",
|
|
11
|
-
"bsy-inputTag__container": "_bsy-inputTag__container_46spj_22",
|
|
12
|
-
"bsy-inputTag__inputContainer": "_bsy-inputTag__inputContainer_46spj_27",
|
|
13
|
-
"bsy-inputTag__inputContainer--zeroMargin": "_bsy-inputTag__inputContainer--zeroMargin_46spj_37",
|
|
14
|
-
"bsy-inputTag__input": "_bsy-inputTag__input_46spj_27",
|
|
15
|
-
"scale-in": "_scale-in_46spj_1"
|
|
16
|
-
}, p = {
|
|
17
|
-
GAP: 4,
|
|
18
|
-
OFFSET: 3,
|
|
19
|
-
INPUT_MIN_WIDTH: 80,
|
|
20
|
-
CONTAINER_PADDING: 10,
|
|
21
|
-
INPUT_MARGIN: 4
|
|
22
|
-
}, m = (e, t) => {
|
|
23
|
-
let [n, r] = s(0);
|
|
24
|
-
return a(() => {
|
|
25
|
-
let t = e.current;
|
|
26
|
-
if (!t) return;
|
|
27
|
-
let n = () => {
|
|
28
|
-
let e = t.children, n = 0;
|
|
29
|
-
for (let t = 0; t < e.length; t++) n += e[t].clientWidth;
|
|
30
|
-
let i = Math.max(0, e.length - 1) * p.GAP, a = Math.max(0, n + i + p.OFFSET);
|
|
31
|
-
r((e) => e === a ? e : a);
|
|
32
|
-
};
|
|
33
|
-
n();
|
|
34
|
-
let i = new ResizeObserver(n);
|
|
35
|
-
return i.observe(t), () => {
|
|
36
|
-
i.disconnect();
|
|
37
|
-
};
|
|
38
|
-
}, [t, e]), n;
|
|
39
|
-
}, h = (h) => {
|
|
40
|
-
let { defaultValue: g, enableActive: _ = !1, defaultActiveIndex: v, onActiveIndexChange: y } = h, [b, x] = l(h, { defaultValue: g || [] }), [S, C] = l(h, {
|
|
41
|
-
valuePropName: "activeIndex",
|
|
42
|
-
trigger: "onActiveIndexChange",
|
|
43
|
-
defaultValue: v
|
|
44
|
-
}), [w, T] = s(""), E = o(null), D = o(null), O = o(null), k = o(!1), A = () => {
|
|
45
|
-
if (D.current && D.current.children.length > 0) {
|
|
46
|
-
let e = D.current.children.length - 1;
|
|
47
|
-
D.current.children[e].scrollIntoView({
|
|
48
|
-
behavior: "smooth",
|
|
49
|
-
block: "nearest",
|
|
50
|
-
inline: "end"
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
i(() => {
|
|
55
|
-
k.current && b.length > 0 && (A(), k.current = !1);
|
|
56
|
-
}, [b.length]);
|
|
57
|
-
let j = (e) => {
|
|
58
|
-
T(e.currentTarget.value);
|
|
59
|
-
}, M = () => {
|
|
60
|
-
let e = w.trim();
|
|
61
|
-
if (e !== "") {
|
|
62
|
-
let t = e;
|
|
63
|
-
k.current = !0, x([...b, t]), T("");
|
|
64
|
-
}
|
|
65
|
-
}, N = (e, t) => {
|
|
66
|
-
if (!_) return;
|
|
67
|
-
let n = S === e ? void 0 : e;
|
|
68
|
-
C(n), y?.(n ?? -1, t);
|
|
69
|
-
}, P = (e) => {
|
|
70
|
-
e.key === "Enter" || e.key === "NumpadEnter" ? M() : e.key === "Backspace" && w === "" && b.length > 0 && x(b.slice(0, -1));
|
|
71
|
-
}, F = (e) => {
|
|
72
|
-
x(b.filter((t, n) => n !== e));
|
|
73
|
-
}, [I, L] = s(0), R = m(D, b.length), z = r(() => {
|
|
74
|
-
if (!E.current || !O.current) return;
|
|
75
|
-
let e = E.current.clientWidth - O.current.clientWidth - p.INPUT_MARGIN - p.CONTAINER_PADDING, t = Math.max(0, e);
|
|
76
|
-
L((e) => e === t ? e : t);
|
|
77
|
-
}, []);
|
|
78
|
-
a(() => {
|
|
79
|
-
if (!E.current || !O.current) return;
|
|
80
|
-
z();
|
|
81
|
-
let e = new ResizeObserver(() => {
|
|
82
|
-
z();
|
|
83
|
-
});
|
|
84
|
-
return e.observe(E.current), e.observe(O.current), () => {
|
|
85
|
-
e.disconnect();
|
|
86
|
-
};
|
|
87
|
-
}, [z]);
|
|
88
|
-
let B = Math.min(R, I);
|
|
89
|
-
return /* @__PURE__ */ n("div", {
|
|
90
|
-
className: f["bsy-inputTag"],
|
|
91
|
-
ref: E,
|
|
92
|
-
children: [/* @__PURE__ */ t("div", {
|
|
93
|
-
className: f["bsy-inputTag__container"],
|
|
94
|
-
children: b.length ? /* @__PURE__ */ t(d, {
|
|
95
|
-
style: { width: B + "px" },
|
|
96
|
-
children: /* @__PURE__ */ t("div", {
|
|
97
|
-
className: "flex gap-1 py-[3px]",
|
|
98
|
-
ref: D,
|
|
99
|
-
children: b.map((r, i) => /* @__PURE__ */ n(u.div, {
|
|
100
|
-
className: c("rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0", {
|
|
101
|
-
"cursor-pointer": _,
|
|
102
|
-
"hover:bg-[#e0e0e0]": _ && S !== i,
|
|
103
|
-
"bg-[#0265ff] text-white": _ && S === i,
|
|
104
|
-
"bg-[#eee] text-black": !_ || S !== i
|
|
105
|
-
}),
|
|
106
|
-
onClick: () => N(i, r),
|
|
107
|
-
children: [/* @__PURE__ */ t("span", { children: r }), /* @__PURE__ */ t("div", {
|
|
108
|
-
className: c("cursor-pointer", _ && S === i ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"),
|
|
109
|
-
onClick: (e) => {
|
|
110
|
-
e.stopPropagation(), F(i);
|
|
111
|
-
},
|
|
112
|
-
children: /* @__PURE__ */ t(e, {
|
|
113
|
-
name: "close",
|
|
114
|
-
size: 12
|
|
115
|
-
})
|
|
116
|
-
})]
|
|
117
|
-
}, i))
|
|
118
|
-
})
|
|
119
|
-
}) : null
|
|
120
|
-
}), /* @__PURE__ */ t("div", {
|
|
121
|
-
ref: O,
|
|
122
|
-
className: c(f["bsy-inputTag__inputContainer"], { [f["bsy-inputTag__inputContainer--zeroMargin"]]: b.length === 0 }, "py-[3px]"),
|
|
123
|
-
children: /* @__PURE__ */ t("input", {
|
|
124
|
-
value: w,
|
|
125
|
-
onChange: j,
|
|
126
|
-
onKeyDown: P,
|
|
127
|
-
onBlur: M,
|
|
128
|
-
className: c(f["bsy-inputTag__input"], "placeholder:text-[#999]"),
|
|
129
|
-
placeholder: "输入标签"
|
|
130
|
-
})
|
|
131
|
-
})]
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
h.displayName = "BsyInputTag";
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/components/InputTag/index.ts
|
|
137
|
-
var g = h;
|
|
138
|
-
//#endregion
|
|
139
|
-
export { g as t };
|