@sia.soul/sia-react-ui 0.1.0 → 0.1.3
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/THIRD_PARTY_NOTICES.md +0 -1
- package/dist/{chunk-YCVXUMGP.js → chunk-2RRTDU3N.js} +2 -2
- package/dist/{chunk-DZ45HRVP.js → chunk-IMZT6VCU.js} +1 -1
- package/dist/{chunk-JKZGAZMB.js → chunk-OAC7BSUR.js} +1 -1
- package/dist/{chunk-OMA75YLM.js → chunk-OQLDEVCF.js} +2 -2
- package/dist/{chunk-ULEGTKXR.js → chunk-Q4XNFMUH.js} +18 -4
- package/dist/{chunk-34TTF4Y7.js → chunk-R4OWKIXJ.js} +70 -20
- package/dist/{core-BeiAQiDY.d.ts → core-DFYheaoJ.d.ts} +2 -0
- package/dist/{core-DRICIs2n.d.cts → core-De2pRX5w.d.cts} +2 -0
- package/dist/core.cjs +16 -2
- package/dist/core.css +158 -12
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +4 -4
- package/dist/index.cjs +736 -115
- package/dist/index.css +158 -12
- package/dist/index.d.cts +110 -10
- package/dist/index.d.ts +110 -10
- package/dist/index.js +653 -99
- package/dist/rich-text-editor.cjs +2 -2
- package/dist/rich-text-editor.js +3 -3
- package/dist/{select-date-range-BDWdo7qt.d.ts → select-date-range-DOyG1DGp.d.ts} +10 -3
- package/dist/{select-date-range-DWik3ADr.d.cts → select-date-range-UyYrHex6.d.cts} +10 -3
- package/dist/select-date-range.cjs +70 -20
- package/dist/select-date-range.d.cts +1 -1
- package/dist/select-date-range.d.ts +1 -1
- package/dist/select-date-range.js +3 -3
- package/package.json +129 -129
package/dist/index.cjs
CHANGED
|
@@ -86,6 +86,7 @@ __export(index_exports, {
|
|
|
86
86
|
ImagePreview: () => ImagePreview,
|
|
87
87
|
Input: () => Input,
|
|
88
88
|
InputNumber: () => InputNumber,
|
|
89
|
+
InputSelect: () => InputSelect,
|
|
89
90
|
KLineChart: () => KLineChart,
|
|
90
91
|
LineChart: () => LineChart,
|
|
91
92
|
LineShareChart: () => LineShareChart,
|
|
@@ -111,6 +112,7 @@ __export(index_exports, {
|
|
|
111
112
|
Segmented: () => Segmented,
|
|
112
113
|
Select: () => Select,
|
|
113
114
|
SelectDateRange: () => SelectDateRange,
|
|
115
|
+
SelectionPanel: () => SelectionPanel,
|
|
114
116
|
SiaChart: () => SiaChart,
|
|
115
117
|
Slider: () => Slider,
|
|
116
118
|
Space: () => Space,
|
|
@@ -145,6 +147,7 @@ __export(index_exports, {
|
|
|
145
147
|
WordCloudChart: () => WordCloudChart,
|
|
146
148
|
XYChart: () => XYChart,
|
|
147
149
|
applySiaTheme: () => applySiaTheme,
|
|
150
|
+
buildFlatTree: () => buildFlatTree,
|
|
148
151
|
chartColor: () => chartColor,
|
|
149
152
|
chartTicks: () => chartTicks,
|
|
150
153
|
createBaiduMapHost: () => createBaiduMapHost,
|
|
@@ -791,8 +794,8 @@ var coreIconPaths = {
|
|
|
791
794
|
download: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 3v12M7 10l5 5 5-5M4 20h16" }) }),
|
|
792
795
|
upload: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 16V4M7 9l5-5 5 5M4 20h16" }) }),
|
|
793
796
|
refresh: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
794
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20
|
|
795
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20 4v4.686h-4.686" }),
|
|
798
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20 8.686 17.657 6.343A8 8 0 1 0 20 12" })
|
|
796
799
|
] }),
|
|
797
800
|
loader: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
|
|
798
801
|
calendar: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
@@ -3128,10 +3131,10 @@ function Tree({
|
|
|
3128
3131
|
},
|
|
3129
3132
|
children: (() => {
|
|
3130
3133
|
const content = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "sia-tree__context-content", children: [
|
|
3131
|
-
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "sia-tree__switcher", style: { width: normalizedSwitcherWidth, flexBasis: normalizedSwitcherWidth }, disabled: node.disabled, onClick: (event) => {
|
|
3134
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "sia-tree__switcher", "aria-label": open ? "\u6536\u8D77\u8282\u70B9" : "\u5C55\u5F00\u8282\u70B9", "aria-expanded": open, style: { width: normalizedSwitcherWidth, flexBasis: normalizedSwitcherWidth }, disabled: node.disabled, onClick: (event) => {
|
|
3132
3135
|
event.stopPropagation();
|
|
3133
3136
|
void toggleExpand(node);
|
|
3134
|
-
}, children: nodeLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: "loader", className: "sia-spin-icon", size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: open ? "chevron-down" : "chevron-right", size: 13 }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-tree__switcher", style: { width: normalizedSwitcherWidth, flexBasis: normalizedSwitcherWidth }, "aria-hidden": "true" }),
|
|
3137
|
+
}, children: nodeLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: "loader", className: "sia-spin-icon", size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: open ? "chevron-down" : "chevron-right", size: 13 }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-tree__switcher", "aria-label": open ? "\u6536\u8D77\u8282\u70B9" : "\u5C55\u5F00\u8282\u70B9", "aria-expanded": open, style: { width: normalizedSwitcherWidth, flexBasis: normalizedSwitcherWidth }, "aria-hidden": "true" }),
|
|
3135
3138
|
checkable || node.checkable ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Checkbox2, { checked: isChecked, disabled: node.disabled || node.disableCheckbox, onChange: () => check(node) }) }) : null,
|
|
3136
3139
|
node.prefix ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-tree__prefix", onClick: (event) => event.stopPropagation(), children: node.prefix }) : null,
|
|
3137
3140
|
showIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-tree__icon", children: node.icon ?? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: hasChildren ? "folder" : "file", size: 15 }) }) : null,
|
|
@@ -4383,6 +4386,21 @@ function setValue(source, path, value) {
|
|
|
4383
4386
|
function isEmpty(value) {
|
|
4384
4387
|
return value === void 0 || value === null || value === "" || Array.isArray(value) && value.length === 0;
|
|
4385
4388
|
}
|
|
4389
|
+
function cloneFormValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
4390
|
+
if (!value || typeof value !== "object") return value;
|
|
4391
|
+
if (seen.has(value)) return seen.get(value);
|
|
4392
|
+
if (value instanceof Date) return new Date(value.getTime());
|
|
4393
|
+
if (value instanceof RegExp) return new RegExp(value.source, value.flags);
|
|
4394
|
+
const cloneable = value;
|
|
4395
|
+
if (typeof cloneable.clone === "function") return cloneable.clone();
|
|
4396
|
+
if (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return value;
|
|
4397
|
+
const next = Array.isArray(value) ? [] : {};
|
|
4398
|
+
seen.set(value, next);
|
|
4399
|
+
Object.keys(value).forEach((key) => {
|
|
4400
|
+
next[key] = cloneFormValue(value[key], seen);
|
|
4401
|
+
});
|
|
4402
|
+
return next;
|
|
4403
|
+
}
|
|
4386
4404
|
var FormStore = class {
|
|
4387
4405
|
values = {};
|
|
4388
4406
|
initialValues = {};
|
|
@@ -4391,11 +4409,13 @@ var FormStore = class {
|
|
|
4391
4409
|
listeners = /* @__PURE__ */ new Set();
|
|
4392
4410
|
callbacks = {};
|
|
4393
4411
|
version = 0;
|
|
4412
|
+
initialized = false;
|
|
4394
4413
|
configure(initialValues, callbacks) {
|
|
4395
4414
|
this.callbacks = callbacks;
|
|
4396
|
-
if (
|
|
4397
|
-
this.
|
|
4398
|
-
this.
|
|
4415
|
+
if (!this.initialized) {
|
|
4416
|
+
this.initialized = true;
|
|
4417
|
+
this.initialValues = cloneFormValue(initialValues ?? {});
|
|
4418
|
+
this.values = cloneFormValue(initialValues ?? {});
|
|
4399
4419
|
}
|
|
4400
4420
|
}
|
|
4401
4421
|
subscribe = (listener) => {
|
|
@@ -4417,7 +4437,7 @@ var FormStore = class {
|
|
|
4417
4437
|
};
|
|
4418
4438
|
}
|
|
4419
4439
|
getFieldValue = (name) => getValue(this.values, pathArray(name));
|
|
4420
|
-
getFieldsValue = () =>
|
|
4440
|
+
getFieldsValue = () => cloneFormValue(this.values);
|
|
4421
4441
|
getFieldError = (name) => this.errors.get(pathKey2(name)) ?? [];
|
|
4422
4442
|
setFieldValue = (name, value) => {
|
|
4423
4443
|
const path = pathArray(name);
|
|
@@ -4435,7 +4455,7 @@ var FormStore = class {
|
|
|
4435
4455
|
};
|
|
4436
4456
|
resetFields = (names) => {
|
|
4437
4457
|
if (!names) {
|
|
4438
|
-
this.values =
|
|
4458
|
+
this.values = cloneFormValue(this.initialValues);
|
|
4439
4459
|
this.errors.clear();
|
|
4440
4460
|
} else {
|
|
4441
4461
|
names.forEach((name) => {
|
|
@@ -4624,7 +4644,7 @@ function FormItem({
|
|
|
4624
4644
|
content = children;
|
|
4625
4645
|
}
|
|
4626
4646
|
}
|
|
4627
|
-
if (noStyle) return content;
|
|
4647
|
+
if (noStyle) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: content });
|
|
4628
4648
|
const inputWrap = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "sia-form-item__input-wrap", children: content });
|
|
4629
4649
|
const hasError = status === "error" && Boolean(helpContent);
|
|
4630
4650
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: itemRef, className: `sia-form-item${status ? ` sia-form-item--${status}` : ""} ${className}`.trim(), "data-sia-form-field": key || void 0, children: [
|
|
@@ -5237,14 +5257,15 @@ function withTime(date, time, showSecond = false) {
|
|
|
5237
5257
|
const [hour = "00", minute = "00", second = "00"] = time.split(":");
|
|
5238
5258
|
return `${date} ${hour}:${minute}${showSecond ? `:${second}` : ""}`;
|
|
5239
5259
|
}
|
|
5240
|
-
function normalizeDateValue(value, showTime) {
|
|
5260
|
+
function normalizeDateValue(value, showTime, index = 0) {
|
|
5241
5261
|
if (!value) return "";
|
|
5242
5262
|
const date = parseDate2(value);
|
|
5243
5263
|
if (!date) return value;
|
|
5244
5264
|
const day = dateKey(date);
|
|
5245
5265
|
if (!showTime) return day;
|
|
5246
5266
|
const config = typeof showTime === "object" ? showTime : {};
|
|
5247
|
-
|
|
5267
|
+
const fallback = typeof config.defaultValue === "string" ? config.defaultValue : config.defaultValue?.[index] ?? "00:00:00";
|
|
5268
|
+
return withTime(day, timePart(value, fallback), Boolean(config.showSecond));
|
|
5248
5269
|
}
|
|
5249
5270
|
var WEEKDAYS = ["\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u65E5"];
|
|
5250
5271
|
function CalendarMonth({
|
|
@@ -5444,8 +5465,9 @@ function placeholderFor(picker, showTime, multiple) {
|
|
|
5444
5465
|
function showSecondFrom(showTime) {
|
|
5445
5466
|
return Boolean(typeof showTime === "object" && showTime.showSecond);
|
|
5446
5467
|
}
|
|
5447
|
-
function defaultTimeFrom(showTime) {
|
|
5448
|
-
|
|
5468
|
+
function defaultTimeFrom(showTime, index = 0) {
|
|
5469
|
+
const value = typeof showTime === "object" ? showTime.defaultValue : void 0;
|
|
5470
|
+
return typeof value === "string" ? value : value?.[index] ?? "00:00:00";
|
|
5449
5471
|
}
|
|
5450
5472
|
function resolvePreset(value) {
|
|
5451
5473
|
return typeof value === "function" ? value() : value;
|
|
@@ -5476,6 +5498,8 @@ function DatePicker({
|
|
|
5476
5498
|
onChange,
|
|
5477
5499
|
onOpenChange,
|
|
5478
5500
|
placeholder,
|
|
5501
|
+
formatValue: formatValue2 = (value2) => value2,
|
|
5502
|
+
renderExtraFooter,
|
|
5479
5503
|
...props
|
|
5480
5504
|
}) {
|
|
5481
5505
|
const id = (0, import_react26.useId)();
|
|
@@ -5541,6 +5565,8 @@ function DatePicker({
|
|
|
5541
5565
|
}
|
|
5542
5566
|
}
|
|
5543
5567
|
function commitDraft() {
|
|
5568
|
+
const values = Array.isArray(draftValue) ? draftValue : [draftValue];
|
|
5569
|
+
if (values.some((value2) => !value2 || isDisabled(dayFromValue(value2)))) return;
|
|
5544
5570
|
setCurrentValue(draftValue);
|
|
5545
5571
|
changeOpen(false);
|
|
5546
5572
|
}
|
|
@@ -5550,7 +5576,7 @@ function DatePicker({
|
|
|
5550
5576
|
setDraftValue(empty);
|
|
5551
5577
|
setCurrentValue(empty);
|
|
5552
5578
|
}
|
|
5553
|
-
const display = Array.isArray(currentValue) ? currentValue.join("\u3001") : currentValue;
|
|
5579
|
+
const display = Array.isArray(currentValue) ? currentValue.map(formatValue2).join("\u3001") : currentValue ? formatValue2(currentValue) : "";
|
|
5554
5580
|
const triggerLabel = props["aria-label"] ?? (typeof placeholder === "string" ? placeholder : "\u65E5\u671F\u9009\u62E9\u5668");
|
|
5555
5581
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { ref: rootRef, className: `sia-picker sia-picker--${size} sia-picker--${status}${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
|
|
5556
5582
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
@@ -5576,15 +5602,16 @@ function DatePicker({
|
|
|
5576
5602
|
},
|
|
5577
5603
|
children: [
|
|
5578
5604
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `sia-picker__value${display ? "" : " is-placeholder"}`, children: display || placeholder || placeholderFor(picker, showTime, multiple) }),
|
|
5579
|
-
allowClear && display && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { role: "button", className: "sia-picker__clear", "aria-label": "\u6E05\u9664\u65E5\u671F", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
5580
5605
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-picker__icon", "aria-hidden": "true", children: suffixIcon ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "calendar", size: 16 }) })
|
|
5581
5606
|
]
|
|
5582
5607
|
}
|
|
5583
5608
|
),
|
|
5609
|
+
allowClear && display && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: "sia-picker__clear", "aria-label": "\u6E05\u9664\u65E5\u671F", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
5584
5610
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: visible, className: `sia-date-panel${showTime ? " sia-date-panel--with-time" : ""}${presets?.length ? " sia-date-panel--with-presets" : ""}`, role: "dialog", "aria-label": "\u65E5\u671F\u9009\u62E9\u9762\u677F", children: [
|
|
5585
5611
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "sia-date-panel__body", children: [
|
|
5586
5612
|
presets?.length ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("aside", { className: "sia-date-panel__presets", children: presets.map((preset2, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", onClick: () => {
|
|
5587
5613
|
const next = resolvePreset(preset2.value);
|
|
5614
|
+
if (!next || isDisabled(dayFromValue(next))) return;
|
|
5588
5615
|
setDraftValue(next);
|
|
5589
5616
|
if (!resolvedNeedConfirm) {
|
|
5590
5617
|
setCurrentValue(next);
|
|
@@ -5612,6 +5639,7 @@ function DatePicker({
|
|
|
5612
5639
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5613
5640
|
DatePanelFooter,
|
|
5614
5641
|
{
|
|
5642
|
+
extra: renderExtraFooter?.(),
|
|
5615
5643
|
showToday,
|
|
5616
5644
|
needConfirm: resolvedNeedConfirm,
|
|
5617
5645
|
disabledConfirm: Array.isArray(draftValue) ? draftValue.length === 0 : !draftValue,
|
|
@@ -5629,6 +5657,8 @@ function DateRangePicker({
|
|
|
5629
5657
|
separator = "\u2192",
|
|
5630
5658
|
presets,
|
|
5631
5659
|
maxRangeDays,
|
|
5660
|
+
allowEmpty = [false, false],
|
|
5661
|
+
endpointDisabled = [false, false],
|
|
5632
5662
|
size = "medium",
|
|
5633
5663
|
status = "default",
|
|
5634
5664
|
allowClear = true,
|
|
@@ -5646,6 +5676,8 @@ function DateRangePicker({
|
|
|
5646
5676
|
onCalendarChange,
|
|
5647
5677
|
onChange,
|
|
5648
5678
|
onOpenChange,
|
|
5679
|
+
formatValue: formatValue2 = (value2) => value2,
|
|
5680
|
+
renderExtraFooter,
|
|
5649
5681
|
...props
|
|
5650
5682
|
}) {
|
|
5651
5683
|
const id = (0, import_react26.useId)();
|
|
@@ -5661,9 +5693,10 @@ function DateRangePicker({
|
|
|
5661
5693
|
const [compactDateTime, setCompactDateTime] = (0, import_react26.useState)(false);
|
|
5662
5694
|
const showSecond = showSecondFrom(showTime);
|
|
5663
5695
|
const defaultTime = defaultTimeFrom(showTime);
|
|
5696
|
+
const defaultEndTime = defaultTimeFrom(showTime, 1);
|
|
5664
5697
|
const [times, setTimes] = (0, import_react26.useState)([
|
|
5665
5698
|
timePart(currentValue[0], defaultTime),
|
|
5666
|
-
timePart(currentValue[1],
|
|
5699
|
+
timePart(currentValue[1], defaultEndTime)
|
|
5667
5700
|
]);
|
|
5668
5701
|
const resolvedNeedConfirm = needConfirm ?? Boolean(showTime);
|
|
5669
5702
|
const rangeDates = [dayFromValue(draftValue[0]), dayFromValue(draftValue[1])];
|
|
@@ -5693,8 +5726,8 @@ function DateRangePicker({
|
|
|
5693
5726
|
function changeOpen(next) {
|
|
5694
5727
|
if (next) {
|
|
5695
5728
|
setDraftValue(currentValue);
|
|
5696
|
-
setTimes([timePart(currentValue[0], defaultTime), timePart(currentValue[1],
|
|
5697
|
-
setActiveIndex(currentValue[0] && !currentValue[1] ? 1 : 0);
|
|
5729
|
+
setTimes([timePart(currentValue[0], defaultTime), timePart(currentValue[1], defaultEndTime)]);
|
|
5730
|
+
setActiveIndex(endpointDisabled[0] ? 1 : endpointDisabled[1] ? 0 : currentValue[0] && !currentValue[1] ? 1 : 0);
|
|
5698
5731
|
const nextStartMonth = startOfMonth(parseDate2(dayFromValue(currentValue[0] || currentValue[1])) ?? /* @__PURE__ */ new Date());
|
|
5699
5732
|
setViewMonth(nextStartMonth);
|
|
5700
5733
|
setEndViewMonth(startOfMonth(parseDate2(dayFromValue(currentValue[1])) ?? addMonths(nextStartMonth, 1)));
|
|
@@ -5702,6 +5735,7 @@ function DateRangePicker({
|
|
|
5702
5735
|
setVisible(next);
|
|
5703
5736
|
}
|
|
5704
5737
|
function isDisabled(day, index = activeIndex, pairedDateTime = false) {
|
|
5738
|
+
if (endpointDisabled[index]) return true;
|
|
5705
5739
|
const minimum = minDate ?? props.min;
|
|
5706
5740
|
const maximum = maxDate ?? props.max;
|
|
5707
5741
|
if (minimum && day < String(minimum).slice(0, 10)) return true;
|
|
@@ -5724,6 +5758,17 @@ function DateRangePicker({
|
|
|
5724
5758
|
}
|
|
5725
5759
|
function selectDate(day) {
|
|
5726
5760
|
if (isDisabled(day)) return;
|
|
5761
|
+
if (endpointDisabled.some(Boolean)) {
|
|
5762
|
+
const index = endpointDisabled[0] ? 1 : 0;
|
|
5763
|
+
const next = [...draftValue];
|
|
5764
|
+
next[index] = buildRangeValue(day, index);
|
|
5765
|
+
updateDraft(next);
|
|
5766
|
+
if (!resolvedNeedConfirm && isValidRange(next)) {
|
|
5767
|
+
setCurrentValue(next);
|
|
5768
|
+
changeOpen(false);
|
|
5769
|
+
}
|
|
5770
|
+
return;
|
|
5771
|
+
}
|
|
5727
5772
|
if (activeIndex === 0 || !rangeDates[0] || rangeDates[1]) {
|
|
5728
5773
|
const next = [buildRangeValue(day, 0), ""];
|
|
5729
5774
|
updateDraft(next);
|
|
@@ -5759,6 +5804,7 @@ function DateRangePicker({
|
|
|
5759
5804
|
}
|
|
5760
5805
|
}
|
|
5761
5806
|
function changeTime(index, nextTime) {
|
|
5807
|
+
if (endpointDisabled[index]) return;
|
|
5762
5808
|
const nextTimes = [...times];
|
|
5763
5809
|
nextTimes[index] = nextTime;
|
|
5764
5810
|
setTimes(nextTimes);
|
|
@@ -5769,6 +5815,28 @@ function DateRangePicker({
|
|
|
5769
5815
|
updateDraft(nextValue);
|
|
5770
5816
|
}
|
|
5771
5817
|
}
|
|
5818
|
+
function isValidRange(next) {
|
|
5819
|
+
if (!next.some(Boolean)) return false;
|
|
5820
|
+
for (const index of [0, 1]) {
|
|
5821
|
+
if (!next[index]) {
|
|
5822
|
+
if (!allowEmpty[index]) return false;
|
|
5823
|
+
else continue;
|
|
5824
|
+
}
|
|
5825
|
+
if (endpointDisabled[index]) {
|
|
5826
|
+
if (next[index] !== currentValue[index]) return false;
|
|
5827
|
+
else continue;
|
|
5828
|
+
}
|
|
5829
|
+
const day = dayFromValue(next[index]);
|
|
5830
|
+
if (!day) return false;
|
|
5831
|
+
if (minDate && day < minDate.slice(0, 10) || maxDate && day > maxDate.slice(0, 10)) return false;
|
|
5832
|
+
if (disabledDate?.(day, { from: index === 1 ? dayFromValue(next[0]) || void 0 : void 0, type: "date" })) return false;
|
|
5833
|
+
}
|
|
5834
|
+
if (next[0] && next[1]) {
|
|
5835
|
+
if (next[0] > next[1]) return false;
|
|
5836
|
+
if (maxRangeDays && Math.abs(daysBetween(dayFromValue(next[0]), dayFromValue(next[1]))) >= maxRangeDays) return false;
|
|
5837
|
+
}
|
|
5838
|
+
return true;
|
|
5839
|
+
}
|
|
5772
5840
|
function confirm() {
|
|
5773
5841
|
if (compactDateTime && showTime && activeIndex === 0) {
|
|
5774
5842
|
if (!draftValue[0]) return;
|
|
@@ -5777,7 +5845,7 @@ function DateRangePicker({
|
|
|
5777
5845
|
setHoverDate("");
|
|
5778
5846
|
return;
|
|
5779
5847
|
}
|
|
5780
|
-
if (!draftValue
|
|
5848
|
+
if (!isValidRange(draftValue)) return;
|
|
5781
5849
|
setCurrentValue(draftValue);
|
|
5782
5850
|
changeOpen(false);
|
|
5783
5851
|
}
|
|
@@ -5785,10 +5853,11 @@ function DateRangePicker({
|
|
|
5785
5853
|
const raw = resolveRangePreset(preset2.value);
|
|
5786
5854
|
const next = [
|
|
5787
5855
|
normalizeDateValue(raw[0], showTime),
|
|
5788
|
-
normalizeDateValue(raw[1], showTime)
|
|
5856
|
+
normalizeDateValue(raw[1], showTime, 1)
|
|
5789
5857
|
];
|
|
5858
|
+
if (!isValidRange(next)) return;
|
|
5790
5859
|
updateDraft(next);
|
|
5791
|
-
setTimes([timePart(next[0], defaultTime), timePart(next[1],
|
|
5860
|
+
setTimes([timePart(next[0], defaultTime), timePart(next[1], defaultEndTime)]);
|
|
5792
5861
|
const nextStartMonth = startOfMonth(parseDate2(dayFromValue(next[0] || next[1])) ?? /* @__PURE__ */ new Date());
|
|
5793
5862
|
setViewMonth(nextStartMonth);
|
|
5794
5863
|
setEndViewMonth(startOfMonth(parseDate2(dayFromValue(next[1])) ?? addMonths(nextStartMonth, 1)));
|
|
@@ -5799,7 +5868,7 @@ function DateRangePicker({
|
|
|
5799
5868
|
}
|
|
5800
5869
|
function clearValue(event) {
|
|
5801
5870
|
event.stopPropagation();
|
|
5802
|
-
const empty = ["", ""];
|
|
5871
|
+
const empty = [endpointDisabled[0] ? currentValue[0] : "", endpointDisabled[1] ? currentValue[1] : ""];
|
|
5803
5872
|
updateDraft(empty);
|
|
5804
5873
|
setCurrentValue(empty);
|
|
5805
5874
|
setActiveIndex(0);
|
|
@@ -5868,14 +5937,14 @@ function DateRangePicker({
|
|
|
5868
5937
|
disabled,
|
|
5869
5938
|
onClick: () => changeOpen(!visible),
|
|
5870
5939
|
children: [
|
|
5871
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `sia-picker-range-control__value${currentValue[0] ? "" : " is-placeholder"}`, children: currentValue[0]
|
|
5940
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `sia-picker-range-control__value${currentValue[0] ? "" : " is-placeholder"}`, children: currentValue[0] ? formatValue2(currentValue[0]) : placeholder[0] }),
|
|
5872
5941
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-picker-range-control__separator", children: separator }),
|
|
5873
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `sia-picker-range-control__value${currentValue[1] ? "" : " is-placeholder"}`, children: currentValue[1]
|
|
5874
|
-
allowClear && (currentValue[0] || currentValue[1]) && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { role: "button", className: "sia-picker__clear", "aria-label": "\u6E05\u9664\u65E5\u671F\u8303\u56F4", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
5942
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `sia-picker-range-control__value${currentValue[1] ? "" : " is-placeholder"}`, children: currentValue[1] ? formatValue2(currentValue[1]) : placeholder[1] }),
|
|
5875
5943
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-picker__icon", "aria-hidden": "true", children: suffixIcon ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "calendar", size: 16 }) })
|
|
5876
5944
|
]
|
|
5877
5945
|
}
|
|
5878
5946
|
),
|
|
5947
|
+
allowClear && (currentValue[0] || currentValue[1]) && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: "sia-picker__clear", "aria-label": "\u6E05\u9664\u65E5\u671F\u8303\u56F4", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
5879
5948
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: visible, className: `sia-date-panel sia-date-panel--range${showTime ? ` sia-date-panel--with-time sia-date-panel--range-time-${compactDateTime ? "compact" : "paired"}` : ""}${presets?.length ? " sia-date-panel--with-presets" : ""}`, role: "dialog", "aria-label": "\u65E5\u671F\u8303\u56F4\u9009\u62E9\u9762\u677F", children: [
|
|
5880
5949
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "sia-date-panel__body", children: showTime ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "sia-date-panel__range-date-time", children: compactDateTime ? renderDateTimeGroup(activeIndex) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5881
5950
|
renderDateTimeGroup(0),
|
|
@@ -5910,10 +5979,11 @@ function DateRangePicker({
|
|
|
5910
5979
|
DatePanelFooter,
|
|
5911
5980
|
{
|
|
5912
5981
|
showToday: showToday && !presets?.length,
|
|
5913
|
-
needConfirm: resolvedNeedConfirm,
|
|
5914
|
-
disabledConfirm: compactDateTime && showTime && activeIndex === 0 ? !draftValue[0] : !draftValue
|
|
5982
|
+
needConfirm: resolvedNeedConfirm || allowEmpty.some(Boolean),
|
|
5983
|
+
disabledConfirm: compactDateTime && showTime && activeIndex === 0 ? !draftValue[0] : !isValidRange(draftValue),
|
|
5915
5984
|
confirmText: compactDateTime && showTime && activeIndex === 0 ? "\u4E0B\u4E00\u6B65" : "\u786E\u5B9A",
|
|
5916
5985
|
extra: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5986
|
+
renderExtraFooter?.(),
|
|
5917
5987
|
presets?.map((preset2, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", onClick: () => applyPreset(preset2), children: preset2.label }, index)),
|
|
5918
5988
|
compactDateTime && showTime && activeIndex === 1 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", onClick: () => {
|
|
5919
5989
|
setActiveIndex(0);
|
|
@@ -6165,14 +6235,14 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
|
|
|
6165
6235
|
// src/components/TreeSelect.tsx
|
|
6166
6236
|
var import_react28 = require("react");
|
|
6167
6237
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
6168
|
-
function flattenTree(nodes, expanded, search, depth = 0, parents = []) {
|
|
6238
|
+
function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
|
|
6169
6239
|
const result = [];
|
|
6170
6240
|
for (const node of nodes) {
|
|
6171
|
-
const matches = !search || String(node.title).toLowerCase().includes(search.toLowerCase());
|
|
6172
|
-
const childMatches = search && node.children ? flattenTree(node.children,
|
|
6241
|
+
const matches = !search || ancestorMatched || filter === false || (filter ? filter(search, node) : String(node.title).toLowerCase().includes(search.toLowerCase()));
|
|
6242
|
+
const childMatches = search && node.children ? flattenTree(node.children, expanded, search, filter, depth + 1, [...parents, node.value], matches) : [];
|
|
6173
6243
|
if (matches || childMatches.length) result.push({ ...node, depth, parentValues: parents });
|
|
6174
|
-
if (node.children && (expanded.has(node.value) || search)) {
|
|
6175
|
-
result.push(...search ? childMatches : flattenTree(node.children, expanded, search, depth + 1, [...parents, node.value]));
|
|
6244
|
+
if (node.children && (expanded.has(node.key ?? node.value) || search)) {
|
|
6245
|
+
result.push(...search ? childMatches : flattenTree(node.children, expanded, search, filter, depth + 1, [...parents, node.value]));
|
|
6176
6246
|
}
|
|
6177
6247
|
}
|
|
6178
6248
|
return result;
|
|
@@ -6203,25 +6273,54 @@ function TreeSelect({
|
|
|
6203
6273
|
onChange,
|
|
6204
6274
|
onSearch,
|
|
6205
6275
|
onDropdownVisibleChange,
|
|
6276
|
+
open: controlledOpen,
|
|
6277
|
+
defaultOpen = false,
|
|
6278
|
+
searchValue,
|
|
6279
|
+
treeExpandedKeys,
|
|
6280
|
+
treeDefaultExpandedKeys = [],
|
|
6281
|
+
onTreeExpand,
|
|
6282
|
+
filterTreeNode,
|
|
6283
|
+
treeCheckStrictly = true,
|
|
6284
|
+
showCheckedStrategy = "all",
|
|
6285
|
+
loading = false,
|
|
6286
|
+
listHeight = 300,
|
|
6287
|
+
popupClassName = "",
|
|
6288
|
+
popupStyle,
|
|
6289
|
+
dropdownFooter,
|
|
6290
|
+
displayRender,
|
|
6291
|
+
renderTrigger,
|
|
6292
|
+
onClear,
|
|
6293
|
+
onSelect,
|
|
6294
|
+
onDeselect,
|
|
6206
6295
|
...props
|
|
6207
6296
|
}) {
|
|
6208
6297
|
const rootRef = (0, import_react28.useRef)(null);
|
|
6209
6298
|
const popupRef = (0, import_react28.useRef)(null);
|
|
6299
|
+
const nodeIndex = (0, import_react28.useMemo)(() => {
|
|
6300
|
+
const index = /* @__PURE__ */ new Map();
|
|
6301
|
+
const visit = (nodes) => nodes.forEach((node) => {
|
|
6302
|
+
index.set(node.value, node);
|
|
6303
|
+
if (node.children) visit(node.children);
|
|
6304
|
+
});
|
|
6305
|
+
visit(treeData);
|
|
6306
|
+
return index;
|
|
6307
|
+
}, [treeData]);
|
|
6308
|
+
const resolveNodes = (values) => values.map((value2) => nodeIndex.get(value2) ?? { value: value2, title: String(value2) });
|
|
6210
6309
|
const multi = multiple || treeCheckable;
|
|
6211
6310
|
const initial3 = defaultValue ?? (multi ? [] : void 0);
|
|
6212
6311
|
const [currentValue, setCurrentValue] = useControllableState({
|
|
6213
|
-
value,
|
|
6312
|
+
value: value === null ? [] : value,
|
|
6214
6313
|
defaultValue: initial3,
|
|
6215
|
-
onChange: (next) => onChange?.(next,
|
|
6314
|
+
onChange: (next) => onChange?.(next, resolveNodes(Array.isArray(next) ? [...next] : next === void 0 ? [] : [next]))
|
|
6216
6315
|
});
|
|
6217
|
-
const [open, setOpen] = (
|
|
6218
|
-
const [search, setSearch] = (
|
|
6316
|
+
const [open, setOpen] = useControllableState({ value: controlledOpen, defaultValue: defaultOpen, onChange: onDropdownVisibleChange });
|
|
6317
|
+
const [search, setSearch] = useControllableState({ value: searchValue, defaultValue: "", onChange: onSearch });
|
|
6219
6318
|
const [expanded, setExpanded] = (0, import_react28.useState)(() => {
|
|
6220
|
-
if (!treeDefaultExpandAll) return
|
|
6319
|
+
if (!treeDefaultExpandAll) return new Set(treeDefaultExpandedKeys);
|
|
6221
6320
|
const values = [];
|
|
6222
6321
|
const collect = (nodes) => nodes.forEach((node) => {
|
|
6223
6322
|
if (node.children?.length) {
|
|
6224
|
-
values.push(node.value);
|
|
6323
|
+
values.push(node.key ?? node.value);
|
|
6225
6324
|
collect(node.children);
|
|
6226
6325
|
}
|
|
6227
6326
|
});
|
|
@@ -6229,99 +6328,229 @@ function TreeSelect({
|
|
|
6229
6328
|
return new Set(values);
|
|
6230
6329
|
});
|
|
6231
6330
|
const selectedValues = Array.isArray(currentValue) ? [...currentValue] : currentValue === void 0 ? [] : [currentValue];
|
|
6232
|
-
const
|
|
6233
|
-
const
|
|
6331
|
+
const expandedSet = treeExpandedKeys ? new Set(treeExpandedKeys) : expanded;
|
|
6332
|
+
const selectedNodes = resolveNodes(selectedValues);
|
|
6333
|
+
const visibleNodes = flattenTree(treeData, expandedSet, search, filterTreeNode);
|
|
6334
|
+
(0, import_react28.useEffect)(() => {
|
|
6335
|
+
if (!open || treeExpandedKeys) return;
|
|
6336
|
+
const keys = new Set(expanded);
|
|
6337
|
+
const walk = (nodes, parents) => nodes.forEach((node) => {
|
|
6338
|
+
if (selectedValues.includes(node.value)) parents.forEach((key) => keys.add(key));
|
|
6339
|
+
if (node.children) walk(node.children, [...parents, node.key ?? node.value]);
|
|
6340
|
+
});
|
|
6341
|
+
walk(treeData, []);
|
|
6342
|
+
if (keys.size !== expanded.size) setExpanded(keys);
|
|
6343
|
+
const frame = requestAnimationFrame(() => popupRef.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" }));
|
|
6344
|
+
return () => cancelAnimationFrame(frame);
|
|
6345
|
+
}, [open, treeData, currentValue, treeExpandedKeys]);
|
|
6346
|
+
function toggleNode(node) {
|
|
6347
|
+
const key = node.key ?? node.value;
|
|
6348
|
+
const next = new Set(expandedSet);
|
|
6349
|
+
if (next.has(key)) next.delete(key);
|
|
6350
|
+
else next.add(key);
|
|
6351
|
+
if (!treeExpandedKeys) setExpanded(next);
|
|
6352
|
+
onTreeExpand?.([...next]);
|
|
6353
|
+
}
|
|
6354
|
+
const cascade = treeCheckable && !treeCheckStrictly;
|
|
6355
|
+
function checkState(values) {
|
|
6356
|
+
const checked2 = new Set(values);
|
|
6357
|
+
const affected2 = (node) => node.disabled || node.disableCheckbox ? [] : [
|
|
6358
|
+
...node.checkable === false ? [] : [node.value],
|
|
6359
|
+
...node.children?.flatMap(affected2) ?? []
|
|
6360
|
+
];
|
|
6361
|
+
if (cascade) {
|
|
6362
|
+
findNodes(treeData, values).forEach((node) => affected2(node).forEach((value2) => checked2.add(value2)));
|
|
6363
|
+
const fold = (nodes) => nodes.forEach((node) => {
|
|
6364
|
+
if (node.disabled || node.disableCheckbox) return;
|
|
6365
|
+
if (node.children) fold(node.children);
|
|
6366
|
+
const children = node.children?.filter((child) => !child.disabled && !child.disableCheckbox && child.checkable !== false) ?? [];
|
|
6367
|
+
if (children.length && node.checkable !== false) {
|
|
6368
|
+
if (children.every((child) => checked2.has(child.value))) checked2.add(node.value);
|
|
6369
|
+
else checked2.delete(node.value);
|
|
6370
|
+
}
|
|
6371
|
+
});
|
|
6372
|
+
fold(treeData);
|
|
6373
|
+
}
|
|
6374
|
+
return { checked: checked2, affected: affected2 };
|
|
6375
|
+
}
|
|
6376
|
+
const { checked, affected } = checkState(selectedValues);
|
|
6377
|
+
function outputValues(values) {
|
|
6378
|
+
if (!cascade || showCheckedStrategy === "all") return [...values];
|
|
6379
|
+
const output = [...values].filter((value2) => !nodeIndex.has(value2));
|
|
6380
|
+
const walk = (nodes, parentChecked = false) => nodes.forEach((node) => {
|
|
6381
|
+
const selected = values.has(node.value);
|
|
6382
|
+
const enabledChildren = node.children?.filter((child) => !child.disabled && !child.disableCheckbox) ?? [];
|
|
6383
|
+
if (selected && (showCheckedStrategy === "parent" ? !parentChecked : !enabledChildren.length)) output.push(node.value);
|
|
6384
|
+
if (node.children) walk(node.children, selected && !node.disabled && !node.disableCheckbox);
|
|
6385
|
+
});
|
|
6386
|
+
walk(treeData);
|
|
6387
|
+
return output;
|
|
6388
|
+
}
|
|
6389
|
+
function clear() {
|
|
6390
|
+
if (disabled || loading) return;
|
|
6391
|
+
setCurrentValue(multi ? [] : void 0);
|
|
6392
|
+
onClear?.();
|
|
6393
|
+
}
|
|
6234
6394
|
(0, import_react28.useEffect)(() => {
|
|
6235
6395
|
if (!open) return void 0;
|
|
6236
6396
|
const close = (event) => {
|
|
6237
6397
|
const target = event.target;
|
|
6238
6398
|
if (!rootRef.current?.contains(target) && !popupRef.current?.contains(target)) {
|
|
6239
6399
|
setOpen(false);
|
|
6240
|
-
|
|
6400
|
+
setSearch("");
|
|
6241
6401
|
}
|
|
6242
6402
|
};
|
|
6243
6403
|
document.addEventListener("pointerdown", close);
|
|
6244
6404
|
return () => document.removeEventListener("pointerdown", close);
|
|
6245
6405
|
}, [onDropdownVisibleChange, open]);
|
|
6246
6406
|
function changeOpen(next) {
|
|
6407
|
+
if (disabled) return;
|
|
6247
6408
|
setOpen(next);
|
|
6248
|
-
|
|
6409
|
+
if (!next) setSearch("");
|
|
6249
6410
|
}
|
|
6250
6411
|
function select(node) {
|
|
6251
|
-
if (
|
|
6412
|
+
if (disabled || loading || node.disabled) return;
|
|
6413
|
+
if (treeCheckable ? node.disableCheckbox || node.checkable === false : node.selectable === false) {
|
|
6414
|
+
if (node.children?.length) toggleNode(node);
|
|
6415
|
+
return;
|
|
6416
|
+
}
|
|
6252
6417
|
if (multi) {
|
|
6253
|
-
const
|
|
6254
|
-
|
|
6418
|
+
const exists = checked.has(node.value);
|
|
6419
|
+
const next = new Set(checked);
|
|
6420
|
+
(cascade ? affected(node) : [node.value]).forEach((value2) => {
|
|
6421
|
+
if (exists) next.delete(value2);
|
|
6422
|
+
else next.add(value2);
|
|
6423
|
+
});
|
|
6424
|
+
if (cascade && exists) {
|
|
6425
|
+
const removeParents = (nodes) => {
|
|
6426
|
+
let found = false;
|
|
6427
|
+
nodes.forEach((item) => {
|
|
6428
|
+
const childFound = item.children ? removeParents(item.children) : false;
|
|
6429
|
+
if (childFound) next.delete(item.value);
|
|
6430
|
+
if (item.value === node.value || childFound) found = true;
|
|
6431
|
+
});
|
|
6432
|
+
return found;
|
|
6433
|
+
};
|
|
6434
|
+
removeParents(treeData);
|
|
6435
|
+
}
|
|
6436
|
+
setCurrentValue(outputValues(checkState([...next]).checked));
|
|
6437
|
+
if (exists) onDeselect?.(node.value, node);
|
|
6438
|
+
else onSelect?.(node.value, node);
|
|
6255
6439
|
} else {
|
|
6256
6440
|
setCurrentValue(node.value);
|
|
6441
|
+
onSelect?.(node.value, node);
|
|
6257
6442
|
changeOpen(false);
|
|
6258
6443
|
}
|
|
6259
6444
|
}
|
|
6260
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
"
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
children: [
|
|
6275
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
"
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6446
|
+
"div",
|
|
6447
|
+
{
|
|
6448
|
+
ref: rootRef,
|
|
6449
|
+
className: `sia-tree-select sia-tree-select--${size} sia-tree-select--${status}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
6450
|
+
...props,
|
|
6451
|
+
onKeyDown: (event) => {
|
|
6452
|
+
props.onKeyDown?.(event);
|
|
6453
|
+
if (event.key === "Escape") {
|
|
6454
|
+
event.stopPropagation();
|
|
6455
|
+
changeOpen(false);
|
|
6456
|
+
}
|
|
6457
|
+
},
|
|
6458
|
+
children: [
|
|
6459
|
+
renderTrigger ? renderTrigger({ open, toggle: () => changeOpen(!open), clear }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6461
|
+
"button",
|
|
6462
|
+
{
|
|
6463
|
+
type: "button",
|
|
6464
|
+
className: "sia-tree-select__trigger",
|
|
6465
|
+
disabled,
|
|
6466
|
+
"aria-haspopup": "tree",
|
|
6467
|
+
"aria-expanded": open,
|
|
6468
|
+
"aria-label": props["aria-label"],
|
|
6469
|
+
onClick: () => changeOpen(!open),
|
|
6470
|
+
onKeyDown: (event) => {
|
|
6471
|
+
if (event.key === "ArrowDown") {
|
|
6472
|
+
event.preventDefault();
|
|
6473
|
+
changeOpen(true);
|
|
6474
|
+
}
|
|
6475
|
+
if (event.key === "Escape") changeOpen(false);
|
|
6476
|
+
},
|
|
6477
|
+
children: [
|
|
6478
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-tree-select__value", children: selectedNodes.length ? displayRender ? displayRender(selectedNodes) : multi ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
6479
|
+
selectedNodes.slice(0, maxTagCount).map((node) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-tree-select__tag", children: node.title }, node.value)),
|
|
6480
|
+
selectedNodes.length > maxTagCount ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "sia-tree-select__tag", children: [
|
|
6481
|
+
"+",
|
|
6482
|
+
selectedNodes.length - maxTagCount
|
|
6483
|
+
] }) : null
|
|
6484
|
+
] }) : selectedNodes[0]?.title : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-tree-select__placeholder", children: placeholder }) }),
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: open ? "chevron-up" : "chevron-down", size: 14 })
|
|
6486
|
+
]
|
|
6487
|
+
}
|
|
6488
|
+
),
|
|
6489
|
+
allowClear && selectedValues.length > 0 && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "sia-tree-select__clear", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: clear, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null
|
|
6490
|
+
] }),
|
|
6491
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && !disabled, className: `sia-tree-select__dropdown ${popupClassName}`, style: popupStyle, children: [
|
|
6492
|
+
showSearch ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "sia-tree-select__search", children: [
|
|
6493
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "search", size: 15 }),
|
|
6494
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { "aria-label": searchPlaceholder, autoFocus: true, value: search, placeholder: searchPlaceholder, onChange: (event) => setSearch(event.currentTarget.value) })
|
|
6495
|
+
] }) : null,
|
|
6496
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sia-tree-select__tree", role: "tree", "aria-multiselectable": multi || void 0, style: { maxHeight: listHeight }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { role: "status", className: "sia-tree-select__empty", children: "\u52A0\u8F7D\u4E2D\u2026" }) : visibleNodes.length ? visibleNodes.map((node) => {
|
|
6497
|
+
const hasChildren = Boolean(node.children?.length);
|
|
6498
|
+
const selected = checked.has(node.value);
|
|
6499
|
+
const partial = cascade && !selected && affected(node).some((value2) => checked.has(value2));
|
|
6500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6501
|
+
"div",
|
|
6502
|
+
{
|
|
6503
|
+
className: `sia-tree-select__node${selected ? " is-selected" : ""}${node.disabled ? " is-disabled" : ""}`,
|
|
6504
|
+
style: { paddingInlineStart: 8 + node.depth * 20 },
|
|
6505
|
+
role: "treeitem",
|
|
6506
|
+
"aria-level": node.depth + 1,
|
|
6507
|
+
"aria-disabled": node.disabled || void 0,
|
|
6508
|
+
"aria-selected": selected,
|
|
6509
|
+
"aria-expanded": hasChildren ? !!search || expandedSet.has(node.key ?? node.value) : void 0,
|
|
6510
|
+
"aria-checked": treeCheckable ? partial ? "mixed" : selected : void 0,
|
|
6511
|
+
children: [
|
|
6512
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "sia-tree-select__expand", "aria-label": expandedSet.has(node.key ?? node.value) ? "\u6536\u8D77\u8282\u70B9" : "\u5C55\u5F00\u8282\u70B9", disabled: node.disabled, onClick: () => toggleNode(node), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: expandedSet.has(node.key ?? node.value) ? "chevron-down" : "chevron-right", size: 13 }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-tree-select__indent" }),
|
|
6513
|
+
treeCheckable && node.checkable !== false ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Checkbox2, { "aria-label": typeof node.title === "string" ? node.title : void 0, checked: selected, indeterminate: partial, disabled: node.disabled || node.disableCheckbox, onChange: () => select(node) }) : null,
|
|
6514
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "sia-tree-select__title", disabled: node.disabled, onClick: () => select(node), children: node.title })
|
|
6515
|
+
]
|
|
6516
|
+
},
|
|
6517
|
+
node.key ?? node.value
|
|
6518
|
+
);
|
|
6519
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sia-tree-select__empty", children: "\u6682\u65E0\u5339\u914D\u8282\u70B9" }) }),
|
|
6520
|
+
dropdownFooter
|
|
6521
|
+
] })
|
|
6522
|
+
]
|
|
6523
|
+
}
|
|
6524
|
+
);
|
|
6525
|
+
}
|
|
6526
|
+
|
|
6527
|
+
// src/components/flatTree.ts
|
|
6528
|
+
function buildFlatTree(items, options = {}) {
|
|
6529
|
+
const { idField = "id", parentIdField = "pId", rootParentId } = options;
|
|
6530
|
+
const keyOf = (value) => String(value ?? "");
|
|
6531
|
+
const nodes = new Map(items.map((item) => [keyOf(item[idField]), { ...item, children: [] }]));
|
|
6532
|
+
const roots = [];
|
|
6533
|
+
const isRoot = (parent) => rootParentId !== void 0 ? keyOf(parent) === keyOf(rootParentId) : parent === null || parent === void 0 || parent === "" || parent === 0;
|
|
6534
|
+
for (const node of nodes.values()) {
|
|
6535
|
+
const parentKey = keyOf(node[parentIdField]);
|
|
6536
|
+
const parent = nodes.get(parentKey);
|
|
6537
|
+
let cyclic = false;
|
|
6538
|
+
const visited = /* @__PURE__ */ new Set([keyOf(node[idField])]);
|
|
6539
|
+
let ancestor = parent;
|
|
6540
|
+
while (ancestor) {
|
|
6541
|
+
const key = keyOf(ancestor[idField]);
|
|
6542
|
+
if (visited.has(key)) {
|
|
6543
|
+
cyclic = true;
|
|
6544
|
+
break;
|
|
6288
6545
|
}
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
] }) : null,
|
|
6298
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sia-tree-select__tree", role: "tree", "aria-multiselectable": multi || void 0, children: visibleNodes.length ? visibleNodes.map((node) => {
|
|
6299
|
-
const hasChildren = Boolean(node.children?.length);
|
|
6300
|
-
const selected = selectedValues.includes(node.value);
|
|
6301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6302
|
-
"div",
|
|
6303
|
-
{
|
|
6304
|
-
className: `sia-tree-select__node${selected ? " is-selected" : ""}${node.disabled ? " is-disabled" : ""}`,
|
|
6305
|
-
style: { paddingInlineStart: 8 + node.depth * 20 },
|
|
6306
|
-
role: "treeitem",
|
|
6307
|
-
"aria-selected": selected,
|
|
6308
|
-
"aria-expanded": hasChildren ? expanded.has(node.value) : void 0,
|
|
6309
|
-
children: [
|
|
6310
|
-
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "sia-tree-select__expand", "aria-label": expanded.has(node.value) ? "\u6536\u8D77\u8282\u70B9" : "\u5C55\u5F00\u8282\u70B9", onClick: () => setExpanded((current) => {
|
|
6311
|
-
const next = new Set(current);
|
|
6312
|
-
if (next.has(node.value)) next.delete(node.value);
|
|
6313
|
-
else next.add(node.value);
|
|
6314
|
-
return next;
|
|
6315
|
-
}), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: expanded.has(node.value) ? "chevron-down" : "chevron-right", size: 13 }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-tree-select__indent" }),
|
|
6316
|
-
treeCheckable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Checkbox2, { checked: selected, disabled: node.disabled, onChange: () => select(node) }) : null,
|
|
6317
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "sia-tree-select__title", disabled: node.disabled, onClick: () => select(node), children: node.title })
|
|
6318
|
-
]
|
|
6319
|
-
},
|
|
6320
|
-
node.key ?? node.value
|
|
6321
|
-
);
|
|
6322
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sia-tree-select__empty", children: "\u6682\u65E0\u5339\u914D\u8282\u70B9" }) })
|
|
6323
|
-
] })
|
|
6324
|
-
] });
|
|
6546
|
+
visited.add(key);
|
|
6547
|
+
if (isRoot(ancestor[parentIdField])) break;
|
|
6548
|
+
ancestor = nodes.get(keyOf(ancestor[parentIdField]));
|
|
6549
|
+
}
|
|
6550
|
+
if (isRoot(node[parentIdField]) || !parent || cyclic) roots.push(node);
|
|
6551
|
+
else parent.children.push(node);
|
|
6552
|
+
}
|
|
6553
|
+
return roots;
|
|
6325
6554
|
}
|
|
6326
6555
|
|
|
6327
6556
|
// src/components/Upload.tsx
|
|
@@ -8651,6 +8880,7 @@ var ModalRoot = (0, import_react37.forwardRef)(function Modal({
|
|
|
8651
8880
|
onOk,
|
|
8652
8881
|
onCancel,
|
|
8653
8882
|
onOpenChange,
|
|
8883
|
+
afterOpenChange,
|
|
8654
8884
|
className = "",
|
|
8655
8885
|
style,
|
|
8656
8886
|
...props
|
|
@@ -8660,6 +8890,14 @@ var ModalRoot = (0, import_react37.forwardRef)(function Modal({
|
|
|
8660
8890
|
const [submitting, setSubmitting] = (0, import_react37.useState)(false);
|
|
8661
8891
|
const [rendered, setRendered] = (0, import_react37.useState)(open);
|
|
8662
8892
|
const [closing, setClosing] = (0, import_react37.useState)(false);
|
|
8893
|
+
const afterOpenChangeRef = (0, import_react37.useRef)(afterOpenChange);
|
|
8894
|
+
afterOpenChangeRef.current = afterOpenChange;
|
|
8895
|
+
const submitLock = (0, import_react37.useRef)(false);
|
|
8896
|
+
(0, import_react37.useEffect)(() => {
|
|
8897
|
+
if (!open || !rendered) return void 0;
|
|
8898
|
+
const timer = window.setTimeout(() => afterOpenChangeRef.current?.(true), MODAL_MOTION_DURATION);
|
|
8899
|
+
return () => window.clearTimeout(timer);
|
|
8900
|
+
}, [open, rendered]);
|
|
8663
8901
|
(0, import_react37.useEffect)(() => {
|
|
8664
8902
|
if (open) {
|
|
8665
8903
|
setRendered(true);
|
|
@@ -8671,6 +8909,7 @@ var ModalRoot = (0, import_react37.forwardRef)(function Modal({
|
|
|
8671
8909
|
const timer = window.setTimeout(() => {
|
|
8672
8910
|
setRendered(false);
|
|
8673
8911
|
setClosing(false);
|
|
8912
|
+
afterOpenChangeRef.current?.(false);
|
|
8674
8913
|
}, MODAL_MOTION_DURATION);
|
|
8675
8914
|
return () => window.clearTimeout(timer);
|
|
8676
8915
|
}, [open, rendered]);
|
|
@@ -8685,8 +8924,11 @@ var ModalRoot = (0, import_react37.forwardRef)(function Modal({
|
|
|
8685
8924
|
onOpenChange?.(false);
|
|
8686
8925
|
}
|
|
8687
8926
|
async function handleOk() {
|
|
8927
|
+
if (submitLock.current || confirmLoading) return;
|
|
8928
|
+
submitLock.current = true;
|
|
8688
8929
|
if (!onOk) {
|
|
8689
8930
|
onOpenChange?.(false);
|
|
8931
|
+
submitLock.current = false;
|
|
8690
8932
|
return;
|
|
8691
8933
|
}
|
|
8692
8934
|
try {
|
|
@@ -8701,6 +8943,7 @@ var ModalRoot = (0, import_react37.forwardRef)(function Modal({
|
|
|
8701
8943
|
} catch {
|
|
8702
8944
|
return;
|
|
8703
8945
|
} finally {
|
|
8946
|
+
submitLock.current = false;
|
|
8704
8947
|
setSubmitting(false);
|
|
8705
8948
|
}
|
|
8706
8949
|
}
|
|
@@ -11084,10 +11327,13 @@ function TableInner(props, ref) {
|
|
|
11084
11327
|
const [autoColumnWidths, setAutoColumnWidths] = (0, import_react41.useState)({});
|
|
11085
11328
|
const getRowKey = (0, import_react41.useCallback)((record, index) => typeof rowKey === "function" ? rowKey(record, index) : record[String(rowKey)] ?? index, [rowKey]);
|
|
11086
11329
|
const builtInResizePlugin = (0, import_react41.useMemo)(() => createResizePlugin(), []);
|
|
11330
|
+
const builtInHighlightPlugin = (0, import_react41.useMemo)(() => createHighlightPlugin(), []);
|
|
11087
11331
|
const activePlugins = (0, import_react41.useMemo)(() => {
|
|
11088
11332
|
const plugins = providedPlugins.filter((plugin) => resizable || plugin.id !== "resize");
|
|
11089
|
-
|
|
11090
|
-
|
|
11333
|
+
if (!plugins.some((plugin) => plugin.id === "highlight")) plugins.push(builtInHighlightPlugin);
|
|
11334
|
+
if (resizable && !plugins.some((plugin) => plugin.id === "resize")) plugins.push(builtInResizePlugin);
|
|
11335
|
+
return plugins;
|
|
11336
|
+
}, [builtInHighlightPlugin, builtInResizePlugin, providedPlugins, resizable]);
|
|
11091
11337
|
const sortedPlugins = (0, import_react41.useMemo)(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
|
|
11092
11338
|
const pluginsByIdRef = (0, import_react41.useRef)(/* @__PURE__ */ new Map());
|
|
11093
11339
|
pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
|
@@ -11534,7 +11780,7 @@ function TableInner(props, ref) {
|
|
|
11534
11780
|
summaries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("tfoot", { className: "sia-table__summary", children: summaries.map(renderSummaryRow) }) : null
|
|
11535
11781
|
] }) }),
|
|
11536
11782
|
pipeline.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "sia-table__empty", role: "status", children: emptyText }) : null,
|
|
11537
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "sia-table__scrollbar sia-table__scrollbar--horizontal", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "sia-scrollbar-track sia-table__scrollbar sia-table__scrollbar--horizontal", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11538
11784
|
"div",
|
|
11539
11785
|
{
|
|
11540
11786
|
className: "sia-table__scrollbar-thumb",
|
|
@@ -11544,7 +11790,7 @@ function TableInner(props, ref) {
|
|
|
11544
11790
|
onPointerCancel: handleScrollbarPointerEnd
|
|
11545
11791
|
}
|
|
11546
11792
|
) }),
|
|
11547
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "sia-table__scrollbar sia-table__scrollbar--vertical", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11793
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "sia-scrollbar-track sia-table__scrollbar sia-table__scrollbar--vertical", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11548
11794
|
"div",
|
|
11549
11795
|
{
|
|
11550
11796
|
className: "sia-table__scrollbar-thumb",
|
|
@@ -11662,7 +11908,7 @@ function visibleRect(target) {
|
|
|
11662
11908
|
function createTrack(axis) {
|
|
11663
11909
|
const track = document.createElement("div");
|
|
11664
11910
|
const thumb = document.createElement("div");
|
|
11665
|
-
track.className = `sia-floating-scrollbar sia-floating-scrollbar--${axis}`;
|
|
11911
|
+
track.className = `sia-scrollbar-track sia-floating-scrollbar sia-floating-scrollbar--${axis}`;
|
|
11666
11912
|
thumb.className = "sia-floating-scrollbar__thumb";
|
|
11667
11913
|
track.dataset.axis = axis;
|
|
11668
11914
|
track.setAttribute("aria-hidden", "true");
|
|
@@ -19504,6 +19750,378 @@ function createBaiduMapHost(element, sdk, options) {
|
|
|
19504
19750
|
destroy
|
|
19505
19751
|
};
|
|
19506
19752
|
}
|
|
19753
|
+
|
|
19754
|
+
// src/components/SelectionPanel.tsx
|
|
19755
|
+
var import_react82 = require("react");
|
|
19756
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
19757
|
+
function SelectionPanel({
|
|
19758
|
+
options,
|
|
19759
|
+
value,
|
|
19760
|
+
onChange,
|
|
19761
|
+
multiple = false,
|
|
19762
|
+
disabled = false,
|
|
19763
|
+
loading = false,
|
|
19764
|
+
showSearch = true,
|
|
19765
|
+
searchValue,
|
|
19766
|
+
onSearch,
|
|
19767
|
+
selectedOnly = false,
|
|
19768
|
+
showValue = false,
|
|
19769
|
+
displayField = "label",
|
|
19770
|
+
columns = 1,
|
|
19771
|
+
maxHeight = 250,
|
|
19772
|
+
autoFocusSearch = false
|
|
19773
|
+
}) {
|
|
19774
|
+
const [localSearch, setLocalSearch] = (0, import_react82.useState)("");
|
|
19775
|
+
const search = searchValue ?? localSearch;
|
|
19776
|
+
const [scrollTop, setScrollTop] = (0, import_react82.useState)(0);
|
|
19777
|
+
const [active, setActive] = (0, import_react82.useState)();
|
|
19778
|
+
const listRef = (0, import_react82.useRef)(null);
|
|
19779
|
+
const id = (0, import_react82.useId)();
|
|
19780
|
+
const selected = (0, import_react82.useMemo)(() => new Set(value), [value]);
|
|
19781
|
+
const count = Math.max(1, Math.floor(columns));
|
|
19782
|
+
const allOptions = (0, import_react82.useMemo)(() => {
|
|
19783
|
+
const known = new Set(options.filter((option) => option.optionType !== "divider").map((option) => option.value));
|
|
19784
|
+
return [...value.filter((item) => !known.has(item)).map((item) => ({ value: item, label: String(item), group: "\u81EA\u5B9A\u4E49\u503C" })), ...options];
|
|
19785
|
+
}, [options, value]);
|
|
19786
|
+
const filtered = (0, import_react82.useMemo)(
|
|
19787
|
+
() => allOptions.filter((option) => (!selectedOnly || selected.has(option.value)) && (!search || option.optionType !== "divider" && [option.label, option.value].some((text) => String(text ?? "").toLowerCase().includes(search.toLowerCase())))),
|
|
19788
|
+
[allOptions, selectedOnly, selected, search]
|
|
19789
|
+
);
|
|
19790
|
+
const rows = (0, import_react82.useMemo)(() => {
|
|
19791
|
+
const groups = /* @__PURE__ */ new Map();
|
|
19792
|
+
filtered.forEach((option) => {
|
|
19793
|
+
const items = groups.get(option.group) ?? [];
|
|
19794
|
+
items.push(option);
|
|
19795
|
+
groups.set(option.group, items);
|
|
19796
|
+
});
|
|
19797
|
+
const rows2 = [];
|
|
19798
|
+
let top = 0;
|
|
19799
|
+
for (const [group, items] of groups) {
|
|
19800
|
+
if (group) {
|
|
19801
|
+
rows2.push({ key: `group-${rows2.length}`, title: group, top, height: 30 });
|
|
19802
|
+
top += 30;
|
|
19803
|
+
}
|
|
19804
|
+
for (let index = 0; index < items.length; index += count) {
|
|
19805
|
+
const height = showValue ? 48 : 34;
|
|
19806
|
+
rows2.push({ key: `row-${rows2.length}`, items: items.slice(index, index + count), top, height });
|
|
19807
|
+
top += height;
|
|
19808
|
+
}
|
|
19809
|
+
}
|
|
19810
|
+
return rows2;
|
|
19811
|
+
}, [filtered, count, showValue]);
|
|
19812
|
+
const totalHeight = rows.length ? rows[rows.length - 1].top + rows[rows.length - 1].height : 0;
|
|
19813
|
+
const virtual = filtered.length > 100;
|
|
19814
|
+
const renderedRows = virtual ? rows.filter((row) => row.top + row.height >= scrollTop - 100 && row.top <= scrollTop + maxHeight + 100) : rows;
|
|
19815
|
+
const enabled = filtered.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
19816
|
+
(0, import_react82.useEffect)(() => {
|
|
19817
|
+
setScrollTop(0);
|
|
19818
|
+
if (listRef.current) listRef.current.scrollTop = 0;
|
|
19819
|
+
setActive(void 0);
|
|
19820
|
+
}, [search, selectedOnly, count]);
|
|
19821
|
+
function toggle(option) {
|
|
19822
|
+
if (disabled || loading || option.disabled || option.optionType === "divider") return;
|
|
19823
|
+
setActive(option.value);
|
|
19824
|
+
onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : [option.value]);
|
|
19825
|
+
}
|
|
19826
|
+
function batch(operation) {
|
|
19827
|
+
if (disabled || loading) return;
|
|
19828
|
+
if (operation === "clear") {
|
|
19829
|
+
onChange([]);
|
|
19830
|
+
return;
|
|
19831
|
+
}
|
|
19832
|
+
const editable = new Set(enabled.map((option) => option.value));
|
|
19833
|
+
const retained = value.filter((item) => !editable.has(item));
|
|
19834
|
+
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
19835
|
+
onChange([...retained, ...add]);
|
|
19836
|
+
}
|
|
19837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "sia-selection-panel", children: [
|
|
19838
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
19839
|
+
Input,
|
|
19840
|
+
{
|
|
19841
|
+
"aria-label": "\u641C\u7D22\u9009\u9879",
|
|
19842
|
+
placeholder: "\u641C\u7D22",
|
|
19843
|
+
autoFocus: autoFocusSearch,
|
|
19844
|
+
value: search,
|
|
19845
|
+
allowClear: true,
|
|
19846
|
+
onChange: (event) => {
|
|
19847
|
+
setLocalSearch(event.target.value);
|
|
19848
|
+
onSearch?.(event.target.value);
|
|
19849
|
+
}
|
|
19850
|
+
}
|
|
19851
|
+
),
|
|
19852
|
+
multiple && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "sia-selection-panel__actions", children: [
|
|
19853
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !enabled.length, onClick: () => batch("all"), children: "\u5168\u9009" }),
|
|
19854
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !enabled.length, onClick: () => batch("invert"), children: "\u53CD\u9009" }),
|
|
19855
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !value.length, onClick: () => batch("clear"), children: "\u6E05\u7A7A" }),
|
|
19856
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { children: [
|
|
19857
|
+
"\u5DF2\u9009 ",
|
|
19858
|
+
value.length,
|
|
19859
|
+
" \u9879"
|
|
19860
|
+
] })
|
|
19861
|
+
] }),
|
|
19862
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
19863
|
+
"div",
|
|
19864
|
+
{
|
|
19865
|
+
ref: listRef,
|
|
19866
|
+
role: "listbox",
|
|
19867
|
+
"aria-label": "\u9009\u9879\u5217\u8868",
|
|
19868
|
+
"aria-multiselectable": multiple || void 0,
|
|
19869
|
+
tabIndex: disabled ? -1 : 0,
|
|
19870
|
+
className: "sia-selection-panel__list",
|
|
19871
|
+
style: { maxHeight },
|
|
19872
|
+
onScroll: (event) => setScrollTop(event.currentTarget.scrollTop),
|
|
19873
|
+
"aria-activedescendant": active !== void 0 ? `${id}-${typeof active}-${active}` : void 0,
|
|
19874
|
+
onKeyDown: (event) => {
|
|
19875
|
+
if (disabled || loading || !enabled.length) return;
|
|
19876
|
+
const index = enabled.findIndex((option) => option.value === active);
|
|
19877
|
+
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) {
|
|
19878
|
+
event.preventDefault();
|
|
19879
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
|
|
19880
|
+
const option = enabled[next];
|
|
19881
|
+
setActive(option.value);
|
|
19882
|
+
const row = rows.find((row2) => row2.items?.includes(option));
|
|
19883
|
+
if (row && listRef.current) {
|
|
19884
|
+
listRef.current.scrollTop = Math.max(0, row.top - maxHeight / 2);
|
|
19885
|
+
setScrollTop(listRef.current.scrollTop);
|
|
19886
|
+
}
|
|
19887
|
+
} else if ((event.key === "Enter" || event.key === " ") && index >= 0) {
|
|
19888
|
+
event.preventDefault();
|
|
19889
|
+
toggle(enabled[index]);
|
|
19890
|
+
}
|
|
19891
|
+
},
|
|
19892
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { role: "status", children: "\u52A0\u8F7D\u4E2D\u2026" }) : !rows.length ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "sia-selection-panel__empty", children: "\u6682\u65E0\u5339\u914D\u9009\u9879" }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { height: totalHeight, position: "relative" }, children: renderedRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
19893
|
+
"div",
|
|
19894
|
+
{
|
|
19895
|
+
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
19896
|
+
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
19897
|
+
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
19898
|
+
"button",
|
|
19899
|
+
{
|
|
19900
|
+
type: "button",
|
|
19901
|
+
role: "option",
|
|
19902
|
+
id: `${id}-${typeof option.value}-${option.value}`,
|
|
19903
|
+
tabIndex: -1,
|
|
19904
|
+
"aria-selected": selected.has(option.value),
|
|
19905
|
+
"aria-disabled": disabled || option.disabled || void 0,
|
|
19906
|
+
className: `sia-selection-panel__option${active === option.value ? " is-active" : ""}`,
|
|
19907
|
+
onClick: () => toggle(option),
|
|
19908
|
+
children: [
|
|
19909
|
+
multiple && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { "aria-hidden": "true", className: "sia-selection-panel__check", children: selected.has(option.value) ? "\u2713" : "" }),
|
|
19910
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
19911
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
19912
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("small", { children: String(option.value) })
|
|
19913
|
+
] })
|
|
19914
|
+
]
|
|
19915
|
+
}
|
|
19916
|
+
) }, `${typeof option.value}-${option.value}`))
|
|
19917
|
+
},
|
|
19918
|
+
row.key
|
|
19919
|
+
)) })
|
|
19920
|
+
}
|
|
19921
|
+
)
|
|
19922
|
+
] });
|
|
19923
|
+
}
|
|
19924
|
+
|
|
19925
|
+
// src/components/InputSelect.tsx
|
|
19926
|
+
var import_react83 = require("react");
|
|
19927
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
19928
|
+
var InputSelect = (0, import_react83.forwardRef)(function InputSelect2({
|
|
19929
|
+
options,
|
|
19930
|
+
value,
|
|
19931
|
+
defaultValue,
|
|
19932
|
+
onChange,
|
|
19933
|
+
multiple = false,
|
|
19934
|
+
displayField = "label",
|
|
19935
|
+
showValue = false,
|
|
19936
|
+
placeholder = "\u8BF7\u9009\u62E9",
|
|
19937
|
+
size = "medium",
|
|
19938
|
+
status,
|
|
19939
|
+
disabled = false,
|
|
19940
|
+
loading = false,
|
|
19941
|
+
allowClear = true,
|
|
19942
|
+
hideSearch,
|
|
19943
|
+
inputMaxLength,
|
|
19944
|
+
parseInput,
|
|
19945
|
+
enableModal,
|
|
19946
|
+
suffix,
|
|
19947
|
+
style,
|
|
19948
|
+
className = "",
|
|
19949
|
+
onOpenChange,
|
|
19950
|
+
...inputProps
|
|
19951
|
+
}, forwardedRef) {
|
|
19952
|
+
const [internal, setInternal] = (0, import_react83.useState)(defaultValue);
|
|
19953
|
+
const current = value !== void 0 ? value : internal;
|
|
19954
|
+
const values = current == null ? [] : Array.isArray(current) ? current : [current];
|
|
19955
|
+
const text = values.map((item) => displayField === "label" ? String(options.find((option) => option.optionType !== "divider" && option.value === item)?.label ?? item) : String(item)).join(",");
|
|
19956
|
+
const [draft, setDraft] = (0, import_react83.useState)(text);
|
|
19957
|
+
(0, import_react83.useEffect)(() => {
|
|
19958
|
+
setDraft(text);
|
|
19959
|
+
}, [text, current]);
|
|
19960
|
+
const [open, setOpen] = (0, import_react83.useState)(false);
|
|
19961
|
+
const [search, setSearch] = (0, import_react83.useState)("");
|
|
19962
|
+
const [modalOpen, setModalOpen] = (0, import_react83.useState)(false);
|
|
19963
|
+
const [modalValues, setModalValues] = (0, import_react83.useState)([]);
|
|
19964
|
+
const [selectedOnly, setSelectedOnly] = (0, import_react83.useState)(false);
|
|
19965
|
+
const rootRef = (0, import_react83.useRef)(null);
|
|
19966
|
+
const popupRef = (0, import_react83.useRef)(null);
|
|
19967
|
+
const inputRef = (0, import_react83.useRef)(null);
|
|
19968
|
+
const config = typeof enableModal === "object" ? enableModal : {};
|
|
19969
|
+
function changeOpen(next) {
|
|
19970
|
+
if (next && (disabled || loading)) return;
|
|
19971
|
+
setOpen(next);
|
|
19972
|
+
if (next !== open) onOpenChange?.(next);
|
|
19973
|
+
if (!next) setSearch("");
|
|
19974
|
+
}
|
|
19975
|
+
function emit(next) {
|
|
19976
|
+
if (disabled || loading) return;
|
|
19977
|
+
if (value === void 0) setInternal(next);
|
|
19978
|
+
onChange?.(next);
|
|
19979
|
+
}
|
|
19980
|
+
function select(next) {
|
|
19981
|
+
emit(multiple ? next : next[0]);
|
|
19982
|
+
if (!multiple) {
|
|
19983
|
+
changeOpen(false);
|
|
19984
|
+
inputRef.current?.focus();
|
|
19985
|
+
}
|
|
19986
|
+
}
|
|
19987
|
+
(0, import_react83.useEffect)(() => {
|
|
19988
|
+
if (!open) return;
|
|
19989
|
+
const outside = (event) => {
|
|
19990
|
+
if (!rootRef.current?.contains(event.target) && !popupRef.current?.contains(event.target)) changeOpen(false);
|
|
19991
|
+
};
|
|
19992
|
+
document.addEventListener("pointerdown", outside);
|
|
19993
|
+
return () => document.removeEventListener("pointerdown", outside);
|
|
19994
|
+
}, [open, onOpenChange]);
|
|
19995
|
+
(0, import_react83.useEffect)(() => {
|
|
19996
|
+
if (disabled || loading) {
|
|
19997
|
+
changeOpen(false);
|
|
19998
|
+
setModalOpen(false);
|
|
19999
|
+
}
|
|
20000
|
+
}, [disabled, loading]);
|
|
20001
|
+
function openModal2() {
|
|
20002
|
+
if (disabled || loading) return;
|
|
20003
|
+
changeOpen(false);
|
|
20004
|
+
setModalValues([...values]);
|
|
20005
|
+
setSelectedOnly(false);
|
|
20006
|
+
setModalOpen(true);
|
|
20007
|
+
}
|
|
20008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { ref: rootRef, style, className: `sia-input-select ${className}`, onKeyDown: (event) => {
|
|
20009
|
+
if (event.key === "Escape" && open) {
|
|
20010
|
+
event.stopPropagation();
|
|
20011
|
+
changeOpen(false);
|
|
20012
|
+
inputRef.current?.focus();
|
|
20013
|
+
}
|
|
20014
|
+
}, children: [
|
|
20015
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
20016
|
+
Input,
|
|
20017
|
+
{
|
|
20018
|
+
...inputProps,
|
|
20019
|
+
ref: (node) => {
|
|
20020
|
+
inputRef.current = node;
|
|
20021
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
20022
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
20023
|
+
},
|
|
20024
|
+
role: "combobox",
|
|
20025
|
+
"aria-label": inputProps["aria-label"] ?? placeholder,
|
|
20026
|
+
"aria-expanded": open,
|
|
20027
|
+
"aria-haspopup": "listbox",
|
|
20028
|
+
size,
|
|
20029
|
+
status,
|
|
20030
|
+
disabled,
|
|
20031
|
+
readOnly: displayField === "label" || loading,
|
|
20032
|
+
placeholder,
|
|
20033
|
+
value: draft,
|
|
20034
|
+
maxLength: inputMaxLength && inputMaxLength > 0 ? inputMaxLength : void 0,
|
|
20035
|
+
showCount: !!inputMaxLength && inputMaxLength > 0,
|
|
20036
|
+
onClick: () => changeOpen(!open),
|
|
20037
|
+
autoComplete: "off",
|
|
20038
|
+
onKeyDown: (event) => {
|
|
20039
|
+
if (event.key === "ArrowDown" || event.key === "Enter" && displayField === "label") {
|
|
20040
|
+
event.preventDefault();
|
|
20041
|
+
if (open) popupRef.current?.querySelector('[role="listbox"]')?.focus();
|
|
20042
|
+
else changeOpen(true);
|
|
20043
|
+
}
|
|
20044
|
+
},
|
|
20045
|
+
onChange: (event) => {
|
|
20046
|
+
const next = event.target.value;
|
|
20047
|
+
setDraft(next);
|
|
20048
|
+
emit(parseInput ? parseInput(next) : multiple ? next.split(",").map((item) => item.trim()).filter(Boolean) : next);
|
|
20049
|
+
changeOpen(true);
|
|
20050
|
+
},
|
|
20051
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "sia-input-select__suffix", children: [
|
|
20052
|
+
allowClear && draft && !disabled && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
20053
|
+
event.stopPropagation();
|
|
20054
|
+
setDraft("");
|
|
20055
|
+
emit(multiple ? [] : void 0);
|
|
20056
|
+
inputRef.current?.focus();
|
|
20057
|
+
}, children: "\xD7" }),
|
|
20058
|
+
suffix,
|
|
20059
|
+
enableModal && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u6253\u5F00\u9009\u62E9\u5F39\u7A97", onClick: (event) => {
|
|
20060
|
+
event.stopPropagation();
|
|
20061
|
+
openModal2();
|
|
20062
|
+
}, children: "\u2026" }),
|
|
20063
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u5C55\u5F00\u9009\u9879", onClick: (event) => {
|
|
20064
|
+
event.stopPropagation();
|
|
20065
|
+
changeOpen(!open);
|
|
20066
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Icon, { name: loading ? "refresh" : open ? "chevron-up" : "chevron-down", size: 13 }) })
|
|
20067
|
+
] })
|
|
20068
|
+
}
|
|
20069
|
+
),
|
|
20070
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && !disabled && !loading, className: "sia-input-select__popup", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
20071
|
+
SelectionPanel,
|
|
20072
|
+
{
|
|
20073
|
+
options,
|
|
20074
|
+
value: values,
|
|
20075
|
+
multiple,
|
|
20076
|
+
onChange: select,
|
|
20077
|
+
showValue,
|
|
20078
|
+
displayField,
|
|
20079
|
+
showSearch: !(hideSearch ?? (!multiple && displayField === "value")),
|
|
20080
|
+
autoFocusSearch: displayField === "label",
|
|
20081
|
+
searchValue: search || (!multiple && displayField === "value" ? draft : ""),
|
|
20082
|
+
onSearch: setSearch
|
|
20083
|
+
}
|
|
20084
|
+
) }),
|
|
20085
|
+
enableModal && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
20086
|
+
Modal2,
|
|
20087
|
+
{
|
|
20088
|
+
open: modalOpen,
|
|
20089
|
+
title: config.title ?? "\u9009\u62E9",
|
|
20090
|
+
width: config.width ?? 900,
|
|
20091
|
+
onCancel: () => setModalOpen(false),
|
|
20092
|
+
onOpenChange: setModalOpen,
|
|
20093
|
+
onOk: () => {
|
|
20094
|
+
emit(multiple ? modalValues : modalValues[0]);
|
|
20095
|
+
setModalOpen(false);
|
|
20096
|
+
},
|
|
20097
|
+
children: [
|
|
20098
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "sia-selection-panel__actions", role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
|
|
20099
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { role: "tab", "aria-selected": !selectedOnly, variant: !selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
|
|
20100
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Button, { role: "tab", "aria-selected": selectedOnly, variant: selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(true), children: [
|
|
20101
|
+
"\u5DF2\u9009\u9879(",
|
|
20102
|
+
modalValues.length,
|
|
20103
|
+
")"
|
|
20104
|
+
] })
|
|
20105
|
+
] }),
|
|
20106
|
+
modalOpen && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
20107
|
+
SelectionPanel,
|
|
20108
|
+
{
|
|
20109
|
+
options,
|
|
20110
|
+
value: modalValues,
|
|
20111
|
+
multiple,
|
|
20112
|
+
onChange: setModalValues,
|
|
20113
|
+
selectedOnly,
|
|
20114
|
+
columns: config.columns ?? 3,
|
|
20115
|
+
maxHeight: config.maxHeight ?? 450,
|
|
20116
|
+
showValue,
|
|
20117
|
+
displayField
|
|
20118
|
+
}
|
|
20119
|
+
)
|
|
20120
|
+
]
|
|
20121
|
+
}
|
|
20122
|
+
)
|
|
20123
|
+
] });
|
|
20124
|
+
});
|
|
19507
20125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
19508
20126
|
0 && (module.exports = {
|
|
19509
20127
|
Alert,
|
|
@@ -19562,6 +20180,7 @@ function createBaiduMapHost(element, sdk, options) {
|
|
|
19562
20180
|
ImagePreview,
|
|
19563
20181
|
Input,
|
|
19564
20182
|
InputNumber,
|
|
20183
|
+
InputSelect,
|
|
19565
20184
|
KLineChart,
|
|
19566
20185
|
LineChart,
|
|
19567
20186
|
LineShareChart,
|
|
@@ -19587,6 +20206,7 @@ function createBaiduMapHost(element, sdk, options) {
|
|
|
19587
20206
|
Segmented,
|
|
19588
20207
|
Select,
|
|
19589
20208
|
SelectDateRange,
|
|
20209
|
+
SelectionPanel,
|
|
19590
20210
|
SiaChart,
|
|
19591
20211
|
Slider,
|
|
19592
20212
|
Space,
|
|
@@ -19621,6 +20241,7 @@ function createBaiduMapHost(element, sdk, options) {
|
|
|
19621
20241
|
WordCloudChart,
|
|
19622
20242
|
XYChart,
|
|
19623
20243
|
applySiaTheme,
|
|
20244
|
+
buildFlatTree,
|
|
19624
20245
|
chartColor,
|
|
19625
20246
|
chartTicks,
|
|
19626
20247
|
createBaiduMapHost,
|