mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 11:54:42 +00:00
feat(webui): redesign select metadata fields and improve long text field widget (#305)
* feat(webui): redesign select and multi-select metadata fields with search box and dynamic option creation * fix(webui): stabilize select popover placement and preserve field visibility in store * refactor(webui): enforce 2-row collapsed height and whitespace-pre-wrap on LongTextField
This commit is contained in:
+3
@@ -692,6 +692,9 @@ export * from "./search_fields_placeholder.js";
|
||||
export * from "./visible_count.js";
|
||||
export * from "./option_name_placeholder.js";
|
||||
export * from "./unknown_field_type.js";
|
||||
export * from "./search_options_placeholder.js";
|
||||
export * from "./add_option_with_name.js";
|
||||
export * from "./no_options_found.js";
|
||||
export * from "./settings_updated.js";
|
||||
export * from "./failed_update_settings.js";
|
||||
export * from "./unknown_user.js";
|
||||
|
||||
+3
@@ -694,6 +694,9 @@ export * from './search_fields_placeholder.js'
|
||||
export * from './visible_count.js'
|
||||
export * from './option_name_placeholder.js'
|
||||
export * from './unknown_field_type.js'
|
||||
export * from './search_options_placeholder.js'
|
||||
export * from './add_option_with_name.js'
|
||||
export * from './no_options_found.js'
|
||||
export * from './settings_updated.js'
|
||||
export * from './failed_update_settings.js'
|
||||
export * from './unknown_user.js'
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add options: {name}" |
|
||||
*
|
||||
* @param {Add_Option_With_NameInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_option_with_name: ((inputs: Add_Option_With_NameInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Add_Option_With_NameInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Add_Option_With_NameInputs = {
|
||||
name: NonNullable<unknown>;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{ name: NonNullable<unknown> }} Add_Option_With_NameInputs */
|
||||
|
||||
const en_add_option_with_name = /** @type {(inputs: Add_Option_With_NameInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`Add options: ${i?.name}`)
|
||||
};
|
||||
|
||||
const zh_add_option_with_name = /** @type {(inputs: Add_Option_With_NameInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`添加选项:${i?.name}`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Add options: {name}" |
|
||||
*
|
||||
* @param {Add_Option_With_NameInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const add_option_with_name = /** @type {((inputs: Add_Option_With_NameInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Add_Option_With_NameInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_add_option_with_name(inputs)
|
||||
return zh_add_option_with_name(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No options found" |
|
||||
*
|
||||
* @param {No_Options_FoundInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_options_found: ((inputs?: No_Options_FoundInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_Options_FoundInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_Options_FoundInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_Options_FoundInputs */
|
||||
|
||||
const en_no_options_found = /** @type {(inputs: No_Options_FoundInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`No options found`)
|
||||
};
|
||||
|
||||
const zh_no_options_found = /** @type {(inputs: No_Options_FoundInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`未找到选项`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No options found" |
|
||||
*
|
||||
* @param {No_Options_FoundInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_options_found = /** @type {((inputs?: No_Options_FoundInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_Options_FoundInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_options_found(inputs)
|
||||
return zh_no_options_found(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Search options..." |
|
||||
*
|
||||
* @param {Search_Options_PlaceholderInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const search_options_placeholder: ((inputs?: Search_Options_PlaceholderInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Search_Options_PlaceholderInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Search_Options_PlaceholderInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Search_Options_PlaceholderInputs */
|
||||
|
||||
const en_search_options_placeholder = /** @type {(inputs: Search_Options_PlaceholderInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Search options...`)
|
||||
};
|
||||
|
||||
const zh_search_options_placeholder = /** @type {(inputs: Search_Options_PlaceholderInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`搜索选项...`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Search options..." |
|
||||
*
|
||||
* @param {Search_Options_PlaceholderInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const search_options_placeholder = /** @type {((inputs?: Search_Options_PlaceholderInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Search_Options_PlaceholderInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_search_options_placeholder(inputs)
|
||||
return zh_search_options_placeholder(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user