All Projects → Devrax → v-cupertino

Devrax / v-cupertino

Licence: MIT license
A Vue 3 Wrapper for Cupertino Pane Library

Programming Languages

Vue
7211 projects
HTML
75241 projects
typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to v-cupertino

ionic-vue-mobile-template-03
Hybrid app template built with vue, ionic and capacitor.
Stars: ✭ 62 (+264.71%)
Mutual labels:  cordova, ionic, capacitor, ionic-vue
ionic-vue-mobile-template-01
Hybrid app template built with vue, ionic and capacitor.
Stars: ✭ 47 (+176.47%)
Mutual labels:  ionic, capacitor, ionic-vue
Cupertino Pane
🎉📱Multi-functional panes and boards for next generation progressive applications
Stars: ✭ 267 (+1470.59%)
Mutual labels:  cordova, ionic, touch
Capacitor
Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
Stars: ✭ 6,598 (+38711.76%)
Mutual labels:  cordova, ionic, capacitor
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+170.59%)
Mutual labels:  cordova, ionic, capacitor
capacitor-rate-app
Let users rate your app using native review app dialog for both Android and iOS.
Stars: ✭ 88 (+417.65%)
Mutual labels:  cordova, ionic, capacitor
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (+11.76%)
Mutual labels:  cordova, ionic
gestures
A library for normalized events and gesture for desktop and mobile.
Stars: ✭ 31 (+82.35%)
Mutual labels:  touch, swipe-gestures
angular-cordova
Angular wrapper for Cordova
Stars: ✭ 21 (+23.53%)
Mutual labels:  cordova, ionic
FhemNative
Cross Platform FHEM-HomeAutomation Frontend
Stars: ✭ 14 (-17.65%)
Mutual labels:  ionic, capacitor
ionic4-angular7-example
Ionic 4, Angular 7 and Cordova Tutorial: Build CRUD Mobile Apps
Stars: ✭ 57 (+235.29%)
Mutual labels:  cordova, ionic
mobile-messaging-cordova-plugin
Mobile Messaging SDK plugin for Cordova projects
Stars: ✭ 19 (+11.76%)
Mutual labels:  cordova, ionic
ionic-3-video-calling-using-webrtc
This is demo code of how to implement video calling in ionic 3 using webrtc
Stars: ✭ 58 (+241.18%)
Mutual labels:  cordova, ionic
cordova-plugin-amap
Amap Maps plugin for Cordova
Stars: ✭ 51 (+200%)
Mutual labels:  cordova, ionic
ionic4-boilerplate
🚀 boilerplate for ionic4 with CI based on travis and fastlane. doc and example are provided
Stars: ✭ 25 (+47.06%)
Mutual labels:  cordova, ionic
ionic3-angular4-sample-app
Sample app of Ionic 3 and Angular 4
Stars: ✭ 35 (+105.88%)
Mutual labels:  cordova, ionic
ellenorzo
Arisztokréta: Nem hivatalos KRÉTA-kompatibilis ellenőrző alkalmazás
Stars: ✭ 17 (+0%)
Mutual labels:  cordova, ionic
IonicMadrid
Charlas Ionic Madrid
Stars: ✭ 14 (-17.65%)
Mutual labels:  ionic, capacitor
larasar
Laravel + Quasar Framework
Stars: ✭ 77 (+352.94%)
Mutual labels:  cordova, capacitor
travis-ci-ionic-yml
An example configuration of Ionic/cordova + NPM + AngularJS + Android continuous integration setup on Travis CI
Stars: ✭ 21 (+23.53%)
Mutual labels:  cordova, ionic

Cupertino Pane for Vue 3

Notes: if your are looking for vue 2 repo here Cupertino-Pane for vue 2

Installation

Actually kinda easy

  npm i -D v-cupertino

How works

Example

Example

Slot

The component just have one simple slot where you can easily put one or multiple components (by wrapping it in a template or wrap element like a div), doesn't have any special v-slots, any component or html element used will fallback into v-slot:default.

  <template>
    <v-cupertino>
      <div>Hola mundo!<div>
      <div>Adiós mundo cruel!</div>
    <v-cupertino>
  </template>

  <script lang="ts">
    import { defineComponent } from "vue";
    import VCupertino from "v-cupertino";

    export default defineComponent({
      name: "App",
      components: {
        VCupertino
      }
    })
  </script>


Props

