Skip to content

Commit b27ebfd

Browse files
mynetfana004811
authored and
a004811
committed
fix: add triggerClass binding to PopoverTrigger and update icon-picker styles (vbenjs#6095)
* Popover支持设置trigger的样式 * 修正icon-picker的input值更新
1 parent 0517a70 commit b27ebfd

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

package.json

+1-34
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,7 @@
2525
},
2626
"type": "module",
2727
"scripts": {
28-
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build",
29-
"build:analyze": "turbo build:analyze",
30-
"build:antd": "pnpm run build --filter=@vben/web-antd",
31-
"build:docker": "./scripts/deploy/build-local-docker-image.sh",
32-
"build:docs": "pnpm run build --filter=@vben/docs",
33-
"build:ele": "pnpm run build --filter=@vben/web-ele",
34-
"build:naive": "pnpm run build --filter=@vben/web-naive",
35-
"build:play": "pnpm run build --filter=@vben/playground",
36-
"changeset": "pnpm exec changeset",
37-
"check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell",
38-
"check:circular": "vsh check-circular",
39-
"check:cspell": "cspell lint **/*.ts **/README.md .changeset/*.md --no-progress",
40-
"check:dep": "vsh check-dep",
41-
"check:type": "turbo run typecheck",
42-
"clean": "node ./scripts/clean.mjs",
43-
"commit": "czg",
44-
"dev": "turbo-run dev",
45-
"dev:antd": "pnpm -F @vben/web-antd run dev",
46-
"dev:docs": "pnpm -F @vben/docs run dev",
47-
"dev:ele": "pnpm -F @vben/web-ele run dev",
48-
"dev:naive": "pnpm -F @vben/web-naive run dev",
49-
"dev:play": "pnpm -F @vben/playground run dev",
50-
"format": "vsh lint --format",
51-
"lint": "vsh lint",
52-
"postinstall": "pnpm -r run stub --if-present",
53-
"preinstall": "npx only-allow pnpm",
54-
"prepare": "is-ci || husky",
55-
"preview": "turbo-run preview",
56-
"publint": "vsh publint",
57-
"reinstall": "pnpm clean --del-lock && pnpm install",
58-
"test:unit": "vitest run --dom",
59-
"test:e2e": "turbo run test:e2e",
60-
"update:deps": "npx taze -r -w",
61-
"version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile"
28+
"vercel-build": "pnpm --filter @vben/web-antd build"
6229
},
6330
"devDependencies": {
6431
"@changesets/changelog-github": "catalog:",

packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface Props extends PopoverRootProps {
2121
class?: ClassType;
2222
contentClass?: ClassType;
2323
contentProps?: PopoverContentProps;
24+
triggerClass?: ClassType;
2425
}
2526
2627
const props = withDefaults(defineProps<Props>(), {});
@@ -32,6 +33,7 @@ const delegatedProps = computed(() => {
3233
class: _cls,
3334
contentClass: _,
3435
contentProps: _cProps,
36+
triggerClass: _tClass,
3537
...delegated
3638
} = props;
3739
@@ -43,7 +45,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
4345

4446
<template>
4547
<PopoverRoot v-bind="forwarded">
46-
<PopoverTrigger>
48+
<PopoverTrigger :class="triggerClass">
4749
<slot name="trigger"></slot>
4850

4951
<PopoverContent

packages/effects/common-ui/src/components/icon-picker/icon-picker.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,18 @@ const searchInputProps = computed(() => {
165165
};
166166
});
167167
168+
function updateCurrentSelect(v: string) {
169+
currentSelect.value = v;
170+
}
171+
168172
defineExpose({ toggleOpenState, open, close });
169173
</script>
170174
<template>
171175
<VbenPopover
172176
v-model:open="visible"
173177
:content-props="{ align: 'end', alignOffset: -11, sideOffset: 8 }"
174-
content-class="p-0 pt-3"
178+
content-class="p-0 pt-3 w-full"
179+
trigger-class="w-full"
175180
>
176181
<template #trigger>
177182
<template v-if="props.type === 'input'">
@@ -183,6 +188,7 @@ defineExpose({ toggleOpenState, open, close });
183188
role="combobox"
184189
:aria-label="$t('ui.iconPicker.placeholder')"
185190
aria-expanded="visible"
191+
:[`onUpdate:${modelValueProp}`]="updateCurrentSelect"
186192
v-bind="$attrs"
187193
>
188194
<template #[iconSlot]>

0 commit comments

Comments
 (0)