second commit

This commit is contained in:
2024-12-27 22:31:23 +09:00
parent 2353324570
commit 10a0f110ca
8819 changed files with 1307198 additions and 28 deletions

21
node_modules/flowbite/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Bergside Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

844
node_modules/flowbite/README.md generated vendored Normal file
View File

@ -0,0 +1,844 @@
<p>
<a href="https://flowbite.com" >
<img alt="Flowbite - Tailwind CSS components" width="350" src="https://flowbite.s3.amazonaws.com/github/logo-github.png">
</a><br>
Build websites even faster with components on top of Tailwind CSS
</p>
<p>
<a href="https://discord.com/invite/4eeurUVvTy"><img src="https://img.shields.io/discord/902911619032576090?color=%237289da&label=Discord" alt="Discord"></a>
<a href="https://www.npmjs.com/package/flowbite"><img src="https://img.shields.io/npm/dt/flowbite.svg" alt="Total Downloads"></a>
<a href="https://github.com/themesberg/flowbite/releases"><img src="https://img.shields.io/npm/v/flowbite.svg" alt="Latest Release"></a>
<a href="https://flowbite.com/docs/getting-started/license/"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
</p>
------
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Documentation](#documentation)
- [Getting started](#getting-started)
- [Install using NPM](#install-using-npm)
- [Include via CDN](#include-via-cdn)
- [Bundled JavaScript](#bundled-javascript)
- [Data attributes](#data-attributes)
- [Init functions](#init-functions)
- [ESM and CJS](#esm-and-cjs)
- [TypeScript](#typescript)
- [RTL support](#rtl-support)
- [JavaScript Frameworks](#javascript-frameworks)
- [Back-end Frameworks](#back-end-frameworks)
- [Components](#components)
- [Figma Design System](#figma-design-system)
- [Flowbite Blocks](#flowbite-blocks)
- [Flowbite Icons](#flowbite-icons)
- [Flowbite GPT](#flowbite-gpt)
- [Pro version](#pro-version)
- [Hire us](#hire-us)
- [Learn Design Concepts](#learn-design-concepts)
- [Community](#community)
- [Copyright and license](#copyright-and-license)
## Documentation
For full documentation, visit [flowbite.com](https://flowbite.com/).
## Getting started
Flowbite can be included as a plugin into an existing Tailwind CSS project and it is supposed to help you build websites faster by having a set of web components to work with built with the utility classes from Tailwind CSS.
### Install using NPM
Make sure that you have <a href="https://nodejs.org/en/" rel="nofollow" >Node.js</a> and <a href="https://tailwindcss.com/" rel="nofollow" >Tailwind CSS</a> installed.
1. Install Flowbite as a dependency using NPM by running the following command:
```bash
npm install flowbite
```
2. Require Flowbite as a plugin inside the `tailwind.config.js` file:
```javascript
module.exports = {
plugins: [
require('flowbite/plugin')
]
}
```
3. Make sure that you add the template path to the `tailwind.config.js` file:
```javascript
module.exports = {
content: [
"./node_modules/flowbite/**/*.js"
]
}
```
4. Include the main JavaScript file to make interactive elements work:
```html
<script src="../path/to/flowbite/dist/flowbite.js"></script>
```
### Include via CDN
The quickest way to get started working with Flowbite is to simply include the CSS and JavaScript into your project via a CDN service such as UNPKG or CDNJS (content delivery networks).
Require the following minified stylesheet inside the `head` tag:
```html
<link href="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.css" rel="stylesheet" />
```
And include the following javascript file before the end of the `body` tag:
```html
<script src="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.js"></script>
```
### Bundled JavaScript
One of the most popular way of using Flowbite is to include the bundled Javascript file which is UMD ready using a bundler such as Webpack or Parcel which makes sure that all of the data attributes and functionality will work out-of-the-box.
You can directly import the main JavaScript file inside your bundled `app-bundle.js` file like this:
```javascript
import 'flowbite';
```
This file has access to all of the components and it automatically applies event listeners to the data attributes.
### Data attributes
The preferred way to use the interactive UI components from Flowbite is via the data attributes interface which allows us to add functionality via the HTML element attributes and most of the examples on our documentation applies this strategy.
For example, to set up a modal component all you need to do is use `data-modal-target` and `data-modal-{toggle|show|hide}` to toggle, show, or hide the component by clicking on any trigger element.
```html
<button data-modal-target="defaultModal" data-modal-toggle="defaultModal" class="block text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" type="button">
Toggle modal
</button>
<!-- Main modal -->
<div id="defaultModal" tabindex="-1" aria-hidden="true" class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative w-full max-w-2xl max-h-full">
<!-- Modal content -->
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<!-- Modal header -->
<div class="flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white">
Terms of Service
</h3>
<button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white" data-modal-hide="defaultModal">
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<!-- Modal body -->
<div class="p-6 space-y-6">
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
With less than a month to go before the European Union enacts new consumer privacy laws for its citizens, companies around the world are updating their terms of service agreements to comply.
</p>
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
The European Unions General Data Protection Regulation (G.D.P.R.) goes into effect on May 25 and is meant to ensure a common set of data rights in the European Union. It requires organizations to notify users as soon as possible of high-risk data breaches that could personally affect them.
</p>
</div>
<!-- Modal footer -->
<div class="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
<button data-modal-hide="defaultModal" type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">I accept</button>
<button data-modal-hide="defaultModal" type="button" class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">Decline</button>
</div>
</div>
</div>
</div>
```
#### Init functions
You can also use the init functions to set up the event listeners yourself. Here's an example how you can do it with Vue or Nuxt:
```
<script setup>
import { onMounted } from 'vue'
import { initFlowbite } from 'flowbite'
// initialize components based on data attribute selectors
onMounted(() => {
initFlowbite();
})
</script>
<template>
// Modal HTML markup with data attributes from Flowbite
</template>
```
The `initFlowbite` function sets up all of the init functions for dropdowns, modals, navbars, tooltips and so on to hook onto the data attributes. Alternatively, you can also initialise each component category class separately with `initDropdowns` or `initModals`.
You can view more examples by browsing the [components from Flowbite](#components).
### ESM and CJS
Flowbite also offers an API for using the components programmatically and it supports both CJS and ESM for JavaScript which can be helpful if you need to expand the default capabilities of the data attributes interface and get access to function callbacks.
Here's an example how you can import and create a new Modal component inside JavaScript:
```javascript
import { Modal } from 'flowbite'
const $modalElement = document.querySelector('#modalEl');
const modalOptions = {
placement: 'bottom-right',
backdrop: 'dynamic',
backdropClasses: 'bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40',
onHide: () => {
console.log('modal is hidden');
},
onShow: () => {
console.log('modal is shown');
},
onToggle: () => {
console.log('modal has been toggled');
}
}
const modal = new Modal($modalElement, modalOptions);
modal.show();
```
Check out the JavaScript behaviour section of each component's page to learn how you can use this.
### TypeScript
Flowbite supports type declarations for the interactive UI components including object interfaces and parameter types. Check out the following examples to learn how you can use types with Flowbite.
Additionally to our code above, we will now import some relevant types from the Flowbite package, namely the `ModalOptions` and `ModalInterface`:
```javascript
import { Modal } from 'flowbite'
import type { ModalOptions, ModalInterface } from 'flowbite'
// other code
```
Generally speaking, all of the components have an interface definition that you can use whenever you create a new object to make sure that you're using the correct types of parameters and methods.
When creating a new modal you can set the `ModalInterface` as the main type:
```javascript
const modal: ModalInterface = new Modal($modalElement, modalOptions);
```
Flowbite also supports type definitions for the options object so if you want to set the placement of the modal based on types, here's how you would do that:
```javascript
const modalOptions: ModalOptions = {
placement: 'top-right'
}
const modal: ModalInterface = new Modal($modalElement, modalOptions);
```
Learn more about Flowbite and TypeScript in the [quickstart guide](https://flowbite.com/docs/getting-started/typescript/).
### RTL support
All of the Flowbite UI components have native RTL support and you can easily set it up by using the `dir="rtl"` attribute on the HTML element. Read more about Flowbite and [RTL support here](https://flowbite.com/docs/customize/rtl/).
### JavaScript Frameworks
The awesome open-source community also built and currently maintains the following standalone libraries for React, Vue, Svelte, and Angular:
- [🌀 Flowbite React Library](https://github.com/themesberg/flowbite-react)
- [🍀 Flowbite Vue Library](https://github.com/themesberg/flowbite-vue)
- [🎸 Flowbite Svelte Library](https://github.com/themesberg/flowbite-svelte)
- [📕 Flowbite Angular Library](https://github.com/themesberg/flowbite-angular)
We also wrote integration guides for the following front-end frameworks and libraries:
- [📝 Flowbite with React guide](https://flowbite.com/docs/getting-started/react/)
- [📝 Flowbite with Next.js guide](https://flowbite.com/docs/getting-started/next-js/)
- [📝 Flowbite with Remix guide](https://flowbite.com/docs/getting-started/remix/)
- [📝 Flowbite with Vue guide](https://flowbite.com/docs/getting-started/vue/)
- [📝 Flowbite with Nuxt guide](https://flowbite.com/docs/getting-started/nuxt-js/)
- [📝 Flowbite with Svelte guide](https://flowbite.com/docs/getting-started/svelte/)
- [📝 Flowbite with Astro guide](https://flowbite.com/docs/getting-started/astro/)
- [📝 Flowbite with MeteorJS guide](https://flowbite.com/docs/getting-started/meteor-js/)
- [📝 Flowbite with Gatsby guide](https://flowbite.com/docs/getting-started/gatsby/)
- [📝 Flowbite with SolidJS guide](https://flowbite.com/docs/getting-started/solid-js/)
- [📝 Flowbite with Qwik guide](https://flowbite.com/docs/getting-started/qwik/)
### Back-end Frameworks
Flowbite has a great integration with most of the back-end frameworks because it relies on vanilla JavaScript:
- [📚 Using Flowbite with Laravel](https://flowbite.com/docs/getting-started/laravel/)
- [🎼 Using Flowbite with Symfony](https://flowbite.com/docs/getting-started/symfony/)
- [🚊 Using Flowbite with Ruby on Rails 7](https://flowbite.com/docs/getting-started/rails/)
- [🐉 Using Flowbite with Phoenix (Elixir)](https://flowbite.com/docs/getting-started/phoenix/)
- [🐸 Using Flowbite with Django](https://flowbite.com/docs/getting-started/django/)
- [🌶 Using Flowbite with Flask](https://flowbite.com/docs/getting-started/flask/)
## Components
Flowbite is an open source collection of UI components built with the utility classes from Tailwind CSS that you can use as a starting point when coding user interfaces and websites.
<table>
<tr>
<td width="33.3333%">Alerts</td>
<td width="33.3333%">Badge</td>
<td width="33.3333%">Breadcrumbs</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/alerts/">
<img alt="Tailwind CSS Alerts" src="https://flowbite.s3.amazonaws.com/github/alerts.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/badge/">
<img alt="Tailwind CSS Badge" src="https://flowbite.s3.amazonaws.com/github/badge.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/breadcrumb/">
<img alt="Tailwind CSS Breadcrumbs" src="https://flowbite.s3.amazonaws.com/github/breadcrumbs.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Buttons</td>
<td width="33.3333%">Button group</td>
<td width="33.3333%">Cards</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/buttons/">
<img alt="Tailwind CSS Buttons" src="https://flowbite.s3.amazonaws.com/github/buttons.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/button-group/">
<img alt="Tailwind CSS Button Group" src="https://flowbite.s3.amazonaws.com/github/button-group.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/card/">
<img alt="Tailwind CSS Cards" src="https://flowbite.s3.amazonaws.com/github/cards.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Dropdown</td>
<td width="33.3333%">Forms</td>
<td width="33.3333%">List group</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/dropdowns/">
<img alt="Tailwind CSS Dropdown" src="https://flowbite.s3.amazonaws.com/github/dropdown.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/forms/">
<img alt="Tailwind CSS Forms" src="https://flowbite.s3.amazonaws.com/github/forms.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/list-group/">
<img alt="Tailwind CSS List group" src="https://flowbite.s3.amazonaws.com/github/list-group.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Typography</td>
<td width="33.3333%">Modal</td>
<td width="33.3333%">Tabs</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/typography/">
<img alt="Tailwind CSS Typography" src="https://flowbite.s3.amazonaws.com/github/typography.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/modal/">
<img alt="Tailwind CSS Modal" src="https://flowbite.s3.amazonaws.com/github/modal.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/tabs/">
<img alt="Tailwind CSS Tabs" src="https://flowbite.s3.amazonaws.com/github/tabs.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Navbar</td>
<td width="33.3333%">Pagination</td>
<td width="33.3333%">Timeline</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/navbar/">
<img alt="Tailwind CSS Navbar" src="https://flowbite.s3.amazonaws.com/github/navbar.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/pagination/">
<img alt="Tailwind CSS Pagination" src="https://flowbite.s3.amazonaws.com/github/pagination.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/timeline/">
<img alt="Tailwind CSS Timeline" src="https://flowbite.s3.amazonaws.com/github/timeline.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Progress bar</td>
<td width="33.3333%">Tables</td>
<td width="33.3333%">Toast</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/progress/">
<img alt="Tailwind CSS Progress Bar" src="https://flowbite.s3.amazonaws.com/github/progress.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/tables/">
<img alt="Tailwind CSS Tables" src="https://flowbite.s3.amazonaws.com/github/tables.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/toast/">
<img alt="Tailwind CSS Toast" src="https://flowbite.s3.amazonaws.com/github/toast.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Tooltips</td>
<td width="33.3333%">Datepicker</td>
<td width="33.3333%">Spinner</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/tooltips/">
<img alt="Tailwind CSS Tooltips" src="https://flowbite.s3.amazonaws.com/github/tooltips.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/datepicker/">
<img alt="Tailwind CSS Datepicker" src="https://flowbite.s3.amazonaws.com/github/datepicker.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/spinner/">
<img alt="Tailwind CSS Spinner" src="https://flowbite.s3.amazonaws.com/github/spinner.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Footer</td>
<td width="33.3333%">Accordion</td>
<td width="33.3333%">Sidebar</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/footer/">
<img alt="Tailwind CSS Footer" src="https://flowbite.s3.amazonaws.com/github/footer.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/accordion/">
<img alt="Tailwind CSS Accordion" src="https://flowbite.s3.amazonaws.com/github/accordion.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/sidebar/">
<img alt="Tailwind CSS Sidebar" src="https://flowbite.s3.amazonaws.com/github/sidebar.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Carousel</td>
<td width="33.3333%">Avatar</td>
<td width="33.3333%">Rating</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/carousel/">
<img alt="Tailwind CSS Carousel" src="https://flowbite.s3.amazonaws.com/github/carousel.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/avatar/">
<img alt="Tailwind CSS Avatar" src="https://flowbite.s3.amazonaws.com/github/avatar.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/rating/">
<img alt="Tailwind CSS Rating" src="https://flowbite.s3.amazonaws.com/github/rating.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Input Field</td>
<td width="33.3333%">File Input</td>
<td width="33.3333%">Search Input</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/input-field/">
<img alt="Tailwind CSS Input Field" src="https://flowbite.s3.amazonaws.com/github/input-field.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/file-input/">
<img alt="Tailwind CSS File Input" src="https://flowbite.s3.amazonaws.com/github/file-input.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/search-input/">
<img alt="Tailwind CSS Search Input" src="https://flowbite.s3.amazonaws.com/github/search-input.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Select</td>
<td width="33.3333%">Textarea</td>
<td width="33.3333%">Checkbox</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/select/">
<img alt="Tailwind CSS Select" src="https://flowbite.s3.amazonaws.com/github/select.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/textarea/">
<img alt="Tailwind CSS Textarea" src="https://flowbite.s3.amazonaws.com/github/textarea.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/checkbox/">
<img alt="Tailwind CSS Checkbox" src="https://flowbite.s3.amazonaws.com/github/checkbox.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Radio</td>
<td width="33.3333%">Toggle</td>
<td width="33.3333%">Range Slider</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/radio/">
<img alt="Tailwind CSS Radio" src="https://flowbite.s3.amazonaws.com/github/radio.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/toggle/">
<img alt="Tailwind CSS Toggle" src="https://flowbite.s3.amazonaws.com/github/toggle.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/range/">
<img alt="Tailwind CSS Range Slider" src="https://flowbite.s3.amazonaws.com/github/range-slider.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Floating Label</td>
<td width="33.3333%">Mega Menu</td>
<td width="33.3333%">Skeleton</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/floating-label/">
<img alt="Tailwind CSS Floating Label" src="https://flowbite.s3.amazonaws.com/github/floating-label.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/mega-menu/">
<img alt="Tailwind CSS Mega Menu" src="https://flowbite.s3.amazonaws.com/github/mega-menu.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/skeleton/">
<img alt="Tailwind CSS Skeleton" src="https://flowbite.s3.amazonaws.com/github/skeleton.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">KBD (keyboard)</td>
<td width="33.3333%">Drawer (offcanvas)</td>
<td width="33.3333%">Popover</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/kbd/">
<img alt="Tailwind CSS KBD (Keyboard)" src="https://flowbite.s3.amazonaws.com/github/kbd.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/drawer/">
<img alt="Tailwind CSS Drawer (offcanvas)" src="https://flowbite.s3.amazonaws.com/github/drawer.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/popover/">
<img alt="Tailwind CSS Popover" src="https://flowbite.s3.amazonaws.com/github/popover.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Video</td>
<td width="33.3333%">Heading</td>
<td width="33.3333%">Paragraph</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/video/">
<img alt="Tailwind CSS Video" src="https://flowbite.s3.amazonaws.com/github/video.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/headings/">
<img alt="Tailwind CSS Heading" src="https://flowbite.s3.amazonaws.com/github/heading.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/paragraphs/">
<img alt="Tailwind CSS Paragraph" src="https://flowbite.s3.amazonaws.com/github/paragraph.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Blockquote</td>
<td width="33.3333%">Image</td>
<td width="33.3333%">List</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/blockquote/">
<img alt="Tailwind CSS Blockquote" src="https://flowbite.s3.amazonaws.com/github/blockquote.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/images/">
<img alt="Tailwind CSS Image" src="https://flowbite.s3.amazonaws.com/github/image.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/lists/">
<img alt="Tailwind CSS List" src="https://flowbite.s3.amazonaws.com/github/list.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Link</td>
<td width="33.3333%">Text</td>
<td width="33.3333%">Horizontal line (HR)</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/links/">
<img alt="Tailwind CSS Link" src="https://flowbite.s3.amazonaws.com/github/link.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/text/">
<img alt="Tailwind CSS Text" src="https://flowbite.s3.amazonaws.com/github/text.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/typography/hr/">
<img alt="Tailwind CSS HR" src="https://flowbite.s3.amazonaws.com/github/hr.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Speed Dial</td>
<td width="33.3333%">Stepper</td>
<td width="33.3333%">Indicators</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/speed-dial/">
<img alt="Tailwind CSS Speed Dial" src="https://flowbite.s3.amazonaws.com/github/dial.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/stepper/">
<img alt="Tailwind CSS Stepper" src="https://flowbite.s3.amazonaws.com/github/stepper.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/indicators/">
<img alt="Tailwind CSS Indicators" src="https://flowbite.s3.amazonaws.com/github/indicators.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Bottom Navigation</td>
<td width="33.3333%">Sticky Banner</td>
<td width="33.3333%">Gallery (Masonry)</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/bottom-navigation/">
<img alt="Tailwind CSS Bottom Navigation Bar" src="https://flowbite.s3.amazonaws.com/github/bottom-bar.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/banner/">
<img alt="Tailwind CSS Bottom Sticky Banner" src="https://flowbite.s3.amazonaws.com/github/banner.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/gallery/">
<img alt="Tailwind CSS Image Gallery (Masonry)" src="https://flowbite.s3.amazonaws.com/github/gallery.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Jumbotron</td>
<td width="33.3333%">Device mockups</td>
<td width="33.3333%">Charts</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/jumbotron/">
<img alt="Tailwind CSS Jumbotron" src="https://flowbite.s3.amazonaws.com/github/jumbotron.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/device-mockups/">
<img alt="Tailwind CSS Device Mockups" src="https://flowbite.s3.amazonaws.com/github/device-mockups.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/plugins/charts/">
<img alt="Tailwind CSS Charts" src="https://flowbite.s3.amazonaws.com/github/charts.jpg">
</a>
</td>
</tr>
<tr>
<td width="33.3333%">Number Input</td>
<td width="33.3333%">Phone Input</td>
<td width="33.3333%">Chat Bubble</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/number-input/">
<img alt="Tailwind CSS Number Input" src="https://flowbite.s3.amazonaws.com/github/number-input.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/phone-input/">
<img alt="Tailwind CSS Phone Input" src="https://flowbite.s3.amazonaws.com/github/phone-input.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/chat-bubble/">
<img alt="Tailwind CSS Chat Bubble" src="https://flowbite.s3.amazonaws.com/github/chat-bubble.jpg">
</a>
</td>
</tr>
</tr>
<tr>
<td width="33.3333%">Copy to Clipboard</td>
<td width="33.3333%">Timepicker</td>
<td width="33.3333%">DataTables</td>
</tr>
<tr>
<td width="33.3333%">
<a href="https://flowbite.com/docs/components/clipboard/">
<img alt="Tailwind CSS Clipboard" src="https://flowbite.s3.amazonaws.com/github/clipboard.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/forms/timepicker/">
<img alt="Tailwind CSS Timepicker" src="https://flowbite.s3.amazonaws.com/github/timepicker.jpg">
</a>
</td>
<td width="33.3333%">
<a href="https://flowbite.com/docs/plugins/datatables/">
<img alt="Tailwind CSS DataTables" src="https://flowbite.s3.amazonaws.com/github/datatables.jpg">
</a>
</td>
</tr>
</table>
## Figma Design System
If you need the Figma files for the components you can check out our website for more information:
🎨 [Get access to the Figma design files](https://flowbite.com/figma/)
## Flowbite Blocks
Check out Flowbite Blocks to get access to over 400+ website sections coded in Tailwind CSS and Flowbite:
📦 [Check out Flowbite Blocks](https://flowbite.com/blocks/)
## Flowbite Icons
Start using over 450+ free and open-source collection of solid and outline SVG icons built for Tailwind CSS and with support for Figma and JSX (React):
🔍 [Check out the icons](https://flowbite.com/icons/)
## Flowbite GPT
We've developed a custom trained ChatGPT model that you can use to generate website sections and pages based on the resources from Flowbite and Tailwind CSS.
🤖 [Generate with Flowbite GPT](https://chat.openai.com/g/g-y7yC35HB9-flowbite-gpt)
## Pro version
Get access to all premium features including the Figma design system, access to all Flowbite Block sections and a dashboard UI interface:
💎 [Check out Flowbite Pro](https://flowbite.com/pro/)
## Hire us
If you're ready to take your application to the next level you can work with us on your project with developers who have been using Flowbite and Tailwind CSS.
🙋‍♂️ [Work with us](https://flowbite.com/work-with-us/)
## Learn Design Concepts
If you want to create even better Flowbite pages, learn design fundamentals from Teach Me Design - Enhance UI, a book that covers color theory, typography, UI and UX so you can make the most to implement the Flowbite Ecosystem!
📖 [Learn with Enhance UI](https://www.enhanceui.com/?ref=flowbite-github)
## Community
If you need help or just want to discuss about the library join the community on Github:
⌨️ [Discuss about Flowbite on GitHub](https://github.com/themesberg/flowbite/discussions)
For casual chatting with others using the library:
💬 [Join the Flowbite Discord Server](https://discord.gg/4eeurUVvTy)
Video tutorials and presentations using Flowbite:
🎥 [Subscribe to our YouTube channel](https://www.youtube.com/channel/UC_Ms4V2kYDsh7F_CSsHyQ6A)
## Copyright and license
The Flowbite name and logos are trademarks of Bergside Inc.
- 📝 [Read about the licensing terms](https://flowbite.com/docs/getting-started/license/)
- 📀 [Brand guideline and trademark usage agreement](https://flowbite.com/brand/)

9555
node_modules/flowbite/dist/flowbite.css generated vendored Normal file

File diff suppressed because it is too large Load Diff

8542
node_modules/flowbite/dist/flowbite.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/flowbite/dist/flowbite.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/flowbite/dist/flowbite.min.css generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/flowbite/dist/flowbite.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/flowbite/dist/flowbite.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

8549
node_modules/flowbite/dist/flowbite.phoenix.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/flowbite/dist/flowbite.phoenix.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/flowbite/dist/flowbite.phoenix.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8533
node_modules/flowbite/dist/flowbite.turbo.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/flowbite/dist/flowbite.turbo.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/flowbite/dist/flowbite.turbo.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/flowbite/dist/flowbite.turbo.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,26 @@
import type { AccordionItem, AccordionOptions } from './types';
import type { InstanceOptions } from '../../dom/types';
import { AccordionInterface } from './interface';
declare class Accordion implements AccordionInterface {
_instanceId: string;
_accordionEl: HTMLElement;
_items: AccordionItem[];
_options: AccordionOptions;
_clickHandler: EventListenerOrEventListenerObject;
_initialized: boolean;
constructor(accordionEl?: HTMLElement | null, items?: AccordionItem[], options?: AccordionOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
getItem(id: string): AccordionItem;
open(id: string): void;
toggle(id: string): void;
close(id: string): void;
updateOnOpen(callback: () => void): void;
updateOnClose(callback: () => void): void;
updateOnToggle(callback: () => void): void;
}
export declare function initAccordions(): void;
export default Accordion;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAiBjD,cAAM,SAAU,YAAW,kBAAkB;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,aAAa,EAAE,kCAAkC,CAAC;IAClD,YAAY,EAAE,OAAO,CAAC;gBAGlB,WAAW,GAAE,WAAW,GAAG,IAAW,EACtC,KAAK,GAAE,aAAa,EAAO,EAC3B,OAAO,GAAE,gBAA0B,EACnC,eAAe,GAAE,eAAwC;IAkB7D,IAAI;IAqBJ,OAAO;IAYP,cAAc;IAId,wBAAwB;IAKxB,OAAO,CAAC,EAAE,EAAE,MAAM;IAIlB,IAAI,CAAC,EAAE,EAAE,MAAM;IA2Cf,MAAM,CAAC,EAAE,EAAE,MAAM;IAajB,KAAK,CAAC,EAAE,EAAE,MAAM;IAsBhB,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,aAAa,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIlC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGtC;AAED,wBAAgB,cAAc,SA2C7B;AAOD,eAAe,SAAS,CAAC"}

View File

@ -0,0 +1,194 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initAccordions = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
alwaysOpen: false,
activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',
inactiveClasses: 'text-gray-500 dark:text-gray-400',
onOpen: function () { },
onClose: function () { },
onToggle: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Accordion = /** @class */ (function () {
function Accordion(accordionEl, items, options, instanceOptions) {
if (accordionEl === void 0) { accordionEl = null; }
if (items === void 0) { items = []; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: accordionEl.id;
this._accordionEl = accordionEl;
this._items = items;
this._options = __assign(__assign({}, Default), options);
this._initialized = false;
this.init();
instances_1.default.addInstance('Accordion', this, this._instanceId, instanceOptions.override);
}
Accordion.prototype.init = function () {
var _this = this;
if (this._items.length && !this._initialized) {
// show accordion item based on click
this._items.forEach(function (item) {
if (item.active) {
_this.open(item.id);
}
var clickHandler = function () {
_this.toggle(item.id);
};
item.triggerEl.addEventListener('click', clickHandler);
// Store the clickHandler in a property of the item for removal later
item.clickHandler = clickHandler;
});
this._initialized = true;
}
};
Accordion.prototype.destroy = function () {
if (this._items.length && this._initialized) {
this._items.forEach(function (item) {
item.triggerEl.removeEventListener('click', item.clickHandler);
// Clean up by deleting the clickHandler property from the item
delete item.clickHandler;
});
this._initialized = false;
}
};
Accordion.prototype.removeInstance = function () {
instances_1.default.removeInstance('Accordion', this._instanceId);
};
Accordion.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Accordion.prototype.getItem = function (id) {
return this._items.filter(function (item) { return item.id === id; })[0];
};
Accordion.prototype.open = function (id) {
var _a, _b;
var _this = this;
var item = this.getItem(id);
// don't hide other accordions if always open
if (!this._options.alwaysOpen) {
this._items.map(function (i) {
var _a, _b;
if (i !== item) {
(_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' '));
(_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' '));
i.targetEl.classList.add('hidden');
i.triggerEl.setAttribute('aria-expanded', 'false');
i.active = false;
// rotate icon if set
if (i.iconEl) {
i.iconEl.classList.add('rotate-180');
}
}
});
}
// show active item
(_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' '));
(_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' '));
item.triggerEl.setAttribute('aria-expanded', 'true');
item.targetEl.classList.remove('hidden');
item.active = true;
// rotate icon if set
if (item.iconEl) {
item.iconEl.classList.remove('rotate-180');
}
// callback function
this._options.onOpen(this, item);
};
Accordion.prototype.toggle = function (id) {
var item = this.getItem(id);
if (item.active) {
this.close(id);
}
else {
this.open(id);
}
// callback function
this._options.onToggle(this, item);
};
Accordion.prototype.close = function (id) {
var _a, _b;
var item = this.getItem(id);
(_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' '));
(_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' '));
item.targetEl.classList.add('hidden');
item.triggerEl.setAttribute('aria-expanded', 'false');
item.active = false;
// rotate icon if set
if (item.iconEl) {
item.iconEl.classList.add('rotate-180');
}
// callback function
this._options.onClose(this, item);
};
Accordion.prototype.updateOnOpen = function (callback) {
this._options.onOpen = callback;
};
Accordion.prototype.updateOnClose = function (callback) {
this._options.onClose = callback;
};
Accordion.prototype.updateOnToggle = function (callback) {
this._options.onToggle = callback;
};
return Accordion;
}());
function initAccordions() {
document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) {
var alwaysOpen = $accordionEl.getAttribute('data-accordion');
var activeClasses = $accordionEl.getAttribute('data-active-classes');
var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes');
var items = [];
$accordionEl
.querySelectorAll('[data-accordion-target]')
.forEach(function ($triggerEl) {
// Consider only items that directly belong to $accordionEl
// (to make nested accordions work).
if ($triggerEl.closest('[data-accordion]') === $accordionEl) {
var item = {
id: $triggerEl.getAttribute('data-accordion-target'),
triggerEl: $triggerEl,
targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')),
iconEl: $triggerEl.querySelector('[data-accordion-icon]'),
active: $triggerEl.getAttribute('aria-expanded') === 'true'
? true
: false,
};
items.push(item);
}
});
new Accordion($accordionEl, items, {
alwaysOpen: alwaysOpen === 'open' ? true : false,
activeClasses: activeClasses
? activeClasses
: Default.activeClasses,
inactiveClasses: inactiveClasses
? inactiveClasses
: Default.inactiveClasses,
});
});
}
exports.initAccordions = initAccordions;
if (typeof window !== 'undefined') {
window.Accordion = Accordion;
window.initAccordions = initAccordions;
}
exports.default = Accordion;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,13 @@
import { AccordionItem, AccordionOptions } from './types';
export declare interface AccordionInterface {
_items: AccordionItem[];
_options: AccordionOptions;
getItem(id: string): AccordionItem | undefined;
open(id: string): void;
toggle(id: string): void;
close(id: string): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACvC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAC/C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,18 @@
import { AccordionInterface } from './interface';
export declare type AccordionItem = {
id: string;
triggerEl: HTMLElement;
targetEl: HTMLElement;
iconEl?: HTMLElement | null;
active?: boolean;
clickHandler?: EventListenerOrEventListenerObject;
};
export declare type AccordionOptions = {
alwaysOpen?: boolean;
activeClasses?: string;
inactiveClasses?: string;
onOpen?: (accordion: AccordionInterface, item: AccordionItem) => void;
onClose?: (accordion: AccordionInterface, item: AccordionItem) => void;
onToggle?: (accordion: AccordionInterface, item: AccordionItem) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,kCAAkC,CAAC;CACrD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3E,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,64 @@
import type { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types';
import type { InstanceOptions } from '../../dom/types';
import { CarouselInterface } from './interface';
declare class Carousel implements CarouselInterface {
_instanceId: string;
_carouselEl: HTMLElement;
_items: CarouselItem[];
_indicators: IndicatorItem[];
_activeItem: CarouselItem;
_intervalDuration: number;
_intervalInstance: number;
_options: CarouselOptions;
_initialized: boolean;
constructor(carouselEl?: HTMLElement | null, items?: CarouselItem[], options?: CarouselOptions, instanceOptions?: InstanceOptions);
/**
* initialize carousel and items based on active one
*/
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
getItem(position: number): CarouselItem;
/**
* Slide to the element based on id
* @param {*} position
*/
slideTo(position: number): void;
/**
* Based on the currently active item it will go to the next position
*/
next(): void;
/**
* Based on the currently active item it will go to the previous position
*/
prev(): void;
/**
* This method applies the transform classes based on the left, middle, and right rotation carousel items
* @param {*} rotationItems
*/
_rotate(rotationItems: RotationItems): void;
/**
* Set an interval to cycle through the carousel items
*/
cycle(): void;
/**
* Clears the cycling interval
*/
pause(): void;
/**
* Get the currently active item
*/
getActiveItem(): CarouselItem;
/**
* Set the currently active item and data attribute
* @param {*} position
*/
_setActiveItem(item: CarouselItem): void;
updateOnNext(callback: () => void): void;
updateOnPrev(callback: () => void): void;
updateOnChange(callback: () => void): void;
}
export declare function initCarousels(): void;
export default Carousel;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAsBhD,cAAM,QAAS,YAAW,iBAAiB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;gBAGlB,UAAU,GAAE,WAAW,GAAG,IAAW,EACrC,KAAK,GAAE,YAAY,EAAO,EAC1B,OAAO,GAAE,eAAyB,EAClC,eAAe,GAAE,eAAwC;IA0B7D;;OAEG;IACH,IAAI;IA4BJ,OAAO;IAMP,cAAc;IAId,wBAAwB;IAKxB,OAAO,CAAC,QAAQ,EAAE,MAAM;IAIxB;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM;IAuBxB;;OAEG;IACH,IAAI;IAiBJ;;OAEG;IACH,IAAI;IAiBJ;;;OAGG;IACH,OAAO,CAAC,aAAa,EAAE,aAAa;IAmDpC;;OAEG;IACH,KAAK;IAQL;;OAEG;IACH,KAAK;IAIL;;OAEG;IACH,aAAa;IAIb;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,YAAY;IAyBjC,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGtC;AAED,wBAAgB,aAAa,SA0E5B;AAOD,eAAe,QAAQ,CAAC"}

View File

@ -0,0 +1,289 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initCarousels = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
defaultPosition: 0,
indicators: {
items: [],
activeClasses: 'bg-white dark:bg-gray-800',
inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',
},
interval: 3000,
onNext: function () { },
onPrev: function () { },
onChange: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Carousel = /** @class */ (function () {
function Carousel(carouselEl, items, options, instanceOptions) {
if (carouselEl === void 0) { carouselEl = null; }
if (items === void 0) { items = []; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: carouselEl.id;
this._carouselEl = carouselEl;
this._items = items;
this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) });
this._activeItem = this.getItem(this._options.defaultPosition);
this._indicators = this._options.indicators.items;
this._intervalDuration = this._options.interval;
this._intervalInstance = null;
this._initialized = false;
this.init();
instances_1.default.addInstance('Carousel', this, this._instanceId, instanceOptions.override);
}
/**
* initialize carousel and items based on active one
*/
Carousel.prototype.init = function () {
var _this = this;
if (this._items.length && !this._initialized) {
this._items.map(function (item) {
item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform');
});
// if no active item is set then first position is default
if (this.getActiveItem()) {
this.slideTo(this.getActiveItem().position);
}
else {
this.slideTo(0);
}
this._indicators.map(function (indicator, position) {
indicator.el.addEventListener('click', function () {
_this.slideTo(position);
});
});
this._initialized = true;
}
};
Carousel.prototype.destroy = function () {
if (this._initialized) {
this._initialized = false;
}
};
Carousel.prototype.removeInstance = function () {
instances_1.default.removeInstance('Carousel', this._instanceId);
};
Carousel.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Carousel.prototype.getItem = function (position) {
return this._items[position];
};
/**
* Slide to the element based on id
* @param {*} position
*/
Carousel.prototype.slideTo = function (position) {
var nextItem = this._items[position];
var rotationItems = {
left: nextItem.position === 0
? this._items[this._items.length - 1]
: this._items[nextItem.position - 1],
middle: nextItem,
right: nextItem.position === this._items.length - 1
? this._items[0]
: this._items[nextItem.position + 1],
};
this._rotate(rotationItems);
this._setActiveItem(nextItem);
if (this._intervalInstance) {
this.pause();
this.cycle();
}
this._options.onChange(this);
};
/**
* Based on the currently active item it will go to the next position
*/
Carousel.prototype.next = function () {
var activeItem = this.getActiveItem();
var nextItem = null;
// check if last item
if (activeItem.position === this._items.length - 1) {
nextItem = this._items[0];
}
else {
nextItem = this._items[activeItem.position + 1];
}
this.slideTo(nextItem.position);
// callback function
this._options.onNext(this);
};
/**
* Based on the currently active item it will go to the previous position
*/
Carousel.prototype.prev = function () {
var activeItem = this.getActiveItem();
var prevItem = null;
// check if first item
if (activeItem.position === 0) {
prevItem = this._items[this._items.length - 1];
}
else {
prevItem = this._items[activeItem.position - 1];
}
this.slideTo(prevItem.position);
// callback function
this._options.onPrev(this);
};
/**
* This method applies the transform classes based on the left, middle, and right rotation carousel items
* @param {*} rotationItems
*/
Carousel.prototype._rotate = function (rotationItems) {
// reset
this._items.map(function (item) {
item.el.classList.add('hidden');
});
// Handling the case when there is only one item
if (this._items.length === 1) {
rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10');
rotationItems.middle.el.classList.add('translate-x-0', 'z-20');
return;
}
// left item (previously active)
rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20');
rotationItems.left.el.classList.add('-translate-x-full', 'z-10');
// currently active item
rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10');
rotationItems.middle.el.classList.add('translate-x-0', 'z-30');
// right item (upcoming active)
rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-30');
rotationItems.right.el.classList.add('translate-x-full', 'z-20');
};
/**
* Set an interval to cycle through the carousel items
*/
Carousel.prototype.cycle = function () {
var _this = this;
if (typeof window !== 'undefined') {
this._intervalInstance = window.setInterval(function () {
_this.next();
}, this._intervalDuration);
}
};
/**
* Clears the cycling interval
*/
Carousel.prototype.pause = function () {
clearInterval(this._intervalInstance);
};
/**
* Get the currently active item
*/
Carousel.prototype.getActiveItem = function () {
return this._activeItem;
};
/**
* Set the currently active item and data attribute
* @param {*} position
*/
Carousel.prototype._setActiveItem = function (item) {
var _a, _b;
var _this = this;
this._activeItem = item;
var position = item.position;
// update the indicators if available
if (this._indicators.length) {
this._indicators.map(function (indicator) {
var _a, _b;
indicator.el.setAttribute('aria-current', 'false');
(_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' '));
(_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' '));
});
(_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' '));
(_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' '));
this._indicators[position].el.setAttribute('aria-current', 'true');
}
};
Carousel.prototype.updateOnNext = function (callback) {
this._options.onNext = callback;
};
Carousel.prototype.updateOnPrev = function (callback) {
this._options.onPrev = callback;
};
Carousel.prototype.updateOnChange = function (callback) {
this._options.onChange = callback;
};
return Carousel;
}());
function initCarousels() {
document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) {
var interval = $carouselEl.getAttribute('data-carousel-interval');
var slide = $carouselEl.getAttribute('data-carousel') === 'slide'
? true
: false;
var items = [];
var defaultPosition = 0;
if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {
Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) {
items.push({
position: position,
el: $carouselItemEl,
});
if ($carouselItemEl.getAttribute('data-carousel-item') ===
'active') {
defaultPosition = position;
}
});
}
var indicators = [];
if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {
Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) {
indicators.push({
position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')),
el: $indicatorEl,
});
});
}
var carousel = new Carousel($carouselEl, items, {
defaultPosition: defaultPosition,
indicators: {
items: indicators,
},
interval: interval ? interval : Default.interval,
});
if (slide) {
carousel.cycle();
}
// check for controls
var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]');
var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]');
if (carouselNextEl) {
carouselNextEl.addEventListener('click', function () {
carousel.next();
});
}
if (carouselPrevEl) {
carouselPrevEl.addEventListener('click', function () {
carousel.prev();
});
}
});
}
exports.initCarousels = initCarousels;
if (typeof window !== 'undefined') {
window.Carousel = Carousel;
window.initCarousels = initCarousels;
}
exports.default = Carousel;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
import { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types';
export declare interface CarouselInterface {
_items: CarouselItem[];
_indicators: IndicatorItem[];
_activeItem: CarouselItem;
_intervalDuration: number;
_intervalInstance: number;
_options: CarouselOptions;
init(): void;
getItem(position: number): CarouselItem;
getActiveItem(): CarouselItem;
_setActiveItem(item: CarouselItem): void;
slideTo(position: number): void;
next(): void;
prev(): void;
_rotate(rotationItems: RotationItems): void;
cycle(): void;
pause(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAE1B,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAAC;IACxC,aAAa,IAAI,YAAY,CAAC;IAE9B,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;IAEd,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,27 @@
import { CarouselInterface } from './interface';
export declare type CarouselItem = {
position: number;
el: HTMLElement;
};
export declare type IndicatorItem = {
position: number;
el: HTMLElement;
};
export declare type RotationItems = {
left: CarouselItem;
middle: CarouselItem;
right: CarouselItem;
};
export declare type CarouselOptions = {
defaultPosition?: number;
indicators?: {
items?: IndicatorItem[];
activeClasses?: string;
inactiveClasses?: string;
};
interval?: number;
onNext?: (carousel: CarouselInterface) => void;
onPrev?: (carousel: CarouselInterface) => void;
onChange?: (carousel: CarouselInterface) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,24 @@
import type { CopyClipboardOptions } from './types';
import type { InstanceOptions } from '../../dom/types';
import { CopyClipboardInterface } from './interface';
declare class CopyClipboard implements CopyClipboardInterface {
_instanceId: string;
_triggerEl: HTMLElement | null;
_targetEl: HTMLInputElement | null;
_options: CopyClipboardOptions;
_initialized: boolean;
_triggerElClickHandler: EventListenerOrEventListenerObject;
_inputHandler: EventListenerOrEventListenerObject;
constructor(triggerEl?: HTMLElement | null, targetEl?: HTMLInputElement | null, options?: CopyClipboardOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
getTargetValue(): string;
copy(): string;
decodeHTML(html: string): string;
updateOnCopyCallback(callback: () => void): void;
}
export declare function initCopyClipboards(): void;
export default CopyClipboard;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/clipboard/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAcrD,cAAM,aAAc,YAAW,sBAAsB;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,kCAAkC,CAAC;IAC3D,aAAa,EAAE,kCAAkC,CAAC;gBAG9C,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,QAAQ,GAAE,gBAAgB,GAAG,IAAW,EACxC,OAAO,GAAE,oBAA8B,EACvC,eAAe,GAAE,eAAwC;IAoB7D,IAAI;IAkBJ,OAAO;IAYP,cAAc;IAId,wBAAwB;IAKxB,cAAc;IAcd,IAAI;IA4BJ,UAAU,CAAC,IAAI,EAAE,MAAM;IAMvB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI;CAG5C;AAED,wBAAgB,kBAAkB,SA2CjC;AAOD,eAAe,aAAa,CAAC"}

View File

@ -0,0 +1,143 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initCopyClipboards = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
htmlEntities: false,
contentType: 'input',
onCopy: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var CopyClipboard = /** @class */ (function () {
function CopyClipboard(triggerEl, targetEl, options, instanceOptions) {
if (triggerEl === void 0) { triggerEl = null; }
if (targetEl === void 0) { targetEl = null; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: targetEl.id;
this._triggerEl = triggerEl;
this._targetEl = targetEl;
this._options = __assign(__assign({}, Default), options);
this._initialized = false;
this.init();
instances_1.default.addInstance('CopyClipboard', this, this._instanceId, instanceOptions.override);
}
CopyClipboard.prototype.init = function () {
var _this = this;
if (this._targetEl && this._triggerEl && !this._initialized) {
this._triggerElClickHandler = function () {
_this.copy();
};
// clicking on the trigger element should copy the value of the target element
if (this._triggerEl) {
this._triggerEl.addEventListener('click', this._triggerElClickHandler);
}
this._initialized = true;
}
};
CopyClipboard.prototype.destroy = function () {
if (this._triggerEl && this._targetEl && this._initialized) {
if (this._triggerEl) {
this._triggerEl.removeEventListener('click', this._triggerElClickHandler);
}
this._initialized = false;
}
};
CopyClipboard.prototype.removeInstance = function () {
instances_1.default.removeInstance('CopyClipboard', this._instanceId);
};
CopyClipboard.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
CopyClipboard.prototype.getTargetValue = function () {
if (this._options.contentType === 'input') {
return this._targetEl.value;
}
if (this._options.contentType === 'innerHTML') {
return this._targetEl.innerHTML;
}
if (this._options.contentType === 'textContent') {
return this._targetEl.textContent.replace(/\s+/g, ' ').trim();
}
};
CopyClipboard.prototype.copy = function () {
var textToCopy = this.getTargetValue();
// Check if HTMLEntities option is enabled
if (this._options.htmlEntities) {
// Encode the text using HTML entities
textToCopy = this.decodeHTML(textToCopy);
}
// Create a temporary textarea element
var tempTextArea = document.createElement('textarea');
tempTextArea.value = textToCopy;
document.body.appendChild(tempTextArea);
// Select the text inside the textarea and copy it to the clipboard
tempTextArea.select();
document.execCommand('copy');
// Remove the temporary textarea
document.body.removeChild(tempTextArea);
// Callback function
this._options.onCopy(this);
return textToCopy;
};
// Function to encode text into HTML entities
CopyClipboard.prototype.decodeHTML = function (html) {
var textarea = document.createElement('textarea');
textarea.innerHTML = html;
return textarea.textContent;
};
CopyClipboard.prototype.updateOnCopyCallback = function (callback) {
this._options.onCopy = callback;
};
return CopyClipboard;
}());
function initCopyClipboards() {
document
.querySelectorAll('[data-copy-to-clipboard-target]')
.forEach(function ($triggerEl) {
var targetId = $triggerEl.getAttribute('data-copy-to-clipboard-target');
var $targetEl = document.getElementById(targetId);
var contentType = $triggerEl.getAttribute('data-copy-to-clipboard-content-type');
var htmlEntities = $triggerEl.getAttribute('data-copy-to-clipboard-html-entities');
// check if the target element exists
if ($targetEl) {
if (!instances_1.default.instanceExists('CopyClipboard', $targetEl.getAttribute('id'))) {
new CopyClipboard($triggerEl, $targetEl, {
htmlEntities: htmlEntities && htmlEntities === 'true'
? true
: Default.htmlEntities,
contentType: contentType
? contentType
: Default.contentType,
});
}
}
else {
console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-copy-to-clipboard-target attribute."));
}
});
}
exports.initCopyClipboards = initCopyClipboards;
if (typeof window !== 'undefined') {
window.CopyClipboard = CopyClipboard;
window.initClipboards = initCopyClipboards;
}
exports.default = CopyClipboard;
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/clipboard/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,iDAA4C;AAE5C,IAAM,OAAO,GAAyB;IAClC,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,OAAO;IACpB,MAAM,EAAE,cAAO,CAAC;CACnB,CAAC;AAEF,IAAM,sBAAsB,GAAoB;IAC5C,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF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AAC,OAAO,CAAC,YAAY;oBAC9B,WAAW,EAAE,WAAW;wBACpB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,OAAO,CAAC,WAAW;iBACJ,CAC5B,CAAC;aACL;SACJ;aAAM;YACH,OAAO,CAAC,KAAK,CACT,uCAA+B,QAAQ,iFAA6E,CACvH,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AA3CD,gDA2CC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,MAAM,CAAC,cAAc,GAAG,kBAAkB,CAAC;CAC9C;AAED,kBAAe,aAAa,CAAC"}

View File

@ -0,0 +1,12 @@
import { CopyClipboardOptions } from './types';
export declare interface CopyClipboardInterface {
_triggerEl: HTMLElement | null;
_targetEl: HTMLElement | HTMLInputElement | null;
_options: CopyClipboardOptions;
init(): void;
copy(): string;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/clipboard/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,CAAC,OAAO,WAAW,sBAAsB;IAC3C,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACjD,QAAQ,EAAE,oBAAoB,CAAC;IAE/B,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,MAAM,CAAC;IAEf,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/clipboard/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,7 @@
import { CopyClipboardInterface } from './interface';
export declare type CopyClipboardOptions = {
htmlEntities: boolean;
contentType?: string;
onCopy?: (clipboard: CopyClipboardInterface) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/clipboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,CAAC,OAAO,MAAM,oBAAoB,GAAG;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACxD,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/clipboard/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,26 @@
import type { CollapseOptions } from './types';
import type { InstanceOptions } from '../../dom/types';
import { CollapseInterface } from './interface';
declare class Collapse implements CollapseInterface {
_instanceId: string;
_targetEl: HTMLElement | null;
_triggerEl: HTMLElement | null;
_options: CollapseOptions;
_visible: boolean;
_initialized: boolean;
_clickHandler: EventListenerOrEventListenerObject;
constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: CollapseOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
collapse(): void;
expand(): void;
toggle(): void;
updateOnCollapse(callback: () => void): void;
updateOnExpand(callback: () => void): void;
updateOnToggle(callback: () => void): void;
}
export declare function initCollapses(): void;
export default Collapse;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,cAAM,QAAS,YAAW,iBAAiB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,kCAAkC,CAAC;gBAG9C,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,eAAyB,EAClC,eAAe,GAAE,eAAwC;IAmB7D,IAAI;IAmBJ,OAAO;IAOP,cAAc;IAId,wBAAwB;IAKxB,QAAQ;IAWR,MAAM;IAWN,MAAM;IAUN,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIrC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;IAInC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGtC;AAED,wBAAgB,aAAa,SAuC5B;AAOD,eAAe,QAAQ,CAAC"}

View File

@ -0,0 +1,143 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initCollapses = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
onCollapse: function () { },
onExpand: function () { },
onToggle: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Collapse = /** @class */ (function () {
function Collapse(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) { targetEl = null; }
if (triggerEl === void 0) { triggerEl = null; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign(__assign({}, Default), options);
this._visible = false;
this._initialized = false;
this.init();
instances_1.default.addInstance('Collapse', this, this._instanceId, instanceOptions.override);
}
Collapse.prototype.init = function () {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
if (this._triggerEl.hasAttribute('aria-expanded')) {
this._visible =
this._triggerEl.getAttribute('aria-expanded') === 'true';
}
else {
// fix until v2 not to break previous single collapses which became dismiss
this._visible = !this._targetEl.classList.contains('hidden');
}
this._clickHandler = function () {
_this.toggle();
};
this._triggerEl.addEventListener('click', this._clickHandler);
this._initialized = true;
}
};
Collapse.prototype.destroy = function () {
if (this._triggerEl && this._initialized) {
this._triggerEl.removeEventListener('click', this._clickHandler);
this._initialized = false;
}
};
Collapse.prototype.removeInstance = function () {
instances_1.default.removeInstance('Collapse', this._instanceId);
};
Collapse.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Collapse.prototype.collapse = function () {
this._targetEl.classList.add('hidden');
if (this._triggerEl) {
this._triggerEl.setAttribute('aria-expanded', 'false');
}
this._visible = false;
// callback function
this._options.onCollapse(this);
};
Collapse.prototype.expand = function () {
this._targetEl.classList.remove('hidden');
if (this._triggerEl) {
this._triggerEl.setAttribute('aria-expanded', 'true');
}
this._visible = true;
// callback function
this._options.onExpand(this);
};
Collapse.prototype.toggle = function () {
if (this._visible) {
this.collapse();
}
else {
this.expand();
}
// callback function
this._options.onToggle(this);
};
Collapse.prototype.updateOnCollapse = function (callback) {
this._options.onCollapse = callback;
};
Collapse.prototype.updateOnExpand = function (callback) {
this._options.onExpand = callback;
};
Collapse.prototype.updateOnToggle = function (callback) {
this._options.onToggle = callback;
};
return Collapse;
}());
function initCollapses() {
document
.querySelectorAll('[data-collapse-toggle]')
.forEach(function ($triggerEl) {
var targetId = $triggerEl.getAttribute('data-collapse-toggle');
var $targetEl = document.getElementById(targetId);
// check if the target element exists
if ($targetEl) {
if (!instances_1.default.instanceExists('Collapse', $targetEl.getAttribute('id'))) {
new Collapse($targetEl, $triggerEl);
}
else {
// if instance exists already for the same target element then create a new one with a different trigger element
new Collapse($targetEl, $triggerEl, {}, {
id: $targetEl.getAttribute('id') +
'_' +
instances_1.default._generateRandomId(),
});
}
}
else {
console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute."));
}
});
}
exports.initCollapses = initCollapses;
if (typeof window !== 'undefined') {
window.Collapse = Collapse;
window.initCollapses = initCollapses;
}
exports.default = Collapse;
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,iDAA4C;AAE5C,IAAM,OAAO,GAAoB;IAC7B,UAAU,EAAE,cAAO,CAAC;IACpB,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF,IAAM,sBAAsB,GAAoB;IAC5C,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF;IASI,kBACI,QAAmC,EACnC,SAAoC,EACpC,OAAkC,EAClC,eAAyD;QAHzD,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,wBAAA,EAAA,iBAAkC;QAClC,gCAAA,EAAA,wCAAyD;QAEzD,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,EAAE;YACjC,CAAC,CAAC,eAAe,CAAC,EAAE;YACpB,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClB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15 @@
import { CollapseOptions } from './types';
export declare interface CollapseInterface {
_targetEl: HTMLElement | null;
_triggerEl: HTMLElement | null;
_options: CollapseOptions;
_visible: boolean;
init(): void;
collapse(): void;
expand(): void;
toggle(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAElB,IAAI,IAAI,IAAI,CAAC;IACb,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IAEf,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,7 @@
import { CollapseInterface } from './interface';
export declare type CollapseOptions = {
onCollapse?: (collapse: CollapseInterface) => void;
onExpand?: (collapse: CollapseInterface) => void;
onToggle?: (collapse: CollapseInterface) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,27 @@
import type { DatepickerOptions } from './types';
import type { InstanceOptions } from '../../dom/types';
import { DatepickerInterface } from './interface';
import { Datepicker as FlowbiteDatepicker, DateRangePicker as FlowbiteDateRangePicker } from 'flowbite-datepicker';
declare class Datepicker implements DatepickerInterface {
_instanceId: string;
_datepickerEl: HTMLElement;
_datepickerInstance: FlowbiteDatepicker | FlowbiteDateRangePicker | null;
_options: DatepickerOptions;
_initialized: boolean;
constructor(datepickerEl?: HTMLElement | null, options?: DatepickerOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
getDatepickerInstance(): FlowbiteDatepicker | FlowbiteDateRangePicker;
getDate(): string | string[];
setDate(date: any): void;
show(): void;
hide(): void;
_getDatepickerOptions(options: DatepickerOptions): any;
updateOnShow(callback: () => void): void;
updateOnHide(callback: () => void): void;
}
export declare function initDatepickers(): void;
export default Datepicker;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datepicker/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EACH,UAAU,IAAI,kBAAkB,EAChC,eAAe,IAAI,uBAAuB,EAC7C,MAAM,qBAAqB,CAAC;AAuB7B,cAAM,UAAW,YAAW,mBAAmB;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,WAAW,CAAC;IAC3B,mBAAmB,EAAE,kBAAkB,GAAG,uBAAuB,GAAG,IAAI,CAAC;IACzE,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;gBAGlB,YAAY,GAAE,WAAW,GAAG,IAAW,EACvC,OAAO,GAAE,iBAA2B,EACpC,eAAe,GAAE,eAAwC;IAkB7D,IAAI;IAkBJ,OAAO;IAOP,cAAc;IAKd,wBAAwB;IAKxB,qBAAqB;IAIrB,OAAO;IAgBP,OAAO,CAAC,IAAI,EAAE,GAAG;IAgBjB,IAAI;IAKJ,IAAI;IAKJ,qBAAqB,CAAC,OAAO,EAAE,iBAAiB;IA2ChD,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGpC;AAED,wBAAgB,eAAe,SA0D9B;AAOD,eAAe,UAAU,CAAC"}

View File

@ -0,0 +1,192 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDatepickers = void 0;
var instances_1 = require("../../dom/instances");
var flowbite_datepicker_1 = require("flowbite-datepicker");
var Default = {
defaultDatepickerId: null,
autohide: false,
format: 'mm/dd/yyyy',
maxDate: null,
minDate: null,
orientation: 'bottom',
buttons: false,
autoSelectToday: 0,
title: null,
language: 'en',
rangePicker: false,
onShow: function () { },
onHide: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Datepicker = /** @class */ (function () {
function Datepicker(datepickerEl, options, instanceOptions) {
if (datepickerEl === void 0) { datepickerEl = null; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: datepickerEl.id;
this._datepickerEl = datepickerEl;
this._datepickerInstance = null;
this._options = __assign(__assign({}, Default), options);
this._initialized = false;
this.init();
instances_1.default.addInstance('Datepicker', this, this._instanceId, instanceOptions.override);
}
Datepicker.prototype.init = function () {
if (this._datepickerEl && !this._initialized) {
if (this._options.rangePicker) {
this._datepickerInstance = new flowbite_datepicker_1.DateRangePicker(this._datepickerEl, this._getDatepickerOptions(this._options));
}
else {
this._datepickerInstance = new flowbite_datepicker_1.Datepicker(this._datepickerEl, this._getDatepickerOptions(this._options));
}
this._initialized = true;
}
};
Datepicker.prototype.destroy = function () {
if (this._initialized) {
this._initialized = false;
this._datepickerInstance.destroy();
}
};
Datepicker.prototype.removeInstance = function () {
this.destroy();
instances_1.default.removeInstance('Datepicker', this._instanceId);
};
Datepicker.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Datepicker.prototype.getDatepickerInstance = function () {
return this._datepickerInstance;
};
Datepicker.prototype.getDate = function () {
if (this._options.rangePicker &&
this._datepickerInstance instanceof flowbite_datepicker_1.DateRangePicker) {
return this._datepickerInstance.getDates();
}
if (!this._options.rangePicker &&
this._datepickerInstance instanceof flowbite_datepicker_1.Datepicker) {
return this._datepickerInstance.getDate();
}
};
Datepicker.prototype.setDate = function (date) {
if (this._options.rangePicker &&
this._datepickerInstance instanceof flowbite_datepicker_1.DateRangePicker) {
return this._datepickerInstance.setDates(date);
}
if (!this._options.rangePicker &&
this._datepickerInstance instanceof flowbite_datepicker_1.Datepicker) {
return this._datepickerInstance.setDate(date);
}
};
Datepicker.prototype.show = function () {
this._datepickerInstance.show();
this._options.onShow(this);
};
Datepicker.prototype.hide = function () {
this._datepickerInstance.hide();
this._options.onHide(this);
};
Datepicker.prototype._getDatepickerOptions = function (options) {
var datepickerOptions = {};
if (options.buttons) {
datepickerOptions.todayBtn = true;
datepickerOptions.clearBtn = true;
if (options.autoSelectToday) {
datepickerOptions.todayBtnMode = 1;
}
}
if (options.autohide) {
datepickerOptions.autohide = true;
}
if (options.format) {
datepickerOptions.format = options.format;
}
if (options.maxDate) {
datepickerOptions.maxDate = options.maxDate;
}
if (options.minDate) {
datepickerOptions.minDate = options.minDate;
}
if (options.orientation) {
datepickerOptions.orientation = options.orientation;
}
if (options.title) {
datepickerOptions.title = options.title;
}
if (options.language) {
datepickerOptions.language = options.language;
}
return datepickerOptions;
};
Datepicker.prototype.updateOnShow = function (callback) {
this._options.onShow = callback;
};
Datepicker.prototype.updateOnHide = function (callback) {
this._options.onHide = callback;
};
return Datepicker;
}());
function initDatepickers() {
document
.querySelectorAll('[datepicker], [inline-datepicker], [date-rangepicker]')
.forEach(function ($datepickerEl) {
if ($datepickerEl) {
var buttons = $datepickerEl.hasAttribute('datepicker-buttons');
var autoselectToday = $datepickerEl.hasAttribute('datepicker-autoselect-today');
var autohide = $datepickerEl.hasAttribute('datepicker-autohide');
var format = $datepickerEl.getAttribute('datepicker-format');
var maxDate = $datepickerEl.getAttribute('datepicker-max-date');
var minDate = $datepickerEl.getAttribute('datepicker-min-date');
var orientation_1 = $datepickerEl.getAttribute('datepicker-orientation');
var title = $datepickerEl.getAttribute('datepicker-title');
var language = $datepickerEl.getAttribute('datepicker-language');
var rangePicker = $datepickerEl.hasAttribute('date-rangepicker');
new Datepicker($datepickerEl, {
buttons: buttons ? buttons : Default.buttons,
autoSelectToday: autoselectToday
? autoselectToday
: Default.autoSelectToday,
autohide: autohide ? autohide : Default.autohide,
format: format ? format : Default.format,
maxDate: maxDate ? maxDate : Default.maxDate,
minDate: minDate ? minDate : Default.minDate,
orientation: orientation_1
? orientation_1
: Default.orientation,
title: title ? title : Default.title,
language: language ? language : Default.language,
rangePicker: rangePicker
? rangePicker
: Default.rangePicker,
});
}
else {
console.error("The datepicker element does not exist. Please check the datepicker attribute.");
}
});
}
exports.initDatepickers = initDatepickers;
if (typeof window !== 'undefined') {
window.Datepicker = Datepicker;
window.initDatepickers = initDatepickers;
}
exports.default = Datepicker;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
import { DatepickerOptions } from './types';
export declare interface DatepickerInterface {
_datepickerEl: HTMLElement;
_datepickerInstance: any | null;
_options: DatepickerOptions;
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/datepicker/interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,OAAO,WAAW,mBAAmB;IACxC,aAAa,EAAE,WAAW,CAAC;IAC3B,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,iBAAiB,CAAC;IAE5B,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/datepicker/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,20 @@
import { DatepickerInterface } from './interface';
export interface DatepickerOptions {
defaultDatepickerId?: string | null;
autohide?: boolean;
format?: string;
maxDate?: string | null;
minDate?: string | null;
orientation?: string;
buttons?: boolean;
autoSelectToday?: number;
title?: string | null;
language?: string;
locales?: {
[key: string]: any;
};
rangePicker?: boolean | false;
onShow?: (Datepicker: DatepickerInterface) => void;
onHide?: (Datepicker: DatepickerInterface) => void;
}
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/datepicker/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAC9B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACtD"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/datepicker/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,34 @@
import type { DialOptions, DialTriggerType } from './types';
import type { InstanceOptions } from '../../dom/types';
import { DialInterface } from './interface';
declare class Dial implements DialInterface {
_instanceId: string;
_parentEl: HTMLElement;
_triggerEl: HTMLElement;
_targetEl: HTMLElement;
_options: DialOptions;
_visible: boolean;
_initialized: boolean;
_showEventHandler: EventListenerOrEventListenerObject;
_hideEventHandler: EventListenerOrEventListenerObject;
constructor(parentEl?: HTMLElement | null, triggerEl?: HTMLElement | null, targetEl?: HTMLElement | null, options?: DialOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
hide(): void;
show(): void;
toggle(): void;
isHidden(): boolean;
isVisible(): boolean;
_getTriggerEventTypes(triggerType: DialTriggerType): {
showEvents: string[];
hideEvents: string[];
};
updateOnShow(callback: () => void): void;
updateOnHide(callback: () => void): void;
updateOnToggle(callback: () => void): void;
}
export declare function initDials(): void;
export default Dial;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe5C,cAAM,IAAK,YAAW,aAAa;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,kCAAkC,CAAC;IACtD,iBAAiB,EAAE,kCAAkC,CAAC;gBAGlD,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,WAAqB,EAC9B,eAAe,GAAE,eAAwC;IAoB7D,IAAI;IA4BJ,OAAO;IAmBP,cAAc;IAId,wBAAwB;IAKxB,IAAI;IAWJ,IAAI;IAWJ,MAAM;IAQN,QAAQ;IAIR,SAAS;IAIT,qBAAqB,CAAC,WAAW,EAAE,eAAe;;;;IAyBlD,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGtC;AAED,wBAAgB,SAAS,SAgCxB;AAOD,eAAe,IAAI,CAAC"}

184
node_modules/flowbite/lib/cjs/components/dial/index.js generated vendored Normal file
View File

@ -0,0 +1,184 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDials = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
triggerType: 'hover',
onShow: function () { },
onHide: function () { },
onToggle: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Dial = /** @class */ (function () {
function Dial(parentEl, triggerEl, targetEl, options, instanceOptions) {
if (parentEl === void 0) { parentEl = null; }
if (triggerEl === void 0) { triggerEl = null; }
if (targetEl === void 0) { targetEl = null; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: targetEl.id;
this._parentEl = parentEl;
this._triggerEl = triggerEl;
this._targetEl = targetEl;
this._options = __assign(__assign({}, Default), options);
this._visible = false;
this._initialized = false;
this.init();
instances_1.default.addInstance('Dial', this, this._instanceId, instanceOptions.override);
}
Dial.prototype.init = function () {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
this._showEventHandler = function () {
_this.show();
};
triggerEventTypes.showEvents.forEach(function (ev) {
_this._triggerEl.addEventListener(ev, _this._showEventHandler);
_this._targetEl.addEventListener(ev, _this._showEventHandler);
});
this._hideEventHandler = function () {
if (!_this._parentEl.matches(':hover')) {
_this.hide();
}
};
triggerEventTypes.hideEvents.forEach(function (ev) {
_this._parentEl.addEventListener(ev, _this._hideEventHandler);
});
this._initialized = true;
}
};
Dial.prototype.destroy = function () {
var _this = this;
if (this._initialized) {
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
triggerEventTypes.showEvents.forEach(function (ev) {
_this._triggerEl.removeEventListener(ev, _this._showEventHandler);
_this._targetEl.removeEventListener(ev, _this._showEventHandler);
});
triggerEventTypes.hideEvents.forEach(function (ev) {
_this._parentEl.removeEventListener(ev, _this._hideEventHandler);
});
this._initialized = false;
}
};
Dial.prototype.removeInstance = function () {
instances_1.default.removeInstance('Dial', this._instanceId);
};
Dial.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Dial.prototype.hide = function () {
this._targetEl.classList.add('hidden');
if (this._triggerEl) {
this._triggerEl.setAttribute('aria-expanded', 'false');
}
this._visible = false;
// callback function
this._options.onHide(this);
};
Dial.prototype.show = function () {
this._targetEl.classList.remove('hidden');
if (this._triggerEl) {
this._triggerEl.setAttribute('aria-expanded', 'true');
}
this._visible = true;
// callback function
this._options.onShow(this);
};
Dial.prototype.toggle = function () {
if (this._visible) {
this.hide();
}
else {
this.show();
}
};
Dial.prototype.isHidden = function () {
return !this._visible;
};
Dial.prototype.isVisible = function () {
return this._visible;
};
Dial.prototype._getTriggerEventTypes = function (triggerType) {
switch (triggerType) {
case 'hover':
return {
showEvents: ['mouseenter', 'focus'],
hideEvents: ['mouseleave', 'blur'],
};
case 'click':
return {
showEvents: ['click', 'focus'],
hideEvents: ['focusout', 'blur'],
};
case 'none':
return {
showEvents: [],
hideEvents: [],
};
default:
return {
showEvents: ['mouseenter', 'focus'],
hideEvents: ['mouseleave', 'blur'],
};
}
};
Dial.prototype.updateOnShow = function (callback) {
this._options.onShow = callback;
};
Dial.prototype.updateOnHide = function (callback) {
this._options.onHide = callback;
};
Dial.prototype.updateOnToggle = function (callback) {
this._options.onToggle = callback;
};
return Dial;
}());
function initDials() {
document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) {
var $triggerEl = $parentEl.querySelector('[data-dial-toggle]');
if ($triggerEl) {
var dialId = $triggerEl.getAttribute('data-dial-toggle');
var $dialEl = document.getElementById(dialId);
if ($dialEl) {
var triggerType = $triggerEl.getAttribute('data-dial-trigger');
new Dial($parentEl, $triggerEl, $dialEl, {
triggerType: triggerType
? triggerType
: Default.triggerType,
});
}
else {
console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"));
}
}
else {
console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"));
}
});
}
exports.initDials = initDials;
if (typeof window !== 'undefined') {
window.Dial = Dial;
window.initDials = initDials;
}
exports.default = Dial;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
import { DialOptions, DialTriggerEventTypes, DialTriggerType } from './types';
export declare interface DialInterface {
_parentEl: HTMLElement;
_triggerEl: HTMLElement;
_targetEl: HTMLElement;
_options: DialOptions;
_visible: boolean;
init(): void;
isVisible(): boolean;
isHidden(): boolean;
hide(): void;
show(): void;
toggle(): void;
_getTriggerEventTypes(triggerType: DialTriggerType): DialTriggerEventTypes;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,IAAI,IAAI,IAAI,CAAC;IACb,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,qBAAqB,CAAC,WAAW,EAAE,eAAe,GAAG,qBAAqB,CAAC;IAE3E,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,13 @@
import { DialInterface } from './interface';
export declare type DialTriggerType = 'click' | 'hover' | 'none';
export declare type DialTriggerEventTypes = {
showEvents: string[];
hideEvents: string[];
};
export declare type DialOptions = {
triggerType?: DialTriggerType;
onShow?: (dial: DialInterface) => void;
onHide?: (dial: DialInterface) => void;
onToggle?: (dial: DialInterface) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,21 @@
import type { DismissOptions } from './types';
import type { InstanceOptions } from '../../dom/types';
import { DismissInterface } from './interface';
declare class Dismiss implements DismissInterface {
_instanceId: string;
_targetEl: HTMLElement | null;
_triggerEl: HTMLElement | null;
_options: DismissOptions;
_initialized: boolean;
_clickHandler: EventListenerOrEventListenerObject;
constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: DismissOptions, instanceOptions?: InstanceOptions);
init(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
hide(): void;
updateOnHide(callback: () => void): void;
}
export declare function initDismisses(): void;
export default Dismiss;
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAe/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,kCAAkC,CAAC;gBAG9C,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB,EACjC,eAAe,GAAE,eAAwC;IAkB7D,IAAI;IAUJ,OAAO;IAOP,cAAc;IAId,wBAAwB;IAKxB,IAAI;IAeJ,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGpC;AAED,wBAAgB,aAAa,SAa5B;AAOD,eAAe,OAAO,CAAC"}

View File

@ -0,0 +1,97 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDismisses = void 0;
var instances_1 = require("../../dom/instances");
var Default = {
transition: 'transition-opacity',
duration: 300,
timing: 'ease-out',
onHide: function () { },
};
var DefaultInstanceOptions = {
id: null,
override: true,
};
var Dismiss = /** @class */ (function () {
function Dismiss(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) { targetEl = null; }
if (triggerEl === void 0) { triggerEl = null; }
if (options === void 0) { options = Default; }
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
this._instanceId = instanceOptions.id
? instanceOptions.id
: targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign(__assign({}, Default), options);
this._initialized = false;
this.init();
instances_1.default.addInstance('Dismiss', this, this._instanceId, instanceOptions.override);
}
Dismiss.prototype.init = function () {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
this._clickHandler = function () {
_this.hide();
};
this._triggerEl.addEventListener('click', this._clickHandler);
this._initialized = true;
}
};
Dismiss.prototype.destroy = function () {
if (this._triggerEl && this._initialized) {
this._triggerEl.removeEventListener('click', this._clickHandler);
this._initialized = false;
}
};
Dismiss.prototype.removeInstance = function () {
instances_1.default.removeInstance('Dismiss', this._instanceId);
};
Dismiss.prototype.destroyAndRemoveInstance = function () {
this.destroy();
this.removeInstance();
};
Dismiss.prototype.hide = function () {
var _this = this;
this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0');
setTimeout(function () {
_this._targetEl.classList.add('hidden');
}, this._options.duration);
// callback function
this._options.onHide(this, this._targetEl);
};
Dismiss.prototype.updateOnHide = function (callback) {
this._options.onHide = callback;
};
return Dismiss;
}());
function initDismisses() {
document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) {
var targetId = $triggerEl.getAttribute('data-dismiss-target');
var $dismissEl = document.querySelector(targetId);
if ($dismissEl) {
new Dismiss($dismissEl, $triggerEl);
}
else {
console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute."));
}
});
}
exports.initDismisses = initDismisses;
if (typeof window !== 'undefined') {
window.Dismiss = Dismiss;
window.initDismisses = initDismisses;
}
exports.default = Dismiss;
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,iDAA4C;AAE5C,IAAM,OAAO,GAAmB;IAC5B,UAAU,EAAE,oBAAoB;IAChC,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,cAAO,CAAC;CACnB,CAAC;AAEF,IAAM,sBAAsB,GAAoB;IAC5C,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF;IAQI,iBACI,Q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CAAC,CAAC,CAAC;AACP,CAAC;AAbD,sCAaC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,kBAAe,OAAO,CAAC"}

View File

@ -0,0 +1,12 @@
import { DismissOptions } from './types';
export declare interface DismissInterface {
_targetEl: HTMLElement | null;
_triggerEl: HTMLElement | null;
_options: DismissOptions;
init(): void;
hide(): void;
destroy(): void;
removeInstance(): void;
destroyAndRemoveInstance(): void;
}
//# sourceMappingURL=interface.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IAEzB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interface.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,8 @@
import { DismissInterface } from './interface';
export declare type DismissOptions = {
transition?: string;
duration?: number;
timing?: string;
onHide?: (dismiss: DismissInterface, targetEl: HTMLElement) => void;
};
//# sourceMappingURL=types.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CACvE,CAAC"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":""}

Some files were not shown because too many files have changed in this diff Show More