props type example comments
:drawerOptions ( optional ) CupertinoSettings <v-cupertino :drawerOptions="yourSettingsObject"> The same as the Cupertinos Options; constraints you cannot override cupertino's callbacks even if you specified in the CupertinoSettings' Object
:entryAnimation ( optional ) Boolean <v-cupertino :entryAnimation="Boolean"> Whether the drawer should present, destroy or hide with a smooth animation
:entryComponent ( optional ) Component <v-cupertino :entryComponent="Component"> The component itself use slots, but I think it would be faster to toggle between component from scripts instead of using v-if also components remember their state because are wrapped by <keep-alive> tag
:isPresent Boolean <v-cupertino :entryComponent="Component"> Whether the component should be present or hide, when initialize; default: true
:id Number | String <v-cupertino :id="2"> If you have multiples v-cupertino components in the same app that might be working in the same time could crash the library cupertino-pane due that all of them are using the same selector class to create a new pane, using custom id, will allow you to use multiples v-cupertino components as much as you want


Events

Note: Are the same hooks as the Cupertino pane but instead of camelCase are kebak-case and without the prefix on: @will-dismiss, @backdrop-tap...

events return comments
@did-dismiss () => void
@will-dismiss () => void
@did-present () => cupertinoInstance Returns: the cupertino instance inside the component when the drawer is already visible, this is useful when you need to have access to the instance once is visible
@will-present () => cupertinoInstance Returns: the cupertino instance inside the component when the drawer will be visible, this is useful when you need to have access to the instance before is visible
@drag-start () => number Returns: the property y from the method getBoundingClientRect() that belongs to the DOMRect
@drag () => number Returns: the property y from the method getBoundingClientRect() that belongs to the DOMRect
@drag-end () => number Returns: the property y from the method getBoundingClientRect() that belongs to the DOMRect
@backdrop-tap () => void
@transition-start () => void
@transition-end () => void


How to get access to the public method from the Cupertino Instance inside the component <v-cupertino />

There are actually three ways to get the instance from <v-cupertino /> component from its parent container:

  • refs
  • From the instance returned by @did-present event
  • From the instance returned by @will-present event

Getting the instance with refs

ref

Sample code

<template>
  <v-cupertino ref="cupertinoRef">
    <div>Hola mundo!<div>
  <v-cupertino>
</template>

<script lang="ts">
  import { CupertinoPane } from "cupertino-pane";
  import { defineComponent, onMounted, ref, Ref } from "vue";
  import VCupertino from "./components/VCupertino.vue";

  export default defineComponent({
    name: "App",
    components: {
      VCupertino,
    },
    setup() {
      const cupertinoRef: Ref<typeof VCupertino> = ref(VCupertino);

      onMounted(() => {
        const cupertino = cupertinoRef.value.cupertino as CupertinoPane;
        cupertino.setDarkMode({ enable: true });
        console.log(cupertino);
      });

      return {
        cupertinoRef,
      };
    },
  });
</script>

Getting the instance from @did-present or @will-present event

ref

Sample code

<template>
  <v-cupertino @did-present="hook">
    <div>Hola mundo!<div>
  <v-cupertino>
</template>

<script lang="ts">
  import { CupertinoPane } from "cupertino-pane";
  import { defineComponent, onMounted, ref, Ref } from "vue";
  import VCupertino from "./components/VCupertino.vue";

  export default defineComponent({
    name: "App",
    components: {
      VCupertino,
    },
    setup() {
      const hook = ({ value }: Ref<CupertinoPane>) => {
        console.log(value);
      }

      return {
        hook,
      };
    },
  });
</script>


Using public methods

Here an overview of all the public methods

Using the refs example to access public methods

import { CupertinoPane } from "cupertino-pane";
import { defineComponent, onMounted, ref, Ref } from "vue";
import VCupertino from "./components/VCupertino.vue";

export default defineComponent({
  name: "App",
  components: {
    VCupertino,
  },
  setup() {
    const cupertinoRef: Ref<typeof VCupertino> = ref(VCupertino);

    onMounted(() => {
      const cupertino = cupertinoRef.value.cupertino as CupertinoPane;
      cupertino.setDarkMode({ enable: Boolean }); // param: 
      cupertino.moveToBreak(String); // Will change pane position with animation to selected breakpoint. param: required('top' | 'middle' | 'bottom')
      cupertino.moveToHeight(Number); // Will move pane to exact height with animation. Breakpoints will saved. param: required
      cupertino.hide(); // Dissappear pane from screen, still keep pane in DOM.
      cupertino.present({ animated: Boolean }); // Will render pane DOM and show pane with setted params. param: optional
      cupertino.destroy({ animated: Boolean }); // Remove pane from DOM and clear styles
      // to check more public methods to *overview* that is above
    });

    return {
      cupertinoRef,
    };
  },
});


Notes: In case you need more information about the library, remember that this is only a wrapper, for more information go to the oficial Cupertino Pane library.



License

Licensed under the MIT License. View original LICENSE Project's LICENSE

Lol, that's all, thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].