{ "$schema": "https://shadcn-vue.com/schema/registry-item.json", "name": "smart-search-input", "title": "Smart Search Input", "description": "An advanced search input component with filter tree, multi-select, and various input types.", "dependencies": [ "@lucide/vue" ], "registryDependencies": [ "command", "button", "badge", "checkbox", "popover", "scroll-area", "dialog", "https://raw.githubusercontent.com/smoosex/inovue-ui/refs/heads/main/public/r/date-time-range-picker.json" ], "files": [ { "path": "src/components/smart-search-input/ActiveFilterTags.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/SmartSearchInput.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/types.ts", "content": "import type {\n DateRange,\n DateTimeRange,\n} from \"@/components/date-time-range-picker\";\n\nexport type SelectOption = {\n label: string;\n value: string | number;\n id?: string; // province id\n children?: SelectOption[];\n childrenSize?: number;\n};\n\nexport type FilterInputType =\n | \"text\"\n | \"select\"\n | \"multi-select\"\n | \"tree-multi-select\"\n | \"date\"\n | \"date-range\"\n | \"date-time-range\"\n | \"cascade-select\";\n\nexport type CascadeValue = {\n level1?: string;\n level2?: string;\n};\n\nexport type FilterInputValueMap = {\n text: string;\n select: string | number;\n \"multi-select\": (string | number)[];\n \"tree-multi-select\": (string | number)[];\n date: Date | undefined;\n \"date-range\": DateRange;\n \"date-time-range\": DateTimeRange;\n \"cascade-select\": CascadeValue;\n};\n\nexport type AnyFilterValue = FilterInputValueMap[keyof FilterInputValueMap];\n\nexport type FilterOption = {\n label: string;\n value: string;\n type?: FilterInputType;\n options?: SelectOption[];\n placeholder?: string;\n total?: number;\n currentPage?: number;\n pageSize?: number;\n loading?: boolean;\n formatValue?: (value: any) => any;\n // For advanced filter in advancedSearch\n formatValueAdvanced?: (value: any) => any;\n // For cascade-select\n level1Label?: string;\n level2Label?: string;\n // Lazy loading callback - called when field is selected/mounted\n loadOptions?: () => Promise;\n // Pagination callback\n loadMore?: () => Promise;\n // Cascade select children loader\n loadChildren?: (parentId: string) => Promise;\n};\n\nexport type FilterValue = {\n key: string;\n value: T;\n};\n\nexport type ActiveFilterItem = {\n key: string;\n label: string;\n value: unknown;\n displayValue: string;\n};\n\nexport type ActiveFilterRemoveEvent = {\n key: string;\n item: ActiveFilterItem;\n};\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/locales.ts", "content": "export type Locale = \"en\" | \"zhHans\";\n\nconst translations = {\n en: {\n selectColumn: \"Select column\",\n filterTag: \"Filter Condition:\",\n clearAll: \"Clear All\",\n select: \"Select\",\n search: \"Search\",\n loading: \"Loading...\",\n loadMore: \"Load more\",\n noResults: \"No results\",\n clearFilters: \"Clear filters\",\n selected: \"selected\",\n noData: \"No data\",\n selectLevel1First: \"Select level 1 first\",\n },\n zhHans: {\n selectColumn: \"选择字段\",\n filterTag: \"筛选条件:\",\n clearAll: \"清空\",\n select: \"请选择\",\n search: \"搜索\",\n loading: \"加载中...\",\n loadMore: \"加载更多\",\n noResults: \"无结果\",\n clearFilters: \"清空筛选\",\n selected: \"项已选\",\n noData: \"暂无数据\",\n selectLevel1First: \"请先选择一级\",\n },\n} as const;\n\nexport function GetI18nText(key: keyof typeof translations.en, locale: Locale) {\n return translations[locale][key] || translations.en[key];\n}\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/index.ts", "content": "export { default as SmartSearchInput } from \"./SmartSearchInput.vue\";\nexport { default as ActiveFilterTags } from \"./ActiveFilterTags.vue\";\nexport * from \"./types\";\nexport type { Locale } from \"@/components/date-time-range-picker/locales\";\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterInput.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterSelect.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterMultiSelect.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterTreeSelect.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterTreeSelectOption.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterCascadeSelect.vue", "content": "\n\n\n", "type": "registry:component" }, { "path": "src/components/smart-search-input/FilterClearButton.vue", "content": "\n\n\n", "type": "registry:component" } ], "type": "registry:component" }