vuesp-components 1.3.0 → 1.3.2
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/README.md +185 -1
- package/dist/components/app/AppAside.vue.d.ts.map +1 -1
- package/dist/components/ui/drag-drop/VDragDrop.vue.d.ts +4 -4
- package/dist/components/ui/drag-drop/types.d.ts +2 -2
- package/dist/components/ui/drag-drop/types.d.ts.map +1 -1
- package/dist/components/ui/func/VFunc.vue.d.ts.map +1 -1
- package/dist/composables/index.es.js +1 -1
- package/dist/composables/types.d.ts +2 -2
- package/dist/composables/types.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +3 -3
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.es.js +23 -23
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.es.js +50 -50
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +994 -962
- package/dist/plugins/i18n/index.d.ts +2 -2
- package/dist/plugins/i18n/index.d.ts.map +1 -1
- package/dist/plugins/index.es.js +18 -13
- package/package.json +6 -6
- package/dist/helpers/fetch.d.ts +0 -14
- package/dist/helpers/fetch.d.ts.map +0 -1
- package/dist/helpers/utils.d.ts +0 -2
- package/dist/helpers/utils.d.ts.map +0 -1
- package/dist/utils-DxCyEA-K.js +0 -62
package/README.md
CHANGED
|
@@ -1,7 +1,191 @@
|
|
|
1
1
|
# Vuesp components
|
|
2
2
|
|
|
3
|
-
Component library for
|
|
3
|
+
Component library for [Vuesp](https://github.com/bondrogeen/vuesp) - Template for your arduino projects with a web interface.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install vuesp-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### yarn
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add vuesp-components
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### pnpm
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add vuesp-components
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Basic Setup
|
|
28
|
+
|
|
29
|
+
Import the components and styles in your Vue app:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { createApp } from 'vue'
|
|
33
|
+
import App from './App.vue'
|
|
34
|
+
import * as components from 'vuesp-components'
|
|
35
|
+
import 'vuesp-components/dist/style.css'
|
|
36
|
+
|
|
37
|
+
const app = createApp(App)
|
|
38
|
+
|
|
39
|
+
// Register all components globally
|
|
40
|
+
Object.entries(components).forEach(([name, component]) => {
|
|
41
|
+
if (typeof component === 'object' && component.name) {
|
|
42
|
+
app.component(component.name, component)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
app.mount('#app')
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Using Components
|
|
50
|
+
|
|
51
|
+
#### UI Components
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<template>
|
|
55
|
+
<div>
|
|
56
|
+
<VButton color="primary" @click="handleClick">Click me</VButton>
|
|
57
|
+
<VTextField v-model="text" label="Input text" />
|
|
58
|
+
<VSelect v-model="selected" :list="options" />
|
|
59
|
+
<VCheckbox v-model="checked" />
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import { ref } from 'vue'
|
|
65
|
+
|
|
66
|
+
const text = ref('')
|
|
67
|
+
const selected = ref('')
|
|
68
|
+
const checked = ref(false)
|
|
69
|
+
const options = [
|
|
70
|
+
{ label: 'Option 1', value: 1 },
|
|
71
|
+
{ label: 'Option 2', value: 2 },
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
const handleClick = () => {
|
|
75
|
+
console.log('Button clicked')
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### App Layout Components
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
<template>
|
|
84
|
+
<div class="app">
|
|
85
|
+
<AppHeader :changeTheme="toggleTheme" :notifications="notifications" />
|
|
86
|
+
<AppNav :menu="menuItems" :fullPath="route.path" />
|
|
87
|
+
<div class="app-content">
|
|
88
|
+
<RouterView />
|
|
89
|
+
</div>
|
|
90
|
+
<AppNotification ref="notification" />
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Dashboard Components
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<template>
|
|
99
|
+
<div class="dashboard">
|
|
100
|
+
<CardBase label="Temperature" icon="thermometer">
|
|
101
|
+
<CardInput :value="temperature" @input="updateTemp" />
|
|
102
|
+
</CardBase>
|
|
103
|
+
<CardBase label="Status" icon="info">
|
|
104
|
+
<CardButton label="Toggle" @click="toggleStatus" />
|
|
105
|
+
</CardBase>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Composables
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import { useForms } from 'vuesp-components/composables'
|
|
114
|
+
|
|
115
|
+
const { formData, submitForm, resetForm } = useForms()
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Helpers
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { someHelper } from 'vuesp-components/helpers'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Plugins
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { i18nPlugin } from 'vuesp-components/plugins'
|
|
128
|
+
|
|
129
|
+
app.use(i18nPlugin, {
|
|
130
|
+
locale: 'en',
|
|
131
|
+
})
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Features
|
|
135
|
+
|
|
136
|
+
- ✅ Vue 3 with TypeScript support
|
|
137
|
+
- ✅ Tailwind CSS styling
|
|
138
|
+
- ✅ Fully typed components
|
|
139
|
+
- ✅ Accessible UI components
|
|
140
|
+
- ✅ Responsive design
|
|
141
|
+
- ✅ Dark mode support
|
|
142
|
+
- ✅ Dashboard components for IoT interfaces
|
|
143
|
+
- ✅ Form utilities and composables
|
|
144
|
+
- ✅ i18n integration
|
|
145
|
+
|
|
146
|
+
## Components
|
|
147
|
+
|
|
148
|
+
### UI Components
|
|
149
|
+
- `VButton` - Button component
|
|
150
|
+
- `VCheckbox` - Checkbox component
|
|
151
|
+
- `VTextField` - Text input field
|
|
152
|
+
- `VSelect` - Select dropdown
|
|
153
|
+
- `VAutocomplete` - Autocomplete input
|
|
154
|
+
- `VTable` - Data table
|
|
155
|
+
- `VTabs` - Tabs component
|
|
156
|
+
- `VAccordion` - Accordion component
|
|
157
|
+
- `VDropdown` - Dropdown menu
|
|
158
|
+
- `VLoader` - Loading spinner
|
|
159
|
+
- `VIcon` - Icon component
|
|
160
|
+
- `VFile` - File upload
|
|
161
|
+
- `VDragDrop` - Drag and drop
|
|
162
|
+
- `VExpansion` - Expansion panel
|
|
163
|
+
- `VList` - List component
|
|
164
|
+
|
|
165
|
+
### App Components
|
|
166
|
+
- `AppHeader` - Header with theme toggle
|
|
167
|
+
- `AppNav` - Navigation menu
|
|
168
|
+
- `AppAside` - Sidebar
|
|
169
|
+
- `AppDialog` - Modal dialog
|
|
170
|
+
- `AppNotification` - Toast notifications
|
|
171
|
+
- `AppProgress` - Progress bar
|
|
172
|
+
|
|
173
|
+
### Dashboard Components
|
|
174
|
+
- `CardBase` - Base card
|
|
175
|
+
- `CardButton` - Button card
|
|
176
|
+
- `CardDate` - Date card
|
|
177
|
+
- `CardDimmer` - Dimmer control
|
|
178
|
+
- `CardInfo` - Info card
|
|
179
|
+
- `CardInput` - Input card
|
|
180
|
+
- `CardList` - List card
|
|
181
|
+
- `ItemEdit` - Edit item component
|
|
182
|
+
- `ItemOptions` - Options component
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
## 1.3.1 (2026-06-22)
|
|
187
|
+
|
|
188
|
+
- (bondrogeen) Build fixes and documentation updates
|
|
5
189
|
|
|
6
190
|
## 1.3.0 (2025-10-09)
|
|
7
191
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAside.vue.d.ts","sourceRoot":"","sources":["../../../src/components/app/AppAside.vue"],"names":[],"mappings":"AAmBA;
|
|
1
|
+
{"version":3,"file":"AppAside.vue.d.ts","sourceRoot":"","sources":["../../../src/components/app/AppAside.vue"],"names":[],"mappings":"AAmBA;AAqCA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,wBAAwB,CAAC;AAmB7E,iBAAS,cAAc;WA2ET,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;6EAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -18,16 +18,16 @@ declare const __VLS_component: import('vue').DefineComponent<IVDragDropProps, {}
|
|
|
18
18
|
"order-change": (payload: {
|
|
19
19
|
fromIndex: number;
|
|
20
20
|
toIndex: number;
|
|
21
|
-
movedItem:
|
|
22
|
-
newOrder:
|
|
21
|
+
movedItem: IVDragDropItem;
|
|
22
|
+
newOrder: IVDragDropItem[];
|
|
23
23
|
}) => any;
|
|
24
24
|
}, string, import('vue').PublicProps, Readonly<IVDragDropProps & {
|
|
25
25
|
"onUpdate:items"?: ((items: IVDragDropItem[]) => any) | undefined;
|
|
26
26
|
"onOrder-change"?: ((payload: {
|
|
27
27
|
fromIndex: number;
|
|
28
28
|
toIndex: number;
|
|
29
|
-
movedItem:
|
|
30
|
-
newOrder:
|
|
29
|
+
movedItem: IVDragDropItem;
|
|
30
|
+
newOrder: IVDragDropItem[];
|
|
31
31
|
}) => any) | undefined;
|
|
32
32
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}>;
|
|
33
33
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -10,8 +10,8 @@ export interface IVDragDropEmits {
|
|
|
10
10
|
(e: 'order-change', payload: {
|
|
11
11
|
fromIndex: number;
|
|
12
12
|
toIndex: number;
|
|
13
|
-
movedItem:
|
|
14
|
-
newOrder:
|
|
13
|
+
movedItem: IVDragDropItem;
|
|
14
|
+
newOrder: IVDragDropItem[];
|
|
15
15
|
}): void;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/drag-drop/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CACnI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFunc.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/func/VFunc.vue"],"names":[],"mappings":"AAuBA;
|
|
1
|
+
{"version":3,"file":"VFunc.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/func/VFunc.vue"],"names":[],"mappings":"AAuBA;AAqEA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,4BAA4B,CAAC;;;;;;;;;;;;AAqL3E,wBASG"}
|
|
@@ -2,7 +2,7 @@ import { reactive as h, computed as F } from "vue";
|
|
|
2
2
|
function S(d) {
|
|
3
3
|
const { validationSchema: n, initialValues: f = {} } = d, s = h({}), e = h({}), u = h({}), l = h({}), E = () => {
|
|
4
4
|
Object.keys(n).forEach((t) => {
|
|
5
|
-
s[t] = f[t]
|
|
5
|
+
s[t] = f[t] ?? "", e[t] = [], u[t] = !1, l[t] = !1;
|
|
6
6
|
});
|
|
7
7
|
}, v = (t, r) => {
|
|
8
8
|
const a = n[t] || [], c = [];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from 'vue';
|
|
2
|
-
export type Validator = (value:
|
|
2
|
+
export type Validator = (value: string, values?: Record<string, unknown>) => true | string;
|
|
3
3
|
export type ValidationSchema = Record<string, Validator[]>;
|
|
4
4
|
export interface FieldState {
|
|
5
|
-
value:
|
|
5
|
+
value: string | number;
|
|
6
6
|
errors: string[];
|
|
7
7
|
touched: boolean;
|
|
8
8
|
dirty: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/composables/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/composables/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC;AAC3F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACzH,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TypeGetDataValue, TypeGetParamsData, IDashboardItem } from '../types/types';
|
|
1
|
+
import { TypeGetDataValue, TypeGetParamsData, IDashboardItem, GetTypeByPath } from '../types/types';
|
|
2
2
|
export declare const getDataValue: TypeGetDataValue;
|
|
3
3
|
export declare const getParamsData: TypeGetParamsData;
|
|
4
4
|
export declare const getFunction: (body: string | undefined) => Function | null;
|
|
5
5
|
export declare const setStateItem: <T>(item: IDashboardItem, value: unknown, object: T) => any;
|
|
6
6
|
export declare const getStateItem: <T>(item: IDashboardItem, object: T) => {
|
|
7
|
-
value: string | NonNullable<
|
|
8
|
-
valueTo: string | NonNullable<
|
|
7
|
+
value: string | NonNullable<GetTypeByPath<T, string>>;
|
|
8
|
+
valueTo: string | NonNullable<GetTypeByPath<T, string>>;
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
11
11
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExG,eAAO,MAAM,YAAY,EAAE,gBAY1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,GAAG,SAAS,oBAInD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,OAAO,OAAO,EAAE,QAAQ,CAAC,QAU9E,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,cAAc,EAAE,QAAQ,CAAC;;;;;;;;;;;;CAkB9D,CAAC"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const v = (t,
|
|
2
|
-
const
|
|
3
|
-
let e =
|
|
4
|
-
for (const
|
|
5
|
-
if (e !== null && typeof e == "object" &&
|
|
6
|
-
e = e[
|
|
1
|
+
const v = (t, r) => {
|
|
2
|
+
const c = t.split(".");
|
|
3
|
+
let e = r;
|
|
4
|
+
for (const n of c)
|
|
5
|
+
if (e !== null && typeof e == "object" && n in e)
|
|
6
|
+
e = e[n];
|
|
7
7
|
else
|
|
8
8
|
return;
|
|
9
9
|
return e;
|
|
10
|
-
}, i = ({ args: t },
|
|
11
|
-
const [
|
|
12
|
-
let
|
|
10
|
+
}, i = ({ args: t }, r) => t.map((c) => v(c, r)), u = (t) => t ? (t = t.includes("return") ? t : `return ${t}`, new Function("v", "a", "b", "c", t)) : null, F = (t, r, c) => {
|
|
11
|
+
const [, ...e] = i(t, c);
|
|
12
|
+
let n = null;
|
|
13
13
|
try {
|
|
14
|
-
const o =
|
|
15
|
-
o && (
|
|
14
|
+
const o = u(t.set);
|
|
15
|
+
o && (n = o(r, ...e));
|
|
16
16
|
} catch (o) {
|
|
17
17
|
console.warn(o);
|
|
18
18
|
}
|
|
19
|
-
return
|
|
20
|
-
}, p = (t,
|
|
21
|
-
const
|
|
22
|
-
let
|
|
19
|
+
return n;
|
|
20
|
+
}, p = (t, r) => {
|
|
21
|
+
const c = i(t, r), [e, n, o, l] = c;
|
|
22
|
+
let s = e ?? "", g = s;
|
|
23
23
|
try {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const f =
|
|
27
|
-
f && (g = f(
|
|
28
|
-
} catch (
|
|
29
|
-
console.warn(
|
|
24
|
+
const a = u(t.get);
|
|
25
|
+
a && (s = a(s, n, o, l));
|
|
26
|
+
const f = u(t.getTo);
|
|
27
|
+
f && (g = f(s, n, o, l));
|
|
28
|
+
} catch (a) {
|
|
29
|
+
console.warn(a);
|
|
30
30
|
}
|
|
31
|
-
return { ...t, value:
|
|
31
|
+
return { ...t, value: s, valueTo: g };
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
34
|
v as getDataValue,
|
|
35
|
-
|
|
35
|
+
u as getFunction,
|
|
36
36
|
i as getParamsData,
|
|
37
37
|
p as getStateItem,
|
|
38
38
|
F as setStateItem
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
package/dist/helpers/index.es.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
const s = async (t) => {
|
|
1
|
+
const c = (t) => {
|
|
3
2
|
try {
|
|
4
|
-
|
|
5
|
-
return e.ok ? await e.json() : null;
|
|
3
|
+
return t ? JSON.parse(t) : null;
|
|
6
4
|
} catch (e) {
|
|
7
|
-
return console.
|
|
5
|
+
return console.warn(e), t;
|
|
8
6
|
}
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const n =
|
|
22
|
-
|
|
7
|
+
}, s = (t) => typeof t == "object" ? JSON.stringify(t) : t, h = (t) => c(s(t)), g = (t) => {
|
|
8
|
+
const e = ["B", "KB", "MB"];
|
|
9
|
+
if (t == 0) return "0 B";
|
|
10
|
+
let o = Math.floor(Math.log(t) / Math.log(1024));
|
|
11
|
+
return o > 1 && (o = 1), Math.round(t / Math.pow(1024, o)) + " " + e[o];
|
|
12
|
+
}, f = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), S = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), r = (t) => t >= 10 ? t : `0${t}`, p = (t) => {
|
|
13
|
+
const e = Math.floor(t % 31536e3 % 2628e3 / 86400), o = Math.floor(t % (3600 * 24) / 3600), n = Math.floor(t % 3600 / 60), m = Math.floor(t % 60);
|
|
14
|
+
return `${e ? e + " days " : ""} ${r(o)}:${r(n)}:${r(m)}`;
|
|
15
|
+
}, w = (t) => t.join("."), M = (t) => t.split(".").map((e) => +e), y = (t, e = "file") => {
|
|
16
|
+
const o = document.createElement("a");
|
|
17
|
+
o.setAttribute("download", e), o.href = t, document.body.appendChild(o), o.click(), o.remove();
|
|
18
|
+
}, T = (t) => new Promise((e, o) => {
|
|
19
|
+
const n = document.createElement("script");
|
|
20
|
+
n.src = t, n.type = "text/javascript", n.async = !0, n.onload = () => e(n), n.onerror = () => o(new Error(`Ошибка загрузки скрипта: ${t}`)), document.head.appendChild(n);
|
|
21
|
+
}), i = (t) => (e) => c(t.getItem(e)), a = (t) => (e, o) => {
|
|
22
|
+
t && t.setItem(e, s(o));
|
|
23
|
+
}, u = i(localStorage), l = a(localStorage), E = i(sessionStorage), L = a(sessionStorage), $ = (t = "isShow") => {
|
|
24
|
+
const e = u(t);
|
|
25
|
+
return e || l(t, !0), !e;
|
|
26
|
+
}, j = (t) => {
|
|
27
|
+
l("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
|
|
23
28
|
}, d = (t, e) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
};
|
|
29
|
+
if (!t) return null;
|
|
30
|
+
for (const o of t)
|
|
31
|
+
if (!(e === "/" || o.path === "/") && (o.path === e || e.includes(o.path)))
|
|
32
|
+
return o;
|
|
33
|
+
return null;
|
|
34
|
+
}, B = (t, e) => d(t, e);
|
|
30
35
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
J as timeUtcToString,
|
|
52
|
-
L as toByte,
|
|
53
|
-
d as uploadBinary,
|
|
54
|
-
i as uploadJson,
|
|
55
|
-
a as useFetch
|
|
36
|
+
r as addZero,
|
|
37
|
+
w as arrToStr,
|
|
38
|
+
j as changeTheme,
|
|
39
|
+
h as clone,
|
|
40
|
+
y as createDownloadLink,
|
|
41
|
+
f as dateUtcToString,
|
|
42
|
+
d as findMenuItem,
|
|
43
|
+
B as getPageTitle,
|
|
44
|
+
$ as isNewVersion,
|
|
45
|
+
c as jsonParse,
|
|
46
|
+
s as jsonString,
|
|
47
|
+
T as loadScript,
|
|
48
|
+
u as localGet,
|
|
49
|
+
l as localSet,
|
|
50
|
+
p as secToTime,
|
|
51
|
+
E as sessionGet,
|
|
52
|
+
L as sessionSet,
|
|
53
|
+
M as strToArr,
|
|
54
|
+
S as timeUtcToString,
|
|
55
|
+
g as toByte
|
|
56
56
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
2
|
export * from './components';
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: Plugin;
|
|
4
4
|
export default _default;
|
|
5
5
|
export * from './dashboard';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,MAAM,EAAa,MAAM,KAAK,CAAC;AAS7C,OAAO,uBAAuB,CAAC;AAI/B,cAAc,eAAe,CAAC;wBASzB,MAAM;AAPX,wBAOY;AAEZ,cAAc,aAAa,CAAC"}
|