Skip to content

Commit

Permalink
refactor(programmatic): cleanup useProgrammatic composable (#833)
Browse files Browse the repository at this point in the history
* cleanup `useProgrammatic` composable

* update `useClickOutside` and `useEventListener` composables

* remove unnecessary `onCancel` prop from loading, modal, notification, sidebar component
  • Loading branch information
mlmoravek committed Jun 6, 2024
1 parent cda731d commit c509666
Show file tree
Hide file tree
Showing 19 changed files with 453 additions and 411 deletions.
27 changes: 13 additions & 14 deletions packages/docs/components/Loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,19 @@ title: Loading

### Props

| Prop name | Description | Type | Values | Default |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| active | Whether loading is active or not, use v-model:active to make it two-way binding. | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| animation | Custom animation (transition name) | string | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;animation: "fade"<br>}</code> |
| cancelable | Is Loading cancable by pressing escape or clicking outside. | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| container | DOM element where the loading component will be created on (for programmatic usage).<br/>Note that this also changes fullPage to false. | string \| HTMLElement | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;container: "body"<br>}</code> |
| fullPage | Loader will overlay the full page. | boolean | - | <code style='white-space: nowrap; padding: 0;'>true</code> |
| icon | Icon name to show, unnecessary when default slot is used. | string | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;icon: "loading"<br>}</code> |
| iconSize | Icon size | string | `small`, `medium`, `large` | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;iconSize: "medium"<br>}</code> |
| iconSpin | Enable spin effect on icon | boolean | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;iconSpin: true<br>}</code> |
| label | Notification label, unnecessary when default slot is used. | string | - | |
| onCancel | Callback function to call after user canceled (pressed escape / clicked outside). | () =&gt; void | - | Default function (see source code) |
| onClose | Callback function to call after close (programmatically close or user canceled). | () =&gt; void | - | Default function (see source code) |
| override | Override existing theme classes completely | boolean | - | |
| Prop name | Description | Type | Values | Default |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| active | Whether loading is active or not, use v-model:active to make it two-way binding. | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| animation | Custom animation (transition name) | string | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;animation: "fade"<br>}</code> |
| cancelable | Is Loading cancable by pressing escape or clicking outside. | boolean | - | <code style='white-space: nowrap; padding: 0;'>false</code> |
| container | DOM element where the loading component will be created on (for programmatic usage).<br/>Note that this also changes fullPage to false. | string \| HTMLElement \| null | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;container: "body"<br>}</code> |
| fullPage | Loader will overlay the full page. | boolean | - | <code style='white-space: nowrap; padding: 0;'>true</code> |
| icon | Icon name to show, unnecessary when default slot is used. | string | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;icon: "loading"<br>}</code> |
| iconSize | Icon size | string | `small`, `medium`, `large` | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;iconSize: "medium"<br>}</code> |
| iconSpin | Enable spin effect on icon | boolean | - | <div><small>From <b>config</b>:</small></div><code style='white-space: nowrap; padding: 0;'>loading: {<br>&nbsp;&nbsp;iconSpin: true<br>}</code> |
| label | Notification label, unnecessary when default slot is used. | string | - | |
| onClose | Callback function to call on close (programmatically close or user canceled). | () =&gt; void | - | Default function (see source code) |
| override | Override existing theme classes completely | boolean | - | |

### Events

Expand Down
Loading

0 comments on commit c509666

Please sign in to comment.