niuma-ui 1.2.5 → 1.2.8
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/CHANGELOG.md +27 -0
- package/dist/components/RsAutoComplete.d.ts +39 -0
- package/dist/components/RsAutoComplete.impl.js +306 -0
- package/dist/components/RsAutoComplete.js +5 -0
- package/dist/components/RsCascader.css +81 -0
- package/dist/components/RsCascader.d.ts +34 -0
- package/dist/components/RsCascader.impl.js +138 -0
- package/dist/components/RsCascader.js +8 -0
- package/dist/components/RsMentions-1.css +29 -0
- package/dist/components/RsMentions.css +19 -0
- package/dist/components/RsMentions.d.ts +32 -0
- package/dist/components/RsMentions.impl.js +242 -0
- package/dist/components/RsMentions.js +10 -0
- package/dist/components/RsSelect.css +51 -36
- package/dist/components/RsSelect.d.ts +27 -7
- package/dist/components/RsSelect.impl.js +145 -30
- package/dist/components/RsSelect.js +1 -1
- package/dist/components/RsSplitPane.impl.js +6 -2
- package/dist/components/RsTabs.d.ts +1 -1
- package/dist/components/RsToaster.d.ts +1 -1
- package/dist/components/RsTree.d.ts +4 -4
- package/dist/components/RsTree.impl.js +1 -1
- package/dist/components/RsTreeSelect.css +60 -0
- package/dist/components/RsTreeSelect.d.ts +33 -0
- package/dist/components/RsTreeSelect.impl.js +145 -0
- package/dist/components/RsTreeSelect.js +8 -0
- package/dist/components/cascader-utils.d.ts +16 -0
- package/dist/components/cascader-utils.js +39 -0
- package/dist/components/mentions-utils.d.ts +46 -0
- package/dist/components/mentions-utils.js +128 -0
- package/dist/components/overlay-utils.d.ts +31 -0
- package/dist/components/overlay-utils.js +29 -1
- package/dist/components/select-utils.d.ts +15 -0
- package/dist/components/select-utils.js +37 -1
- package/dist/components/table/RsTableCellEditor.impl.js +7 -1
- package/dist/components/use-rs-select.d.ts +5 -2
- package/dist/components/use-rs-select.js +31 -19
- package/dist/composables/useRsTableShell.js +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +6 -0
- package/dist/locale/messages.js +6 -0
- package/dist/styles.css +160 -0
- package/dist/vite-plugins/niuma-ui-host.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useFilter } from "./reka.js";
|
|
2
|
-
import { buildOptionDisabledMap, buildOptionLabelMap, comboboxBindingToTokens, filterSelectOptions, findSelectOption, flattenSelectOptions, flattenSelectValues, fromComboboxValue, isSelectLabeledValue, normalizeSelectOptions, optionDisplayLabel, packSelectModel, restoreSelectValue, restoreSelectValues, selectModelEntries, sortSelectOptions, splitByTokenSeparators, toComboboxValue, toSelectedTokens } from "./select-utils.js";
|
|
3
|
-
import { computed, nextTick, watch } from "vue";
|
|
2
|
+
import { buildOptionDisabledMap, buildOptionLabelMap, comboboxBindingToTokens, filterSelectOptions, findSelectOption, flattenSelectOptions, flattenSelectValues, fromComboboxValue, isSelectLabeledValue, isSelectMultiple, normalizeSelectOptions, optionDisplayLabel, packSelectModel, restoreSelectValue, restoreSelectValues, selectModelEntries, sortSelectOptions, splitByTokenSeparators, toComboboxValue, toSelectedTokens } from "./select-utils.js";
|
|
3
|
+
import { computed, nextTick, onUnmounted, watch } from "vue";
|
|
4
4
|
//#region src/components/use-rs-select.ts
|
|
5
5
|
/**
|
|
6
6
|
* Select 过滤、选中、多选 tag、creatable / 分隔符提交。
|
|
@@ -8,6 +8,7 @@ import { computed, nextTick, watch } from "vue";
|
|
|
8
8
|
*/
|
|
9
9
|
function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
10
10
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
11
|
+
const isMultiple = computed(() => isSelectMultiple(props.multiple));
|
|
11
12
|
const normalizedOptions = computed(() => normalizeSelectOptions(props.options, props.fieldNames));
|
|
12
13
|
const resolvedPlaceholder = computed(() => props.placeholder ?? t("select.placeholder"));
|
|
13
14
|
const resolvedSearchPlaceholder = computed(() => props.searchPlaceholder ?? t("select.searchPlaceholder"));
|
|
@@ -46,11 +47,12 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
46
47
|
if (!canCreate.value) return values;
|
|
47
48
|
return [createValue.value, ...values.filter((item) => String(item) !== createValue.value)];
|
|
48
49
|
});
|
|
49
|
-
const selectedValues = computed(() => toSelectedTokens(model.value,
|
|
50
|
+
const selectedValues = computed(() => toSelectedTokens(model.value, isMultiple.value));
|
|
50
51
|
const hasValue = computed(() => selectedValues.value.length > 0);
|
|
51
52
|
const visibleTagTokens = computed(() => {
|
|
52
53
|
const all = selectedValues.value;
|
|
53
|
-
if (!
|
|
54
|
+
if (!isMultiple.value || props.maxTagCount == null || props.maxTagCount === "responsive") return all;
|
|
55
|
+
if (all.length <= props.maxTagCount) return all;
|
|
54
56
|
return all.slice(0, Math.max(0, props.maxTagCount));
|
|
55
57
|
});
|
|
56
58
|
const omittedTagCount = computed(() => Math.max(0, selectedValues.value.length - visibleTagTokens.value.length));
|
|
@@ -82,7 +84,7 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
82
84
|
if (!max || max < 1 || label.length <= max) return label;
|
|
83
85
|
return `${label.slice(0, max)}…`;
|
|
84
86
|
}
|
|
85
|
-
const atMultipleLimit = computed(() =>
|
|
87
|
+
const atMultipleLimit = computed(() => isMultiple.value && props.multipleLimit != null && props.multipleLimit > 0 && selectedValues.value.length >= props.multipleLimit);
|
|
86
88
|
function isOptionLimited(option) {
|
|
87
89
|
if (!atMultipleLimit.value) return false;
|
|
88
90
|
return !selectedValues.value.includes(toComboboxValue(option.value));
|
|
@@ -93,11 +95,11 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
93
95
|
return option ? isOptionLimited(option) : false;
|
|
94
96
|
}
|
|
95
97
|
const singleDisplayLabel = computed(() => {
|
|
96
|
-
if (
|
|
98
|
+
if (isMultiple.value || !hasValue.value) return "";
|
|
97
99
|
return tokenLabel(selectedValues.value[0]);
|
|
98
100
|
});
|
|
99
101
|
function writeTokens(tokens) {
|
|
100
|
-
model.value = packSelectModel(restoreSelectValues(tokens, normalizedOptions.value), normalizedOptions.value,
|
|
102
|
+
model.value = packSelectModel(restoreSelectValues(tokens, normalizedOptions.value), normalizedOptions.value, isMultiple.value, Boolean(props.labelInValue));
|
|
101
103
|
}
|
|
102
104
|
function emitSelectionDiff(prev, next) {
|
|
103
105
|
const prevSet = new Set(prev);
|
|
@@ -113,12 +115,12 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
113
115
|
}
|
|
114
116
|
const comboboxModel = computed({
|
|
115
117
|
get() {
|
|
116
|
-
if (
|
|
118
|
+
if (isMultiple.value) return selectedValues.value;
|
|
117
119
|
return hasValue.value ? selectedValues.value[0] : void 0;
|
|
118
120
|
},
|
|
119
121
|
set(value) {
|
|
120
122
|
const prev = selectedValues.value;
|
|
121
|
-
const tokens = comboboxBindingToTokens(value,
|
|
123
|
+
const tokens = comboboxBindingToTokens(value, isMultiple.value);
|
|
122
124
|
emitSelectionDiff(prev, tokens);
|
|
123
125
|
writeTokens(tokens);
|
|
124
126
|
if (props.autoClearSearchValue) searchQuery.value = "";
|
|
@@ -132,7 +134,7 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
132
134
|
if (!next) return;
|
|
133
135
|
const values = currentValues();
|
|
134
136
|
if (values.some((item) => String(item) === next)) return;
|
|
135
|
-
if (
|
|
137
|
+
if (isMultiple.value) {
|
|
136
138
|
if (atMultipleLimit.value) return;
|
|
137
139
|
const prev = selectedValues.value;
|
|
138
140
|
const packed = packSelectModel([...values, next], normalizedOptions.value, true, Boolean(props.labelInValue));
|
|
@@ -147,7 +149,7 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
147
149
|
if (props.autoClearSearchValue) searchQuery.value = "";
|
|
148
150
|
}
|
|
149
151
|
function consumeTokenSeparators(raw) {
|
|
150
|
-
if (!
|
|
152
|
+
if (!isMultiple.value && !props.creatable) return;
|
|
151
153
|
const parts = splitByTokenSeparators(raw, props.tokenSeparators ?? []);
|
|
152
154
|
if (!parts) return;
|
|
153
155
|
const rest = parts.pop() ?? "";
|
|
@@ -159,26 +161,35 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
159
161
|
const prev = selectedValues.value;
|
|
160
162
|
const key = toComboboxValue(matched.value);
|
|
161
163
|
if (prev.includes(key)) continue;
|
|
162
|
-
if (
|
|
163
|
-
const nextTokens =
|
|
164
|
+
if (isMultiple.value && atMultipleLimit.value) continue;
|
|
165
|
+
const nextTokens = isMultiple.value ? [...prev, key] : [key];
|
|
164
166
|
emitSelectionDiff(prev, nextTokens);
|
|
165
167
|
writeTokens(nextTokens);
|
|
166
|
-
if (!
|
|
168
|
+
if (!isMultiple.value) open.value = false;
|
|
167
169
|
} else if (props.creatable) commitCreatedValue(token);
|
|
168
170
|
}
|
|
169
171
|
if (rest !== raw) searchQuery.value = rest;
|
|
170
172
|
}
|
|
173
|
+
let searchTimer;
|
|
171
174
|
watch(searchQuery, (query) => {
|
|
172
|
-
if (props.remote)
|
|
175
|
+
if (props.remote) {
|
|
176
|
+
const wait = props.debounce ?? 0;
|
|
177
|
+
if (searchTimer) clearTimeout(searchTimer);
|
|
178
|
+
if (wait <= 0) emit("search", query);
|
|
179
|
+
else searchTimer = setTimeout(() => emit("search", query), wait);
|
|
180
|
+
}
|
|
173
181
|
if (props.tokenSeparators?.length) consumeTokenSeparators(query);
|
|
174
182
|
});
|
|
183
|
+
onUnmounted(() => {
|
|
184
|
+
if (searchTimer) clearTimeout(searchTimer);
|
|
185
|
+
});
|
|
175
186
|
watch(open, async (isOpen) => {
|
|
176
187
|
if (isOpen) {
|
|
177
188
|
const pending = searchQuery.value;
|
|
178
189
|
await nextTick();
|
|
179
190
|
await nextTick();
|
|
180
191
|
if (pending) searchQuery.value = pending;
|
|
181
|
-
else if (props.fillSearchWithValue && !
|
|
192
|
+
else if (props.fillSearchWithValue && !isMultiple.value && hasValue.value) searchQuery.value = singleDisplayLabel.value;
|
|
182
193
|
else searchQuery.value = "";
|
|
183
194
|
return;
|
|
184
195
|
}
|
|
@@ -196,19 +207,19 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
196
207
|
event.stopPropagation();
|
|
197
208
|
emitSelectionDiff(selectedValues.value, []);
|
|
198
209
|
emit("clear");
|
|
199
|
-
model.value =
|
|
210
|
+
model.value = isMultiple.value ? [] : "";
|
|
200
211
|
}
|
|
201
212
|
function removeTag(value, event) {
|
|
202
213
|
event.preventDefault();
|
|
203
214
|
event.stopPropagation();
|
|
204
|
-
if (!
|
|
215
|
+
if (!isMultiple.value) return;
|
|
205
216
|
const prev = selectedValues.value;
|
|
206
217
|
const tokens = prev.filter((item) => item !== value);
|
|
207
218
|
emitSelectionDiff(prev, tokens);
|
|
208
219
|
writeTokens(tokens);
|
|
209
220
|
}
|
|
210
221
|
function setValue(value) {
|
|
211
|
-
if (
|
|
222
|
+
if (isMultiple.value) {
|
|
212
223
|
writeTokens(toSelectedTokens(Array.isArray(value) ? value : value !== "" && value != null ? [value] : [], true));
|
|
213
224
|
return;
|
|
214
225
|
}
|
|
@@ -229,6 +240,7 @@ function useRsSelect(props, model, open, searchQuery, emit, t) {
|
|
|
229
240
|
resolvedSearchPlaceholder,
|
|
230
241
|
resolvedEmptyText,
|
|
231
242
|
resolvedLoadingText,
|
|
243
|
+
isMultiple,
|
|
232
244
|
isSearchable,
|
|
233
245
|
labelMap,
|
|
234
246
|
useVirtual,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { resolveVirtualListHeight } from "../components/virtual-list-utils.js";
|
|
1
2
|
import { resolveScrollWidth, selectRowKeys } from "../components/table-utils.js";
|
|
2
3
|
import { RS_TABLE_PREFIX_COL_WIDTH, measureRsTablePrefixWidth, useRsTableColumnVirtual } from "./useRsTableColumnVirtual.js";
|
|
3
4
|
import { useRsTableColumnLayout } from "./useRsTableColumnLayout.js";
|
|
4
5
|
import { useRsTableColumnResize } from "./useRsTableColumnResize.js";
|
|
5
6
|
import { useRsTableContextMenu } from "./useRsTableContextMenu.js";
|
|
6
7
|
import { useRsTableInteraction } from "./useRsTableInteraction.js";
|
|
7
|
-
import { resolveVirtualListHeight } from "../components/virtual-list-utils.js";
|
|
8
8
|
import { computed } from "vue";
|
|
9
9
|
//#region src/composables/useRsTableShell.ts
|
|
10
10
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export { default as RsLabel } from './components/RsLabel.js';
|
|
|
35
35
|
export { default as RsLink } from './components/RsLink.js';
|
|
36
36
|
export { default as RsMenu } from './components/RsMenu.js';
|
|
37
37
|
export { default as RsSelect } from './components/RsSelect.js';
|
|
38
|
+
export { default as RsAutoComplete } from './components/RsAutoComplete.js';
|
|
39
|
+
export { default as RsCascader } from './components/RsCascader.js';
|
|
40
|
+
export { default as RsTreeSelect } from './components/RsTreeSelect.js';
|
|
41
|
+
export { default as RsMentions } from './components/RsMentions.js';
|
|
38
42
|
export { default as RsScrollbar } from './components/RsScrollbar.js';
|
|
39
43
|
export { default as RsAvatar } from './components/RsAvatar.js';
|
|
40
44
|
export { default as RsCard } from './components/RsCard.js';
|
|
@@ -100,10 +104,12 @@ export type { RsContextMenuItem } from './components/context-menu-utils';
|
|
|
100
104
|
export type { RsDropdownItem, RsDropdownItemGroup, RsDropdownItems } from './components/dropdown-utils';
|
|
101
105
|
export type { RsMenuItem, RsMenuItemGroup, RsMenuItems } from './components/menu-utils';
|
|
102
106
|
export type { RsScrollbarOrientation, RsScrollbarType } from './components/scrollbar-utils';
|
|
103
|
-
export type { RsSelectFieldNames, RsSelectFilterOption, RsSelectFilterSort, RsSelectGetPopupContainer, RsSelectLabeledValue, RsSelectModelValue, RsSelectResolvedModel, RsSelectOption, RsSelectOptionFilterProp, RsSelectOptionGroup, RsSelectOptionInput, RsSelectOptions, RsSelectOptionsInput, RsSelectPlacement, RsSelectStatus, RsSelectValue, } from './components/select-utils';
|
|
107
|
+
export type { RsSelectFieldNames, RsSelectFilterOption, RsSelectFilterSort, RsSelectGetPopupContainer, RsSelectLabeledValue, RsSelectModelValue, RsSelectResolvedModel, RsSelectOption, RsSelectOptionFilterProp, RsSelectOptionGroup, RsSelectOptionInput, RsSelectOptions, RsSelectOptionsInput, RsSelectPlacement, RsSelectStatus, RsSelectMaxTagCount, RsSelectVariant, RsSelectValue, } from './components/select-utils';
|
|
108
|
+
export type { RsCascaderExpandTrigger, RsCascaderOption, RsCascaderPath, } from './components/cascader-utils';
|
|
109
|
+
export type { RsMentionActive, RsMentionCaretBox, RsMentionOption, RsMentionPopupBox, } from './components/mentions-utils';
|
|
104
110
|
export { RS_SELECT_EMPTY_VALUE, fromComboboxValue, isSelectLabeledValue, normalizeSelectOptions, optionDisplayLabel, packSelectModel, restoreSelectValue, toComboboxValue, unwrapSelectEntry, } from './components/select-utils';
|
|
105
|
-
export type { RsFeedbackTone, RsToastPosition, RsToastType } from './components/overlay-utils';
|
|
106
|
-
export { RS_TOAST_DEFAULT_GAP, RS_TOAST_DEFAULT_POSITION, rsToastPositions, rsFeedbackIconClass } from './components/overlay-utils';
|
|
111
|
+
export type { RsFeedbackTone, RsToastPosition, RsToastType, RsOverlayAnchorBox, RsOverlayBox } from './components/overlay-utils';
|
|
112
|
+
export { RS_TOAST_DEFAULT_GAP, RS_TOAST_DEFAULT_POSITION, rsToastPositions, rsFeedbackIconClass, placeAnchoredPopup, stepEnabledIndex } from './components/overlay-utils';
|
|
107
113
|
export type { RsFormContext, RsFormErrorRender, RsFormErrorRenderContext, RsFormFieldExpose, RsFormItemContext, RsFormListContext, RsFormListField, RsFormListOperations, RsFormFieldValidationResult, RsFormGap, RsFormLabelAlign, RsFormLabelPosition, RsFormMaxWidth, RsFormSize, RsFormValidateStatus, RsFormValidationResult, } from './components/form-utils';
|
|
108
114
|
export { cloneFormFieldValue, isRsFormItemBoundControl, provideRsFormItemContext, provideRsFormListContext, RS_FORM_INJECTION_KEY, RS_FORM_ITEM_INJECTION_KEY, RS_FORM_LIST_INJECTION_KEY, resolveFieldRules, useRsFormContext, useRsFormField, useRsFormItemContext, useRsFormListContext, } from './components/form-utils';
|
|
109
115
|
export type { RsFormNamePath } from './components/form-path';
|
package/dist/index.js
CHANGED
|
@@ -47,12 +47,14 @@ export { RS_TIME_SECONDS_FORMAT } from './lib/rs-dayjs.js'
|
|
|
47
47
|
export { RS_TOAST_DEFAULT_GAP } from './components/overlay-utils.js'
|
|
48
48
|
export { RS_TOAST_DEFAULT_POSITION } from './components/overlay-utils.js'
|
|
49
49
|
export { default as RsAlert } from './components/RsAlert.js'
|
|
50
|
+
export { default as RsAutoComplete } from './components/RsAutoComplete.js'
|
|
50
51
|
export { default as RsAvatar } from './components/RsAvatar.js'
|
|
51
52
|
export { default as RsBadge } from './components/RsBadge.js'
|
|
52
53
|
export { default as RsBreadcrumb } from './components/RsBreadcrumb.js'
|
|
53
54
|
export { default as RsButton } from './components/RsButton.js'
|
|
54
55
|
export { default as RsCalendarGrid } from './components/RsCalendarGrid.js'
|
|
55
56
|
export { default as RsCard } from './components/RsCard.js'
|
|
57
|
+
export { default as RsCascader } from './components/RsCascader.js'
|
|
56
58
|
export { default as RsCheckbox } from './components/RsCheckbox.js'
|
|
57
59
|
export { default as RsCodeBlock } from './components/RsCodeBlock.js'
|
|
58
60
|
export { default as RsCodeEditor } from './components/RsCodeEditor.js'
|
|
@@ -81,6 +83,7 @@ export { default as RsLink } from './components/RsLink.js'
|
|
|
81
83
|
export { default as RsLoading } from './components/RsLoading.js'
|
|
82
84
|
export { default as RsLoadingBar } from './components/RsLoadingBar.js'
|
|
83
85
|
export { default as RsMarkdown } from './components/RsMarkdown.js'
|
|
86
|
+
export { default as RsMentions } from './components/RsMentions.js'
|
|
84
87
|
export { default as RsMenu } from './components/RsMenu.js'
|
|
85
88
|
export { default as RsMonacoEditor } from './components/RsMonacoEditor.js'
|
|
86
89
|
export { default as RsPagination } from './components/RsPagination.js'
|
|
@@ -114,6 +117,7 @@ export { default as RsToolbar } from './components/RsToolbar.js'
|
|
|
114
117
|
export { default as RsTooltip } from './components/RsTooltip.js'
|
|
115
118
|
export { default as RsTooltipProvider } from './components/RsTooltipProvider.js'
|
|
116
119
|
export { default as RsTree } from './components/RsTree.js'
|
|
120
|
+
export { default as RsTreeSelect } from './components/RsTreeSelect.js'
|
|
117
121
|
export { default as RsUpload } from './components/RsUpload.js'
|
|
118
122
|
export { default as RsVirtualList } from './components/RsVirtualList.js'
|
|
119
123
|
export { TIME_HOUR_OPTIONS } from './components/time-picker-utils.js'
|
|
@@ -280,6 +284,7 @@ export { parseDateValue } from './components/date-picker-utils.js'
|
|
|
280
284
|
export { parseLocalDateTimeToUtcIso } from './lib/iso-local-datetime.js'
|
|
281
285
|
export { parseNumberInput } from './components/input-number-utils.js'
|
|
282
286
|
export { parseTimeValue } from './components/time-picker-utils.js'
|
|
287
|
+
export { placeAnchoredPopup } from './components/overlay-utils.js'
|
|
283
288
|
export { prefetchClipboardText } from './utils/rs-clipboard.js'
|
|
284
289
|
export { prewarmCodeMirrorEditor } from './components/code-mirror-lang.js'
|
|
285
290
|
export { provideRsFormItemContext } from './components/form-utils.js'
|
|
@@ -378,6 +383,7 @@ export { sortTableRowsMulti } from './components/table-utils.js'
|
|
|
378
383
|
export { sortTableTreeRows } from './components/table-utils.js'
|
|
379
384
|
export { splitSizesEqual } from './components/split-pane-utils.js'
|
|
380
385
|
export { splitTreeLabelHighlight } from './components/tree-utils.js'
|
|
386
|
+
export { stepEnabledIndex } from './components/overlay-utils.js'
|
|
381
387
|
export { stepNumberValue } from './components/input-number-utils.js'
|
|
382
388
|
export { supportsRsButtonTone } from './components/button-utils.js'
|
|
383
389
|
export { terminalShortcutLabel } from './components/terminal-utils.js'
|
package/dist/locale/messages.js
CHANGED
|
@@ -7,6 +7,9 @@ var zhCN = {
|
|
|
7
7
|
"select.clear": "清空",
|
|
8
8
|
"select.createOption": "使用 “{query}”",
|
|
9
9
|
"select.maxTagPlaceholder": "+{count}",
|
|
10
|
+
"mentions.placeholder": "输入 @ 提及",
|
|
11
|
+
"mentions.suggestions": "提及建议",
|
|
12
|
+
"autocomplete.suggestions": "自动完成建议",
|
|
10
13
|
"dropdown.placeholder": "请选择",
|
|
11
14
|
"breadcrumb.label": "面包屑",
|
|
12
15
|
"breadcrumb.separator": "分隔符",
|
|
@@ -207,6 +210,9 @@ var enUS = {
|
|
|
207
210
|
"select.clear": "Clear",
|
|
208
211
|
"select.createOption": "Use “{query}”",
|
|
209
212
|
"select.maxTagPlaceholder": "+{count}",
|
|
213
|
+
"mentions.placeholder": "Type @ to mention",
|
|
214
|
+
"mentions.suggestions": "Mention suggestions",
|
|
215
|
+
"autocomplete.suggestions": "Autocomplete suggestions",
|
|
210
216
|
"dropdown.placeholder": "Select",
|
|
211
217
|
"breadcrumb.label": "Breadcrumb",
|
|
212
218
|
"breadcrumb.separator": "Separator",
|
package/dist/styles.css
CHANGED
|
@@ -1664,6 +1664,166 @@ code {
|
|
|
1664
1664
|
cursor: not-allowed;
|
|
1665
1665
|
}
|
|
1666
1666
|
|
|
1667
|
+
.rs-auto-complete {
|
|
1668
|
+
position: relative;
|
|
1669
|
+
display: inline-flex;
|
|
1670
|
+
align-items: center;
|
|
1671
|
+
width: 100%;
|
|
1672
|
+
max-width: 100%;
|
|
1673
|
+
box-sizing: border-box;
|
|
1674
|
+
vertical-align: middle;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.rs-auto-complete__input {
|
|
1678
|
+
box-sizing: border-box;
|
|
1679
|
+
width: 100%;
|
|
1680
|
+
height: var(--rs-control-height-md);
|
|
1681
|
+
padding: 0 var(--rs-space-md);
|
|
1682
|
+
border: 1px solid var(--rs-input-border, var(--rs-border));
|
|
1683
|
+
border-radius: var(--rs-select-radius, var(--rs-radius-sm));
|
|
1684
|
+
background: var(--rs-input-bg);
|
|
1685
|
+
color: var(--rs-text);
|
|
1686
|
+
font-family: inherit;
|
|
1687
|
+
font-size: var(--rs-font-size-sm);
|
|
1688
|
+
line-height: var(--rs-line-height-tight);
|
|
1689
|
+
outline: none;
|
|
1690
|
+
box-shadow: var(--rs-input-shadow, none);
|
|
1691
|
+
transition:
|
|
1692
|
+
border-color var(--rs-transition-fast),
|
|
1693
|
+
box-shadow var(--rs-transition-fast),
|
|
1694
|
+
background var(--rs-transition-fast);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
.rs-auto-complete--sm .rs-auto-complete__input {
|
|
1698
|
+
height: var(--rs-control-height-sm);
|
|
1699
|
+
padding: 0 var(--rs-space-sm);
|
|
1700
|
+
font-size: var(--rs-font-size-xs);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.rs-auto-complete--lg .rs-auto-complete__input {
|
|
1704
|
+
height: var(--rs-control-height-lg);
|
|
1705
|
+
padding: 0 var(--rs-space-lg);
|
|
1706
|
+
font-size: var(--rs-font-size-base);
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
.rs-auto-complete--clearable .rs-auto-complete__input {
|
|
1710
|
+
padding-right: calc(var(--rs-space-md) + 1.25rem);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
.rs-auto-complete__input::placeholder {
|
|
1714
|
+
color: var(--rs-placeholder);
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
.rs-auto-complete__input:hover:not(:disabled) {
|
|
1718
|
+
border-color: var(--rs-input-border-hover, var(--rs-border));
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
.rs-auto-complete__input:focus {
|
|
1722
|
+
border-color: var(--rs-focus-border, var(--rs-primary));
|
|
1723
|
+
background: var(--rs-input-bg);
|
|
1724
|
+
box-shadow:
|
|
1725
|
+
var(--rs-input-shadow, none),
|
|
1726
|
+
0 0 0 var(--rs-focus-ring-width, 2px) var(--rs-focus-ring);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
.rs-auto-complete__input:disabled {
|
|
1730
|
+
opacity: 0.38;
|
|
1731
|
+
cursor: not-allowed;
|
|
1732
|
+
background: var(--rs-surface-hover);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
.rs-auto-complete__clear {
|
|
1736
|
+
position: absolute;
|
|
1737
|
+
top: 50%;
|
|
1738
|
+
right: var(--rs-space-sm);
|
|
1739
|
+
display: inline-flex;
|
|
1740
|
+
align-items: center;
|
|
1741
|
+
justify-content: center;
|
|
1742
|
+
width: 1.25rem;
|
|
1743
|
+
height: 1.25rem;
|
|
1744
|
+
padding: 0;
|
|
1745
|
+
border: 0;
|
|
1746
|
+
border-radius: var(--rs-radius-xs);
|
|
1747
|
+
background: transparent;
|
|
1748
|
+
color: var(--rs-muted);
|
|
1749
|
+
transform: translateY(-50%);
|
|
1750
|
+
cursor: pointer;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
.rs-auto-complete__clear:hover {
|
|
1754
|
+
color: var(--rs-text);
|
|
1755
|
+
background: var(--rs-item-hover);
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
.rs-auto-complete__list {
|
|
1759
|
+
z-index: calc(var(--rs-z-modal) + 2);
|
|
1760
|
+
box-sizing: border-box;
|
|
1761
|
+
min-width: 8rem;
|
|
1762
|
+
max-width: min(24rem, calc(100vw - 1rem));
|
|
1763
|
+
max-height: 16rem;
|
|
1764
|
+
margin: 0;
|
|
1765
|
+
padding: var(--rs-space-xs);
|
|
1766
|
+
overflow: auto;
|
|
1767
|
+
border: 1px solid var(--rs-dialog-border, var(--rs-border));
|
|
1768
|
+
border-radius: var(--rs-radius);
|
|
1769
|
+
background: var(--rs-surface-elevated);
|
|
1770
|
+
box-shadow: var(--rs-shadow-lg);
|
|
1771
|
+
color: var(--rs-text);
|
|
1772
|
+
font-size: var(--rs-font-size-sm);
|
|
1773
|
+
line-height: var(--rs-line-height-tight);
|
|
1774
|
+
list-style: none;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
.rs-auto-complete__label {
|
|
1778
|
+
flex: 1;
|
|
1779
|
+
min-width: 0;
|
|
1780
|
+
overflow: hidden;
|
|
1781
|
+
text-overflow: ellipsis;
|
|
1782
|
+
white-space: nowrap;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
.rs-auto-complete__item {
|
|
1786
|
+
display: flex;
|
|
1787
|
+
align-items: center;
|
|
1788
|
+
width: 100%;
|
|
1789
|
+
box-sizing: border-box;
|
|
1790
|
+
padding: var(--rs-space-sm) var(--rs-space-md);
|
|
1791
|
+
border-radius: var(--rs-radius-sm);
|
|
1792
|
+
color: var(--rs-text);
|
|
1793
|
+
font-size: var(--rs-font-size-sm);
|
|
1794
|
+
line-height: var(--rs-line-height-tight);
|
|
1795
|
+
cursor: pointer;
|
|
1796
|
+
user-select: none;
|
|
1797
|
+
transition:
|
|
1798
|
+
background var(--rs-transition-fast),
|
|
1799
|
+
color var(--rs-transition-fast);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
.rs-auto-complete__item--active,
|
|
1803
|
+
.rs-auto-complete__item:hover:not(.rs-auto-complete__item--disabled) {
|
|
1804
|
+
background: var(--rs-item-hover);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.rs-auto-complete__item--disabled {
|
|
1808
|
+
opacity: 0.38;
|
|
1809
|
+
cursor: not-allowed;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.rs-auto-complete__empty {
|
|
1813
|
+
padding: var(--rs-space-md);
|
|
1814
|
+
color: var(--rs-muted);
|
|
1815
|
+
font-size: var(--rs-font-size-sm);
|
|
1816
|
+
text-align: center;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.rs-auto-complete__mark {
|
|
1820
|
+
padding: 0;
|
|
1821
|
+
background: color-mix(in srgb, var(--rs-primary) 22%, transparent);
|
|
1822
|
+
color: inherit;
|
|
1823
|
+
font-weight: var(--rs-font-weight-medium);
|
|
1824
|
+
border-radius: 0.125rem;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1667
1827
|
.rs-field {
|
|
1668
1828
|
display: flex;
|
|
1669
1829
|
flex-direction: column;
|
|
@@ -49,6 +49,8 @@ function niumaUiHostAlias(ctx) {
|
|
|
49
49
|
: [];
|
|
50
50
|
return {
|
|
51
51
|
resolve: alias.length > 0 ? { alias } : {},
|
|
52
|
+
// 不要把 reka-ui / @lucide/vue / vue-sonner 写进 include:
|
|
53
|
+
// 它们装在 niuma-ui 下,pnpm 宿主(cloud / site)resolve 不到,Vite 会报 Failed to resolve dependency。
|
|
52
54
|
optimizeDeps: {
|
|
53
55
|
exclude: ['@niuma/ui', 'niuma-ui'],
|
|
54
56
|
},
|