adminforth 1.1.75 → 1.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/utils.js +1 -1
- package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +1 -1
- package/dist/plugins/S3UploadPlugin/package.json +1 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +61 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +21 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +217 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +21 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +21 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +201 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +68 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +51 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +2 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +58 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +6 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +22 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +135 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +33 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +221 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +22 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +1 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +217 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +19 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +24 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +23 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +26 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +128 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +63 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +12 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +164 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +41 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +68 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +3 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +47 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +1 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +374 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +373 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +1 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +424 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +6 -0
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +55 -0
- package/dist/plugins/TwoFactorsAuthPlugin/package-lock.json +69 -0
- package/dist/plugins/TwoFactorsAuthPlugin/package.json +15 -0
- package/dist/spa/spa/.eslintrc.cjs +14 -0
- package/dist/spa/spa/.vscode/extensions.json +6 -0
- package/dist/spa/spa/README.md +39 -0
- package/dist/spa/spa/env.d.ts +1 -0
- package/dist/spa/spa/index.html +23 -0
- package/dist/spa/spa/package-lock.json +4470 -0
- package/dist/spa/spa/package.json +48 -0
- package/dist/spa/spa/postcss.config.js +6 -0
- package/dist/spa/spa/public/assets/favicon.png +0 -0
- package/dist/spa/spa/src/App.vue +316 -0
- package/dist/spa/spa/src/assets/base.css +0 -0
- package/dist/spa/spa/src/assets/logo.svg +19 -0
- package/dist/spa/spa/src/components/AcceptModal.vue +45 -0
- package/dist/spa/spa/src/components/Breadcrumbs.vue +40 -0
- package/dist/spa/spa/src/components/BreadcrumbsWithButtons.vue +26 -0
- package/dist/spa/spa/src/components/CustomDatePicker.vue +174 -0
- package/dist/spa/spa/src/components/CustomDateRangePicker.vue +218 -0
- package/dist/spa/spa/src/components/CustomRangePicker.vue +148 -0
- package/dist/spa/spa/src/components/Dropdown.vue +168 -0
- package/dist/spa/spa/src/components/Filters.vue +211 -0
- package/dist/spa/spa/src/components/HelloWorld.vue +17 -0
- package/dist/spa/spa/src/components/MenuLink.vue +24 -0
- package/dist/spa/spa/src/components/ResourceForm.vue +265 -0
- package/dist/spa/spa/src/components/ResourceListTable.vue +404 -0
- package/dist/spa/spa/src/components/SingleSkeletLoader.vue +13 -0
- package/dist/spa/spa/src/components/SkeleteLoader.vue +23 -0
- package/dist/spa/spa/src/components/Toast.vue +66 -0
- package/dist/spa/spa/src/components/ValueRenderer.vue +59 -0
- package/dist/spa/spa/src/components/icons/IconCalendar.vue +5 -0
- package/dist/spa/spa/src/components/icons/IconCommunity.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconDocumentation.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconEcosystem.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconSupport.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconTime.vue +5 -0
- package/dist/spa/spa/src/components/icons/IconTooling.vue +19 -0
- package/dist/spa/spa/src/composables/useFrontendApi.ts +26 -0
- package/dist/spa/spa/src/composables/useStores.ts +126 -0
- package/dist/spa/spa/src/index.scss +26 -0
- package/dist/spa/spa/src/main.ts +18 -0
- package/dist/spa/spa/src/router/index.ts +63 -0
- package/dist/spa/spa/src/spa_types/core.ts +51 -0
- package/dist/spa/spa/src/stores/core.ts +144 -0
- package/dist/spa/spa/src/stores/filters.ts +22 -0
- package/dist/spa/spa/src/stores/modal.ts +48 -0
- package/dist/spa/spa/src/stores/toast.ts +15 -0
- package/dist/spa/spa/src/stores/user.ts +54 -0
- package/dist/spa/spa/src/utils.ts +101 -0
- package/dist/spa/spa/src/views/CreateView.vue +155 -0
- package/dist/spa/spa/src/views/EditView.vue +157 -0
- package/dist/spa/spa/src/views/ListView.vue +266 -0
- package/dist/spa/spa/src/views/LoginView.vue +139 -0
- package/dist/spa/spa/src/views/ResourceParent.vue +17 -0
- package/dist/spa/spa/src/views/ShowView.vue +180 -0
- package/dist/spa/spa/tailwind.config.js +17 -0
- package/dist/spa/spa/tsconfig.app.json +14 -0
- package/dist/spa/spa/tsconfig.json +11 -0
- package/dist/spa/spa/tsconfig.node.json +19 -0
- package/dist/spa/spa/vite.config.ts +49 -0
- package/modules/utils.ts +1 -1
- package/package.json +1 -3
- package/plugins/S3UploadPlugin/custom/s3uploader.vue +1 -1
- package/plugins/S3UploadPlugin/package.json +1 -0
- package/plugins/S3UploadPlugin/types.ts +1 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +61 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +21 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +1040 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +2363 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +1544 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +578 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +452 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +19 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +4523 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +596 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +864 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +124 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +170 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +931 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +4317 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +412 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +1 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +1908 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +2418 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +550 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +89 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +2746 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +315 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +999 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +495 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +217 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +191 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +905 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +1754 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +117 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +153 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +540 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +430 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +153 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +367 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +1707 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +1718 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +240 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +1217 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +197 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +208 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +952 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +2292 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +808 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +924 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +181 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +694 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +530 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +21 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +127 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +21 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +201 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +68 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +11 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +51 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +4 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +2 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +58 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +6 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +22 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +135 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +33 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +221 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +22 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +1 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +217 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +19 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +24 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +23 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +26 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +128 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +63 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +12 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +164 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +41 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +37 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +68 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +3 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +47 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +453 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +1 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +374 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +373 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +1 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +424 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +6 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +31 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +43 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +36 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +97 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +34 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +21 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +28 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +128 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +209 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +39 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +54 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +108 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +7 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +9 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +4 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +63 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +5 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +25 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +55 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +71 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +28 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +61 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +220 -0
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +131 -0
- package/plugins/TwoFactorsAuthPlugin/package-lock.json +69 -0
- package/plugins/TwoFactorsAuthPlugin/package.json +15 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2">
|
|
4
|
+
<div>
|
|
5
|
+
<label for="start-time" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ label }}</label>
|
|
6
|
+
|
|
7
|
+
<div class="relative">
|
|
8
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
9
|
+
<IconCalendar class="w-4 h-4 text-gray-500 dark:text-gray-400"/>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<input ref="datepickerStartEl" type="text"
|
|
13
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
14
|
+
placeholder="Start date">
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div>
|
|
20
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2" :class="{hidden: !showTimeInputs}">
|
|
21
|
+
<div>
|
|
22
|
+
<div class="relative">
|
|
23
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
24
|
+
<IconTime class="w-4 h-4 text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-700"/>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<input v-model="startTime" type="time" id="start-time" onfocus="this.showPicker()" onclick="this.showPicker()" step="1"
|
|
28
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
29
|
+
value="00:00" required/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<button type="button"
|
|
35
|
+
class="text-blue-700 dark:text-blue-500 text-base font-medium hover:underline p-0 inline-flex items-center mb-2"
|
|
36
|
+
@click="toggleTimeInputs">{{ showTimeInputs ? 'Hide time' : 'Show time' }}
|
|
37
|
+
<svg class="w-8 h-8 ms-0.5" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
|
|
38
|
+
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
39
|
+
fill="none" viewBox="0 0 24 24">
|
|
40
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
41
|
+
d="m8 10 4 4 4-4"/>
|
|
42
|
+
</svg>
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
<script setup>
|
|
48
|
+
import {ref, computed, onMounted, watch, onBeforeUnmount} from 'vue';
|
|
49
|
+
import dayjs from 'dayjs';
|
|
50
|
+
import utc from 'dayjs/plugin/utc';
|
|
51
|
+
|
|
52
|
+
import {useCoreStore} from '@/stores/core';
|
|
53
|
+
|
|
54
|
+
import Datepicker from "flowbite-datepicker/Datepicker";
|
|
55
|
+
import IconCalendar from "@/components/icons/IconCalendar.vue";
|
|
56
|
+
import IconTime from "@/components/icons/IconTime.vue";
|
|
57
|
+
|
|
58
|
+
const coreStore = useCoreStore();
|
|
59
|
+
dayjs.extend(utc)
|
|
60
|
+
|
|
61
|
+
const props = defineProps({
|
|
62
|
+
valueStart: {
|
|
63
|
+
default: undefined
|
|
64
|
+
},
|
|
65
|
+
column: {
|
|
66
|
+
type: Object,
|
|
67
|
+
},
|
|
68
|
+
label: {
|
|
69
|
+
type: String,
|
|
70
|
+
},
|
|
71
|
+
autoHide: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const emit = defineEmits(['update:valueStart']);
|
|
77
|
+
|
|
78
|
+
const datepickerStartEl = ref();
|
|
79
|
+
|
|
80
|
+
const showTimeInputs = ref(false);
|
|
81
|
+
|
|
82
|
+
const startDate = ref('');
|
|
83
|
+
|
|
84
|
+
const startTime = ref('');
|
|
85
|
+
|
|
86
|
+
const datepickerObject = ref('')
|
|
87
|
+
|
|
88
|
+
const start = computed(() => {
|
|
89
|
+
if (!startDate.value) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
let date = dayjs(startDate.value);
|
|
94
|
+
|
|
95
|
+
if (startTime.value) {
|
|
96
|
+
date = addTimeToDate(formatTime(startTime.value), date)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return date.utc().toISOString();
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
function updateFromProps() {
|
|
103
|
+
if (!props.valueStart) {
|
|
104
|
+
datepickerStartEl.value.value = '';
|
|
105
|
+
startTime.value = '';
|
|
106
|
+
} else {
|
|
107
|
+
datepickerObject.value.setDate(dayjs(props.valueStart).format('DD MMM YYYY'));
|
|
108
|
+
startTime.value = dayjs(props.valueStart).format('HH:mm:ss')
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
onMounted(() => {
|
|
113
|
+
updateFromProps();
|
|
114
|
+
|
|
115
|
+
watch(() => [props.valueStart], (value) => {
|
|
116
|
+
updateFromProps();
|
|
117
|
+
});
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
watch(start, () => {
|
|
121
|
+
//console.log('⚡ emit', start.value)
|
|
122
|
+
emit('update:valueStart', start.value)
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
function initDatepickers() {
|
|
126
|
+
const options = {format: 'dd M yyyy'};
|
|
127
|
+
|
|
128
|
+
if (props.autoHide) {
|
|
129
|
+
options.autohide = true;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
datepickerObject.value = new Datepicker(datepickerStartEl.value, options);
|
|
133
|
+
|
|
134
|
+
addChangeDateListener();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function addChangeDateListener() {
|
|
138
|
+
datepickerStartEl.value.addEventListener('changeDate', setStartDate)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function removeChangeDateListener() {
|
|
142
|
+
datepickerStartEl.value.removeEventListener('changeDate', setStartDate);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function destroyDatepickerElement() {
|
|
146
|
+
datepickerObject.value.destroy();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function setStartDate(event) {
|
|
150
|
+
startDate.value = event.detail.date
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function formatTime(time) {
|
|
154
|
+
return time.split(':').map(Number).length === 2 ? time + ':00' : time;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function addTimeToDate(time, date) {
|
|
158
|
+
const [hours, minutes, seconds] = time.split(':').map(Number)
|
|
159
|
+
return date.hour(hours).minute(minutes).second(seconds)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const toggleTimeInputs = () => {
|
|
163
|
+
showTimeInputs.value = !showTimeInputs.value
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
onMounted(() => {
|
|
167
|
+
initDatepickers();
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
onBeforeUnmount(() => {
|
|
171
|
+
removeChangeDateListener();
|
|
172
|
+
destroyDatepickerElement();
|
|
173
|
+
});
|
|
174
|
+
</script>
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2">
|
|
4
|
+
<div class="relative">
|
|
5
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
6
|
+
<IconCalendar class="w-4 h-4 text-gray-500 dark:text-gray-400"/>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<input ref="datepickerStartEl" type="text"
|
|
10
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
11
|
+
placeholder="From">
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="relative">
|
|
15
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
16
|
+
<IconCalendar class="w-4 h-4 text-gray-500 dark:text-gray-400"/>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<input ref="datepickerEndEl" type="text"
|
|
20
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
21
|
+
placeholder="To">
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div>
|
|
26
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2" :class="{hidden: !showTimeInputs}">
|
|
27
|
+
<div>
|
|
28
|
+
<div class="relative">
|
|
29
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
30
|
+
<IconTime class="w-4 h-4 text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-700"/>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<input v-model="startTime" type="time" id="start-time"
|
|
34
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
35
|
+
value="00:00" required/>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div>
|
|
40
|
+
<div class="relative">
|
|
41
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
42
|
+
<IconTime class="w-4 h-4 text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-700"/>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<input v-model="endTime" type="time" id="end-time"
|
|
46
|
+
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
47
|
+
value="00:00" required/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<button type="button"
|
|
53
|
+
class="text-blue-700 dark:text-blue-500 text-base font-medium hover:underline p-0 inline-flex items-center mb-2"
|
|
54
|
+
@click="toggleTimeInputs">{{ showTimeInputs ? 'Hide time' : 'Show time' }}
|
|
55
|
+
<svg class="w-8 h-8 ms-0.5 relative top-px" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
57
|
+
fill="none" viewBox="0 0 24 24">
|
|
58
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
59
|
+
d="m8 10 4 4 4-4"/>
|
|
60
|
+
</svg>
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
<script setup>
|
|
66
|
+
import {ref, computed, onMounted, watch, onBeforeUnmount} from 'vue';
|
|
67
|
+
import dayjs from 'dayjs';
|
|
68
|
+
import utc from 'dayjs/plugin/utc';
|
|
69
|
+
|
|
70
|
+
import {useCoreStore} from '@/stores/core';
|
|
71
|
+
|
|
72
|
+
import Datepicker from "flowbite-datepicker/Datepicker";
|
|
73
|
+
import IconCalendar from "@/components/icons/IconCalendar.vue";
|
|
74
|
+
import IconTime from "@/components/icons/IconTime.vue";
|
|
75
|
+
|
|
76
|
+
const coreStore = useCoreStore();
|
|
77
|
+
dayjs.extend(utc)
|
|
78
|
+
|
|
79
|
+
const props = defineProps({
|
|
80
|
+
valueStart: {
|
|
81
|
+
default: undefined
|
|
82
|
+
},
|
|
83
|
+
valueEnd: {
|
|
84
|
+
default: undefined
|
|
85
|
+
},
|
|
86
|
+
column: {
|
|
87
|
+
type: Object,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const emit = defineEmits(['update:valueStart', 'update:valueEnd']);
|
|
92
|
+
|
|
93
|
+
const datepickerStartEl = ref();
|
|
94
|
+
const datepickerEndEl = ref();
|
|
95
|
+
|
|
96
|
+
const showTimeInputs = ref(false);
|
|
97
|
+
|
|
98
|
+
const startDate = ref('');
|
|
99
|
+
const endDate = ref('');
|
|
100
|
+
|
|
101
|
+
const startTime = ref('');
|
|
102
|
+
const endTime = ref('');
|
|
103
|
+
|
|
104
|
+
const datepickerStartObject = ref('')
|
|
105
|
+
const datepickerEndObject = ref('')
|
|
106
|
+
|
|
107
|
+
const start = computed(() => {
|
|
108
|
+
if (!startDate.value) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let date = dayjs(startDate.value);
|
|
113
|
+
|
|
114
|
+
if (startTime.value) {
|
|
115
|
+
date = addTimeToDate(formatTime(startTime.value), date)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return date.utc().toISOString();
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const end = computed(() => {
|
|
122
|
+
if (!endDate.value) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let date = dayjs(endDate.value);
|
|
127
|
+
|
|
128
|
+
if (endTime.value) {
|
|
129
|
+
date = addTimeToDate(formatTime(endTime.value), date)
|
|
130
|
+
} else {
|
|
131
|
+
date = addTimeToDate('23:59:59', date)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return date.utc().toISOString();
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
function updateFromProps() {
|
|
138
|
+
if (!props.valueStart) {
|
|
139
|
+
datepickerStartEl.value.value = '';
|
|
140
|
+
startTime.value = '';
|
|
141
|
+
}
|
|
142
|
+
if (!props.valueEnd) {
|
|
143
|
+
datepickerEndEl.value.value = '';
|
|
144
|
+
endTime.value = '';
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
onMounted(() => {
|
|
149
|
+
updateFromProps();
|
|
150
|
+
|
|
151
|
+
watch(() => [props.valueStart, props.valueEnd], (value) => {
|
|
152
|
+
updateFromProps();
|
|
153
|
+
});
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
watch(start, () => {
|
|
157
|
+
//console.log('⚡ emit', start.value)
|
|
158
|
+
emit('update:valueStart', start.value)
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
watch(end, () => {
|
|
162
|
+
//console.log('⚡ emit', end.value)
|
|
163
|
+
emit('update:valueEnd', end.value)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
function initDatepickers() {
|
|
167
|
+
|
|
168
|
+
datepickerStartObject.value = new Datepicker(datepickerStartEl.value, {format: 'dd M yyyy'});
|
|
169
|
+
|
|
170
|
+
datepickerEndObject.value = new Datepicker(datepickerEndEl.value, {format: 'dd M yyyy'});
|
|
171
|
+
addChangeDateListener();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function addChangeDateListener() {
|
|
175
|
+
datepickerStartEl.value.addEventListener('changeDate', setStartDate)
|
|
176
|
+
datepickerEndEl.value.addEventListener('changeDate', setEndDate)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function removeChangeDateListener() {
|
|
180
|
+
datepickerStartEl.value.removeEventListener('changeDate', setStartDate);
|
|
181
|
+
datepickerEndEl.value.removeEventListener('changeDate', setEndDate);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function destroyDatepickerElement() {
|
|
185
|
+
datepickerStartObject.value.destroy();
|
|
186
|
+
datepickerEndObject.value.destroy();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function setStartDate(event) {
|
|
190
|
+
startDate.value = event.detail.date
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function setEndDate(event) {
|
|
194
|
+
endDate.value = event.detail.date
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function formatTime(time) {
|
|
198
|
+
return time.split(':').map(Number).length === 2 ? time + ':00' : time;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function addTimeToDate(time, date) {
|
|
202
|
+
const [hours, minutes, seconds] = time.split(':').map(Number)
|
|
203
|
+
return date.hour(hours).minute(minutes).second(seconds)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const toggleTimeInputs = () => {
|
|
207
|
+
showTimeInputs.value = !showTimeInputs.value
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
onMounted(() => {
|
|
211
|
+
initDatepickers();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
onBeforeUnmount(() => {
|
|
215
|
+
removeChangeDateListener();
|
|
216
|
+
destroyDatepickerElement();
|
|
217
|
+
})
|
|
218
|
+
</script>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-wrap gap-2">
|
|
3
|
+
<input
|
|
4
|
+
type="number" aria-describedby="helper-text-explanation"
|
|
5
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
6
|
+
placeholder="From"
|
|
7
|
+
v-model="start"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
<input
|
|
11
|
+
type="number" aria-describedby="helper-text-explanation"
|
|
12
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
13
|
+
placeholder="To"
|
|
14
|
+
v-model="end"
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
<button
|
|
18
|
+
v-if="isChanged"
|
|
19
|
+
type="button"
|
|
20
|
+
class="flex items-center p-0.5 ml-auto px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
21
|
+
@click="clear">Clear
|
|
22
|
+
</button>
|
|
23
|
+
|
|
24
|
+
<div class="w-full">
|
|
25
|
+
<vue-slider
|
|
26
|
+
class="custom-slider"
|
|
27
|
+
:dot-size="20"
|
|
28
|
+
height="7.99px"
|
|
29
|
+
:min="minFormatted"
|
|
30
|
+
:max="maxFormatted"
|
|
31
|
+
v-model="sliderValue"
|
|
32
|
+
@update:model-value="updateFromSlider($event)"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import VueSlider from 'vue-slider-component';
|
|
39
|
+
import 'vue-slider-component/theme/antd.css'
|
|
40
|
+
import {computed, onMounted, ref, watch} from "vue";
|
|
41
|
+
import debounce from 'debounce'
|
|
42
|
+
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
valueStart: {
|
|
45
|
+
default: '',
|
|
46
|
+
},
|
|
47
|
+
valueEnd: {
|
|
48
|
+
default: '',
|
|
49
|
+
},
|
|
50
|
+
min: {
|
|
51
|
+
default: 0,
|
|
52
|
+
},
|
|
53
|
+
max: {
|
|
54
|
+
default: 10,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const emit = defineEmits(['update:valueStart', 'update:valueEnd']);
|
|
59
|
+
|
|
60
|
+
const minFormatted = computed(() => Math.floor(props.min));
|
|
61
|
+
const maxFormatted = computed(() => Math.ceil(props.max));
|
|
62
|
+
|
|
63
|
+
const isChanged = computed(() => {
|
|
64
|
+
return start.value && start.value !== minFormatted.value || end.value && end.value !== maxFormatted.value;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const start = ref(props.valueStart);
|
|
68
|
+
const end = ref(props.valueEnd);
|
|
69
|
+
|
|
70
|
+
const sliderValue = ref([minFormatted.value, maxFormatted.value]);
|
|
71
|
+
|
|
72
|
+
const updateFromSlider =
|
|
73
|
+
debounce((value: [number, number]) => {
|
|
74
|
+
start.value = value[0] === minFormatted.value ? '': value[0];
|
|
75
|
+
end.value = value[1] === maxFormatted.value ? '': value[1];
|
|
76
|
+
}, 500);
|
|
77
|
+
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
updateStartFromProps();
|
|
80
|
+
updateEndFromProps();
|
|
81
|
+
|
|
82
|
+
watch(() => props.valueStart, (value) => {
|
|
83
|
+
updateStartFromProps();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
watch(() => props.valueEnd, (value) => {
|
|
87
|
+
updateEndFromProps();
|
|
88
|
+
});
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
function updateStartFromProps() {
|
|
92
|
+
start.value = props.valueStart;
|
|
93
|
+
setSliderValues(start.value, end.value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function updateEndFromProps() {
|
|
97
|
+
end.value = props.valueEnd;
|
|
98
|
+
setSliderValues(start.value, end.value)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
watch(start, () => {
|
|
102
|
+
console.log('⚡ emit', start.value)
|
|
103
|
+
emit('update:valueStart', start.value)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
watch(end, () => {
|
|
107
|
+
console.log('⚡ emit', end.value)
|
|
108
|
+
emit('update:valueEnd', end.value);
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const clear = () => {
|
|
112
|
+
start.value = ''
|
|
113
|
+
end.value = ''
|
|
114
|
+
setSliderValues('', '')
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function setSliderValues(start, end) {
|
|
118
|
+
sliderValue.value = [start || minFormatted.value, end || maxFormatted.value];
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<style lang="scss" scoped>
|
|
123
|
+
.custom-slider {
|
|
124
|
+
&:deep(.vue-slider-rail) {
|
|
125
|
+
background-color: rgb(229 231 235);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:deep(.vue-slider-dot-handle) {
|
|
129
|
+
background-color: #1c64f2;
|
|
130
|
+
border: none;
|
|
131
|
+
box-shadow: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:deep(.vue-slider-dot-handle:hover) {
|
|
135
|
+
background-color: #1c64f2;
|
|
136
|
+
border: none;
|
|
137
|
+
box-shadow: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:deep(.vue-slider-process) {
|
|
141
|
+
background-color: rgb(225 239 254);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:deep(.vue-slider-process:hover) {
|
|
145
|
+
background-color: rgb(225 239 254);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
</style>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative inline-block w-full" id="dropd">
|
|
3
|
+
<div class="relative">
|
|
4
|
+
<input
|
|
5
|
+
type="text"
|
|
6
|
+
v-model="search"
|
|
7
|
+
@focus="showDropdown = true"
|
|
8
|
+
class="block w-full pl-3 pr-10 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 sm:text-sm transition duration-150 ease-in-out dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
9
|
+
:placeholder="selectedItems.length ? '' : placeholder || 'Select...'"
|
|
10
|
+
/>
|
|
11
|
+
<div class="absolute inset-y-0 left-2 flex items-center pr-2 flex-wrap">
|
|
12
|
+
{{ }}
|
|
13
|
+
<div v-for="item in selectedItems" :key="item?.name" class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">
|
|
14
|
+
<span>{{ item.label }}</span>
|
|
15
|
+
<button
|
|
16
|
+
type="button"
|
|
17
|
+
@click="toogleItem(item)"
|
|
18
|
+
class="z-index-100 flex-shrink-0 ml-1 h-4 w-4 -mr-1 rounded-full inline-flex items-center justify-center text-gray-400 hover:text-gray-500 focus:outline-none focus:text-gray-500 focus:bg-gray-100"
|
|
19
|
+
>
|
|
20
|
+
<span class="sr-only">Remove item</span>
|
|
21
|
+
<svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
|
|
22
|
+
<path
|
|
23
|
+
stroke-linecap="round"
|
|
24
|
+
stroke-linejoin="round"
|
|
25
|
+
stroke-width="1.5"
|
|
26
|
+
d="M1 1l6 6m0-6L1 7"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="absolute inset-y-0 right-2 flex items-center pointer-events-none">
|
|
33
|
+
<!-- triangle icon -->
|
|
34
|
+
<IconCaretDownSolid v-if="!showDropdown" class="h-5 w-5 text-gray-400" />
|
|
35
|
+
<IconCaretUpSolid v-else class="h-5 w-5 text-gray-400" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div v-if="showDropdown" class="absolute z-10 mt-1 w-full bg-white shadow-lg dark:shadow-black rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
|
|
39
|
+
<div
|
|
40
|
+
v-for="item in filteredItems"
|
|
41
|
+
:key="item.value"
|
|
42
|
+
class="px-4 py-2 cursor-pointer hover:bg-gray-100"
|
|
43
|
+
:class="{ 'bg-blue-100': selectedItems.includes(item) }"
|
|
44
|
+
@click="toogleItem(item)"
|
|
45
|
+
>
|
|
46
|
+
<label :for="item.value">{{ item.label }}</label>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup>
|
|
53
|
+
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
|
|
54
|
+
import { IconCaretDownSolid, IconCaretUpSolid } from '@iconify-prerendered/vue-flowbite';
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const props = defineProps({
|
|
58
|
+
options: Array,
|
|
59
|
+
modelValue: {
|
|
60
|
+
default: undefined,
|
|
61
|
+
},
|
|
62
|
+
allowCustom: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
single: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
placeholder: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '',
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const emit = defineEmits(['update:modelValue']);
|
|
78
|
+
|
|
79
|
+
const search = ref('');
|
|
80
|
+
const showDropdown = ref(false);
|
|
81
|
+
|
|
82
|
+
const selectedItems = ref([]);
|
|
83
|
+
|
|
84
|
+
function updateFromProps() {
|
|
85
|
+
if (props.modelValue !== undefined) {
|
|
86
|
+
if (props.single) {
|
|
87
|
+
const el = props.options.find(item => item.value === props.modelValue);
|
|
88
|
+
if (el) {
|
|
89
|
+
selectedItems.value = [el];
|
|
90
|
+
} else {
|
|
91
|
+
selectedItems.value = [];
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
selectedItems.value = props.options.filter(item => props.modelValue.includes(item.value));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
updateFromProps();
|
|
101
|
+
|
|
102
|
+
watch(() => props.modelValue, (value) => {
|
|
103
|
+
updateFromProps();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
watch(() => props.options, () => {
|
|
107
|
+
updateFromProps();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
addClickListener();
|
|
111
|
+
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const filteredItems = computed(() => {
|
|
115
|
+
return props.options.filter(item =>
|
|
116
|
+
item.label.toLowerCase().includes(search.value.toLowerCase())
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const handleClickOutside = (event) => {
|
|
121
|
+
if (!event.target.closest('#dropd')) {
|
|
122
|
+
showDropdown.value = false;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const addClickListener = () => {
|
|
127
|
+
document.addEventListener('click', handleClickOutside);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const removeClickListener = () => {
|
|
131
|
+
document.removeEventListener('click', handleClickOutside);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const toogleItem = (item) => {
|
|
135
|
+
if (selectedItems.value.includes(item)) {
|
|
136
|
+
selectedItems.value = selectedItems.value.filter(i => i !== item);
|
|
137
|
+
} else {
|
|
138
|
+
if (props.single) {
|
|
139
|
+
selectedItems.value = [item];
|
|
140
|
+
} else {
|
|
141
|
+
selectedItems.value = [...selectedItems.value, item];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (props.single) {
|
|
145
|
+
showDropdown.value = false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
const list = selectedItems.value.map(item => item.value);
|
|
150
|
+
const updValue = list.length ? list : undefined;
|
|
151
|
+
let emitValue;
|
|
152
|
+
if (props.single) {
|
|
153
|
+
emitValue = updValue ? updValue[0] : undefined;
|
|
154
|
+
} else {
|
|
155
|
+
emitValue = updValue;
|
|
156
|
+
}
|
|
157
|
+
console.log('⚡ emit', emitValue)
|
|
158
|
+
emit('update:modelValue', emitValue);
|
|
159
|
+
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
onUnmounted(() => {
|
|
164
|
+
removeClickListener();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
</script>
|