@vuetify/v0 0.1.3 → 0.1.4
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/adapter-BN-h5JbD.d.mts +344 -0
- package/dist/adapter-CJIj5ySf.d.mts +11 -0
- package/dist/adapter-D_0ptsPm.mjs +229 -0
- package/dist/adapters-BQ-Lr3PW.mjs +1 -0
- package/dist/adapters-DEXpW9If.mjs +1 -0
- package/dist/adapters-Q9WaOsJp.mjs +1 -0
- package/dist/adapters-SSDVth5e.mjs +1 -0
- package/dist/browser/index.js +359 -933
- package/dist/components/index.d.mts +19 -6
- package/dist/components/index.mjs +37 -5
- package/dist/{components-C0zEvP7w.mjs → components-CMuzTJdK.mjs} +11 -4
- package/dist/composables/index.d.mts +17 -4
- package/dist/composables/index.mjs +36 -4
- package/dist/consola-DiUk9j3y.d.mts +15 -0
- package/dist/consola-GBy8XRuL.mjs +31 -0
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +3 -3
- package/dist/constants-B8pMSkcW.mjs +1 -0
- package/dist/createDataTable-BJnmvxfb.mjs +387 -0
- package/dist/createGroup-CPhp6FUh.mjs +363 -0
- package/dist/createPagination-cyOWlpfH.mjs +234 -0
- package/dist/createSelection-uqEbFgha.mjs +261 -0
- package/dist/createSingle-B59ya3aa.mjs +179 -0
- package/dist/createTokens-BlhLdHXE.mjs +682 -0
- package/dist/createTrinity-EeHQSsb6.mjs +149 -0
- package/dist/data-table/adapters/client/index.d.mts +3 -0
- package/dist/data-table/adapters/client/index.mjs +9 -0
- package/dist/data-table/adapters/index.d.mts +5 -0
- package/dist/data-table/adapters/index.mjs +12 -0
- package/dist/data-table/adapters/server/index.d.mts +3 -0
- package/dist/data-table/adapters/server/index.mjs +7 -0
- package/dist/data-table/adapters/virtual/index.d.mts +3 -0
- package/dist/data-table/adapters/virtual/index.mjs +9 -0
- package/dist/data-table/index.d.mts +7 -0
- package/dist/data-table/index.mjs +25 -0
- package/dist/date/index.d.mts +1 -1
- package/dist/date/index.mjs +2 -2
- package/dist/features/adapters/flagsmith/index.d.mts +16 -0
- package/dist/features/adapters/flagsmith/index.mjs +3 -0
- package/dist/features/adapters/launchdarkly/index.d.mts +15 -0
- package/dist/features/adapters/launchdarkly/index.mjs +3 -0
- package/dist/features/adapters/posthog/index.d.mts +15 -0
- package/dist/features/adapters/posthog/index.mjs +4 -0
- package/dist/features/index.d.mts +17 -0
- package/dist/features/index.mjs +18 -0
- package/dist/flagsmith-CHmpPGR7.mjs +40 -0
- package/dist/{globals-BwYsH-rt.mjs → globals-B_GVfG06.mjs} +2 -2
- package/dist/index-7mWYFHA6.d.mts +251 -0
- package/dist/index-BDTbJClL.d.mts +11 -0
- package/dist/index-BuOz3Rgm.d.mts +32 -0
- package/dist/{index-Bmem4l8m.d.mts → index-Bv1VN_j5.d.mts} +1 -1
- package/dist/{index-DFM5iBqh.d.mts → index-CQrDeqsK.d.mts} +280 -279
- package/dist/{index-2wh69fk5.d.mts → index-Dd0m0LIJ.d.mts} +135 -1407
- package/dist/{index-DBZTizq2.d.mts → index-UNwEBkQT.d.mts} +16 -2
- package/dist/index.d.mts +20 -7
- package/dist/index.mjs +39 -7
- package/dist/json/web-types.json +1 -1
- package/dist/launchdarkly-W8t8ZANX.mjs +28 -0
- package/dist/locale/adapters/index.d.mts +3 -0
- package/dist/locale/adapters/index.mjs +6 -0
- package/dist/locale/adapters/v0/index.d.mts +3 -0
- package/dist/locale/adapters/v0/index.mjs +5 -0
- package/dist/locale/index.d.mts +17 -0
- package/dist/locale/index.mjs +17 -0
- package/dist/logger/adapters/consola/index.d.mts +3 -0
- package/dist/logger/adapters/consola/index.mjs +3 -0
- package/dist/logger/adapters/index.d.mts +5 -0
- package/dist/logger/adapters/index.mjs +8 -0
- package/dist/logger/adapters/pino/index.d.mts +3 -0
- package/dist/logger/adapters/pino/index.mjs +5 -0
- package/dist/logger/adapters/v0/index.d.mts +3 -0
- package/dist/logger/adapters/v0/index.mjs +5 -0
- package/dist/logger/index.d.mts +17 -0
- package/dist/logger/index.mjs +10 -0
- package/dist/memory-BsZGbGnG.mjs +27 -0
- package/dist/memory-DVjquu_v.d.mts +25 -0
- package/dist/permissions/adapters/index.d.mts +18 -0
- package/dist/permissions/adapters/index.mjs +6 -0
- package/dist/permissions/adapters/v0/index.d.mts +18 -0
- package/dist/permissions/adapters/v0/index.mjs +5 -0
- package/dist/permissions/index.d.mts +17 -0
- package/dist/permissions/index.mjs +15 -0
- package/dist/pino-01x_NmWp.mjs +49 -0
- package/dist/pino-p-jDkNQd.d.mts +24 -0
- package/dist/posthog-BrGBPPir.mjs +50 -0
- package/dist/server-6cs14bj1.d.mts +20 -0
- package/dist/server-ClCwiLMA.mjs +45 -0
- package/dist/storage/adapters/index.d.mts +3 -0
- package/dist/storage/adapters/index.mjs +3 -0
- package/dist/storage/adapters/memory/index.d.mts +2 -0
- package/dist/storage/adapters/memory/index.mjs +3 -0
- package/dist/storage/index.d.mts +17 -0
- package/dist/storage/index.mjs +37 -0
- package/dist/theme/adapters/index.d.mts +17 -0
- package/dist/theme/adapters/index.mjs +6 -0
- package/dist/theme/adapters/v0/index.d.mts +17 -0
- package/dist/theme/adapters/v0/index.mjs +5 -0
- package/dist/theme/index.d.mts +17 -0
- package/dist/theme/index.mjs +16 -0
- package/dist/toArray-DIeXVX1C.mjs +38 -0
- package/dist/types/index.d.mts +1 -1
- package/dist/useClickOutside-p8HP07At.mjs +4680 -0
- package/dist/useFeatures-C4JF3Hgr.mjs +122 -0
- package/dist/useLocale-DlbShzF-.mjs +85 -0
- package/dist/useLogger-CO9JwbSJ.mjs +283 -0
- package/dist/usePermissions-DQVT_4nD.mjs +128 -0
- package/dist/useTheme-Bcw1Ebyt.mjs +135 -0
- package/dist/utilities/index.d.mts +3 -3
- package/dist/utilities/index.mjs +3 -3
- package/dist/{utilities-BbKjbXTx.mjs → utilities-BqS1sC1W.mjs} +20 -3
- package/dist/v0-B40YkIQ-.mjs +21 -0
- package/dist/v0-BOxb3nD1.d.mts +33 -0
- package/dist/v0-BogbIzpM.mjs +41 -0
- package/dist/v0-BtQCSBOG.mjs +37 -0
- package/dist/v0-C-9dv_1S.d.mts +10 -0
- package/dist/v0-CtjuUUPl.mjs +73 -0
- package/dist/v0-DHMoZ7dS.d.mts +22 -0
- package/dist/v0-ONBWyQYQ.mjs +83 -0
- package/dist/v0-RepwEY1F.d.mts +9 -0
- package/dist/virtual-B3IPkHC0.d.mts +9 -0
- package/dist/virtual-BP9WXRzN.mjs +44 -0
- package/package.json +34 -2
- package/dist/useClickOutside-DrkNYxDe.mjs +0 -8871
- /package/dist/{adapter-D95FHAtt.d.mts → adapter-DcwxFryd.d.mts} +0 -0
- /package/dist/{constants-DHKqjdjH.mjs → adapters-BGJKsBrw.mjs} +0 -0
- /package/dist/{htmlElements-DO9n35bD.mjs → htmlElements-d8iBCGpO.mjs} +0 -0
- /package/dist/{index-BLK67J_-.d.mts → index-BFBN5Zl3.d.mts} +0 -0
package/dist/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { Fragment, Teleport, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createPropsRestProxy, createTextVNode, createVNode, defineComponent, effectScope, guardReactiveProps, inject, isRef, mergeModels, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRaw, toRef, toValue, unref, useAttrs, useId as useId$1, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives } from "vue";
|
|
2
|
+
import { Fragment, Teleport, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createPropsRestProxy, createTextVNode, createVNode, defineComponent, effectScope, guardReactiveProps, hasInjectionContext, inject, isRef, mergeModels, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRaw, toRef, toValue, unref, useAttrs, useId as useId$1, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/constants/htmlElements.ts
|
|
5
5
|
const selfClosingTags = [
|
|
@@ -85,7 +85,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
85
85
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
86
86
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
87
87
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
88
|
-
const version = "0.1.
|
|
88
|
+
const version = "0.1.4";
|
|
89
89
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
90
90
|
const __LOGGER_ENABLED__ = false;
|
|
91
91
|
|
|
@@ -227,6 +227,23 @@ function isArray(item) {
|
|
|
227
227
|
return Array.isArray(item);
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
+
* Checks if a value is a DOM Element
|
|
231
|
+
*
|
|
232
|
+
* @param item The value to check
|
|
233
|
+
* @returns True if the value is a DOM Element
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* isElement(document.body) // true
|
|
238
|
+
* isElement('string') // false
|
|
239
|
+
* isElement(null) // false
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
243
|
+
function isElement(item) {
|
|
244
|
+
return item instanceof Element;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
230
247
|
* Checks if a value is null
|
|
231
248
|
*
|
|
232
249
|
* @param item The value to check
|
|
@@ -691,6 +708,21 @@ function createTrinity(useContext$1, provideContext$1, context) {
|
|
|
691
708
|
|
|
692
709
|
//#endregion
|
|
693
710
|
//#region src/composables/createPlugin/index.ts
|
|
711
|
+
/**
|
|
712
|
+
* @module createPlugin
|
|
713
|
+
*
|
|
714
|
+
* @see https://vuejs.org/guide/reusability/plugins.html
|
|
715
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-plugin
|
|
716
|
+
*
|
|
717
|
+
* @remarks
|
|
718
|
+
* Factory for creating Vue plugins with proper context provision.
|
|
719
|
+
*
|
|
720
|
+
* Wraps the provide function in app.runWithContext() to ensure proper execution context,
|
|
721
|
+
* allowing plugins to safely provide dependency injection contexts at the application level.
|
|
722
|
+
*
|
|
723
|
+
* Also exports `createPluginContext` — a higher-level factory that generates the standard
|
|
724
|
+
* context/plugin/consumer triple for plugin composables, eliminating boilerplate.
|
|
725
|
+
*/
|
|
694
726
|
const INSTALLED = Symbol.for("v0:installed-plugins");
|
|
695
727
|
function getInstalled(app) {
|
|
696
728
|
const ctx = app._context;
|
|
@@ -731,6 +763,68 @@ function createPlugin(options) {
|
|
|
731
763
|
});
|
|
732
764
|
} };
|
|
733
765
|
}
|
|
766
|
+
/**
|
|
767
|
+
* Creates the three standard functions for a plugin composable.
|
|
768
|
+
*
|
|
769
|
+
* @param defaultNamespace The default DI namespace string (e.g. `'v0:logger'`).
|
|
770
|
+
* @param factory Function that creates the composable context instance from options.
|
|
771
|
+
* @param config Optional setup callback and fallback factory.
|
|
772
|
+
* @returns A readonly tuple: `[createXContext, createXPlugin, useX]`.
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* ```ts
|
|
776
|
+
* // Simple — no setup or fallback
|
|
777
|
+
* export const [createStorageContext, createStoragePlugin, useStorage] =
|
|
778
|
+
* createPluginContext('v0:storage', options => createStorage(options))
|
|
779
|
+
*
|
|
780
|
+
* // With fallback — safe outside component instances
|
|
781
|
+
* export const [createLoggerContext, createLoggerPlugin, useLogger] =
|
|
782
|
+
* createPluginContext('v0:logger', options => createLogger(options), {
|
|
783
|
+
* fallback: ns => createFallbackLogger(ns),
|
|
784
|
+
* setup: (context) => {
|
|
785
|
+
* if (__DEV__ && IN_BROWSER) (window as any).__v0Logger__ = context
|
|
786
|
+
* },
|
|
787
|
+
* })
|
|
788
|
+
* ```
|
|
789
|
+
*/
|
|
790
|
+
function createPluginContext(defaultNamespace, factory, config) {
|
|
791
|
+
function createXContext(_options = {}) {
|
|
792
|
+
const { namespace = defaultNamespace, ...options } = _options;
|
|
793
|
+
const [_use, _provide] = createContext(namespace);
|
|
794
|
+
const context = factory(options);
|
|
795
|
+
function provide$1(_context = context, app) {
|
|
796
|
+
return _provide(_context, app);
|
|
797
|
+
}
|
|
798
|
+
return createTrinity(_use, provide$1, context);
|
|
799
|
+
}
|
|
800
|
+
function createXPlugin(_options = {}) {
|
|
801
|
+
const { namespace = defaultNamespace, ...options } = _options;
|
|
802
|
+
const [, provide$1, context] = createXContext({
|
|
803
|
+
...options,
|
|
804
|
+
namespace
|
|
805
|
+
});
|
|
806
|
+
return createPlugin({
|
|
807
|
+
namespace,
|
|
808
|
+
provide: (app) => {
|
|
809
|
+
provide$1(context, app);
|
|
810
|
+
},
|
|
811
|
+
setup: config?.setup ? (app) => config.setup(context, app, options) : void 0
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
function useX(namespace = defaultNamespace) {
|
|
815
|
+
if (config?.fallback) {
|
|
816
|
+
const instance = config.fallback(namespace);
|
|
817
|
+
if (!hasInjectionContext()) return instance;
|
|
818
|
+
return useContext(namespace, instance);
|
|
819
|
+
}
|
|
820
|
+
return useContext(namespace);
|
|
821
|
+
}
|
|
822
|
+
return [
|
|
823
|
+
createXContext,
|
|
824
|
+
createXPlugin,
|
|
825
|
+
useX
|
|
826
|
+
];
|
|
827
|
+
}
|
|
734
828
|
|
|
735
829
|
//#endregion
|
|
736
830
|
//#region src/composables/useLogger/adapters/consola.ts
|
|
@@ -1026,85 +1120,12 @@ function createFallbackLogger(namespace = "v0:logger") {
|
|
|
1026
1120
|
* })
|
|
1027
1121
|
* ```
|
|
1028
1122
|
*/
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
function provideLoggerContext(_context = context, app) {
|
|
1034
|
-
return _provideLoggerContext(_context, app);
|
|
1035
|
-
}
|
|
1036
|
-
return createTrinity(useLoggerContext, provideLoggerContext, context);
|
|
1037
|
-
}
|
|
1038
|
-
/**
|
|
1039
|
-
* Creates a new logger plugin.
|
|
1040
|
-
*
|
|
1041
|
-
* @param options The options for the logger plugin.
|
|
1042
|
-
* @returns A new logger plugin.
|
|
1043
|
-
*
|
|
1044
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-logger
|
|
1045
|
-
*
|
|
1046
|
-
* @example
|
|
1047
|
-
* ```ts
|
|
1048
|
-
* import { createApp } from 'vue'
|
|
1049
|
-
* import { createLoggerPlugin } from '@vuetify/v0'
|
|
1050
|
-
* import App from './App.vue'
|
|
1051
|
-
*
|
|
1052
|
-
* const app = createApp(App)
|
|
1053
|
-
*
|
|
1054
|
-
* app.use(
|
|
1055
|
-
* createLoggerPlugin({
|
|
1056
|
-
* level: 'debug',
|
|
1057
|
-
* prefix: '[MyApp]',
|
|
1058
|
-
* })
|
|
1059
|
-
* )
|
|
1060
|
-
*
|
|
1061
|
-
* app.mount('#app')
|
|
1062
|
-
* ```
|
|
1063
|
-
*/
|
|
1064
|
-
function createLoggerPlugin(_options = {}) {
|
|
1065
|
-
const { namespace = "v0:logger", ...options } = _options;
|
|
1066
|
-
const [, provideLoggerContext, context] = createLoggerContext({
|
|
1067
|
-
...options,
|
|
1068
|
-
namespace
|
|
1069
|
-
});
|
|
1070
|
-
return createPlugin({
|
|
1071
|
-
namespace,
|
|
1072
|
-
provide: (app) => {
|
|
1073
|
-
provideLoggerContext(context, app);
|
|
1074
|
-
},
|
|
1075
|
-
setup: (_app) => {}
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Uses an existing or creates a new logger instance.
|
|
1080
|
-
*
|
|
1081
|
-
* @param namespace The namespace for the logger context. Defaults to `'v0:logger'`.
|
|
1082
|
-
* @returns The logger instance.
|
|
1083
|
-
*
|
|
1084
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-logger
|
|
1085
|
-
*
|
|
1086
|
-
* @example
|
|
1087
|
-
* ```ts
|
|
1088
|
-
* import { useLogger } from '@vuetify/v0'
|
|
1089
|
-
*
|
|
1090
|
-
* const logger = useLogger()
|
|
1091
|
-
*
|
|
1092
|
-
* logger.info('This is an info message')
|
|
1093
|
-
* logger.debug('This is a debug message')
|
|
1094
|
-
* logger.error('This is an error message')
|
|
1095
|
-
* logger.level('debug')
|
|
1096
|
-
* logger.debug('This debug message will now be logged')
|
|
1097
|
-
* ```
|
|
1098
|
-
*/
|
|
1099
|
-
function useLogger(namespace = "v0:logger") {
|
|
1100
|
-
const fallback = createFallbackLogger(namespace);
|
|
1101
|
-
if (!instanceExists()) return fallback;
|
|
1102
|
-
try {
|
|
1103
|
-
return useContext(namespace, fallback);
|
|
1104
|
-
} catch {
|
|
1105
|
-
return fallback;
|
|
1123
|
+
const [createLoggerContext, createLoggerPlugin, useLogger] = createPluginContext("v0:logger", (options) => createLogger(options), {
|
|
1124
|
+
fallback: (ns) => createFallbackLogger(ns),
|
|
1125
|
+
setup: (context, _app, _options) => {
|
|
1126
|
+
if (!/* @__PURE__ */ isUndefined(false) && false);
|
|
1106
1127
|
}
|
|
1107
|
-
}
|
|
1128
|
+
});
|
|
1108
1129
|
|
|
1109
1130
|
//#endregion
|
|
1110
1131
|
//#region src/composables/createRegistry/index.ts
|
|
@@ -2688,92 +2709,101 @@ function createFallbackHydration() {
|
|
|
2688
2709
|
* })
|
|
2689
2710
|
* ```
|
|
2690
2711
|
*/
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2712
|
+
const [createHydrationContext, createHydrationPlugin, useHydration] = createPluginContext("v0:hydration", () => createHydration(), {
|
|
2713
|
+
fallback: () => createFallbackHydration(),
|
|
2714
|
+
setup: (context, app, _options) => {
|
|
2715
|
+
app.mixin({ async mounted() {
|
|
2716
|
+
if (!/* @__PURE__ */ isNull(this.$parent)) return;
|
|
2717
|
+
context.hydrate();
|
|
2718
|
+
await nextTick();
|
|
2719
|
+
context.settle();
|
|
2720
|
+
} });
|
|
2697
2721
|
}
|
|
2698
|
-
|
|
2699
|
-
|
|
2722
|
+
});
|
|
2723
|
+
|
|
2724
|
+
//#endregion
|
|
2725
|
+
//#region src/composables/createObserver/index.ts
|
|
2700
2726
|
/**
|
|
2701
|
-
*
|
|
2702
|
-
*
|
|
2703
|
-
* @param options The options for the hydration plugin.
|
|
2704
|
-
* @template E The type of the hydration context.
|
|
2705
|
-
* @returns A new hydration plugin.
|
|
2727
|
+
* @module createObserver
|
|
2706
2728
|
*
|
|
2707
|
-
* @
|
|
2708
|
-
*
|
|
2709
|
-
*
|
|
2710
|
-
*
|
|
2711
|
-
* import { createApp } from 'vue'
|
|
2712
|
-
* import { createHydrationPlugin } from '@vuetify/v0'
|
|
2713
|
-
* import App from './App.vue'
|
|
2714
|
-
*
|
|
2715
|
-
* const app = createApp(App)
|
|
2716
|
-
*
|
|
2717
|
-
* app.use(createHydrationPlugin())
|
|
2729
|
+
* @remarks
|
|
2730
|
+
* Internal factory for browser Observer API composables. Encapsulates the
|
|
2731
|
+
* shared lifecycle, hydration, pause/resume/stop, and target-watch logic
|
|
2732
|
+
* used by useResizeObserver, useIntersectionObserver, and useMutationObserver.
|
|
2718
2733
|
*
|
|
2719
|
-
*
|
|
2720
|
-
*
|
|
2734
|
+
* The `observer` ref uses a three-state sentinel:
|
|
2735
|
+
* - `undefined` — not yet created
|
|
2736
|
+
* - `null` — permanently stopped (`stop()` was called; `setup()` is a no-op)
|
|
2737
|
+
* - instance — active observer
|
|
2721
2738
|
*/
|
|
2722
|
-
function
|
|
2723
|
-
const {
|
|
2724
|
-
const
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2739
|
+
function createObserver(target, userCallback, config) {
|
|
2740
|
+
const { isHydrated } = useHydration();
|
|
2741
|
+
const targetRef = toRef(target);
|
|
2742
|
+
const observer = shallowRef(void 0);
|
|
2743
|
+
const isPaused = shallowRef(false);
|
|
2744
|
+
const isActive = toRef(() => !!observer.value);
|
|
2745
|
+
function invoke(entries) {
|
|
2746
|
+
config.onEntry?.(entries);
|
|
2747
|
+
userCallback(entries);
|
|
2748
|
+
if (config.once) {
|
|
2749
|
+
if (config.shouldStop ? config.shouldStop(entries) : true) stop();
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
function setup() {
|
|
2753
|
+
if (/* @__PURE__ */ isNull(observer.value)) return;
|
|
2754
|
+
if (!isHydrated.value || !config.supports || !/* @__PURE__ */ isElement(targetRef.value) || isPaused.value) return;
|
|
2755
|
+
observer.value = config.create(invoke);
|
|
2756
|
+
config.observe(observer.value, targetRef.value);
|
|
2757
|
+
if (config.immediate) {
|
|
2758
|
+
const entries = config.immediate(targetRef.value);
|
|
2759
|
+
if (config.onceIncludesImmediate) invoke(entries);
|
|
2760
|
+
else {
|
|
2761
|
+
config.onEntry?.(entries);
|
|
2762
|
+
userCallback(entries);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
watch(() => targetRef.value, (el, oldEl) => {
|
|
2767
|
+
if (oldEl || observer.value) cleanup();
|
|
2768
|
+
if (isHydrated.value && /* @__PURE__ */ isElement(el)) setup();
|
|
2769
|
+
}, { immediate: true });
|
|
2770
|
+
let stopHydrationWatch;
|
|
2771
|
+
if (!isHydrated.value) stopHydrationWatch = watch(() => isHydrated.value, (hydrated) => {
|
|
2772
|
+
if (hydrated && /* @__PURE__ */ isElement(targetRef.value) && !observer.value) {
|
|
2773
|
+
setup();
|
|
2774
|
+
stopHydrationWatch?.();
|
|
2775
|
+
stopHydrationWatch = void 0;
|
|
2740
2776
|
}
|
|
2741
2777
|
});
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
* <template>
|
|
2763
|
-
* <Transition :name="transition">
|
|
2764
|
-
* <div v-if="show">Animates only after hydration settles</div>
|
|
2765
|
-
* </Transition>
|
|
2766
|
-
* </template>
|
|
2767
|
-
* ```
|
|
2768
|
-
*/
|
|
2769
|
-
function useHydration(namespace = "v0:hydration") {
|
|
2770
|
-
const fallback = createFallbackHydration();
|
|
2771
|
-
if (!instanceExists()) return fallback;
|
|
2772
|
-
try {
|
|
2773
|
-
return useContext(namespace, fallback);
|
|
2774
|
-
} catch {
|
|
2775
|
-
return fallback;
|
|
2778
|
+
function cleanup() {
|
|
2779
|
+
if (observer.value) {
|
|
2780
|
+
observer.value.disconnect();
|
|
2781
|
+
observer.value = void 0;
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
function pause() {
|
|
2785
|
+
isPaused.value = true;
|
|
2786
|
+
config.onPause?.();
|
|
2787
|
+
observer.value?.disconnect();
|
|
2788
|
+
}
|
|
2789
|
+
function resume() {
|
|
2790
|
+
isPaused.value = false;
|
|
2791
|
+
setup();
|
|
2792
|
+
}
|
|
2793
|
+
function stop() {
|
|
2794
|
+
stopHydrationWatch?.();
|
|
2795
|
+
stopHydrationWatch = void 0;
|
|
2796
|
+
cleanup();
|
|
2797
|
+
observer.value = null;
|
|
2776
2798
|
}
|
|
2799
|
+
onScopeDispose(stop, true);
|
|
2800
|
+
return {
|
|
2801
|
+
isActive: shallowReadonly(isActive),
|
|
2802
|
+
isPaused: shallowReadonly(isPaused),
|
|
2803
|
+
pause,
|
|
2804
|
+
resume,
|
|
2805
|
+
stop
|
|
2806
|
+
};
|
|
2777
2807
|
}
|
|
2778
2808
|
|
|
2779
2809
|
//#endregion
|
|
@@ -2836,80 +2866,34 @@ function useHydration(namespace = "v0:hydration") {
|
|
|
2836
2866
|
* ```
|
|
2837
2867
|
*/
|
|
2838
2868
|
function useResizeObserver(target, callback, options = {}) {
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
function setup() {
|
|
2845
|
-
if (/* @__PURE__ */ isNull(observer.value)) return;
|
|
2846
|
-
if (!isHydrated.value || !SUPPORTS_OBSERVER || !targetRef.value || isPaused.value) return;
|
|
2847
|
-
observer.value = new ResizeObserver((entries) => {
|
|
2848
|
-
callback(entries.map((entry) => ({
|
|
2869
|
+
return createObserver(target, callback, {
|
|
2870
|
+
supports: SUPPORTS_OBSERVER,
|
|
2871
|
+
once: options.once,
|
|
2872
|
+
create: (cb) => new ResizeObserver((entries) => {
|
|
2873
|
+
cb(entries.map((e) => ({
|
|
2849
2874
|
contentRect: {
|
|
2850
|
-
width:
|
|
2851
|
-
height:
|
|
2852
|
-
top:
|
|
2853
|
-
left:
|
|
2875
|
+
width: e.contentRect.width,
|
|
2876
|
+
height: e.contentRect.height,
|
|
2877
|
+
top: e.contentRect.top,
|
|
2878
|
+
left: e.contentRect.left
|
|
2854
2879
|
},
|
|
2855
|
-
target:
|
|
2880
|
+
target: e.target
|
|
2856
2881
|
})));
|
|
2857
|
-
|
|
2858
|
-
})
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
callback([{
|
|
2882
|
+
}),
|
|
2883
|
+
observe: (obs, el) => obs.observe(el, { box: options.box ?? "content-box" }),
|
|
2884
|
+
immediate: options.immediate ? (el) => {
|
|
2885
|
+
const rect = el.getBoundingClientRect();
|
|
2886
|
+
return [{
|
|
2863
2887
|
contentRect: {
|
|
2864
2888
|
width: rect.width,
|
|
2865
2889
|
height: rect.height,
|
|
2866
2890
|
top: rect.top,
|
|
2867
2891
|
left: rect.left
|
|
2868
2892
|
},
|
|
2869
|
-
target:
|
|
2870
|
-
}]
|
|
2871
|
-
}
|
|
2872
|
-
}
|
|
2873
|
-
watch(() => targetRef.value, (el, oldEl) => {
|
|
2874
|
-
if (oldEl || observer.value) cleanup();
|
|
2875
|
-
if (isHydrated.value && el) setup();
|
|
2876
|
-
}, { immediate: true });
|
|
2877
|
-
let stopHydrationWatch;
|
|
2878
|
-
if (!isHydrated.value) stopHydrationWatch = watch(() => isHydrated.value, (hydrated) => {
|
|
2879
|
-
if (hydrated && targetRef.value && !observer.value) {
|
|
2880
|
-
setup();
|
|
2881
|
-
stopHydrationWatch?.();
|
|
2882
|
-
stopHydrationWatch = void 0;
|
|
2883
|
-
}
|
|
2893
|
+
target: el
|
|
2894
|
+
}];
|
|
2895
|
+
} : void 0
|
|
2884
2896
|
});
|
|
2885
|
-
function cleanup() {
|
|
2886
|
-
if (observer.value) {
|
|
2887
|
-
observer.value.disconnect();
|
|
2888
|
-
observer.value = void 0;
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
function pause() {
|
|
2892
|
-
isPaused.value = true;
|
|
2893
|
-
observer.value?.disconnect();
|
|
2894
|
-
}
|
|
2895
|
-
function resume() {
|
|
2896
|
-
isPaused.value = false;
|
|
2897
|
-
setup();
|
|
2898
|
-
}
|
|
2899
|
-
function stop() {
|
|
2900
|
-
stopHydrationWatch?.();
|
|
2901
|
-
stopHydrationWatch = void 0;
|
|
2902
|
-
cleanup();
|
|
2903
|
-
observer.value = null;
|
|
2904
|
-
}
|
|
2905
|
-
onScopeDispose(stop, true);
|
|
2906
|
-
return {
|
|
2907
|
-
isActive: shallowReadonly(isActive),
|
|
2908
|
-
isPaused: shallowReadonly(isPaused),
|
|
2909
|
-
pause,
|
|
2910
|
-
resume,
|
|
2911
|
-
stop
|
|
2912
|
-
};
|
|
2913
2897
|
}
|
|
2914
2898
|
/**
|
|
2915
2899
|
* A convenience composable that uses the Resize Observer API to track an
|
|
@@ -2953,7 +2937,7 @@ function useElementSize(target) {
|
|
|
2953
2937
|
width,
|
|
2954
2938
|
height,
|
|
2955
2939
|
isActive,
|
|
2956
|
-
isPaused,
|
|
2940
|
+
isPaused: shallowReadonly(isPaused),
|
|
2957
2941
|
pause,
|
|
2958
2942
|
resume,
|
|
2959
2943
|
stop
|
|
@@ -3534,88 +3518,7 @@ function createLocaleFallback() {
|
|
|
3534
3518
|
n: String
|
|
3535
3519
|
};
|
|
3536
3520
|
}
|
|
3537
|
-
|
|
3538
|
-
* Creates a new locale context.
|
|
3539
|
-
*
|
|
3540
|
-
* @param options The options for the locale context.
|
|
3541
|
-
* @template Z The type of the locale ticket.
|
|
3542
|
-
* @template E The type of the locale context.
|
|
3543
|
-
* @returns A new locale context.
|
|
3544
|
-
*
|
|
3545
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-locale
|
|
3546
|
-
*
|
|
3547
|
-
* @example
|
|
3548
|
-
* ```ts
|
|
3549
|
-
* import { createLocaleContext } from '@vuetify/v0'
|
|
3550
|
-
*
|
|
3551
|
-
* export const [useAppLocale, provideAppLocale, appLocale] = createLocaleContext({
|
|
3552
|
-
* namespace: 'app:locale',
|
|
3553
|
-
* messages: {
|
|
3554
|
-
* en: { hello: 'Hello' },
|
|
3555
|
-
* es: { hello: 'Hola' },
|
|
3556
|
-
* },
|
|
3557
|
-
* })
|
|
3558
|
-
*
|
|
3559
|
-
* // In a parent component:
|
|
3560
|
-
* provideAppLocale()
|
|
3561
|
-
*
|
|
3562
|
-
* // In a child component:
|
|
3563
|
-
* const locale = useAppLocale()
|
|
3564
|
-
* locale.select('es')
|
|
3565
|
-
* ```
|
|
3566
|
-
*/
|
|
3567
|
-
function createLocaleContext(_options = {}) {
|
|
3568
|
-
const { namespace = "v0:locale", ...options } = _options;
|
|
3569
|
-
const [useLocaleContext, _provideLocaleContext] = createContext(namespace);
|
|
3570
|
-
const context = createLocale(options);
|
|
3571
|
-
function provideLocaleContext(_context = context, app) {
|
|
3572
|
-
return _provideLocaleContext(_context, app);
|
|
3573
|
-
}
|
|
3574
|
-
return createTrinity(useLocaleContext, provideLocaleContext, context);
|
|
3575
|
-
}
|
|
3576
|
-
/**
|
|
3577
|
-
* Creates a new locale plugin.
|
|
3578
|
-
*
|
|
3579
|
-
* @param options The options for the locale plugin.
|
|
3580
|
-
* @template Z The type of the locale ticket.
|
|
3581
|
-
* @template E The type of the locale context.
|
|
3582
|
-
* @template R The type of the token ticket.
|
|
3583
|
-
* @template O The type of the token context.
|
|
3584
|
-
* @returns A new locale plugin.
|
|
3585
|
-
*
|
|
3586
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-locale
|
|
3587
|
-
*/
|
|
3588
|
-
function createLocalePlugin(_options = {}) {
|
|
3589
|
-
const { namespace = "v0:locale", adapter = new Vuetify0LocaleAdapter(), messages = {}, ...options } = _options;
|
|
3590
|
-
const [, provideLocaleContext, context] = createLocaleContext({
|
|
3591
|
-
...options,
|
|
3592
|
-
namespace,
|
|
3593
|
-
adapter,
|
|
3594
|
-
messages
|
|
3595
|
-
});
|
|
3596
|
-
return createPlugin({
|
|
3597
|
-
namespace,
|
|
3598
|
-
provide: (app) => {
|
|
3599
|
-
provideLocaleContext(context, app);
|
|
3600
|
-
}
|
|
3601
|
-
});
|
|
3602
|
-
}
|
|
3603
|
-
/**
|
|
3604
|
-
* Returns the current locale instance.
|
|
3605
|
-
*
|
|
3606
|
-
* @returns The current locale instance.
|
|
3607
|
-
*
|
|
3608
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-locale
|
|
3609
|
-
*/
|
|
3610
|
-
function useLocale(namespace = "v0:locale") {
|
|
3611
|
-
const fallback = createLocaleFallback();
|
|
3612
|
-
if (!instanceExists()) return fallback;
|
|
3613
|
-
try {
|
|
3614
|
-
return useContext(namespace, fallback);
|
|
3615
|
-
} catch {
|
|
3616
|
-
return fallback;
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3521
|
+
const [createLocaleContext, createLocalePlugin, useLocale] = createPluginContext("v0:locale", (options) => createLocale(options), { fallback: () => createLocaleFallback() });
|
|
3619
3522
|
|
|
3620
3523
|
//#endregion
|
|
3621
3524
|
//#region src/components/Breadcrumbs/BreadcrumbsRoot.vue
|
|
@@ -5863,133 +5766,52 @@ function createBreakpoints(_options = {}) {
|
|
|
5863
5766
|
update
|
|
5864
5767
|
};
|
|
5865
5768
|
}
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
}
|
|
5892
|
-
return createTrinity(useBreakpointsContext, provideBreakpointsContext, context);
|
|
5893
|
-
}
|
|
5894
|
-
/**
|
|
5895
|
-
* Creates a new breakpoints plugin.
|
|
5896
|
-
*
|
|
5897
|
-
* @param options The options for the breakpoints plugin.
|
|
5898
|
-
* @template E The type of the breakpoints context.
|
|
5899
|
-
* @returns A new breakpoints plugin.
|
|
5900
|
-
*
|
|
5901
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-breakpoints
|
|
5902
|
-
*
|
|
5903
|
-
* @example
|
|
5904
|
-
* ```ts
|
|
5905
|
-
* import { createApp } from 'vue'
|
|
5906
|
-
* import { createBreakpointsPlugin } from '@vuetify/v0'
|
|
5907
|
-
* import App from './App.vue'
|
|
5908
|
-
*
|
|
5909
|
-
* const app = createApp(App)
|
|
5910
|
-
*
|
|
5911
|
-
* app.use(
|
|
5912
|
-
* createBreakpointsPlugin({
|
|
5913
|
-
* namespace: 'v0:breakpoints',
|
|
5914
|
-
* mobileBreakpoint: 'md',
|
|
5915
|
-
* breakpoints: {
|
|
5916
|
-
* xs: 0,
|
|
5917
|
-
* sm: 600,
|
|
5918
|
-
* md: 840,
|
|
5919
|
-
* lg: 1145,
|
|
5920
|
-
* xl: 1545,
|
|
5921
|
-
* xxl: 2138,
|
|
5922
|
-
* },
|
|
5923
|
-
* })
|
|
5924
|
-
* )
|
|
5925
|
-
*
|
|
5926
|
-
* app.mount('#app')
|
|
5927
|
-
* ```
|
|
5928
|
-
*/
|
|
5929
|
-
function createBreakpointsPlugin(_options = {}) {
|
|
5930
|
-
const { namespace = "v0:breakpoints", ...options } = _options;
|
|
5931
|
-
const [, provideBreakpointsContext, context] = createBreakpointsContext({
|
|
5932
|
-
...options,
|
|
5933
|
-
namespace
|
|
5934
|
-
});
|
|
5935
|
-
return createPlugin({
|
|
5936
|
-
namespace,
|
|
5937
|
-
provide: (app) => {
|
|
5938
|
-
provideBreakpointsContext(context, app);
|
|
5939
|
-
},
|
|
5940
|
-
setup: (app) => {
|
|
5941
|
-
app.mixin({ mounted() {
|
|
5942
|
-
if (!/* @__PURE__ */ isNull(this.$parent)) return;
|
|
5943
|
-
const hydration = useHydration();
|
|
5944
|
-
function listener() {
|
|
5945
|
-
context.update();
|
|
5946
|
-
}
|
|
5947
|
-
const unwatch = watch(hydration.isHydrated, (hydrated) => {
|
|
5948
|
-
if (hydrated) listener();
|
|
5949
|
-
}, { immediate: true });
|
|
5950
|
-
const cleanup = useWindowEventListener("resize", listener, { passive: true });
|
|
5951
|
-
onScopeDispose(() => {
|
|
5952
|
-
cleanup();
|
|
5953
|
-
unwatch();
|
|
5954
|
-
}, true);
|
|
5955
|
-
} });
|
|
5956
|
-
}
|
|
5957
|
-
});
|
|
5958
|
-
}
|
|
5959
|
-
/**
|
|
5960
|
-
* Returns the current breakpoints instance.
|
|
5961
|
-
*
|
|
5962
|
-
* @param namespace The namespace for the breakpoints context. Defaults to `v0:breakpoints`.
|
|
5963
|
-
* @returns The current breakpoints instance.
|
|
5964
|
-
*
|
|
5965
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-breakpoints
|
|
5966
|
-
*
|
|
5967
|
-
* @example
|
|
5968
|
-
* ```vue
|
|
5969
|
-
* <script setup lang="ts">
|
|
5970
|
-
* import { useBreakpoints } from '@vuetify/v0'
|
|
5971
|
-
*
|
|
5972
|
-
* // Destructure for template auto-unwrapping
|
|
5973
|
-
* const { isMobile, mdAndUp } = useBreakpoints()
|
|
5974
|
-
*
|
|
5975
|
-
* // In script, use .value
|
|
5976
|
-
* if (isMobile.value) {
|
|
5977
|
-
* console.log('Mobile detected')
|
|
5978
|
-
* }
|
|
5979
|
-
* <\/script>
|
|
5980
|
-
*
|
|
5981
|
-
* <template>
|
|
5982
|
-
* <div class="pa-4">
|
|
5983
|
-
* <!-- Destructured refs auto-unwrap in templates -->
|
|
5984
|
-
* <p v-if="isMobile">Mobile layout active</p>
|
|
5985
|
-
* <p v-else-if="mdAndUp">Medium and up layout active</p>
|
|
5986
|
-
* </div>
|
|
5987
|
-
* </template>
|
|
5988
|
-
* ```
|
|
5989
|
-
*/
|
|
5990
|
-
function useBreakpoints(namespace = "v0:breakpoints") {
|
|
5991
|
-
return useContext(namespace);
|
|
5769
|
+
function createBreakpointsFallback() {
|
|
5770
|
+
return {
|
|
5771
|
+
breakpoints: createDefaultBreakpoints().breakpoints,
|
|
5772
|
+
name: readonly(shallowRef("xs")),
|
|
5773
|
+
width: readonly(shallowRef(0)),
|
|
5774
|
+
height: readonly(shallowRef(0)),
|
|
5775
|
+
isMobile: readonly(shallowRef(false)),
|
|
5776
|
+
xs: readonly(shallowRef(false)),
|
|
5777
|
+
sm: readonly(shallowRef(false)),
|
|
5778
|
+
md: readonly(shallowRef(false)),
|
|
5779
|
+
lg: readonly(shallowRef(false)),
|
|
5780
|
+
xl: readonly(shallowRef(false)),
|
|
5781
|
+
xxl: readonly(shallowRef(false)),
|
|
5782
|
+
smAndUp: readonly(shallowRef(false)),
|
|
5783
|
+
mdAndUp: readonly(shallowRef(false)),
|
|
5784
|
+
lgAndUp: readonly(shallowRef(false)),
|
|
5785
|
+
xlAndUp: readonly(shallowRef(false)),
|
|
5786
|
+
xxlAndUp: readonly(shallowRef(false)),
|
|
5787
|
+
smAndDown: readonly(shallowRef(false)),
|
|
5788
|
+
mdAndDown: readonly(shallowRef(false)),
|
|
5789
|
+
lgAndDown: readonly(shallowRef(false)),
|
|
5790
|
+
xlAndDown: readonly(shallowRef(false)),
|
|
5791
|
+
xxlAndDown: readonly(shallowRef(false)),
|
|
5792
|
+
update: () => {}
|
|
5793
|
+
};
|
|
5992
5794
|
}
|
|
5795
|
+
const [createBreakpointsContext, createBreakpointsPlugin, useBreakpoints] = createPluginContext("v0:breakpoints", (options) => createBreakpoints(options), {
|
|
5796
|
+
fallback: () => createBreakpointsFallback(),
|
|
5797
|
+
setup: (context, app, _options) => {
|
|
5798
|
+
app.mixin({ mounted() {
|
|
5799
|
+
if (!/* @__PURE__ */ isNull(this.$parent)) return;
|
|
5800
|
+
const hydration = useHydration();
|
|
5801
|
+
function listener() {
|
|
5802
|
+
context.update();
|
|
5803
|
+
}
|
|
5804
|
+
const unwatch = watch(hydration.isHydrated, (hydrated) => {
|
|
5805
|
+
if (hydrated) listener();
|
|
5806
|
+
}, { immediate: true });
|
|
5807
|
+
const cleanup = useWindowEventListener("resize", listener, { passive: true });
|
|
5808
|
+
onScopeDispose(() => {
|
|
5809
|
+
cleanup();
|
|
5810
|
+
unwatch();
|
|
5811
|
+
}, true);
|
|
5812
|
+
} });
|
|
5813
|
+
}
|
|
5814
|
+
});
|
|
5993
5815
|
|
|
5994
5816
|
//#endregion
|
|
5995
5817
|
//#region src/composables/useDate/index.ts
|
|
@@ -6299,120 +6121,23 @@ function createFeatures(_options = {}) {
|
|
|
6299
6121
|
}
|
|
6300
6122
|
};
|
|
6301
6123
|
}
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
* @returns A new features context.
|
|
6309
|
-
*
|
|
6310
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-features
|
|
6311
|
-
*
|
|
6312
|
-
* @example
|
|
6313
|
-
* ```ts
|
|
6314
|
-
* import { createFeaturesContext } from '@vuetify/v0'
|
|
6315
|
-
*
|
|
6316
|
-
* export const [useFeatures, provideFeatures, context] = createFeaturesContext({
|
|
6317
|
-
* namespace: 'app:features',
|
|
6318
|
-
* features: {
|
|
6319
|
-
* 'dark-mode': true,
|
|
6320
|
-
* 'theme-color': { $variation: 'blue' },
|
|
6321
|
-
* },
|
|
6322
|
-
* })
|
|
6323
|
-
* ```
|
|
6324
|
-
*/
|
|
6325
|
-
function createFeaturesContext(_options = {}) {
|
|
6326
|
-
const { namespace = "v0:features", ...options } = _options;
|
|
6327
|
-
const [useFeaturesContext, _provideFeaturesContext] = createContext(namespace);
|
|
6328
|
-
const context = createFeatures(options);
|
|
6329
|
-
function provideFeaturesContext(_context = context, app) {
|
|
6330
|
-
return _provideFeaturesContext(_context, app);
|
|
6331
|
-
}
|
|
6332
|
-
return createTrinity(useFeaturesContext, provideFeaturesContext, context);
|
|
6124
|
+
function createFeaturesFallback() {
|
|
6125
|
+
return {
|
|
6126
|
+
size: 0,
|
|
6127
|
+
variation: (_id, fallback = null) => fallback,
|
|
6128
|
+
sync: () => {}
|
|
6129
|
+
};
|
|
6333
6130
|
}
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
*
|
|
6342
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-features
|
|
6343
|
-
*
|
|
6344
|
-
* @example
|
|
6345
|
-
* ```ts
|
|
6346
|
-
* import { createApp } from 'vue'
|
|
6347
|
-
* import { createFeaturesPlugin } from '@vuetify/v0'
|
|
6348
|
-
* import App from './App.vue'
|
|
6349
|
-
*
|
|
6350
|
-
* const app = createApp(App)
|
|
6351
|
-
*
|
|
6352
|
-
* app.use(
|
|
6353
|
-
* createFeaturesPlugin({
|
|
6354
|
-
* features: {
|
|
6355
|
-
* 'dark-mode': true,
|
|
6356
|
-
* 'theme-color': { $variation: 'blue' },
|
|
6357
|
-
* },
|
|
6358
|
-
* })
|
|
6359
|
-
* )
|
|
6360
|
-
*
|
|
6361
|
-
* app.mount('#app')
|
|
6362
|
-
* ```
|
|
6363
|
-
*/
|
|
6364
|
-
function createFeaturesPlugin(_options = {}) {
|
|
6365
|
-
const { namespace = "v0:features", adapter, ...options } = _options;
|
|
6366
|
-
const [, provideFeaturesContext, context] = createFeaturesContext({
|
|
6367
|
-
...options,
|
|
6368
|
-
namespace
|
|
6369
|
-
});
|
|
6370
|
-
return createPlugin({
|
|
6371
|
-
namespace,
|
|
6372
|
-
provide: (app) => {
|
|
6373
|
-
provideFeaturesContext(context, app);
|
|
6374
|
-
},
|
|
6375
|
-
setup: (app) => {
|
|
6376
|
-
if (!adapter) return;
|
|
6377
|
-
const adapters = /* @__PURE__ */ isArray(adapter) ? adapter : [adapter];
|
|
6378
|
-
for (const adapter$1 of adapters) {
|
|
6379
|
-
const initialFlags = adapter$1.setup((flags) => {
|
|
6380
|
-
context.sync(flags);
|
|
6381
|
-
});
|
|
6382
|
-
context.sync(initialFlags);
|
|
6383
|
-
if (/* @__PURE__ */ isFunction(adapter$1.dispose)) app.onUnmount(() => adapter$1.dispose());
|
|
6384
|
-
}
|
|
6131
|
+
const [createFeaturesContext, createFeaturesPlugin, useFeatures] = createPluginContext("v0:features", (options) => createFeatures(options), {
|
|
6132
|
+
fallback: () => createFeaturesFallback(),
|
|
6133
|
+
setup: (context, app, { adapter }) => {
|
|
6134
|
+
if (!adapter) return;
|
|
6135
|
+
for (const a of /* @__PURE__ */ isArray(adapter) ? adapter : [adapter]) {
|
|
6136
|
+
context.sync(a.setup((flags) => context.sync(flags)));
|
|
6137
|
+
if (/* @__PURE__ */ isFunction(a.dispose)) app.onUnmount(() => a.dispose());
|
|
6385
6138
|
}
|
|
6386
|
-
}
|
|
6387
|
-
}
|
|
6388
|
-
/**
|
|
6389
|
-
* Returns the current features instance.
|
|
6390
|
-
*
|
|
6391
|
-
* @param namespace The namespace for the features context. Defaults to `v0:features`.
|
|
6392
|
-
* @template Z The type of the feature ticket.
|
|
6393
|
-
* @returns The current features instance.
|
|
6394
|
-
*
|
|
6395
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-features
|
|
6396
|
-
*
|
|
6397
|
-
* @example
|
|
6398
|
-
* ```vue
|
|
6399
|
-
* <script setup lang="ts">
|
|
6400
|
-
* import { useFeatures } from '@vuetify/v0'
|
|
6401
|
-
*
|
|
6402
|
-
* const features = useFeatures()
|
|
6403
|
-
* <\/script>
|
|
6404
|
-
*
|
|
6405
|
-
* <template>
|
|
6406
|
-
* <div>
|
|
6407
|
-
* <p>Features: {{ features.get('dark-mode') }}</p>
|
|
6408
|
-
* <p>Theme Color: {{ features.variation('theme-color') }}</p>
|
|
6409
|
-
* </div>
|
|
6410
|
-
* </template>
|
|
6411
|
-
* ```
|
|
6412
|
-
*/
|
|
6413
|
-
function useFeatures(namespace = "v0:features") {
|
|
6414
|
-
return useContext(namespace);
|
|
6415
|
-
}
|
|
6139
|
+
}
|
|
6140
|
+
});
|
|
6416
6141
|
|
|
6417
6142
|
//#endregion
|
|
6418
6143
|
//#region src/composables/createForm/index.ts
|
|
@@ -6507,6 +6232,8 @@ function createForm(options) {
|
|
|
6507
6232
|
errors.value = [];
|
|
6508
6233
|
isPristine.value = true;
|
|
6509
6234
|
isValid$1.value = null;
|
|
6235
|
+
isValidating$1.value = false;
|
|
6236
|
+
validationGeneration++;
|
|
6510
6237
|
}
|
|
6511
6238
|
let validationGeneration = 0;
|
|
6512
6239
|
async function validate$1(silent = false) {
|
|
@@ -6555,9 +6282,13 @@ function createForm(options) {
|
|
|
6555
6282
|
});
|
|
6556
6283
|
return ticket;
|
|
6557
6284
|
}
|
|
6285
|
+
function onboard(registrations) {
|
|
6286
|
+
return registry.batch(() => registrations.map((r) => register(r)));
|
|
6287
|
+
}
|
|
6558
6288
|
return {
|
|
6559
6289
|
...registry,
|
|
6560
6290
|
register,
|
|
6291
|
+
onboard,
|
|
6561
6292
|
reset,
|
|
6562
6293
|
submit,
|
|
6563
6294
|
validateOn,
|
|
@@ -7066,86 +6797,48 @@ function matchesKeyGroup(e, group, platformIsMac) {
|
|
|
7066
6797
|
* ```
|
|
7067
6798
|
*/
|
|
7068
6799
|
function useIntersectionObserver(target, callback, options = {}) {
|
|
7069
|
-
const { isHydrated } = useHydration();
|
|
7070
|
-
const targetRef = toRef(target);
|
|
7071
|
-
const observer = shallowRef();
|
|
7072
|
-
const isPaused = shallowRef(false);
|
|
7073
6800
|
const isIntersecting = shallowRef(false);
|
|
7074
|
-
const isActive = toRef(() => !!observer.value);
|
|
7075
|
-
function setup() {
|
|
7076
|
-
if (/* @__PURE__ */ isNull(observer.value)) return;
|
|
7077
|
-
if (!isHydrated.value || !SUPPORTS_INTERSECTION_OBSERVER || !targetRef.value || isPaused.value) return;
|
|
7078
|
-
observer.value = new IntersectionObserver((entries) => {
|
|
7079
|
-
const transformedEntries = entries.map((entry) => ({
|
|
7080
|
-
boundingClientRect: entry.boundingClientRect,
|
|
7081
|
-
intersectionRatio: entry.intersectionRatio,
|
|
7082
|
-
intersectionRect: entry.intersectionRect,
|
|
7083
|
-
isIntersecting: entry.isIntersecting,
|
|
7084
|
-
rootBounds: entry.rootBounds,
|
|
7085
|
-
target: entry.target,
|
|
7086
|
-
time: entry.time
|
|
7087
|
-
}));
|
|
7088
|
-
const latestEntry = transformedEntries.at(-1);
|
|
7089
|
-
if (latestEntry) isIntersecting.value = latestEntry.isIntersecting;
|
|
7090
|
-
callback(transformedEntries);
|
|
7091
|
-
if (options.once && latestEntry?.isIntersecting) stop();
|
|
7092
|
-
}, {
|
|
7093
|
-
root: options.root || null,
|
|
7094
|
-
rootMargin: options.rootMargin || "0px",
|
|
7095
|
-
threshold: options.threshold || 0
|
|
7096
|
-
});
|
|
7097
|
-
observer.value.observe(targetRef.value);
|
|
7098
|
-
if (options.immediate) callback([{
|
|
7099
|
-
boundingClientRect: targetRef.value.getBoundingClientRect(),
|
|
7100
|
-
intersectionRatio: 0,
|
|
7101
|
-
intersectionRect: new DOMRect(0, 0, 0, 0),
|
|
7102
|
-
isIntersecting: false,
|
|
7103
|
-
rootBounds: null,
|
|
7104
|
-
target: targetRef.value,
|
|
7105
|
-
time: performance.now()
|
|
7106
|
-
}]);
|
|
7107
|
-
}
|
|
7108
|
-
watch(() => targetRef.value, (el, oldEl) => {
|
|
7109
|
-
if (oldEl || observer.value) cleanup();
|
|
7110
|
-
if (isHydrated.value && el) setup();
|
|
7111
|
-
}, { immediate: true });
|
|
7112
|
-
let stopHydrationWatch;
|
|
7113
|
-
if (!isHydrated.value) stopHydrationWatch = watch(() => isHydrated.value, (hydrated) => {
|
|
7114
|
-
if (hydrated && targetRef.value && !observer.value) {
|
|
7115
|
-
setup();
|
|
7116
|
-
stopHydrationWatch?.();
|
|
7117
|
-
stopHydrationWatch = void 0;
|
|
7118
|
-
}
|
|
7119
|
-
});
|
|
7120
|
-
function cleanup() {
|
|
7121
|
-
if (observer.value) {
|
|
7122
|
-
observer.value.disconnect();
|
|
7123
|
-
observer.value = void 0;
|
|
7124
|
-
}
|
|
7125
|
-
}
|
|
7126
|
-
function pause() {
|
|
7127
|
-
isPaused.value = true;
|
|
7128
|
-
isIntersecting.value = false;
|
|
7129
|
-
observer.value?.disconnect();
|
|
7130
|
-
}
|
|
7131
|
-
function resume() {
|
|
7132
|
-
isPaused.value = false;
|
|
7133
|
-
setup();
|
|
7134
|
-
}
|
|
7135
|
-
function stop() {
|
|
7136
|
-
stopHydrationWatch?.();
|
|
7137
|
-
stopHydrationWatch = void 0;
|
|
7138
|
-
cleanup();
|
|
7139
|
-
observer.value = null;
|
|
7140
|
-
}
|
|
7141
|
-
onScopeDispose(stop, true);
|
|
7142
6801
|
return {
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
6802
|
+
...createObserver(target, callback, {
|
|
6803
|
+
supports: SUPPORTS_INTERSECTION_OBSERVER,
|
|
6804
|
+
once: options.once,
|
|
6805
|
+
create: (cb) => new IntersectionObserver((entries) => {
|
|
6806
|
+
cb(entries.map((e) => ({
|
|
6807
|
+
boundingClientRect: e.boundingClientRect,
|
|
6808
|
+
intersectionRatio: e.intersectionRatio,
|
|
6809
|
+
intersectionRect: e.intersectionRect,
|
|
6810
|
+
isIntersecting: e.isIntersecting,
|
|
6811
|
+
rootBounds: e.rootBounds,
|
|
6812
|
+
target: e.target,
|
|
6813
|
+
time: e.time
|
|
6814
|
+
})));
|
|
6815
|
+
}, {
|
|
6816
|
+
root: options.root ?? null,
|
|
6817
|
+
rootMargin: options.rootMargin ?? "0px",
|
|
6818
|
+
threshold: options.threshold ?? 0
|
|
6819
|
+
}),
|
|
6820
|
+
observe: (obs, el) => obs.observe(el),
|
|
6821
|
+
onEntry: (entries) => {
|
|
6822
|
+
const latest = entries.at(-1);
|
|
6823
|
+
if (latest) isIntersecting.value = latest.isIntersecting;
|
|
6824
|
+
},
|
|
6825
|
+
onPause: () => {
|
|
6826
|
+
isIntersecting.value = false;
|
|
6827
|
+
},
|
|
6828
|
+
shouldStop: (entries) => entries.at(-1)?.isIntersecting ?? false,
|
|
6829
|
+
immediate: options.immediate ? (el) => {
|
|
6830
|
+
return [{
|
|
6831
|
+
boundingClientRect: el.getBoundingClientRect(),
|
|
6832
|
+
intersectionRatio: 0,
|
|
6833
|
+
intersectionRect: new DOMRect(0, 0, 0, 0),
|
|
6834
|
+
isIntersecting: false,
|
|
6835
|
+
rootBounds: null,
|
|
6836
|
+
target: el,
|
|
6837
|
+
time: performance.now()
|
|
6838
|
+
}];
|
|
6839
|
+
} : void 0
|
|
6840
|
+
}),
|
|
6841
|
+
isIntersecting: shallowReadonly(isIntersecting)
|
|
7149
6842
|
};
|
|
7150
6843
|
}
|
|
7151
6844
|
/**
|
|
@@ -7469,11 +7162,6 @@ function usePrefersContrast() {
|
|
|
7469
7162
|
* ```
|
|
7470
7163
|
*/
|
|
7471
7164
|
function useMutationObserver(target, callback, options = {}) {
|
|
7472
|
-
const { isHydrated } = useHydration();
|
|
7473
|
-
const targetRef = toRef(target);
|
|
7474
|
-
const observer = shallowRef();
|
|
7475
|
-
const isPaused = shallowRef(false);
|
|
7476
|
-
const isActive = toRef(() => !!observer.value);
|
|
7477
7165
|
const observerOptions = {
|
|
7478
7166
|
childList: options.childList ?? true,
|
|
7479
7167
|
attributes: options.attributes ?? false,
|
|
@@ -7483,34 +7171,33 @@ function useMutationObserver(target, callback, options = {}) {
|
|
|
7483
7171
|
characterDataOldValue: options.characterDataOldValue ?? false,
|
|
7484
7172
|
attributeFilter: options.attributeFilter
|
|
7485
7173
|
};
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
type:
|
|
7492
|
-
target:
|
|
7493
|
-
addedNodes:
|
|
7494
|
-
removedNodes:
|
|
7495
|
-
previousSibling:
|
|
7496
|
-
nextSibling:
|
|
7497
|
-
attributeName:
|
|
7498
|
-
attributeNamespace:
|
|
7499
|
-
oldValue:
|
|
7174
|
+
return createObserver(target, callback, {
|
|
7175
|
+
supports: SUPPORTS_MUTATION_OBSERVER,
|
|
7176
|
+
once: options.once,
|
|
7177
|
+
create: (cb) => new MutationObserver((mutations) => {
|
|
7178
|
+
cb(mutations.map((m) => ({
|
|
7179
|
+
type: m.type,
|
|
7180
|
+
target: m.target,
|
|
7181
|
+
addedNodes: m.addedNodes,
|
|
7182
|
+
removedNodes: m.removedNodes,
|
|
7183
|
+
previousSibling: m.previousSibling,
|
|
7184
|
+
nextSibling: m.nextSibling,
|
|
7185
|
+
attributeName: m.attributeName,
|
|
7186
|
+
attributeNamespace: m.attributeNamespace,
|
|
7187
|
+
oldValue: m.oldValue
|
|
7500
7188
|
})));
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
if (options.immediate) {
|
|
7189
|
+
}),
|
|
7190
|
+
observe: (obs, el) => obs.observe(el, observerOptions),
|
|
7191
|
+
immediate: options.immediate ? (el) => {
|
|
7505
7192
|
const emptyNodeList = {
|
|
7506
7193
|
length: 0,
|
|
7507
7194
|
item: () => null,
|
|
7508
7195
|
forEach: () => {},
|
|
7509
7196
|
*[Symbol.iterator]() {}
|
|
7510
7197
|
};
|
|
7511
|
-
|
|
7198
|
+
return [{
|
|
7512
7199
|
type: "childList",
|
|
7513
|
-
target:
|
|
7200
|
+
target: el,
|
|
7514
7201
|
addedNodes: emptyNodeList,
|
|
7515
7202
|
removedNodes: emptyNodeList,
|
|
7516
7203
|
previousSibling: null,
|
|
@@ -7518,50 +7205,10 @@ function useMutationObserver(target, callback, options = {}) {
|
|
|
7518
7205
|
attributeName: null,
|
|
7519
7206
|
attributeNamespace: null,
|
|
7520
7207
|
oldValue: null
|
|
7521
|
-
}]
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
}
|
|
7525
|
-
watch(() => targetRef.value, (el, oldEl) => {
|
|
7526
|
-
if (oldEl || observer.value) cleanup();
|
|
7527
|
-
if (isHydrated.value && el) setup();
|
|
7528
|
-
}, { immediate: true });
|
|
7529
|
-
let stopHydrationWatch;
|
|
7530
|
-
if (!isHydrated.value) stopHydrationWatch = watch(() => isHydrated.value, (hydrated) => {
|
|
7531
|
-
if (hydrated && targetRef.value && !observer.value) {
|
|
7532
|
-
setup();
|
|
7533
|
-
stopHydrationWatch?.();
|
|
7534
|
-
stopHydrationWatch = void 0;
|
|
7535
|
-
}
|
|
7208
|
+
}];
|
|
7209
|
+
} : void 0,
|
|
7210
|
+
onceIncludesImmediate: true
|
|
7536
7211
|
});
|
|
7537
|
-
function cleanup() {
|
|
7538
|
-
if (observer.value) {
|
|
7539
|
-
observer.value.disconnect();
|
|
7540
|
-
observer.value = void 0;
|
|
7541
|
-
}
|
|
7542
|
-
}
|
|
7543
|
-
function pause() {
|
|
7544
|
-
isPaused.value = true;
|
|
7545
|
-
observer.value?.disconnect();
|
|
7546
|
-
}
|
|
7547
|
-
function resume() {
|
|
7548
|
-
isPaused.value = false;
|
|
7549
|
-
setup();
|
|
7550
|
-
}
|
|
7551
|
-
function stop() {
|
|
7552
|
-
stopHydrationWatch?.();
|
|
7553
|
-
stopHydrationWatch = void 0;
|
|
7554
|
-
cleanup();
|
|
7555
|
-
observer.value = null;
|
|
7556
|
-
}
|
|
7557
|
-
onScopeDispose(stop, true);
|
|
7558
|
-
return {
|
|
7559
|
-
isActive: shallowReadonly(isActive),
|
|
7560
|
-
isPaused: shallowReadonly(isPaused),
|
|
7561
|
-
pause,
|
|
7562
|
-
resume,
|
|
7563
|
-
stop
|
|
7564
|
-
};
|
|
7565
7212
|
}
|
|
7566
7213
|
|
|
7567
7214
|
//#endregion
|
|
@@ -8273,15 +7920,13 @@ function createPermissions(_options = {}) {
|
|
|
8273
7920
|
* })
|
|
8274
7921
|
* ```
|
|
8275
7922
|
*/
|
|
8276
|
-
function
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
return _providePermissionsContext(_context, app);
|
|
8282
|
-
}
|
|
8283
|
-
return createTrinity(usePermissionsContext, providePermissionsContext, context);
|
|
7923
|
+
function createPermissionsFallback() {
|
|
7924
|
+
return {
|
|
7925
|
+
size: 0,
|
|
7926
|
+
can: () => false
|
|
7927
|
+
};
|
|
8284
7928
|
}
|
|
7929
|
+
const [createPermissionsContext, createPermissionsPlugin, usePermissions] = createPluginContext("v0:permissions", (options) => createPermissions(options), { fallback: () => createPermissionsFallback() });
|
|
8285
7930
|
/**
|
|
8286
7931
|
* Creates a new permissions plugin.
|
|
8287
7932
|
*
|
|
@@ -8312,45 +7957,6 @@ function createPermissionsContext(_options = {}) {
|
|
|
8312
7957
|
* app.mount('#app')
|
|
8313
7958
|
* ```
|
|
8314
7959
|
*/
|
|
8315
|
-
function createPermissionsPlugin(_options = {}) {
|
|
8316
|
-
const { namespace = "v0:permissions", ...options } = _options;
|
|
8317
|
-
const [, providePermissionContext, context] = createPermissionsContext({
|
|
8318
|
-
...options,
|
|
8319
|
-
namespace
|
|
8320
|
-
});
|
|
8321
|
-
return createPlugin({
|
|
8322
|
-
namespace,
|
|
8323
|
-
provide: (app) => {
|
|
8324
|
-
providePermissionContext(context, app);
|
|
8325
|
-
}
|
|
8326
|
-
});
|
|
8327
|
-
}
|
|
8328
|
-
/**
|
|
8329
|
-
* Returns the current permissions instance.
|
|
8330
|
-
*
|
|
8331
|
-
* @template Z The type of the permission ticket.
|
|
8332
|
-
* @returns The current permissions instance.
|
|
8333
|
-
*
|
|
8334
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-permissions
|
|
8335
|
-
*
|
|
8336
|
-
* @example
|
|
8337
|
-
* ```vue
|
|
8338
|
-
* <script setup lang="ts">
|
|
8339
|
-
* import { usePermissions } from '@vuetify/v0'
|
|
8340
|
-
*
|
|
8341
|
-
* const { can } = usePermissions()
|
|
8342
|
-
* <\/script>
|
|
8343
|
-
*
|
|
8344
|
-
* <template>
|
|
8345
|
-
* <div>
|
|
8346
|
-
* <p v-if="can('admin', 'read', 'users')">Admin access</p>
|
|
8347
|
-
* </div>
|
|
8348
|
-
* </template>
|
|
8349
|
-
* ```
|
|
8350
|
-
*/
|
|
8351
|
-
function usePermissions(namespace = "v0:permissions") {
|
|
8352
|
-
return useContext(namespace);
|
|
8353
|
-
}
|
|
8354
7960
|
|
|
8355
7961
|
//#endregion
|
|
8356
7962
|
//#region src/composables/createQueue/index.ts
|
|
@@ -9122,76 +8728,10 @@ function createStorage(options = {}) {
|
|
|
9122
8728
|
clear
|
|
9123
8729
|
};
|
|
9124
8730
|
}
|
|
9125
|
-
function
|
|
9126
|
-
|
|
9127
|
-
const [useStorageContext, _provideStorageContext] = createContext(namespace);
|
|
9128
|
-
const context = createStorage(options);
|
|
9129
|
-
function provideStorageContext(_context = context, app) {
|
|
9130
|
-
return _provideStorageContext(_context, app);
|
|
9131
|
-
}
|
|
9132
|
-
return createTrinity(useStorageContext, provideStorageContext, context);
|
|
9133
|
-
}
|
|
9134
|
-
/**
|
|
9135
|
-
* Creates a new storage plugin.
|
|
9136
|
-
*
|
|
9137
|
-
* @param options The options for the storage plugin.
|
|
9138
|
-
* @returns A new storage plugin.
|
|
9139
|
-
*
|
|
9140
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-storage
|
|
9141
|
-
*
|
|
9142
|
-
* @example
|
|
9143
|
-
* ```ts
|
|
9144
|
-
* import { createApp } from 'vue'
|
|
9145
|
-
* import { createStoragePlugin } from '@vuetify/v0'
|
|
9146
|
-
* import App from './App.vue'
|
|
9147
|
-
*
|
|
9148
|
-
* const app = createApp(App)
|
|
9149
|
-
*
|
|
9150
|
-
* app.use(createStoragePlugin())
|
|
9151
|
-
*
|
|
9152
|
-
* app.mount('#app')
|
|
9153
|
-
* ```
|
|
9154
|
-
*/
|
|
9155
|
-
function createStoragePlugin(_options = {}) {
|
|
9156
|
-
const { namespace = "v0:storage", ...options } = _options;
|
|
9157
|
-
const [, provideStorageContext, context] = createStorageContext({
|
|
9158
|
-
...options,
|
|
9159
|
-
namespace
|
|
9160
|
-
});
|
|
9161
|
-
return createPlugin({
|
|
9162
|
-
namespace,
|
|
9163
|
-
provide: (app) => {
|
|
9164
|
-
provideStorageContext(context, app);
|
|
9165
|
-
}
|
|
9166
|
-
});
|
|
9167
|
-
}
|
|
9168
|
-
/**
|
|
9169
|
-
* Returns the current storage instance.
|
|
9170
|
-
*
|
|
9171
|
-
* @param namespace The namespace for the storage context. Defaults to `'v0:storage'`.
|
|
9172
|
-
* @returns The current storage instance.
|
|
9173
|
-
*
|
|
9174
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-storage
|
|
9175
|
-
*
|
|
9176
|
-
* @example
|
|
9177
|
-
* ```vue
|
|
9178
|
-
* <script setup lang="ts">
|
|
9179
|
-
* import { useStorage } from '@vuetify/v0'
|
|
9180
|
-
*
|
|
9181
|
-
* const storage = useStorage()
|
|
9182
|
-
* const username = storage.get('username', 'Guest')
|
|
9183
|
-
* <\/script>
|
|
9184
|
-
*
|
|
9185
|
-
* <template>
|
|
9186
|
-
* <div>
|
|
9187
|
-
* <p>Username: {{ username }}</p>
|
|
9188
|
-
* </div>
|
|
9189
|
-
* </template>
|
|
9190
|
-
* ```
|
|
9191
|
-
*/
|
|
9192
|
-
function useStorage(namespace = "v0:storage") {
|
|
9193
|
-
return useContext(namespace);
|
|
8731
|
+
function createStorageFallback() {
|
|
8732
|
+
return createStorage({ adapter: new MemoryAdapter() });
|
|
9194
8733
|
}
|
|
8734
|
+
const [createStorageContext, createStoragePlugin, useStorage] = createPluginContext("v0:storage", (options) => createStorage(options), { fallback: () => createStorageFallback() });
|
|
9195
8735
|
|
|
9196
8736
|
//#endregion
|
|
9197
8737
|
//#region src/composables/useTheme/adapters/adapter.ts
|
|
@@ -9384,134 +8924,20 @@ function createTheme(_options = {}) {
|
|
|
9384
8924
|
}
|
|
9385
8925
|
};
|
|
9386
8926
|
}
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
*
|
|
9395
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
9396
|
-
*
|
|
9397
|
-
* @example
|
|
9398
|
-
* ```ts
|
|
9399
|
-
* import { createThemeContext } from '@vuetify/v0'
|
|
9400
|
-
*
|
|
9401
|
-
* export const [useThemeContext, provideThemeContext, context] = createThemeContext({
|
|
9402
|
-
* namespace: 'v0:theme',
|
|
9403
|
-
* default: 'light',
|
|
9404
|
-
* themes: {
|
|
9405
|
-
* light: {
|
|
9406
|
-
* dark: false,
|
|
9407
|
-
* colors: {
|
|
9408
|
-
* primary: '#3b82f6',
|
|
9409
|
-
* },
|
|
9410
|
-
* },
|
|
9411
|
-
* dark: {
|
|
9412
|
-
* dark: true,
|
|
9413
|
-
* colors: {
|
|
9414
|
-
* primary: '#675496',
|
|
9415
|
-
* },
|
|
9416
|
-
* },
|
|
9417
|
-
* },
|
|
9418
|
-
* })
|
|
9419
|
-
* ```
|
|
9420
|
-
*/
|
|
9421
|
-
function createThemeContext(_options = {}) {
|
|
9422
|
-
const { namespace = "v0:theme", ...options } = _options;
|
|
9423
|
-
const [useThemeContext, _provideThemeContext] = createContext(namespace);
|
|
9424
|
-
const context = createTheme(options);
|
|
9425
|
-
function provideThemeContext(_context = context, app) {
|
|
9426
|
-
return _provideThemeContext(_context, app);
|
|
9427
|
-
}
|
|
9428
|
-
return createTrinity(useThemeContext, provideThemeContext, context);
|
|
9429
|
-
}
|
|
9430
|
-
/**
|
|
9431
|
-
* Creates a new theme plugin.
|
|
9432
|
-
*
|
|
9433
|
-
* @param options The options for the theme plugin.
|
|
9434
|
-
* @template Z The type of the theme ticket.
|
|
9435
|
-
* @template E The type of the theme context.
|
|
9436
|
-
* @returns A new theme plugin.
|
|
9437
|
-
*
|
|
9438
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
9439
|
-
*
|
|
9440
|
-
* @example
|
|
9441
|
-
* ```ts
|
|
9442
|
-
* import { createApp } from 'vue'
|
|
9443
|
-
* import { createThemePlugin } from '@vuetify/v0'
|
|
9444
|
-
* import App from './App.vue'
|
|
9445
|
-
*
|
|
9446
|
-
* const app = createApp(App)
|
|
9447
|
-
*
|
|
9448
|
-
* app.use(
|
|
9449
|
-
* createThemePlugin({
|
|
9450
|
-
* default: 'light',
|
|
9451
|
-
* themes: {
|
|
9452
|
-
* light: {
|
|
9453
|
-
* dark: false,
|
|
9454
|
-
* colors: {
|
|
9455
|
-
* primary: '#3b82f6',
|
|
9456
|
-
* },
|
|
9457
|
-
* },
|
|
9458
|
-
* dark: {
|
|
9459
|
-
* dark: true,
|
|
9460
|
-
* colors: {
|
|
9461
|
-
* primary: '#675496',
|
|
9462
|
-
* },
|
|
9463
|
-
* },
|
|
9464
|
-
* },
|
|
9465
|
-
* })
|
|
9466
|
-
* )
|
|
9467
|
-
*
|
|
9468
|
-
* app.mount('#app')
|
|
9469
|
-
* ```
|
|
9470
|
-
*/
|
|
9471
|
-
function createThemePlugin(_options = {}) {
|
|
9472
|
-
const { adapter = new Vuetify0ThemeAdapter(), namespace = "v0:theme", palette = {}, themes = {}, target, ...options } = _options;
|
|
9473
|
-
const [, provideThemeContext, context] = createThemeContext({
|
|
9474
|
-
...options,
|
|
9475
|
-
namespace,
|
|
9476
|
-
themes,
|
|
9477
|
-
palette
|
|
9478
|
-
});
|
|
9479
|
-
return createPlugin({
|
|
9480
|
-
namespace,
|
|
9481
|
-
provide: (app) => {
|
|
9482
|
-
provideThemeContext(context, app);
|
|
9483
|
-
},
|
|
9484
|
-
setup: (app) => {
|
|
9485
|
-
adapter.setup(app, context, target);
|
|
9486
|
-
}
|
|
9487
|
-
});
|
|
9488
|
-
}
|
|
9489
|
-
/**
|
|
9490
|
-
* Returns the current theme instance.
|
|
9491
|
-
*
|
|
9492
|
-
* @param namespace The namespace for the theme context. Defaults to `v0:theme`.
|
|
9493
|
-
* @returns The current theme instance.
|
|
9494
|
-
*
|
|
9495
|
-
* @see https://0.vuetifyjs.com/composables/plugins/use-theme
|
|
9496
|
-
*
|
|
9497
|
-
* @example
|
|
9498
|
-
* ```vue
|
|
9499
|
-
* <script setup lang="ts">
|
|
9500
|
-
* import { useTheme } from '@vuetify/v0'
|
|
9501
|
-
*
|
|
9502
|
-
* const theme = useTheme()
|
|
9503
|
-
* <\/script>
|
|
9504
|
-
*
|
|
9505
|
-
* <template>
|
|
9506
|
-
* <div>
|
|
9507
|
-
* <p>Current theme: {{ theme.selected.value }}</p>
|
|
9508
|
-
* </div>
|
|
9509
|
-
* </template>
|
|
9510
|
-
* ```
|
|
9511
|
-
*/
|
|
9512
|
-
function useTheme(namespace = "v0:theme") {
|
|
9513
|
-
return useContext(namespace);
|
|
8927
|
+
function createThemeFallback() {
|
|
8928
|
+
return {
|
|
8929
|
+
size: 0,
|
|
8930
|
+
colors: computed(() => ({})),
|
|
8931
|
+
isDark: shallowRef(false),
|
|
8932
|
+
cycle: () => {}
|
|
8933
|
+
};
|
|
9514
8934
|
}
|
|
8935
|
+
const [createThemeContext, createThemePlugin, useTheme] = createPluginContext("v0:theme", (options) => createTheme(options), {
|
|
8936
|
+
fallback: () => createThemeFallback(),
|
|
8937
|
+
setup: (context, app, { adapter = new Vuetify0ThemeAdapter(), target }) => {
|
|
8938
|
+
adapter.setup(app, context, target);
|
|
8939
|
+
}
|
|
8940
|
+
});
|
|
9515
8941
|
|
|
9516
8942
|
//#endregion
|
|
9517
8943
|
//#region src/composables/createTimeline/index.ts
|
|
@@ -12774,4 +12200,4 @@ const Tabs = {
|
|
|
12774
12200
|
};
|
|
12775
12201
|
|
|
12776
12202
|
//#endregion
|
|
12777
|
-
export { Atom_default as Atom, Avatar, AvatarFallback_default as AvatarFallback, AvatarImage_default as AvatarImage, AvatarRoot_default as AvatarRoot, Breadcrumbs, BreadcrumbsDivider_default as BreadcrumbsDivider, BreadcrumbsEllipsis_default as BreadcrumbsEllipsis, BreadcrumbsItem_default as BreadcrumbsItem, BreadcrumbsLink_default as BreadcrumbsLink, BreadcrumbsList_default as BreadcrumbsList, BreadcrumbsPage_default as BreadcrumbsPage, BreadcrumbsRoot_default as BreadcrumbsRoot, COMMON_ELEMENTS, Checkbox, CheckboxGroup_default as CheckboxGroup, CheckboxHiddenInput_default as CheckboxHiddenInput, CheckboxIndicator_default as CheckboxIndicator, CheckboxRoot_default as CheckboxRoot, CheckboxSelectAll_default as CheckboxSelectAll, ClientAdapter, ConsolaLoggerAdapter, DataTableAdapter, Dialog, DialogActivator_default as DialogActivator, DialogClose_default as DialogClose, DialogContent_default as DialogContent, DialogDescription_default as DialogDescription, DialogRoot_default as DialogRoot, DialogTitle_default as DialogTitle, ExpansionPanel, ExpansionPanelActivator_default as ExpansionPanelActivator, ExpansionPanelContent_default as ExpansionPanelContent, ExpansionPanelHeader_default as ExpansionPanelHeader, ExpansionPanelItem_default as ExpansionPanelItem, ExpansionPanelRoot_default as ExpansionPanelRoot, FeaturesAdapter, Group, GroupItem_default as GroupItem, GroupRoot_default as GroupRoot, IN_BROWSER, MemoryAdapter, Pagination, PaginationEllipsis_default as PaginationEllipsis, PaginationFirst_default as PaginationFirst, PaginationItem_default as PaginationItem, PaginationLast_default as PaginationLast, PaginationNext_default as PaginationNext, PaginationPrev_default as PaginationPrev, PaginationRoot_default as PaginationRoot, PaginationStatus_default as PaginationStatus, PermissionAdapter, PinoLoggerAdapter, Popover, PopoverActivator_default as PopoverActivator, PopoverContent_default as PopoverContent, PopoverRoot_default as PopoverRoot, Radio, RadioGroup_default as RadioGroup, RadioHiddenInput_default as RadioHiddenInput, RadioIndicator_default as RadioIndicator, RadioRoot_default as RadioRoot, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Scrim_default as Scrim, Selection, SelectionItem_default as SelectionItem, SelectionRoot_default as SelectionRoot, ServerAdapter, Single, SingleItem_default as SingleItem, SingleRoot_default as SingleRoot, Step, StepItem_default as StepItem, StepRoot_default as StepRoot, Tabs, TabsItem_default as TabsItem, TabsList_default as TabsList, TabsPanel_default as TabsPanel, TabsRoot_default as TabsRoot, VirtualAdapter, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, clamp, createBreadcrumbs, createBreadcrumbsContext, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createDataTable, createDataTableContext, createDate, createDateContext, createDatePlugin, createFallbackHydration, createFeatures, createFeaturesContext, createFeaturesPlugin, createFilter, createFilterContext, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocaleFallback, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createNested, createNestedContext, createOverflow, createOverflowContext, createPagination, createPaginationContext, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createQueue, createQueueContext, createRegistry, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createStack, createStackContext, createStackPlugin, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, createVirtual, createVirtualContext, debounce, instanceExists, instanceName, isArray, isBoolean, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isSymbol, isUndefined, mergeDeep, multipleOpenStrategy, provideAvatarRoot, provideBreadcrumbsRoot, provideCheckboxGroup, provideCheckboxRoot, provideContext, provideDialogContext, provideExpansionPanelItem, provideExpansionPanelRoot, provideGroupRoot, providePaginationControls, providePaginationItems, providePaginationRoot, providePopoverContext, provideRadioGroup, provideRadioRoot, provideSelectionRoot, provideSingleRoot, provideStepRoot, provideTabsRoot, range, singleOpenStrategy, toArray, toReactive, useAvatarRoot, useBreadcrumbs, useBreadcrumbsRoot, useBreakpoints, useCheckboxGroup, useCheckboxRoot, useClickOutside, useContext, useDataTable, useDate, useDialogContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useExpansionPanelItem, useExpansionPanelRoot, useFeatures, useFilter, useForm, useGroup, useGroupRoot, useHotkey, useHydration, useId, useIntersectionObserver, useLazy, useLocale, useLogger, useMediaQuery, useMutationObserver, useNested, useOverflow, usePagination, usePaginationControls, usePaginationItems, usePaginationRoot, usePermissions, usePopoverContext, usePrefersContrast, usePrefersDark, usePrefersReducedMotion, useProxyModel, useProxyRegistry, useQueue, useRadioGroup, useRadioRoot, useRegistry, useResizeObserver, useSelection, useSelectionRoot, useSingle, useSingleRoot, useStack, useStep, useStepRoot, useStorage, useTabsRoot, useTheme, useTimeline, useToggleScope, useTokens, useVirtual, useWindowEventListener, version };
|
|
12203
|
+
export { Atom_default as Atom, Avatar, AvatarFallback_default as AvatarFallback, AvatarImage_default as AvatarImage, AvatarRoot_default as AvatarRoot, Breadcrumbs, BreadcrumbsDivider_default as BreadcrumbsDivider, BreadcrumbsEllipsis_default as BreadcrumbsEllipsis, BreadcrumbsItem_default as BreadcrumbsItem, BreadcrumbsLink_default as BreadcrumbsLink, BreadcrumbsList_default as BreadcrumbsList, BreadcrumbsPage_default as BreadcrumbsPage, BreadcrumbsRoot_default as BreadcrumbsRoot, COMMON_ELEMENTS, Checkbox, CheckboxGroup_default as CheckboxGroup, CheckboxHiddenInput_default as CheckboxHiddenInput, CheckboxIndicator_default as CheckboxIndicator, CheckboxRoot_default as CheckboxRoot, CheckboxSelectAll_default as CheckboxSelectAll, ClientAdapter, ConsolaLoggerAdapter, DataTableAdapter, Dialog, DialogActivator_default as DialogActivator, DialogClose_default as DialogClose, DialogContent_default as DialogContent, DialogDescription_default as DialogDescription, DialogRoot_default as DialogRoot, DialogTitle_default as DialogTitle, ExpansionPanel, ExpansionPanelActivator_default as ExpansionPanelActivator, ExpansionPanelContent_default as ExpansionPanelContent, ExpansionPanelHeader_default as ExpansionPanelHeader, ExpansionPanelItem_default as ExpansionPanelItem, ExpansionPanelRoot_default as ExpansionPanelRoot, FeaturesAdapter, Group, GroupItem_default as GroupItem, GroupRoot_default as GroupRoot, IN_BROWSER, MemoryAdapter, Pagination, PaginationEllipsis_default as PaginationEllipsis, PaginationFirst_default as PaginationFirst, PaginationItem_default as PaginationItem, PaginationLast_default as PaginationLast, PaginationNext_default as PaginationNext, PaginationPrev_default as PaginationPrev, PaginationRoot_default as PaginationRoot, PaginationStatus_default as PaginationStatus, PermissionAdapter, PinoLoggerAdapter, Popover, PopoverActivator_default as PopoverActivator, PopoverContent_default as PopoverContent, PopoverRoot_default as PopoverRoot, Radio, RadioGroup_default as RadioGroup, RadioHiddenInput_default as RadioHiddenInput, RadioIndicator_default as RadioIndicator, RadioRoot_default as RadioRoot, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Scrim_default as Scrim, Selection, SelectionItem_default as SelectionItem, SelectionRoot_default as SelectionRoot, ServerAdapter, Single, SingleItem_default as SingleItem, SingleRoot_default as SingleRoot, Step, StepItem_default as StepItem, StepRoot_default as StepRoot, Tabs, TabsItem_default as TabsItem, TabsList_default as TabsList, TabsPanel_default as TabsPanel, TabsRoot_default as TabsRoot, VirtualAdapter, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, clamp, createBreadcrumbs, createBreadcrumbsContext, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createDataTable, createDataTableContext, createDate, createDateContext, createDatePlugin, createFallbackHydration, createFeatures, createFeaturesContext, createFeaturesPlugin, createFilter, createFilterContext, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocaleFallback, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createNested, createNestedContext, createOverflow, createOverflowContext, createPagination, createPaginationContext, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createPluginContext, createQueue, createQueueContext, createRegistry, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createStack, createStackContext, createStackPlugin, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, createVirtual, createVirtualContext, debounce, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isSymbol, isUndefined, mergeDeep, multipleOpenStrategy, provideAvatarRoot, provideBreadcrumbsRoot, provideCheckboxGroup, provideCheckboxRoot, provideContext, provideDialogContext, provideExpansionPanelItem, provideExpansionPanelRoot, provideGroupRoot, providePaginationControls, providePaginationItems, providePaginationRoot, providePopoverContext, provideRadioGroup, provideRadioRoot, provideSelectionRoot, provideSingleRoot, provideStepRoot, provideTabsRoot, range, singleOpenStrategy, toArray, toReactive, useAvatarRoot, useBreadcrumbs, useBreadcrumbsRoot, useBreakpoints, useCheckboxGroup, useCheckboxRoot, useClickOutside, useContext, useDataTable, useDate, useDialogContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useExpansionPanelItem, useExpansionPanelRoot, useFeatures, useFilter, useForm, useGroup, useGroupRoot, useHotkey, useHydration, useId, useIntersectionObserver, useLazy, useLocale, useLogger, useMediaQuery, useMutationObserver, useNested, useOverflow, usePagination, usePaginationControls, usePaginationItems, usePaginationRoot, usePermissions, usePopoverContext, usePrefersContrast, usePrefersDark, usePrefersReducedMotion, useProxyModel, useProxyRegistry, useQueue, useRadioGroup, useRadioRoot, useRegistry, useResizeObserver, useSelection, useSelectionRoot, useSingle, useSingleRoot, useStack, useStep, useStepRoot, useStorage, useTabsRoot, useTheme, useTimeline, useToggleScope, useTokens, useVirtual, useWindowEventListener, version };
|