@vesperjs/vue 0.1.8 → 0.1.9

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/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import * as _vue_reactivity0 from "@vue/reactivity";
1
+ import * as _$_vue_reactivity0 from "@vue/reactivity";
2
2
  import { ComputedGetter, DebuggerEvent, DebuggerOptions, OnCleanup, ReactiveEffect, Ref, ShallowUnwrapRef, UnwrapNestedRefs, WatchCallback, WatchStopHandle, WritableComputedOptions, WritableComputedRef, computed } from "@vue/reactivity";
3
3
  import { FetchError, FetchOptions, FetchResponse } from "ofetch";
4
- import * as vue_i18n0 from "vue-i18n";
5
- import * as _nanostores_router0 from "@nanostores/router";
4
+ import * as _$vue_i18n0 from "vue-i18n";
5
+ import * as _$_nanostores_router0 from "@nanostores/router";
6
6
  import { Router, RouterConfig } from "@nanostores/router";
7
7
 
8
8
  //#region src/composables/backend/api/use-api-constants.d.ts
9
9
  declare const useApiConstants: () => {
10
- baseURL: _vue_reactivity0.WritableComputedRef<string, string>;
10
+ baseURL: _$_vue_reactivity0.WritableComputedRef<string, string>;
11
11
  };
12
12
  //#endregion
13
13
  //#region src/composables/backend/api/use-ofetch.d.ts
@@ -102,7 +102,7 @@ declare const useExternalErrors: <P extends string>({
102
102
  }: {
103
103
  flash: Ref<Flash>;
104
104
  }) => {
105
- externalErrors: _vue_reactivity0.WritableComputedRef<Partial<Record<P, string[]>>, Partial<Record<P, string[]>>>;
105
+ externalErrors: _$_vue_reactivity0.WritableComputedRef<Partial<Record<P, string[]>>, Partial<Record<P, string[]>>>;
106
106
  clearExternalErrors: () => void;
107
107
  isSuccess: () => boolean;
108
108
  };
@@ -131,6 +131,13 @@ declare const useAlert: <BER extends object = BackendErrorResource>({
131
131
  };
132
132
  type UseAlertType = ReturnType<typeof useAlert>;
133
133
  //#endregion
134
+ //#region src/composables/ui/dom/use-element.d.ts
135
+ declare const useElement: <EL extends Element, P extends string>(el: EL | undefined | null, {
136
+ property
137
+ }: {
138
+ property: P;
139
+ }) => Record<P, Ref<string, string | null | undefined>>;
140
+ //#endregion
134
141
  //#region src/composables/util/use-date.d.ts
135
142
  declare const useDate: () => {
136
143
  isValidDate: (str: string) => boolean;
@@ -154,7 +161,7 @@ declare const useEntity: <M extends object, R extends object = M>() => {
154
161
  //#endregion
155
162
  //#region src/composables/use-flash.d.ts
156
163
  declare const useFlash: () => {
157
- flash: _vue_reactivity0.Ref<{
164
+ flash: _$_vue_reactivity0.Ref<{
158
165
  notice?: string | undefined;
159
166
  alert?: string | undefined;
160
167
  }, Flash | {
@@ -21623,14 +21630,14 @@ declare const useLocale: () => {
21623
21630
  //#endregion
21624
21631
  //#region src/composables/use-nano-route.d.ts
21625
21632
  declare const useNanoRoute: <T extends RouterConfig>(router: Router<T>) => {
21626
- params: _nanostores_router0.ParamsFromConfig<T>[string] | _nanostores_router0.ParamsFromConfig<T>[number] | _nanostores_router0.ParamsFromConfig<T>[symbol] | undefined;
21633
+ params: _$_nanostores_router0.ParamsFromConfig<T>[string] | _$_nanostores_router0.ParamsFromConfig<T>[number] | _$_nanostores_router0.ParamsFromConfig<T>[symbol] | undefined;
21627
21634
  query: Record<string, string> | undefined;
21628
21635
  path: string | undefined;
21629
21636
  };
21630
21637
  type UseNanoRouteType = ReturnType<typeof useNanoRoute>;
21631
21638
  //#endregion
21632
21639
  //#region src/i18n/i18n.d.ts
21633
- declare const i18n: vue_i18n0.I18n<{
21640
+ declare const i18n: _$vue_i18n0.I18n<{
21634
21641
  en: {
21635
21642
  backend: {
21636
21643
  error: {
@@ -21651,4 +21658,4 @@ declare const i18n: vue_i18n0.I18n<{
21651
21658
  };
21652
21659
  }, {}, {}, string, false>;
21653
21660
  //#endregion
21654
- export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseAlertType, type UseFlashType, type UseNanoRouteType, i18n, useAlert, useApiConstants, useDate, useEntity, useExternalErrors, useFlash, useLocale, useMutationApi, useNanoRoute, useOFetch, useQueryApi };
21661
+ export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, type UseAlertType, type UseFlashType, type UseNanoRouteType, i18n, useAlert, useApiConstants, useDate, useElement, useEntity, useExternalErrors, useFlash, useLocale, useMutationApi, useNanoRoute, useOFetch, useQueryApi };
package/dist/index.mjs CHANGED
@@ -233,6 +233,21 @@ const useAlert = function({ flash, caller }) {
233
233
  };
234
234
  };
235
235
  //#endregion
236
+ //#region src/composables/ui/dom/use-element.ts
237
+ const useElement = function(el, { property }) {
238
+ const propertyRef = computed({
239
+ get() {
240
+ return el && property in el ? el[property] : "";
241
+ },
242
+ set(value) {
243
+ if (el && property in el) el[property] = value ?? "";
244
+ }
245
+ });
246
+ const obj = {};
247
+ obj[property] = propertyRef;
248
+ return obj;
249
+ };
250
+ //#endregion
236
251
  //#region src/composables/util/use-date.ts
237
252
  const useDate = function() {
238
253
  const isValidDate = (str) => {
@@ -279,4 +294,4 @@ const useNanoRoute = function(router) {
279
294
  };
280
295
  };
281
296
  //#endregion
282
- export { i18n, useAlert, useApiConstants, useDate, useEntity, useExternalErrors, useFlash, useLocale, useMutationApi, useNanoRoute, useOFetch, useQueryApi };
297
+ export { i18n, useAlert, useApiConstants, useDate, useElement, useEntity, useExternalErrors, useFlash, useLocale, useMutationApi, useNanoRoute, useOFetch, useQueryApi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesperjs/vue",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "keywords": [
5
5
  "vue.js"
6
6
  ],
@@ -36,7 +36,7 @@
36
36
  "eslint": "^9.39.4",
37
37
  "eslint-plugin-vue": "^10.8.0",
38
38
  "oxfmt": "^0.42.0",
39
- "tsdown": "^0.21.5",
39
+ "tsdown": "^0.21.6",
40
40
  "typescript": "^5.9.3"
41
41
  },
42
42
  "scripts": {