vue3-time-duration 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Egor Lentarev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # vue3-time-duration
2
+ UI Widget to set a time duration. This is a component for vue 3
3
+
4
+ ## Getting started
5
+ ### Install the component:
6
+ ```angular2html
7
+ npm install --save vue3-time-duration
8
+ ```
9
+
10
+ ### Use the component directly:
11
+
12
+ #### Options API
13
+ ```html
14
+ <template>
15
+ <div>
16
+ <!-- INPUTS -->
17
+ <vue3-time-duration v-model="duration" />
18
+ </div>
19
+ </template>
20
+
21
+ <script lang="ts">
22
+ import "vue3-time-duration/dist/vue3-time-duration.css";
23
+ import Vue3TimeDuration from "vue3-time-duration";
24
+ import { IVue3TimeDuration } from "vue3-time-duration/types/IVue3TimeDuration";
25
+
26
+ export default defineComponent({
27
+ name: "FormLogin",
28
+ components: { Vue3TimeDuration },
29
+
30
+ data() {
31
+ return {
32
+ // Phone
33
+ duration: {
34
+ start: "10:00",
35
+ end: "10:05"
36
+ } as IVue3TimeDuration,
37
+ }
38
+ }
39
+ });
40
+ </script>
41
+ ```
42
+
43
+ #### Composition API
44
+ ```html
45
+ <script setup lang="ts">
46
+ import "vue3-time-duration/dist/vue3-time-duration.css";
47
+ import Vue3TimeDuration from "vue3-time-duration";
48
+ import { IVue3TimeDuration } from "vue3-time-duration/types/IVue3TimeDuration";
49
+
50
+ const duration: IVue3TimeDuration = reactive({ start: "10:00", end: "10:05" });
51
+ </script>
52
+
53
+ <template>
54
+ <div>
55
+ <!-- INPUTS -->
56
+ <vue3-time-duration v-model="duration" />
57
+ </div>
58
+ </template>
59
+ ```
60
+
61
+ #### If you want to customize the component styles. For example:
62
+ ```css
63
+ /* style.css file */
64
+
65
+ .vue3-time-duration {
66
+ --bg-element: #ffffff;
67
+ --bg-selected: #f3f3f3;
68
+ --color-font: #333;
69
+ --color-border: rgb(223, 230, 238);
70
+ }
71
+ ```
72
+
73
+ ## License
74
+ Copyright (c) 2025 Egor Lentarev.
75
+ Released under the [MIT License](https://github.com/lentarev/vue3-time-duration/blob/master/LICENSE).
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "vue3-time-duration",
3
+ "description": "UI widget for setting time duration. This is a component for vue 3",
4
+ "version": "0.0.1",
5
+ "private": false,
6
+ "author": "Egor Lentarev",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/lentarev/vue3-time-duration.git"
11
+ },
12
+ "type": "module",
13
+ "main": "./dist/vue3-time-duration.umd.js",
14
+ "module": "./dist/vue3-time-duration.es.js",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/vue3-time-duration.es.js",
18
+ "require": "./dist/vue3-time-duration.umd.js"
19
+ },
20
+ "./dist/vue3-time-duration.css": {
21
+ "import": "./dist/vue3-time-duration.css"
22
+ }
23
+ },
24
+ "types": "types/index.d.ts",
25
+ "scripts": {
26
+ "dev": "vite",
27
+ "build": "run-p type-check \"build-only {@}\" --",
28
+ "preview": "vite preview",
29
+ "test:unit": "vitest",
30
+ "build-only": "vite build",
31
+ "type-check": "vue-tsc --build",
32
+ "lint": "eslint . --fix",
33
+ "format": "prettier --write src/"
34
+ },
35
+ "dependencies": {
36
+ "vue": "^3.5.13"
37
+ },
38
+ "devDependencies": {
39
+ "@tsconfig/node22": "^22.0.1",
40
+ "@types/jsdom": "^21.1.7",
41
+ "@types/node": "^22.14.0",
42
+ "@vitejs/plugin-vue": "^5.2.3",
43
+ "@vitest/eslint-plugin": "^1.1.39",
44
+ "@vue/eslint-config-prettier": "^10.2.0",
45
+ "@vue/eslint-config-typescript": "^14.5.0",
46
+ "@vue/test-utils": "^2.4.6",
47
+ "@vue/tsconfig": "^0.7.0",
48
+ "eslint": "^9.22.0",
49
+ "eslint-plugin-vue": "~10.0.0",
50
+ "jiti": "^2.4.2",
51
+ "jsdom": "^26.0.0",
52
+ "npm-run-all2": "^7.0.2",
53
+ "prettier": "3.5.3",
54
+ "sass-embedded": "^1.89.0",
55
+ "typescript": "~5.8.0",
56
+ "vite": "^6.2.4",
57
+ "vite-plugin-vue-devtools": "^7.7.2",
58
+ "vitest": "^3.1.1",
59
+ "vue-tsc": "^2.2.8"
60
+ },
61
+ "keywords": [
62
+ "vue3",
63
+ "vue 3",
64
+ "time",
65
+ "duration",
66
+ "vue3-time-duration",
67
+ "time duration"
68
+ ],
69
+ "files": [
70
+ "dist",
71
+ "types"
72
+ ]
73
+ }
@@ -0,0 +1,4 @@
1
+ export interface IVue3TimeDuration {
2
+ start: string
3
+ end: string
4
+ }
@@ -0,0 +1,2 @@
1
+ import './vue3-time-duration'
2
+ import './IVue3TimeDuration'
@@ -0,0 +1,4 @@
1
+ declare module 'vue3-time-duration' {
2
+ import Vue3TimeDuration from 'vue3-time-duration/dist/vue3-time-duration.es'
3
+ export default Vue3TimeDuration
4
+ }