@vinicunca/taman-ui 0.1.0
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 +95 -0
- package/dist/_virtual/_/plugin-vue/export-helper.mjs +8 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.mjs +2 -0
- package/dist/components/auth/taman-auth-form.mjs +67 -0
- package/dist/components/auth/taman-auth-form.vue.d.ts +31 -0
- package/dist/components/back-to-top/index.mjs +2 -0
- package/dist/components/back-to-top/taman-back-to-top.mjs +70 -0
- package/dist/components/back-to-top/taman-back-to-top.vue.d.ts +18 -0
- package/dist/components/button/check-group-selection.mjs +17 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/button/index.mjs +3 -0
- package/dist/components/button/taman-button-check-group.mjs +132 -0
- package/dist/components/button/taman-button-check-group.types.d.ts +22 -0
- package/dist/components/button/taman-button-check-group.vue.d.ts +41 -0
- package/dist/components/button/taman-button-icon.mjs +105 -0
- package/dist/components/button/taman-button-icon.vue.d.ts +17 -0
- package/dist/components/descriptions/index.d.ts +4 -0
- package/dist/components/descriptions/index.mjs +3 -0
- package/dist/components/descriptions/taman-description-cell.mjs +116 -0
- package/dist/components/descriptions/taman-description-item.mjs +10 -0
- package/dist/components/descriptions/taman-description-item.vue.d.ts +5 -0
- package/dist/components/descriptions/taman-description-row.mjs +131 -0
- package/dist/components/descriptions/taman-description.mjs +78 -0
- package/dist/components/descriptions/taman-description.types.d.ts +51 -0
- package/dist/components/descriptions/taman-description.vue.d.ts +23 -0
- package/dist/components/descriptions/use-taman-description.mjs +161 -0
- package/dist/components/file-upload/index.d.ts +3 -0
- package/dist/components/file-upload/index.mjs +2 -0
- package/dist/components/file-upload/taman-file-upload.mjs +88 -0
- package/dist/components/file-upload/taman-file-upload.types.d.ts +10 -0
- package/dist/components/file-upload/taman-file-upload.vue.d.ts +21 -0
- package/dist/components/full-screen/full-screen.mjs +27 -0
- package/dist/components/full-screen/full-screen.vue.d.ts +8 -0
- package/dist/components/full-screen/index.mjs +2 -0
- package/dist/components/icon/icon.mjs +27 -0
- package/dist/components/icon/icon.vue.d.ts +9 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.mjs +2 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.mjs +31 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input/index.mjs +4 -0
- package/dist/components/input/password-strength.d.ts +7 -0
- package/dist/components/input/password-strength.mjs +21 -0
- package/dist/components/input/taman-input-currency.mjs +76 -0
- package/dist/components/input/taman-input-currency.types.d.ts +8 -0
- package/dist/components/input/taman-input-currency.vue.d.ts +15 -0
- package/dist/components/input/taman-input-password.mjs +99 -0
- package/dist/components/input/taman-input-password.vue.d.ts +17 -0
- package/dist/components/input-date/format-calendar-input-value.mjs +26 -0
- package/dist/components/input-date/index.d.ts +3 -0
- package/dist/components/input-date/index.mjs +2 -0
- package/dist/components/input-date/taman-input-date.mjs +116 -0
- package/dist/components/input-date/taman-input-date.types.d.ts +14 -0
- package/dist/components/input-date/taman-input-date.vue.d.ts +21 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/loading/index.mjs +2 -0
- package/dist/components/loading/taman-loading.mjs +64 -0
- package/dist/components/loading/taman-loading.vue.d.ts +25 -0
- package/dist/components/loading/types.d.ts +13 -0
- package/dist/components/logo/index.mjs +2 -0
- package/dist/components/logo/taman-logo.mjs +60 -0
- package/dist/components/logo/taman-logo.vue.d.ts +32 -0
- package/dist/components/render-content/index.d.ts +2 -0
- package/dist/components/render-content/index.mjs +2 -0
- package/dist/components/render-content/render-content.mjs +42 -0
- package/dist/components/render-content/render-content.vue.d.ts +31 -0
- package/dist/components/scrollbar/index.d.ts +2 -0
- package/dist/components/scrollbar/index.mjs +2 -0
- package/dist/components/scrollbar/scrollbar.mjs +136 -0
- package/dist/components/scrollbar/scrollbar.vue.d.ts +50 -0
- package/dist/form/components/form-actions.mjs +151 -0
- package/dist/form/components/form-field-array.mjs +154 -0
- package/dist/form/components/form-field-array.types.d.ts +18 -0
- package/dist/form/form-render/form-render-field-collapsible.mjs +32 -0
- package/dist/form/form-render/form-render-field-control.mjs +44 -0
- package/dist/form/form-render/form-render-form-field.mjs +408 -0
- package/dist/form/form-render/form-render-form-label.mjs +46 -0
- package/dist/form/form-render/form-render-form.mjs +163 -0
- package/dist/form/form-render/form-render-group.mjs +89 -0
- package/dist/form/form-render/form-render.context.mjs +10 -0
- package/dist/form/form-render/form-render.dependencies.mjs +101 -0
- package/dist/form/form-render/form-render.helper.mjs +31 -0
- package/dist/form/form-render/form-render.schema.mjs +209 -0
- package/dist/form/form-render/index.mjs +4 -0
- package/dist/form/form.api.d.ts +54 -0
- package/dist/form/form.api.mjs +324 -0
- package/dist/form/form.built-ins.d.ts +36 -0
- package/dist/form/form.built-ins.mjs +48 -0
- package/dist/form/form.codec.d.ts +17 -0
- package/dist/form/form.codec.mjs +45 -0
- package/dist/form/form.config.d.ts +6 -0
- package/dist/form/form.config.mjs +43 -0
- package/dist/form/form.empty-value.d.ts +4 -0
- package/dist/form/form.empty-value.mjs +20 -0
- package/dist/form/form.field-name.mjs +25 -0
- package/dist/form/form.rule-registry.mjs +10 -0
- package/dist/form/form.runtime-field.mjs +56 -0
- package/dist/form/form.runtime.mjs +235 -0
- package/dist/form/form.schema-defaults.mjs +36 -0
- package/dist/form/form.types.d.ts +315 -0
- package/dist/form/form.use-delayed-flag.mjs +35 -0
- package/dist/form/form.use-form-context.mjs +44 -0
- package/dist/form/form.use-taman-form.d.ts +7 -0
- package/dist/form/form.use-taman-form.mjs +36 -0
- package/dist/form/index.d.ts +8 -0
- package/dist/form/index.mjs +6 -0
- package/dist/form/taman-use-form.mjs +146 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.mjs +56 -0
- package/dist/layout/components/index.mjs +6 -0
- package/dist/layout/components/taman-core-button-collapse.mjs +38 -0
- package/dist/layout/components/taman-core-button-fixed.mjs +29 -0
- package/dist/layout/components/taman-core-layout-content.mjs +50 -0
- package/dist/layout/components/taman-core-layout-footer.mjs +38 -0
- package/dist/layout/components/taman-core-layout-header.mjs +48 -0
- package/dist/layout/components/taman-core-layout-sidebar.mjs +319 -0
- package/dist/layout/components/taman-core-layout-tabbar.mjs +21 -0
- package/dist/layout/composables/use-layout.mjs +31 -0
- package/dist/layout/composables/use-sidebar-drag.mjs +103 -0
- package/dist/layout/header-scroll-state.mjs +9 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.mjs +2 -0
- package/dist/layout/taman-core-layout.d.ts +41 -0
- package/dist/layout/taman-core-layout.mjs +603 -0
- package/dist/layout/taman-core-layout.vue.d.ts +99 -0
- package/dist/menu/components/collapse-transition.mjs +82 -0
- package/dist/menu/components/index.mjs +5 -0
- package/dist/menu/components/normal-menu/index.d.ts +3 -0
- package/dist/menu/components/normal-menu/index.mjs +2 -0
- package/dist/menu/components/normal-menu/normal-menu.d.ts +11 -0
- package/dist/menu/components/normal-menu/normal-menu.mjs +50 -0
- package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +19 -0
- package/dist/menu/components/taman-menu-badge-dot.mjs +23 -0
- package/dist/menu/components/taman-menu-badge.mjs +49 -0
- package/dist/menu/components/taman-menu-badge.vue.d.ts +9 -0
- package/dist/menu/components/taman-menu-item.mjs +124 -0
- package/dist/menu/components/taman-menu-root.mjs +250 -0
- package/dist/menu/components/taman-menu-sub-menu-content.mjs +83 -0
- package/dist/menu/components/taman-menu-sub-menu.mjs +216 -0
- package/dist/menu/composables/index.mjs +3 -0
- package/dist/menu/composables/use-menu-context.mjs +36 -0
- package/dist/menu/composables/use-menu-scroll.mjs +23 -0
- package/dist/menu/composables/use-menu.mjs +33 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.mjs +5 -0
- package/dist/menu/menu.constants.mjs +5 -0
- package/dist/menu/menu.types.d.ts +63 -0
- package/dist/menu/menu.utils.mjs +27 -0
- package/dist/menu/taman-menu.mjs +41 -0
- package/dist/menu/taman-menu.vue.d.ts +12 -0
- package/dist/menu/taman-sub-menu.mjs +75 -0
- package/dist/popup/alert/alert-builder.d.ts +8 -0
- package/dist/popup/alert/alert-builder.mjs +98 -0
- package/dist/popup/alert/alert-overlay.mjs +55 -0
- package/dist/popup/alert/alert.d.ts +43 -0
- package/dist/popup/alert/alert.mjs +10 -0
- package/dist/popup/alert/alert.vue.d.ts +26 -0
- package/dist/popup/alert/alert2.mjs +238 -0
- package/dist/popup/alert/index.d.ts +4 -0
- package/dist/popup/alert/index.mjs +4 -0
- package/dist/popup/dialog/dialog.api.d.ts +23 -0
- package/dist/popup/dialog/dialog.api.mjs +133 -0
- package/dist/popup/dialog/dialog.mjs +336 -0
- package/dist/popup/dialog/dialog.types.d.ts +60 -0
- package/dist/popup/dialog/dialog.vue.d.ts +46 -0
- package/dist/popup/dialog/index.d.ts +4 -0
- package/dist/popup/dialog/index.mjs +3 -0
- package/dist/popup/dialog/use-dialog-draggable.mjs +93 -0
- package/dist/popup/dialog/use-taman-dialog.d.ts +13 -0
- package/dist/popup/dialog/use-taman-dialog.mjs +106 -0
- package/dist/popup/drawer/drawer.api.d.ts +23 -0
- package/dist/popup/drawer/drawer.api.mjs +124 -0
- package/dist/popup/drawer/drawer.mjs +277 -0
- package/dist/popup/drawer/drawer.types.d.ts +56 -0
- package/dist/popup/drawer/drawer.vue.d.ts +47 -0
- package/dist/popup/drawer/index.d.ts +4 -0
- package/dist/popup/drawer/index.mjs +3 -0
- package/dist/popup/drawer/use-taman-drawer.d.ts +13 -0
- package/dist/popup/drawer/use-taman-drawer.mjs +109 -0
- package/dist/popup/index.d.ts +13 -0
- package/dist/popup/index.mjs +11 -0
- package/dist/tabs/components/index.mjs +2 -0
- package/dist/tabs/components/taman-tabs.mjs +158 -0
- package/dist/tabs/components/widgets/index.d.ts +4 -0
- package/dist/tabs/components/widgets/index.mjs +4 -0
- package/dist/tabs/components/widgets/tool-more.mjs +45 -0
- package/dist/tabs/components/widgets/tool-more.vue.d.ts +7 -0
- package/dist/tabs/components/widgets/tool-refresh.mjs +25 -0
- package/dist/tabs/components/widgets/tool-refresh.vue.d.ts +9 -0
- package/dist/tabs/components/widgets/tool-screen.mjs +29 -0
- package/dist/tabs/components/widgets/tool-screen.vue.d.ts +12 -0
- package/dist/tabs/index.d.ts +8 -0
- package/dist/tabs/index.mjs +6 -0
- package/dist/tabs/strict-context-menu.d.ts +10 -0
- package/dist/tabs/tabs.types.d.ts +30 -0
- package/dist/tabs/taman-tabs-view.mjs +101 -0
- package/dist/tabs/taman-tabs-view.vue.d.ts +18 -0
- package/dist/tabs/use-tabs-drag.mjs +69 -0
- package/dist/tabs/use-tabs-view-scroll.mjs +114 -0
- package/dist/ui/alert-dialog/alert-dialog-action.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/alert-dialog-cancel.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/alert-dialog-content.mjs +111 -0
- package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +49 -0
- package/dist/ui/alert-dialog/alert-dialog-description.mjs +30 -0
- package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +20 -0
- package/dist/ui/alert-dialog/alert-dialog-footer.mjs +14 -0
- package/dist/ui/alert-dialog/alert-dialog-footer.vue.d.ts +15 -0
- package/dist/ui/alert-dialog/alert-dialog-header.mjs +14 -0
- package/dist/ui/alert-dialog/alert-dialog-header.vue.d.ts +15 -0
- package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +29 -0
- package/dist/ui/alert-dialog/alert-dialog-root.mjs +23 -0
- package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +23 -0
- package/dist/ui/alert-dialog/alert-dialog-title.mjs +30 -0
- package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +20 -0
- package/dist/ui/alert-dialog/alert-dialog-trigger.mjs +21 -0
- package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +16 -0
- package/dist/ui/alert-dialog/index.d.ts +10 -0
- package/dist/ui/alert-dialog/index.mjs +10 -0
- package/dist/ui/dialog/dialog-close.mjs +21 -0
- package/dist/ui/dialog/dialog-close.vue.d.ts +16 -0
- package/dist/ui/dialog/dialog-content.mjs +111 -0
- package/dist/ui/dialog/dialog-content.vue.d.ts +51 -0
- package/dist/ui/dialog/dialog-description.mjs +31 -0
- package/dist/ui/dialog/dialog-description.vue.d.ts +20 -0
- package/dist/ui/dialog/dialog-footer.mjs +14 -0
- package/dist/ui/dialog/dialog-footer.vue.d.ts +15 -0
- package/dist/ui/dialog/dialog-header.mjs +14 -0
- package/dist/ui/dialog/dialog-header.vue.d.ts +15 -0
- package/dist/ui/dialog/dialog-overlay.mjs +34 -0
- package/dist/ui/dialog/dialog-overlay.vue.d.ts +14 -0
- package/dist/ui/dialog/dialog-root.mjs +24 -0
- package/dist/ui/dialog/dialog-root.vue.d.ts +23 -0
- package/dist/ui/dialog/dialog-title.mjs +31 -0
- package/dist/ui/dialog/dialog-title.vue.d.ts +20 -0
- package/dist/ui/dialog/dialog-trigger.mjs +21 -0
- package/dist/ui/dialog/dialog-trigger.vue.d.ts +16 -0
- package/dist/ui/dialog/index.d.ts +10 -0
- package/dist/ui/dialog/index.mjs +10 -0
- package/dist/ui/dialog/use-dialog-state-events.mjs +60 -0
- package/dist/ui/form/form-control.mjs +27 -0
- package/dist/ui/form/form-control.vue.d.ts +15 -0
- package/dist/ui/form/form-description.mjs +27 -0
- package/dist/ui/form/form-description.vue.d.ts +19 -0
- package/dist/ui/form/form-field.mjs +37 -0
- package/dist/ui/form/form-field.vue.d.ts +27 -0
- package/dist/ui/form/form-item.mjs +27 -0
- package/dist/ui/form/form-item.vue.d.ts +19 -0
- package/dist/ui/form/form-label.mjs +41 -0
- package/dist/ui/form/form-label.vue.d.ts +20 -0
- package/dist/ui/form/form-message.mjs +28 -0
- package/dist/ui/form/form-message.vue.d.ts +9 -0
- package/dist/ui/form/index.d.ts +8 -0
- package/dist/ui/form/index.mjs +8 -0
- package/dist/ui/form/injection-keys.d.ts +13 -0
- package/dist/ui/form/injection-keys.mjs +5 -0
- package/dist/ui/form/use-form-field.mjs +27 -0
- package/dist/ui/index.d.ts +42 -0
- package/dist/ui/index.mjs +42 -0
- package/dist/ui/label/index.d.ts +2 -0
- package/dist/ui/label/index.mjs +2 -0
- package/dist/ui/label/label.mjs +31 -0
- package/dist/ui/label/label.vue.d.ts +20 -0
- package/dist/ui/scroll-area/index.d.ts +3 -0
- package/dist/ui/scroll-area/index.mjs +3 -0
- package/dist/ui/scroll-area/scroll-area.mjs +47 -0
- package/dist/ui/scroll-area/scroll-area.vue.d.ts +21 -0
- package/dist/ui/scroll-area/scroll-bar.mjs +38 -0
- package/dist/ui/scroll-area/scroll-bar.vue.d.ts +12 -0
- package/dist/ui/sheet/index.d.ts +8 -0
- package/dist/ui/sheet/index.mjs +8 -0
- package/dist/ui/sheet/sheet-close.mjs +21 -0
- package/dist/ui/sheet/sheet-close.vue.d.ts +16 -0
- package/dist/ui/sheet/sheet-content.mjs +105 -0
- package/dist/ui/sheet/sheet-content.vue.d.ts +48 -0
- package/dist/ui/sheet/sheet-description.mjs +30 -0
- package/dist/ui/sheet/sheet-description.vue.d.ts +20 -0
- package/dist/ui/sheet/sheet-footer.mjs +14 -0
- package/dist/ui/sheet/sheet-footer.vue.d.ts +15 -0
- package/dist/ui/sheet/sheet-header.mjs +14 -0
- package/dist/ui/sheet/sheet-header.vue.d.ts +15 -0
- package/dist/ui/sheet/sheet-overlay.mjs +32 -0
- package/dist/ui/sheet/sheet-root.mjs +24 -0
- package/dist/ui/sheet/sheet-root.vue.d.ts +23 -0
- package/dist/ui/sheet/sheet-title.mjs +31 -0
- package/dist/ui/sheet/sheet-title.vue.d.ts +20 -0
- package/dist/ui/sheet/sheet.variants.d.ts +27 -0
- package/dist/ui/sheet/sheet.variants.mjs +12 -0
- package/dist/unocss/content.d.ts +4 -0
- package/dist/unocss/content.mjs +9 -0
- package/dist/unocss/index.d.ts +2 -0
- package/dist/unocss/index.mjs +2 -0
- package/package.json +78 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createContext } from "../index.mjs";
|
|
2
|
+
import { getFormFieldSchemas } from "./form-render/form-render.schema.mjs";
|
|
3
|
+
import { useFormRuntime } from "./form.runtime.mjs";
|
|
4
|
+
import { getCustomDefaultValue, normalizeSchemaForDefaults } from "./form.schema-defaults.mjs";
|
|
5
|
+
import { computed, toRaw, unref, useSlots } from "vue";
|
|
6
|
+
import { isString, mergeWithArrayOverride, set } from "@vinicunca/taman-core/utils";
|
|
7
|
+
import { object } from "zod";
|
|
8
|
+
import { getDefaultsForSchema } from "zod-defaults";
|
|
9
|
+
//#region src/form/form.use-form-context.ts
|
|
10
|
+
const [injectFormProps, provideFormProps] = createContext("TamanFormProps");
|
|
11
|
+
const [injectComponentRefMap, provideComponentRefMap] = createContext("ComponentRefMap");
|
|
12
|
+
function useFormInitial(props) {
|
|
13
|
+
const slots = useSlots();
|
|
14
|
+
const initialValues = generateInitialValues();
|
|
15
|
+
const form = useFormRuntime(initialValues);
|
|
16
|
+
const delegatedSlots = computed(() => {
|
|
17
|
+
const resultSlots = [];
|
|
18
|
+
for (const key of Object.keys(slots)) if (key !== "default") resultSlots.push(key);
|
|
19
|
+
return resultSlots;
|
|
20
|
+
});
|
|
21
|
+
function generateInitialValues() {
|
|
22
|
+
const initialValues = {};
|
|
23
|
+
const zodObject = {};
|
|
24
|
+
getFormFieldSchemas(unref(props).schema ?? []).forEach((item) => {
|
|
25
|
+
if (Reflect.has(item, "defaultValue")) set(initialValues, item.fieldName, item.defaultValue);
|
|
26
|
+
else if (item.rules && !isString(item.rules)) {
|
|
27
|
+
const rawRules = toRaw(item.rules);
|
|
28
|
+
const customDefaultValue = getCustomDefaultValue(rawRules);
|
|
29
|
+
zodObject[item.fieldName] = normalizeSchemaForDefaults(rawRules);
|
|
30
|
+
if (customDefaultValue !== void 0) initialValues[item.fieldName] = customDefaultValue;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const schemaInitialValues = getDefaultsForSchema(object(zodObject));
|
|
34
|
+
const zodDefaults = {};
|
|
35
|
+
for (const key of Object.keys(schemaInitialValues)) set(zodDefaults, key, schemaInitialValues[key]);
|
|
36
|
+
return mergeWithArrayOverride(initialValues, zodDefaults);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
delegatedSlots,
|
|
40
|
+
form
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { injectComponentRefMap, injectFormProps, provideComponentRefMap, provideFormProps, useFormInitial };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExtendedFormApi, FormBaseComponentType, FormValues, TamanFormComponent, TamanFormProps } from "./form.types.js";
|
|
2
|
+
//#region src/form/form.use-taman-form.d.ts
|
|
3
|
+
type UseTamanFormReturn<TValues extends FormValues, T extends FormBaseComponentType, P extends Record<string, any>, TSubmitValues extends FormValues = TValues> = readonly [TamanFormComponent<TValues, T, P, TSubmitValues>, ExtendedFormApi<TValues, T, P, TSubmitValues>];
|
|
4
|
+
declare function useTamanForm<T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>>(options: TamanFormProps<T, P>): UseTamanFormReturn<FormValues, T, P>;
|
|
5
|
+
declare function useTamanForm<TValues extends FormValues, T extends FormBaseComponentType = FormBaseComponentType, P extends Record<string, any> = Record<never, never>, TSubmitValues extends FormValues = TValues>(options: TamanFormProps<T, P, TValues, TSubmitValues>): UseTamanFormReturn<TValues, T, P, TSubmitValues>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useTamanForm };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FormApi } from "./form.api.mjs";
|
|
2
|
+
import _sfc_main from "./taman-use-form.mjs";
|
|
3
|
+
import { defineComponent, h, isReactive, onBeforeUnmount, watch } from "vue";
|
|
4
|
+
import { useSelector } from "@vinicunca/taman-core/store";
|
|
5
|
+
//#region src/form/form.use-taman-form.ts
|
|
6
|
+
function useTamanForm(options) {
|
|
7
|
+
const IS_REACTIVE = isReactive(options);
|
|
8
|
+
const api = new FormApi(options);
|
|
9
|
+
const extendedApi = api;
|
|
10
|
+
extendedApi.useStore = (selector) => {
|
|
11
|
+
return useSelector(api.store, selector);
|
|
12
|
+
};
|
|
13
|
+
const Form = defineComponent((props, { attrs, slots }) => {
|
|
14
|
+
onBeforeUnmount(() => {
|
|
15
|
+
api.unmount();
|
|
16
|
+
});
|
|
17
|
+
api.setState({
|
|
18
|
+
...props,
|
|
19
|
+
...attrs
|
|
20
|
+
});
|
|
21
|
+
return () => h(_sfc_main, {
|
|
22
|
+
...props,
|
|
23
|
+
...attrs,
|
|
24
|
+
formApi: extendedApi
|
|
25
|
+
}, slots);
|
|
26
|
+
}, {
|
|
27
|
+
name: "TamanUseForm",
|
|
28
|
+
inheritAttrs: false
|
|
29
|
+
});
|
|
30
|
+
if (IS_REACTIVE) watch(() => options.schema, () => {
|
|
31
|
+
api.setState({ schema: options.schema });
|
|
32
|
+
}, { immediate: true });
|
|
33
|
+
return [Form, extendedApi];
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { useTamanForm };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BuiltInFormComponentPropsMap, BuiltInFormComponentType } from "./form.built-ins.js";
|
|
2
|
+
import { ExtendedFormApi, FormActions, FormBaseComponentType, FormCodec, FormFieldSchema, FormGroupSchema, FormSchema, FormSchemaContext, FormValueSnapshot, FormValues, TamanFormActionSlotProps, TamanFormComponent, TamanFormDefaultSlotProps, TamanFormFieldArrayProps, TamanFormFieldSlotProps, TamanFormProps, TamanFormResolvedComponentProps, TamanFormSlots } from "./form.types.js";
|
|
3
|
+
import { CalendarDateCodecOptions, FormCodecError, FormCodecPhase, calendarDateCodec, calendarDateTimeCodec, createCalendarDateCodec, createCalendarDateTimeCodec, createTimeCodec, timeCodec } from "./form.codec.js";
|
|
4
|
+
import { setupTamanForm } from "./form.config.js";
|
|
5
|
+
import { isEmptyFormValue } from "./form.empty-value.js";
|
|
6
|
+
import { useTamanForm } from "./form.use-taman-form.js";
|
|
7
|
+
import * as z from "zod";
|
|
8
|
+
export { type BuiltInFormComponentPropsMap, type BuiltInFormComponentType, type CalendarDateCodecOptions, type ExtendedFormApi, type FormActions, type FormBaseComponentType, type FormCodec, FormCodecError, type FormCodecPhase, type FormGroupSchema, type FormSchemaContext, type FormValueSnapshot, type FormValues, type TamanFormActionSlotProps, type TamanFormComponent, type TamanFormDefaultSlotProps, type TamanFormFieldArrayProps, type FormFieldSchema as TamanFormFieldSchema, type TamanFormFieldSlotProps, type FormGroupSchema as TamanFormGroupSchema, type TamanFormProps, type TamanFormResolvedComponentProps, type FormSchema as TamanFormSchema, type TamanFormSlots, calendarDateCodec, calendarDateTimeCodec, createCalendarDateCodec, createCalendarDateTimeCodec, createTimeCodec, isEmptyFormValue, setupTamanForm, timeCodec, useTamanForm, z };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FormCodecError, calendarDateCodec, calendarDateTimeCodec, createCalendarDateCodec, createCalendarDateTimeCodec, createTimeCodec, timeCodec } from "./form.codec.mjs";
|
|
2
|
+
import { isEmptyFormValue } from "./form.empty-value.mjs";
|
|
3
|
+
import { setupTamanForm } from "./form.config.mjs";
|
|
4
|
+
import { useTamanForm } from "./form.use-taman-form.mjs";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
export { FormCodecError, calendarDateCodec, calendarDateTimeCodec, createCalendarDateCodec, createCalendarDateTimeCodec, createTimeCodec, isEmptyFormValue, setupTamanForm, timeCodec, useTamanForm, z };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { getFormFieldSchemas } from "./form-render/form-render.schema.mjs";
|
|
2
|
+
import { provideComponentRefMap, provideFormProps, useFormInitial } from "./form.use-form-context.mjs";
|
|
3
|
+
import { DEFAULT_FORM_COMMON_CONFIG, getFormComponentMap } from "./form.config.mjs";
|
|
4
|
+
import _sfc_main$1 from "./components/form-actions.mjs";
|
|
5
|
+
import _sfc_main$2 from "./form-render/form-render-form.mjs";
|
|
6
|
+
import "./form-render/index.mjs";
|
|
7
|
+
import { createBlock, createCommentVNode, createSlots, defineComponent, mergeProps, nextTick, onMounted, openBlock, readonly, renderList, renderSlot, unref, watch, withCtx, withKeys } from "vue";
|
|
8
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
9
|
+
import { get, isDeepEqual } from "@vinicunca/taman-core/utils";
|
|
10
|
+
import { useForwardPriorityValues } from "@vinicunca/taman-core/composables";
|
|
11
|
+
//#region src/form/taman-use-form.vue
|
|
12
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
13
|
+
__name: "taman-use-form",
|
|
14
|
+
props: {
|
|
15
|
+
formApi: {},
|
|
16
|
+
actionButtonsReverse: { type: Boolean },
|
|
17
|
+
actionLayout: {},
|
|
18
|
+
actionPosition: {},
|
|
19
|
+
actionWrapperClass: { type: [
|
|
20
|
+
Boolean,
|
|
21
|
+
null,
|
|
22
|
+
String,
|
|
23
|
+
Object,
|
|
24
|
+
Array
|
|
25
|
+
] },
|
|
26
|
+
changeDebouncedTime: {},
|
|
27
|
+
codec: {},
|
|
28
|
+
handleCollapsedChange: { type: Function },
|
|
29
|
+
handleReset: { type: Function },
|
|
30
|
+
handleSubmit: { type: Function },
|
|
31
|
+
handleValuesChange: { type: Function },
|
|
32
|
+
resetButtonOptions: {},
|
|
33
|
+
scrollToFirstError: { type: Boolean },
|
|
34
|
+
showDefaultActions: { type: Boolean },
|
|
35
|
+
submitButtonOptions: {},
|
|
36
|
+
submitOnChange: { type: Boolean },
|
|
37
|
+
submitOnEnter: { type: Boolean },
|
|
38
|
+
collapsed: { type: Boolean },
|
|
39
|
+
collapseTriggerResize: { type: Boolean },
|
|
40
|
+
commonConfig: {},
|
|
41
|
+
compact: { type: Boolean },
|
|
42
|
+
disabled: { type: Boolean },
|
|
43
|
+
schema: {},
|
|
44
|
+
wrapperClass: {}
|
|
45
|
+
},
|
|
46
|
+
setup(__props) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const formApi = props.formApi;
|
|
49
|
+
if (!formApi) throw new Error("Form api is required in <TamanUseForm />");
|
|
50
|
+
const state = formApi.useStore();
|
|
51
|
+
const forward = useForwardPriorityValues(props, state);
|
|
52
|
+
const formComponentMap = getFormComponentMap();
|
|
53
|
+
const componentRefMap = /* @__PURE__ */ new Map();
|
|
54
|
+
const { delegatedSlots, form } = useFormInitial(forward);
|
|
55
|
+
const values = form.useValues();
|
|
56
|
+
provideFormProps([forward, form]);
|
|
57
|
+
provideComponentRefMap(componentRefMap);
|
|
58
|
+
formApi.mount(form, componentRefMap);
|
|
59
|
+
function handleUpdateCollapsed(value) {
|
|
60
|
+
props.formApi?.setState({ collapsed: value });
|
|
61
|
+
forward.value.handleCollapsedChange?.(value);
|
|
62
|
+
}
|
|
63
|
+
function handleKeyDownEnter(event) {
|
|
64
|
+
if (!state?.value.submitOnEnter || !forward.value.formApi?.isMounted) return;
|
|
65
|
+
if (event.target instanceof HTMLTextAreaElement) return;
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
forward.value.formApi?.validateAndSubmit();
|
|
68
|
+
}
|
|
69
|
+
const handleValuesChangeDebounced = useDebounceFn(async () => {
|
|
70
|
+
state?.value.submitOnChange && forward.value.formApi?.validateAndSubmit();
|
|
71
|
+
}, state?.value?.changeDebouncedTime ?? 300);
|
|
72
|
+
let valuesChangeReady = false;
|
|
73
|
+
onMounted(async () => {
|
|
74
|
+
await nextTick();
|
|
75
|
+
valuesChangeReady = true;
|
|
76
|
+
});
|
|
77
|
+
watch(values, (currentValues, previousValues) => {
|
|
78
|
+
if (!valuesChangeReady) return;
|
|
79
|
+
const handleValuesChange = forward.value.handleValuesChange;
|
|
80
|
+
const submitOnChange = state?.value.submitOnChange;
|
|
81
|
+
if (!handleValuesChange && !submitOnChange) return;
|
|
82
|
+
const fields = getFormFieldSchemas(state?.value.schema ?? []).map((item) => item.fieldName);
|
|
83
|
+
if (handleValuesChange && fields.length > 0) {
|
|
84
|
+
const changedFields = fields.filter((field) => {
|
|
85
|
+
return !isDeepEqual(get(currentValues, field), get(previousValues ?? {}, field));
|
|
86
|
+
});
|
|
87
|
+
if (changedFields.length > 0) handleValuesChange(readonly(currentValues), changedFields, () => formApi.formatValues(currentValues));
|
|
88
|
+
}
|
|
89
|
+
if (submitOnChange) handleValuesChangeDebounced();
|
|
90
|
+
});
|
|
91
|
+
return (_ctx, _cache) => {
|
|
92
|
+
return openBlock(), createBlock(unref(_sfc_main$2), mergeProps(unref(forward), {
|
|
93
|
+
collapsed: unref(state)?.collapsed,
|
|
94
|
+
"component-map": unref(formComponentMap),
|
|
95
|
+
form: unref(form),
|
|
96
|
+
"global-common-config": unref(DEFAULT_FORM_COMMON_CONFIG),
|
|
97
|
+
onKeydown: withKeys(handleKeyDownEnter, ["enter"]),
|
|
98
|
+
"onUpdate:collapsed": handleUpdateCollapsed
|
|
99
|
+
}), createSlots({
|
|
100
|
+
default: withCtx((slotProps) => [_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", mergeProps(slotProps, {
|
|
101
|
+
formApi: unref(formApi),
|
|
102
|
+
values: unref(form).values
|
|
103
|
+
}), void 0, void 0, 0) : unref(forward).showDefaultActions ? (openBlock(), createBlock(_sfc_main$1, {
|
|
104
|
+
key: 1,
|
|
105
|
+
"grid-id": slotProps.gridId,
|
|
106
|
+
"model-value": unref(state)?.collapsed,
|
|
107
|
+
"onUpdate:modelValue": handleUpdateCollapsed
|
|
108
|
+
}, {
|
|
109
|
+
"reset-before": withCtx((resetSlotProps) => [renderSlot(_ctx.$slots, "reset-before", mergeProps(resetSlotProps, {
|
|
110
|
+
formApi: unref(formApi),
|
|
111
|
+
values: unref(form).values
|
|
112
|
+
}))]),
|
|
113
|
+
"submit-before": withCtx((submitSlotProps) => [renderSlot(_ctx.$slots, "submit-before", mergeProps(submitSlotProps, {
|
|
114
|
+
formApi: unref(formApi),
|
|
115
|
+
values: unref(form).values
|
|
116
|
+
}))]),
|
|
117
|
+
"expand-before": withCtx((expandBeforeSlotProps) => [renderSlot(_ctx.$slots, "expand-before", mergeProps(expandBeforeSlotProps, {
|
|
118
|
+
formApi: unref(formApi),
|
|
119
|
+
values: unref(form).values
|
|
120
|
+
}))]),
|
|
121
|
+
"expand-after": withCtx((expandAfterSlotProps) => [renderSlot(_ctx.$slots, "expand-after", mergeProps(expandAfterSlotProps, {
|
|
122
|
+
formApi: unref(formApi),
|
|
123
|
+
values: unref(form).values
|
|
124
|
+
}))]),
|
|
125
|
+
_: 3
|
|
126
|
+
}, 8, ["grid-id", "model-value"])) : createCommentVNode("v-if", true)]),
|
|
127
|
+
_: 2
|
|
128
|
+
}, [renderList(unref(delegatedSlots), (slotName) => {
|
|
129
|
+
return {
|
|
130
|
+
name: slotName,
|
|
131
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, slotName, mergeProps(slotProps, {
|
|
132
|
+
formApi: unref(formApi),
|
|
133
|
+
values: unref(form).values
|
|
134
|
+
}))])
|
|
135
|
+
};
|
|
136
|
+
})]), 1040, [
|
|
137
|
+
"collapsed",
|
|
138
|
+
"component-map",
|
|
139
|
+
"form",
|
|
140
|
+
"global-common-config"
|
|
141
|
+
]);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
//#endregion
|
|
146
|
+
export { _sfc_main as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _default$34 from "./components/auth/taman-auth-form.vue.js";
|
|
2
|
+
import _default$35 from "./components/back-to-top/taman-back-to-top.vue.js";
|
|
3
|
+
import { TamanButtonCheckGroupModel, TamanButtonCheckGroupOption, TamanButtonCheckGroupProps, TamanButtonCheckGroupValue } from "./components/button/taman-button-check-group.types.js";
|
|
4
|
+
import _default$36 from "./components/button/taman-button-check-group.vue.js";
|
|
5
|
+
import _default$37 from "./components/button/taman-button-icon.vue.js";
|
|
6
|
+
import _default$39 from "./components/descriptions/taman-description-item.vue.js";
|
|
7
|
+
import { TamanDescriptionsBreakpoint, TamanDescriptionsColumn, TamanDescriptionsItemProps, TamanDescriptionsItemSpan, TamanDescriptionsItemType, TamanDescriptionsLayout, TamanDescriptionsProps, TamanDescriptionsRenderNode, TamanDescriptionsSize, TamanInternalDescriptionsItem, TamanScreenMap } from "./components/descriptions/taman-description.types.js";
|
|
8
|
+
import _default$38 from "./components/descriptions/taman-description.vue.js";
|
|
9
|
+
import { TamanFileUploadProps } from "./components/file-upload/taman-file-upload.types.js";
|
|
10
|
+
import _default$40 from "./components/file-upload/taman-file-upload.vue.js";
|
|
11
|
+
import _default$41 from "./components/full-screen/full-screen.vue.js";
|
|
12
|
+
import _default$42 from "./components/icon/icon.vue.js";
|
|
13
|
+
import { PASSWORD_STRENGTH_CHECKS, PASSWORD_STRENGTH_MAX, isPasswordStrong, passwordStrengthScore } from "./components/input/password-strength.js";
|
|
14
|
+
import { TamanInputCurrencyProps } from "./components/input/taman-input-currency.types.js";
|
|
15
|
+
import _default$43 from "./components/input/taman-input-currency.vue.js";
|
|
16
|
+
import _default$45 from "./components/input/taman-input-password.vue.js";
|
|
17
|
+
import { TamanInputDateProps } from "./components/input-date/taman-input-date.types.js";
|
|
18
|
+
import _default$44 from "./components/input-date/taman-input-date.vue.js";
|
|
19
|
+
import { TamanLoadingIcon, TamanLoadingIconProps } from "./components/loading/types.js";
|
|
20
|
+
import _default$46 from "./components/loading/taman-loading.vue.js";
|
|
21
|
+
import _default$47 from "./components/logo/taman-logo.vue.js";
|
|
22
|
+
import _default$48 from "./components/render-content/render-content.vue.js";
|
|
23
|
+
import _default$49 from "./components/scrollbar/scrollbar.vue.js";
|
|
24
|
+
import "./components/index.js";
|
|
25
|
+
import _default$3 from "./ui/alert-dialog/alert-dialog-action.vue.js";
|
|
26
|
+
import _default$4 from "./ui/alert-dialog/alert-dialog-cancel.vue.js";
|
|
27
|
+
import _default$5 from "./ui/alert-dialog/alert-dialog-content.vue.js";
|
|
28
|
+
import _default$6 from "./ui/alert-dialog/alert-dialog-description.vue.js";
|
|
29
|
+
import _default$7 from "./ui/alert-dialog/alert-dialog-footer.vue.js";
|
|
30
|
+
import _default$8 from "./ui/alert-dialog/alert-dialog-header.vue.js";
|
|
31
|
+
import _default$2 from "./ui/alert-dialog/alert-dialog-root.vue.js";
|
|
32
|
+
import _default$9 from "./ui/alert-dialog/alert-dialog-title.vue.js";
|
|
33
|
+
import _default$10 from "./ui/alert-dialog/alert-dialog-trigger.vue.js";
|
|
34
|
+
import _default$11 from "./ui/dialog/dialog-close.vue.js";
|
|
35
|
+
import _default$12 from "./ui/dialog/dialog-content.vue.js";
|
|
36
|
+
import _default$13 from "./ui/dialog/dialog-description.vue.js";
|
|
37
|
+
import _default$14 from "./ui/dialog/dialog-footer.vue.js";
|
|
38
|
+
import _default$15 from "./ui/dialog/dialog-header.vue.js";
|
|
39
|
+
import _default$16 from "./ui/dialog/dialog-overlay.vue.js";
|
|
40
|
+
import _default$17 from "./ui/dialog/dialog-root.vue.js";
|
|
41
|
+
import _default$18 from "./ui/dialog/dialog-title.vue.js";
|
|
42
|
+
import _default$19 from "./ui/dialog/dialog-trigger.vue.js";
|
|
43
|
+
import _default$20 from "./ui/form/form-control.vue.js";
|
|
44
|
+
import _default$21 from "./ui/form/form-description.vue.js";
|
|
45
|
+
import _default$22 from "./ui/form/form-field.vue.js";
|
|
46
|
+
import _default$23 from "./ui/form/form-item.vue.js";
|
|
47
|
+
import _default$24 from "./ui/form/form-label.vue.js";
|
|
48
|
+
import _default$25 from "./ui/form/form-message.vue.js";
|
|
49
|
+
import { FORM_FIELD_INJECTION_KEY, FORM_ITEM_INJECTION_KEY } from "./ui/form/injection-keys.js";
|
|
50
|
+
import _default$26 from "./ui/label/label.vue.js";
|
|
51
|
+
import _default from "./ui/scroll-area/scroll-area.vue.js";
|
|
52
|
+
import _default$1 from "./ui/scroll-area/scroll-bar.vue.js";
|
|
53
|
+
import _default$27 from "./ui/sheet/sheet-close.vue.js";
|
|
54
|
+
import _default$28 from "./ui/sheet/sheet-content.vue.js";
|
|
55
|
+
import _default$29 from "./ui/sheet/sheet-description.vue.js";
|
|
56
|
+
import _default$30 from "./ui/sheet/sheet-footer.vue.js";
|
|
57
|
+
import _default$31 from "./ui/sheet/sheet-header.vue.js";
|
|
58
|
+
import _default$32 from "./ui/sheet/sheet-root.vue.js";
|
|
59
|
+
import _default$33 from "./ui/sheet/sheet-title.vue.js";
|
|
60
|
+
import "./ui/index.js";
|
|
61
|
+
import { Slot, VisuallyHidden, createContext } from "akar";
|
|
62
|
+
export type * from "pohon-ui";
|
|
63
|
+
export { _default as AScrollArea, _default$1 as AScrollBar, _default$2 as AlertDialog, _default$3 as AlertDialogAction, _default$4 as AlertDialogCancel, _default$5 as AlertDialogContent, _default$6 as AlertDialogDescription, _default$7 as AlertDialogFooter, _default$8 as AlertDialogHeader, _default$9 as AlertDialogTitle, _default$10 as AlertDialogTrigger, _default$11 as DialogClose, _default$12 as DialogContent, _default$13 as DialogDescription, _default$14 as DialogFooter, _default$15 as DialogHeader, _default$16 as DialogOverlay, _default$17 as DialogRoot, _default$18 as DialogTitle, _default$19 as DialogTrigger, FORM_FIELD_INJECTION_KEY, FORM_ITEM_INJECTION_KEY, _default$20 as FormControl, _default$21 as FormDescription, _default$22 as FormField, _default$23 as FormItem, _default$24 as FormLabel, _default$25 as FormMessage, _default$26 as Label, PASSWORD_STRENGTH_CHECKS, PASSWORD_STRENGTH_MAX, _default$27 as SheetClose, _default$28 as SheetContent, _default$29 as SheetDescription, _default$30 as SheetFooter, _default$31 as SheetHeader, _default$32 as SheetRoot, _default$33 as SheetTitle, Slot, _default$34 as TamanAuthForm, _default$35 as TamanBackToTop, _default$36 as TamanButtonCheckGroup, type TamanButtonCheckGroupModel, type TamanButtonCheckGroupOption, type TamanButtonCheckGroupProps, type TamanButtonCheckGroupValue, _default$37 as TamanButtonIcon, _default$38 as TamanDescription, _default$39 as TamanDescriptionItem, TamanDescriptionsBreakpoint, TamanDescriptionsColumn, TamanDescriptionsItemProps, TamanDescriptionsItemSpan, TamanDescriptionsItemType, TamanDescriptionsLayout, TamanDescriptionsProps, TamanDescriptionsRenderNode, TamanDescriptionsSize, _default$40 as TamanFileUpload, type TamanFileUploadProps, _default$41 as TamanFullScreen, _default$42 as TamanIcon, _default$43 as TamanInputCurrency, type TamanInputCurrencyProps, _default$44 as TamanInputDate, type TamanInputDateProps, _default$45 as TamanInputPassword, TamanInternalDescriptionsItem, _default$46 as TamanLoading, type TamanLoadingIcon, type TamanLoadingIconProps, _default$47 as TamanLogo, _default$48 as TamanRenderContent, TamanScreenMap, _default$49 as TamanScrollbar, VisuallyHidden, createContext, isPasswordStrong, passwordStrengthScore };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _sfc_main$28 from "./components/auth/taman-auth-form.mjs";
|
|
2
|
+
import _sfc_main$29 from "./components/back-to-top/taman-back-to-top.mjs";
|
|
3
|
+
import _sfc_main$41 from "./components/render-content/render-content.mjs";
|
|
4
|
+
import _sfc_main$30 from "./components/button/taman-button-check-group.mjs";
|
|
5
|
+
import _sfc_main$31 from "./components/button/taman-button-icon.mjs";
|
|
6
|
+
import taman_description_item_default from "./components/descriptions/taman-description-item.mjs";
|
|
7
|
+
import _sfc_main$32 from "./components/descriptions/taman-description.mjs";
|
|
8
|
+
import _sfc_main$33 from "./components/file-upload/taman-file-upload.mjs";
|
|
9
|
+
import _sfc_main$34 from "./components/full-screen/full-screen.mjs";
|
|
10
|
+
import _sfc_main$35 from "./components/icon/icon.mjs";
|
|
11
|
+
import { PASSWORD_STRENGTH_CHECKS, PASSWORD_STRENGTH_MAX, isPasswordStrong, passwordStrengthScore } from "./components/input/password-strength.mjs";
|
|
12
|
+
import _sfc_main$36 from "./components/input/taman-input-currency.mjs";
|
|
13
|
+
import _sfc_main$38 from "./components/input/taman-input-password.mjs";
|
|
14
|
+
import _sfc_main$37 from "./components/input-date/taman-input-date.mjs";
|
|
15
|
+
import _sfc_main$39 from "./components/loading/taman-loading.mjs";
|
|
16
|
+
import _sfc_main$40 from "./components/logo/taman-logo.mjs";
|
|
17
|
+
import _sfc_main$3 from "./ui/alert-dialog/alert-dialog-action.mjs";
|
|
18
|
+
import _sfc_main$4 from "./ui/alert-dialog/alert-dialog-cancel.mjs";
|
|
19
|
+
import _sfc_main$5 from "./ui/alert-dialog/alert-dialog-content.mjs";
|
|
20
|
+
import _sfc_main$6 from "./ui/alert-dialog/alert-dialog-description.mjs";
|
|
21
|
+
import alert_dialog_footer_default from "./ui/alert-dialog/alert-dialog-footer.mjs";
|
|
22
|
+
import alert_dialog_header_default from "./ui/alert-dialog/alert-dialog-header.mjs";
|
|
23
|
+
import _sfc_main$2 from "./ui/alert-dialog/alert-dialog-root.mjs";
|
|
24
|
+
import _sfc_main$7 from "./ui/alert-dialog/alert-dialog-title.mjs";
|
|
25
|
+
import _sfc_main$8 from "./ui/alert-dialog/alert-dialog-trigger.mjs";
|
|
26
|
+
import _sfc_main$9 from "./ui/dialog/dialog-close.mjs";
|
|
27
|
+
import _sfc_main$12 from "./ui/dialog/dialog-overlay.mjs";
|
|
28
|
+
import _sfc_main$10 from "./ui/dialog/dialog-content.mjs";
|
|
29
|
+
import _sfc_main$11 from "./ui/dialog/dialog-description.mjs";
|
|
30
|
+
import dialog_footer_default from "./ui/dialog/dialog-footer.mjs";
|
|
31
|
+
import dialog_header_default from "./ui/dialog/dialog-header.mjs";
|
|
32
|
+
import _sfc_main$13 from "./ui/dialog/dialog-root.mjs";
|
|
33
|
+
import _sfc_main$14 from "./ui/dialog/dialog-title.mjs";
|
|
34
|
+
import _sfc_main$15 from "./ui/dialog/dialog-trigger.mjs";
|
|
35
|
+
import { FORM_FIELD_INJECTION_KEY, FORM_ITEM_INJECTION_KEY } from "./ui/form/injection-keys.mjs";
|
|
36
|
+
import _sfc_main$16 from "./ui/form/form-control.mjs";
|
|
37
|
+
import _sfc_main$17 from "./ui/form/form-description.mjs";
|
|
38
|
+
import _sfc_main$18 from "./ui/form/form-field.mjs";
|
|
39
|
+
import _sfc_main$19 from "./ui/form/form-item.mjs";
|
|
40
|
+
import _sfc_main$22 from "./ui/label/label.mjs";
|
|
41
|
+
import _sfc_main$20 from "./ui/form/form-label.mjs";
|
|
42
|
+
import _sfc_main$21 from "./ui/form/form-message.mjs";
|
|
43
|
+
import _sfc_main$1 from "./ui/scroll-area/scroll-bar.mjs";
|
|
44
|
+
import _sfc_main from "./ui/scroll-area/scroll-area.mjs";
|
|
45
|
+
import _sfc_main$23 from "./ui/sheet/sheet-close.mjs";
|
|
46
|
+
import _sfc_main$24 from "./ui/sheet/sheet-content.mjs";
|
|
47
|
+
import _sfc_main$25 from "./ui/sheet/sheet-description.mjs";
|
|
48
|
+
import sheet_footer_default from "./ui/sheet/sheet-footer.mjs";
|
|
49
|
+
import sheet_header_default from "./ui/sheet/sheet-header.mjs";
|
|
50
|
+
import _sfc_main$26 from "./ui/sheet/sheet-root.mjs";
|
|
51
|
+
import _sfc_main$27 from "./ui/sheet/sheet-title.mjs";
|
|
52
|
+
import "./ui/index.mjs";
|
|
53
|
+
import _sfc_main$42 from "./components/scrollbar/scrollbar.mjs";
|
|
54
|
+
import "./components/index.mjs";
|
|
55
|
+
import { Slot, VisuallyHidden, createContext } from "akar";
|
|
56
|
+
export { _sfc_main as AScrollArea, _sfc_main$1 as AScrollBar, _sfc_main$2 as AlertDialog, _sfc_main$3 as AlertDialogAction, _sfc_main$4 as AlertDialogCancel, _sfc_main$5 as AlertDialogContent, _sfc_main$6 as AlertDialogDescription, alert_dialog_footer_default as AlertDialogFooter, alert_dialog_header_default as AlertDialogHeader, _sfc_main$7 as AlertDialogTitle, _sfc_main$8 as AlertDialogTrigger, _sfc_main$9 as DialogClose, _sfc_main$10 as DialogContent, _sfc_main$11 as DialogDescription, dialog_footer_default as DialogFooter, dialog_header_default as DialogHeader, _sfc_main$12 as DialogOverlay, _sfc_main$13 as DialogRoot, _sfc_main$14 as DialogTitle, _sfc_main$15 as DialogTrigger, FORM_FIELD_INJECTION_KEY, FORM_ITEM_INJECTION_KEY, _sfc_main$16 as FormControl, _sfc_main$17 as FormDescription, _sfc_main$18 as FormField, _sfc_main$19 as FormItem, _sfc_main$20 as FormLabel, _sfc_main$21 as FormMessage, _sfc_main$22 as Label, PASSWORD_STRENGTH_CHECKS, PASSWORD_STRENGTH_MAX, _sfc_main$23 as SheetClose, _sfc_main$24 as SheetContent, _sfc_main$25 as SheetDescription, sheet_footer_default as SheetFooter, sheet_header_default as SheetHeader, _sfc_main$26 as SheetRoot, _sfc_main$27 as SheetTitle, Slot, _sfc_main$28 as TamanAuthForm, _sfc_main$29 as TamanBackToTop, _sfc_main$30 as TamanButtonCheckGroup, _sfc_main$31 as TamanButtonIcon, _sfc_main$32 as TamanDescription, taman_description_item_default as TamanDescriptionItem, _sfc_main$33 as TamanFileUpload, _sfc_main$34 as TamanFullScreen, _sfc_main$35 as TamanIcon, _sfc_main$36 as TamanInputCurrency, _sfc_main$37 as TamanInputDate, _sfc_main$38 as TamanInputPassword, _sfc_main$39 as TamanLoading, _sfc_main$40 as TamanLogo, _sfc_main$41 as TamanRenderContent, _sfc_main$42 as TamanScrollbar, VisuallyHidden, createContext, isPasswordStrong, passwordStrengthScore };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import _sfc_main from "./taman-core-layout-content.mjs";
|
|
2
|
+
import _sfc_main$1 from "./taman-core-layout-footer.mjs";
|
|
3
|
+
import _sfc_main$2 from "./taman-core-layout-header.mjs";
|
|
4
|
+
import _sfc_main$3 from "./taman-core-layout-sidebar.mjs";
|
|
5
|
+
import _sfc_main$4 from "./taman-core-layout-tabbar.mjs";
|
|
6
|
+
export { _sfc_main as TamanCoreLayoutContent, _sfc_main$1 as TamanCoreLayoutFooter, _sfc_main$2 as TamanCoreLayoutHeader, _sfc_main$3 as TamanCoreLayoutSidebar, _sfc_main$4 as TamanCoreLayoutTabbar };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createBlock, defineComponent, openBlock, unref, useModel, withModifiers } from "vue";
|
|
2
|
+
import PButton from "pohon-ui/components/Button.vue";
|
|
3
|
+
import { useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
4
|
+
//#region src/layout/components/taman-core-button-collapse.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "taman-core-button-collapse",
|
|
7
|
+
props: {
|
|
8
|
+
"collapsed": { type: Boolean },
|
|
9
|
+
"collapsedModifiers": {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:collapsed"],
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const collapsed = useModel(__props, "collapsed");
|
|
14
|
+
const { $t } = useSimpleLocale();
|
|
15
|
+
function handleCollapsed() {
|
|
16
|
+
collapsed.value = !collapsed.value;
|
|
17
|
+
}
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return openBlock(), createBlock(PButton, {
|
|
20
|
+
class: "bottom-2 left-3 absolute z-10",
|
|
21
|
+
"aria-label": unref($t)("toggleSidebar"),
|
|
22
|
+
"aria-pressed": collapsed.value,
|
|
23
|
+
"data-layout-action": "toggle-sidebar-collapse",
|
|
24
|
+
icon: collapsed.value ? "lucide-chevrons-right" : "lucide-chevrons-left",
|
|
25
|
+
color: "neutral",
|
|
26
|
+
size: "sm",
|
|
27
|
+
variant: "soft",
|
|
28
|
+
onClick: withModifiers(handleCollapsed, ["stop"])
|
|
29
|
+
}, null, 8, [
|
|
30
|
+
"aria-label",
|
|
31
|
+
"aria-pressed",
|
|
32
|
+
"icon"
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createBlock, defineComponent, openBlock, useModel, withModifiers } from "vue";
|
|
2
|
+
import PButton from "pohon-ui/components/Button.vue";
|
|
3
|
+
//#region src/layout/components/taman-core-button-fixed.vue
|
|
4
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
5
|
+
__name: "taman-core-button-fixed",
|
|
6
|
+
props: {
|
|
7
|
+
"expandOnHover": { type: Boolean },
|
|
8
|
+
"expandOnHoverModifiers": {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["update:expandOnHover"],
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const expandOnHover = useModel(__props, "expandOnHover");
|
|
13
|
+
function toggleFixed() {
|
|
14
|
+
expandOnHover.value = !expandOnHover.value;
|
|
15
|
+
}
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createBlock(PButton, {
|
|
18
|
+
class: "bottom-2 right-3 absolute z-10",
|
|
19
|
+
icon: expandOnHover.value ? "lucide-pin" : "lucide-pin-off",
|
|
20
|
+
color: "neutral",
|
|
21
|
+
size: "sm",
|
|
22
|
+
variant: "soft",
|
|
23
|
+
onClick: withModifiers(toggleFixed, ["stop"])
|
|
24
|
+
}, null, 8, ["icon"]);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeStyle, openBlock, renderSlot } from "vue";
|
|
2
|
+
//#region src/layout/components/taman-core-layout-content.vue
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
"data-layout-region": "content-overlay",
|
|
6
|
+
class: "h-0 w-full pointer-events-none top-0 sticky z-150"
|
|
7
|
+
};
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
__name: "taman-core-layout-content",
|
|
10
|
+
props: {
|
|
11
|
+
contentCompact: {},
|
|
12
|
+
contentCompactWidth: {},
|
|
13
|
+
padding: {},
|
|
14
|
+
paddingBottom: {},
|
|
15
|
+
paddingLeft: {},
|
|
16
|
+
paddingRight: {},
|
|
17
|
+
paddingTop: {}
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const overlayViewportStyle = { height: "calc(var(--taman-viewport-height) - var(--taman-header-height, 0px) - var(--taman-footer-height, 0px))" };
|
|
22
|
+
const style = computed(() => {
|
|
23
|
+
const { contentCompact, padding, paddingBottom, paddingLeft, paddingRight, paddingTop } = props;
|
|
24
|
+
return {
|
|
25
|
+
...contentCompact === "compact" ? {
|
|
26
|
+
margin: "0 auto",
|
|
27
|
+
width: `${props.contentCompactWidth}px`
|
|
28
|
+
} : {},
|
|
29
|
+
flex: 1,
|
|
30
|
+
padding: `${padding}px`,
|
|
31
|
+
paddingBottom: `${paddingBottom}px`,
|
|
32
|
+
paddingLeft: `${paddingLeft}px`,
|
|
33
|
+
paddingRight: `${paddingRight}px`,
|
|
34
|
+
paddingTop: `${paddingTop}px`
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("main", {
|
|
39
|
+
style: normalizeStyle(style.value),
|
|
40
|
+
class: "min-h-0 min-w-0 relative"
|
|
41
|
+
}, [_ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
42
|
+
style: overlayViewportStyle,
|
|
43
|
+
"data-layout-region": "overlay-viewport",
|
|
44
|
+
class: "min-h-0 w-full pointer-events-none relative"
|
|
45
|
+
}, [renderSlot(_ctx.$slots, "overlay")])])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 4);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { computed, createElementBlock, defineComponent, normalizeStyle, openBlock, renderSlot } from "vue";
|
|
2
|
+
//#region src/layout/components/taman-core-layout-footer.vue
|
|
3
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
4
|
+
__name: "taman-core-layout-footer",
|
|
5
|
+
props: {
|
|
6
|
+
fixed: { type: Boolean },
|
|
7
|
+
height: {},
|
|
8
|
+
show: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: true
|
|
11
|
+
},
|
|
12
|
+
width: {},
|
|
13
|
+
zIndex: {}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const style = computed(() => {
|
|
18
|
+
const { fixed, height, show, width, zIndex } = props;
|
|
19
|
+
return {
|
|
20
|
+
height: `${height}px`,
|
|
21
|
+
marginBottom: show ? "0" : `-${height}px`,
|
|
22
|
+
position: fixed ? "fixed" : "static",
|
|
23
|
+
transform: show ? "translateY(0)" : "translateY(100%)",
|
|
24
|
+
width,
|
|
25
|
+
zIndex
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createElementBlock("footer", {
|
|
30
|
+
style: normalizeStyle(style.value),
|
|
31
|
+
"data-layout-region": "footer",
|
|
32
|
+
class: "bg-background-elevated shrink-0 w-full transition-all-280 bottom-0"
|
|
33
|
+
}, [renderSlot(_ctx.$slots, "default")], 4);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, unref, useSlots } from "vue";
|
|
2
|
+
//#region src/layout/components/taman-core-layout-header.vue
|
|
3
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
4
|
+
__name: "taman-core-layout-header",
|
|
5
|
+
props: {
|
|
6
|
+
fullWidth: { type: Boolean },
|
|
7
|
+
height: {},
|
|
8
|
+
isMobile: { type: Boolean },
|
|
9
|
+
logoVisible: { type: Boolean },
|
|
10
|
+
show: { type: Boolean },
|
|
11
|
+
sidebarWidth: {},
|
|
12
|
+
theme: {},
|
|
13
|
+
width: {},
|
|
14
|
+
zIndex: {}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const slots = useSlots();
|
|
19
|
+
const style = computed(() => {
|
|
20
|
+
const { fullWidth, height, show } = props;
|
|
21
|
+
const right = !show || !fullWidth ? void 0 : 0;
|
|
22
|
+
return {
|
|
23
|
+
height: `${height}px`,
|
|
24
|
+
marginTop: show ? 0 : `-${height}px`,
|
|
25
|
+
right
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const logoStyle = computed(() => {
|
|
29
|
+
if (!props.logoVisible) return { minWidth: "12px" };
|
|
30
|
+
return { minWidth: `${props.isMobile ? 40 : props.sidebarWidth}px` };
|
|
31
|
+
});
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return openBlock(), createElementBlock("header", {
|
|
34
|
+
class: normalizeClass([__props.theme, "pl-2 border-b border-border bg-background-header flex flex-[0_0_auto] w-full transition-[margin]-200 items-center top-0"]),
|
|
35
|
+
style: normalizeStyle(style.value)
|
|
36
|
+
}, [
|
|
37
|
+
unref(slots).logo || !__props.logoVisible && !__props.isMobile ? (openBlock(), createElementBlock("div", {
|
|
38
|
+
key: 0,
|
|
39
|
+
style: normalizeStyle(logoStyle.value)
|
|
40
|
+
}, [renderSlot(_ctx.$slots, "logo")], 4)) : createCommentVNode("v-if", true),
|
|
41
|
+
renderSlot(_ctx.$slots, "toggle-button"),
|
|
42
|
+
renderSlot(_ctx.$slots, "default")
|
|
43
|
+
], 6);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { _sfc_main as default };
|