Action Panel

Elsio SanchezAbout 3 minComponentMoleculeActionPanelMoleculeComponent

It is a panel with 3 general actions. Option:

Close Check Cleared.

Clear Action

This Action is used to delete or clear the content of the panel

Viwer Source

Code

```vue
<template>
  <el-input v-model="input" placeholder="Please input" />
  <molecula-ActionPanel
    :showClear="true"
    :showClose="false"
    :showCheck="false"
    :actionClear="handleClear"
  />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
const handleClear = () => {
  input.value = ''
}
</script>

```

:::

Close Action

This action is used to Close.

Viwer Source

Code

```vue
<template>
  <el-popover
    :visible="visible"
    trigger="click"
    placement="top"
    :width="460"
  >
    <el-input v-model="input" placeholder="Please input" />
    <molecula-ActionPanel
      :showClear="true"
      :showClose="true"
      :showCheck="false"
      :actionClear="handleClear"
      :actionClose="handleClose"
    />
    <el-button #reference @click="visible = true">Click to activate</el-button>
  </el-popover>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
const visible = ref(false)
const handleClear = () => {
  input.value = ''
}
const handleClose = () => {
  visible.value = false
}
</script>

```

:::

Check Action

This action is used to Close.

Viwer Source

Code

```
<template>
  <el-popover
    :visible="visible"
    trigger="click"
    placement="top"
    :width="460"
  >
    <el-input v-model="input" placeholder="Please input" />
    <molecula-ActionPanel
      :showClear="true"
      :showClose="true"
      :showCheck="true"
      :actionClear="handleClear"
      :actionClose="handleClose"
      :actionCheck="handleDone"
    >
    </molecula-ActionPanel>
    <el-button #reference @click="visible = true">
      !hello! {{ world }}
    </el-button>
  </el-popover>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
const world = ref('')
const visible = ref(false)
const handleClear = () => {
  input.value = ''
}
const handleClose = () => {
  visible.value = false
}
const handleDone = () => {
  handleClose()
  world.value = input.value
}

```

:::

Slots Action

Add Custom Content to the Left or Right of the Action Panel Button.

Viwer Source

Code

```
<template>
  <el-popover
    :visible="visible"
    trigger="click"
    placement="top"
    :width="460"
  >
    <el-input v-model="input" placeholder="Please input" /> {{ world }}
    <molecula-ActionPanel
      :showClear="true"
      :showClose="true"
      :showCheck="true"
      :actionClear="handleClear"
      :actionClose="handleClose"
      :actionCheck="handleDone"
    >
      <template v-slot:slotsLeft>
        <el-button type="success" :icon="Refresh" @click="handleRefresh" />
      </template>
    </molecula-ActionPanel>
    <el-button #reference @click="visible = true">
      !hello! {{ world }}
    </el-button>
  </el-popover>
</template>
<script lang="ts" setup>
import {
  Refresh
} from '@element-plus/icons-vue'
import { ref } from 'vue'
const input = ref('')
const world = ref('')
const visible = ref(false)
const handleClear = () => {
  input.value = ''
}
const handleClose = () => {
  visible.value = false
}
const handleDone = () => {
  handleClose()
  world.value = input.value
}
const handleRefresh = () => {
  world.value = input.value
}

```

:::

Props

NameDescriptionTypeMandatory
showClearThis property allows to display the Clear button.BooleanTrue
showCloseThis property allows to display the Close button.BooleanTrue
showCheckThis property allows to display the Check button.BooleanTrue
actionClearMethod or Function that is triggered when clicking on the Clear Button.FunctionTrue
actionCloseMethod or Function that is triggered when clicking on the Close Button.FunctionTrue
actionCheckMethod or Function that is triggered when clicking on the Check Button.FunctionTrue

Attributes

NameDescriptionTypeDefault
disabledClearDisable the Button ClearBooleanFalse
disabledCloseDisable the Button CloseBooleanFalse
disabledCheckDisable the Button CheckBooleanFalse
textAlingPosition where the buttons are displayedStringRight
slotsLeftAdd Custom Content to the Left of the Button PanelString────────────
slotsRightAdd Custom Content to the Right of the Button PanelString────────────
slotsAlingLeftPosition of the Custom Content to the Left of the Button PanelString────────────
slotsAlingRightPosition of the Custom Content to the Right of the Button PanelString────────────

Events

NameDescriptionType
actionClearMethod or Function that is triggered when clicking on the Clear Button.Function
actionCloseMethod or Function that is triggered when clicking on the Close Button.Function
actionCheckMethod or Function that is triggered when clicking on the Check Button.Function

Example for Developer

Open in StackBlitzopen in new window
Open in StackBlitz

Directory

└─ src                                            # Main source code.
    └── Components                                # Global components
            └── Atoms                             # Atom components
            └── Moleculas                         # Moleculas components
                └── ActionPanel                   # Molecule Action Panel specific components.