Skip to content

Commit

Permalink
feat(confirmDialog): wip
Browse files Browse the repository at this point in the history
RISDEV-4776
  • Loading branch information
hamo225 committed Sep 11, 2024
1 parent d26b4c2 commit 3220aa2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions src/primevue/confirmDialog/confirmDialog.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ConfirmDialog from "primevue/confirmdialog";
import { html } from "@/lib/tags.ts"
import { useConfirm } from "primevue/useconfirm";
import Btn from "primevue/button";

import IconCheck from "~icons/ic/baseline-check";

const meta: Meta<typeof ConfirmDialog> = {
component: ConfirmDialog,
Expand All @@ -12,19 +12,16 @@ const meta: Meta<typeof ConfirmDialog> = {

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: (args) => ({
components: { ConfirmDialog, Btn },
export const Default: Story = {render: (args) => ({
components: { ConfirmDialog, Btn, IconCheck },
setup() {
const confirm = useConfirm();

const confirm1 = () => {
confirm.require({
message: 'Diese Verkündung befindet sich bereits im System. Möchten Sie die bestehende Verkündung überschreiben? \n' +
'\n' +
'Hinweis: Bereits dokumentierte Änderungen werden ebenfalls überschrieben.',
header: 'Verkündung existiert bereits',
message: 'Diese Verkündung befindet',
icon: undefined,
acceptProps: {
label: 'Abbrechen'
},
Expand All @@ -38,7 +35,11 @@ export const Default: Story = {
return { args, confirm1 };
},
template: html`
<ConfirmDialog v-bind="args"/>
<ConfirmDialog v-bind="args">
<template #icon>
<IconCheck/>
</template>
</ConfirmDialog>
<Btn @click="confirm1()" label="Save"/>
`,
}),
Expand Down
8 changes: 4 additions & 4 deletions src/primevue/confirmDialog/confirmDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ const confirmDialog: ConfirmDialogPassThroughOptions = {
};
},

icon: ({}) => {
const base = tw`text-2xl`;
title: ({}) => {
const base = tw`ris-label1-bold`;
return {
class: {
[base]: true,
},
};
},

title: ({}) => {
const base = tw`font-bold text-lg`;
icons: ({}) => {
const base = tw`text-2xl`;
return {
class: {
[base]: true,
Expand Down

0 comments on commit 3220aa2

Please sign in to comment.