Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"vue": "^3.5.13",
"@opentiny/vue-search-box": "^3.28.0",
"@opentiny/vue": "^3.28.0",
"@opentiny/vue-button": "^3.28.0",
"@opentiny/vue-button-group": "^3.28.0",
"@opentiny/vue-checkbox": "^3.28.0",
Expand Down
32 changes: 10 additions & 22 deletions packages/search-box/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-search-box",
"version": "3.28.1",
"version": "3.28.5-alpha.0",
"description": "",
"homepage": "https://github.com/opentiny/tiny-search-box#readme",
"bugs": {
Expand All @@ -13,7 +13,12 @@
"license": "MIT",
"author": "",
"type": "module",
"sideEffects": false,
"sideEffects": [
"*.less",
"*.css",
"./theme/**/*",
"./theme-saas/**/*"
],
"main": "lib/index.js",
"module": "index.ts",
"keywords": [
Expand All @@ -22,26 +27,9 @@
"opentiny"
],
"dependencies": {
"@opentiny/vue-search-box": "workspace:~",
"@opentiny/vue-button": "^2.28.0",
"@opentiny/vue-button-group": "^2.28.0",
"@opentiny/vue-checkbox": "^2.28.0",
"@opentiny/vue-checkbox-group": "^2.28.0",
"@opentiny/vue-common": "^2.28.0",
"@opentiny/vue-date-picker": "^2.28.0",
"@opentiny/vue-dropdown": "^2.28.0",
"@opentiny/vue-dropdown-item": "^2.28.0",
"@opentiny/vue-dropdown-menu": "^2.28.0",
"@opentiny/vue-form": "^2.28.0",
"@opentiny/vue-form-item": "^2.28.0",
"@opentiny/vue-icon": "^2.28.0",
"@opentiny/vue-input": "^2.28.0",
"@opentiny/vue-loading": "^2.28.0",
"@opentiny/vue-option": "^2.28.0",
"@opentiny/vue-popover": "^2.28.0",
"@opentiny/vue-select": "^2.28.0",
"@opentiny/vue-tag": "^2.28.0",
"@opentiny/vue-tooltip": "^2.28.0",
"@opentiny/vue-common": "~2.28.0",
"@opentiny/vue-icon": "~2.28.0",
"@opentiny/vue": "^2.28.0",
"@opentiny/vue-theme": "^3.28.0",
"@opentiny/vue-theme-saas": "^3.28.0"
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand Down
6 changes: 6 additions & 0 deletions packages/search-box/postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const autoprefixer = require('autoprefixer')
const { resolve } = require('path')
// 获取 Tailwind 配置文件的绝对路径
const tailwindConfigPath = resolve(__dirname, 'tailwind.config.cjs')

// 设置环境变量,确保 Tailwind 知道当前是 Saas 模式
if (process.env.TINY_THEME === 'saas' || process.env.TINY_MODE === 'saas') {
process.env.TAILWIND_MODE = 'saas'
}

module.exports = {
plugins: [
// PostCSS 处理顺序:
Expand Down
6 changes: 4 additions & 2 deletions packages/search-box/scripts/plugin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function removeCssOutput(outDir?: string): Plugin {
}

/**
* 移动类型文件插件:从 types/src/ 移到 types/
* 移动类型文件插件:从 types/src/ 移到 types/,并重命名为 index.d.ts
* @param typesDir 类型文件目录路径
*/
export function moveTypesFiles(typesDir: string): Plugin {
Expand All @@ -73,7 +73,7 @@ export function moveTypesFiles(typesDir: string): Plugin {
const typesPath = resolve(typesDir)
const srcDir = resolve(typesPath, 'src')
const indexPath = resolve(srcDir, 'index.type.d.ts')
const targetPath = resolve(typesPath, 'index.type.d.ts')
const targetPath = resolve(typesPath, 'index.d.ts')

if (existsSync(indexPath)) {
// 读取文件内容
Expand All @@ -83,6 +83,8 @@ export function moveTypesFiles(typesDir: string): Plugin {
// 删除 src 目录
rmSync(srcDir, { recursive: true, force: true })
console.log('已移动类型文件到 types 目录')
} else {
console.warn('⚠️ 类型文件不存在:', indexPath)
}
}
}
Expand Down
132 changes: 56 additions & 76 deletions packages/search-box/scripts/post-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,28 @@ function generateVue2NormalPackageJson() {
main: 'index.js',
module: 'index.js',
types: 'types/index.d.ts',
typings: 'types/index.d.ts', // 向后兼容
sideEffects: ['*.css'],
exports: {
'.': {
types: './types/index.d.ts',
import: './index.js',
require: './index.js'
},
'./index.css': './index.css',
'./package.json': './package.json'
},
publishConfig: {
access: 'public'
},
peerDependencies: {
vue: '^2.6.14'
},
dependencies: {
'@opentiny/vue-button': '^2.26.0',
'@opentiny/vue-checkbox': '^2.26.0',
'@opentiny/vue-checkbox-group': '^2.26.0',
'@opentiny/vue-date-picker': '^2.26.0',
'@opentiny/vue-dropdown': '^2.26.0',
'@opentiny/vue-dropdown-item': '^2.26.0',
'@opentiny/vue-dropdown-menu': '^2.26.0',
'@opentiny/vue-form': '^2.26.0',
'@opentiny/vue-form-item': '^2.26.0',
'@opentiny/vue-icon': '^2.26.0',
'@opentiny/vue-input': '^2.26.0',
'@opentiny/vue-loading': '^2.26.0',
'@opentiny/vue-option': '^2.26.0',
'@opentiny/vue-popover': '^2.26.0',
'@opentiny/vue-select': '^2.26.0',
'@opentiny/vue-tag': '^2.26.0',
'@opentiny/vue-tooltip': '^2.26.0',
'@opentiny/vue-common': '^2.26.0',
'@opentiny/vue-theme': '^3.26.0'
'@opentiny/vue': '^2.28.0',
'@opentiny/vue-common': '^2.28.0',
'@opentiny/vue-icon': '^2.28.0',
'@opentiny/vue-theme': '^3.28.0'
Comment on lines +70 to +73
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n packages/search-box/scripts/post-build.js

Repository: opentiny/tiny-search-box

Length of output: 8034


🏁 Script executed:

npm view `@opentiny/vue` versions --json | tail -20
npm view `@opentiny/vue-common` versions --json | tail -20
npm view `@opentiny/vue-icon` versions --json | tail -20
npm view `@opentiny/vue-theme` versions --json | tail -20

Repository: opentiny/tiny-search-box

Length of output: 1005


🏁 Script executed:

npm view `@opentiny/vue` versions --json | grep -E '"2\.' | tail -20
npm view `@opentiny/vue-common` versions --json | grep -E '"2\.' | tail -20
npm view `@opentiny/vue-icon` versions --json | grep -E '"2\.' | tail -20

Repository: opentiny/tiny-search-box

Length of output: 787


Fix Vue2 dependency version inconsistency: @opentiny/vue-theme should be 2.28.0, not 3.28.0.

In the Vue2 builds (lines 70-73 and 110-113), @opentiny/vue-theme is pinned to ^3.28.0 (Vue3) while all other @opentiny dependencies use ^2.28.0 (Vue2). This cross-version mismatch can cause runtime compatibility issues. Align it to ^2.28.0 for consistency with the Vue2 variant.

All referenced package versions are available on npm.

🤖 Prompt for AI Agents
In `@packages/search-box/scripts/post-build.js` around lines 70 - 73, The package
version for `@opentiny/vue-theme` is incorrectly set to ^3.28.0 for the Vue2
builds; update the dependency strings for '@opentiny/vue-theme' in both Vue2
blocks (the occurrences corresponding to the earlier diff and the later block
around lines 110-113) to '^2.28.0' so it matches the other `@opentiny` packages
(e.g., '@opentiny/vue', '@opentiny/vue-common', '@opentiny/vue-icon') and avoids
cross-version mismatch.

},
keywords: packageJson.keywords || [],
license: packageJson.license,
Expand All @@ -94,33 +89,28 @@ function generateVue2SaasPackageJson() {
main: 'index.js',
module: 'index.js',
types: 'types/index.d.ts',
typings: 'types/index.d.ts', // 向后兼容
sideEffects: ['*.css'],
exports: {
'.': {
types: './types/index.d.ts',
import: './index.js',
require: './index.js'
},
'./index.css': './index.css',
'./package.json': './package.json'
},
publishConfig: {
access: 'public'
},
peerDependencies: {
vue: '^2.6.14'
},
dependencies: {
'@opentiny/vue-button': '^2.26.0',
'@opentiny/vue-checkbox': '^2.26.0',
'@opentiny/vue-checkbox-group': '^2.26.0',
'@opentiny/vue-date-picker': '^2.26.0',
'@opentiny/vue-dropdown': '^2.26.0',
'@opentiny/vue-dropdown-item': '^2.26.0',
'@opentiny/vue-dropdown-menu': '^2.26.0',
'@opentiny/vue-form': '^2.26.0',
'@opentiny/vue-form-item': '^2.26.0',
'@opentiny/vue-icon': '^2.26.0',
'@opentiny/vue-input': '^2.26.0',
'@opentiny/vue-loading': '^2.26.0',
'@opentiny/vue-option': '^2.26.0',
'@opentiny/vue-popover': '^2.26.0',
'@opentiny/vue-select': '^2.26.0',
'@opentiny/vue-tag': '^2.26.0',
'@opentiny/vue-tooltip': '^2.26.0',
'@opentiny/vue-common': '^2.26.0',
'@opentiny/vue-theme': '^3.26.0'
'@opentiny/vue': '^2.28.0',
'@opentiny/vue-common': '^2.28.0',
'@opentiny/vue-icon': '^2.28.0',
'@opentiny/vue-theme': '^3.28.0'
},
keywords: packageJson.keywords || [],
license: packageJson.license,
Expand All @@ -139,33 +129,28 @@ function generateVue3NormalPackageJson() {
main: 'index.js',
module: 'index.js',
types: 'types/index.d.ts',
typings: 'types/index.d.ts', // 向后兼容
sideEffects: ['*.css'],
exports: {
'.': {
types: './types/index.d.ts',
import: './index.js',
require: './index.js'
},
'./index.css': './index.css',
'./package.json': './package.json'
},
publishConfig: {
access: 'public'
},
peerDependencies: {
vue: '^3.0.0'
},
dependencies: {
'@opentiny/vue-button': '^3.26.0',
'@opentiny/vue-checkbox': '^3.26.0',
'@opentiny/vue-checkbox-group': '^3.26.0',
'@opentiny/vue-date-picker': '^3.26.0',
'@opentiny/vue-dropdown': '^3.26.0',
'@opentiny/vue-dropdown-item': '^3.26.0',
'@opentiny/vue-dropdown-menu': '^3.26.0',
'@opentiny/vue-form': '^3.26.0',
'@opentiny/vue-form-item': '^3.26.0',
'@opentiny/vue-icon': '^3.26.0',
'@opentiny/vue-input': '^3.26.0',
'@opentiny/vue-loading': '^3.26.0',
'@opentiny/vue-option': '^3.26.0',
'@opentiny/vue-popover': '^3.26.0',
'@opentiny/vue-select': '^3.26.0',
'@opentiny/vue-tag': '^3.26.0',
'@opentiny/vue-tooltip': '^3.26.0',
'@opentiny/vue-common': '^3.26.0',
'@opentiny/vue-theme': '^3.26.0'
'@opentiny/vue': '^3.28.0',
'@opentiny/vue-common': '^3.28.0',
'@opentiny/vue-icon': '^3.28.0',
'@opentiny/vue-theme': '^3.28.0'
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
keywords: packageJson.keywords || [],
license: packageJson.license,
Expand All @@ -184,33 +169,28 @@ function generateVue3SaasPackageJson() {
main: 'index.js',
module: 'index.js',
types: 'types/index.d.ts',
typings: 'types/index.d.ts', // 向后兼容
sideEffects: ['*.css'],
exports: {
'.': {
types: './types/index.d.ts',
import: './index.js',
require: './index.js'
},
'./index.css': './index.css',
'./package.json': './package.json'
},
publishConfig: {
access: 'public'
},
peerDependencies: {
vue: '^3.0.0'
},
dependencies: {
'@opentiny/vue-button': '^3.26.0',
'@opentiny/vue-checkbox': '^3.26.0',
'@opentiny/vue-checkbox-group': '^3.26.0',
'@opentiny/vue-date-picker': '^3.26.0',
'@opentiny/vue-dropdown': '^3.26.0',
'@opentiny/vue-dropdown-item': '^3.26.0',
'@opentiny/vue-dropdown-menu': '^3.26.0',
'@opentiny/vue-form': '^3.26.0',
'@opentiny/vue-form-item': '^3.26.0',
'@opentiny/vue-icon': '^3.26.0',
'@opentiny/vue-input': '^3.26.0',
'@opentiny/vue-loading': '^3.26.0',
'@opentiny/vue-option': '^3.26.0',
'@opentiny/vue-popover': '^3.26.0',
'@opentiny/vue-select': '^3.26.0',
'@opentiny/vue-tag': '^3.26.0',
'@opentiny/vue-tooltip': '^3.26.0',
'@opentiny/vue-common': '^3.26.0',
'@opentiny/vue-theme': '^3.26.0'
'@opentiny/vue': '^3.28.0',
'@opentiny/vue-common': '^3.28.0',
'@opentiny/vue-icon': '^3.28.0',
'@opentiny/vue-theme': '^3.28.0'
},
keywords: packageJson.keywords || [],
license: packageJson.license,
Expand Down
4 changes: 2 additions & 2 deletions packages/search-box/src/components/first-level-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<script>
// Vue2 版本,使用 tiny-vue 的 renderless 架构
import { defineComponent, setup, $props, $prefix } from '@opentiny/vue-common'
import TinyDropdownItem from '@opentiny/vue-dropdown-item'
import { TinyDropdownItem } from '@opentiny/vue'
import { t } from '../utils/i18n.ts'

// 简单的 renderless 函数
Expand Down Expand Up @@ -175,7 +175,7 @@ export default defineComponent({
default: null
}
},
emits: ['events'],
emits: ['events', 'click'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for emit('click') patterns in search-box package
rg -n "emit\(['\"]click['\"]" packages/search-box/src/

Repository: opentiny/tiny-search-box

Length of output: 50


🏁 Script executed:

cat -n packages/search-box/src/components/first-level-panel.vue

Repository: opentiny/tiny-search-box

Length of output: 6950


🏁 Script executed:

rg -n "first-level-panel|FirstLevelPanel" packages/search-box/src/ --type vue --type ts --type js

Repository: opentiny/tiny-search-box

Length of output: 95


🏁 Script executed:

rg -n "first-level-panel|FirstLevelPanel" packages/search-box/src/

Repository: opentiny/tiny-search-box

Length of output: 516


🏁 Script executed:

sed -n '121,130p' packages/search-box/src/pc.vue

Repository: opentiny/tiny-search-box

Length of output: 420


🏁 Script executed:

sed -n '115,135p' packages/search-box/src/pc.vue

Repository: opentiny/tiny-search-box

Length of output: 724


🏁 Script executed:

sed -n '119,130p' packages/search-box/src/pc.vue

Repository: opentiny/tiny-search-box

Length of output: 471


🏁 Script executed:

rg -n "@click" packages/search-box/src/pc.vue | head -20

Repository: opentiny/tiny-search-box

Length of output: 811


Remove unused 'click' emit from the emits array.

The 'click' event is declared in line 178 but is never emitted anywhere in this component. All event handling goes through the 'events' emit. Remove 'click' from the emits array to avoid confusion and maintain clarity about which events this component actually broadcasts.

🤖 Prompt for AI Agents
In `@packages/search-box/src/components/first-level-panel.vue` at line 178, The
emits array in the FirstLevelPanel component incorrectly declares 'click' even
though the component never emits it; remove 'click' from the emits definition
(leave only 'events') in the component options (the emits: [...] declaration)
and scan for any references to emitting 'click' in methods or template to
confirm nothing else is expected to change.

setup(props, context) {
return setup({ props, context, renderless, api })
}
Expand Down
20 changes: 11 additions & 9 deletions packages/search-box/src/components/second-level-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,16 @@
<script>
// Vue2 版本,使用 tiny-vue 的 renderless 架构
import { defineComponent, setup, $props, $prefix } from '@opentiny/vue-common'
import TinyFormItem from '@opentiny/vue-form-item'
import TinyDropdownItem from '@opentiny/vue-dropdown-item'
import TinyCheckbox from '@opentiny/vue-checkbox'
import TinyCheckboxGroup from '@opentiny/vue-checkbox-group'
import TinyDatePicker from '@opentiny/vue-date-picker'
import TinyInput from '@opentiny/vue-input'
import TinyButton from '@opentiny/vue-button'
import TinyLoading from '@opentiny/vue-loading'
import {
TinyFormItem,
TinyDropdownItem,
TinyCheckbox,
TinyCheckboxGroup,
TinyDatePicker,
TinyInput,
TinyButton,
TinyLoading
} from '@opentiny/vue'
import { t } from '../utils/i18n.ts'

// 简单的 renderless 函数
Expand Down Expand Up @@ -356,7 +358,7 @@ const api = [

export default defineComponent({
name: $prefix + 'SearchBoxSecondLevelPanel',
emits: ['events'],
emits: ['events', 'click'],
components: {
TinyFormItem,
TinyDropdownItem,
Expand Down
2 changes: 1 addition & 1 deletion packages/search-box/src/composables/use-match.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import { ref } from 'vue'
import Loading from '@opentiny/vue-loading'
import { Loading } from '@opentiny/vue'
import { debounce } from '../utils/index.ts'
import { hasTagItem, createNewTag, getTagId, emitChangeModelEvent } from '../utils/tag.ts'
import { showDropdown } from '../utils/dropdown.ts'
Expand Down
Loading