@shwfed/nuxt 0.7.8 → 0.7.10
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/module.json +1 -1
- package/dist/runtime/components/app.d.vue.ts +7 -58
- package/dist/runtime/components/app.vue +18 -411
- package/dist/runtime/components/app.vue.d.ts +7 -58
- package/dist/runtime/components/fields.d.vue.ts +177 -0
- package/dist/runtime/components/fields.vue +47 -0
- package/dist/runtime/components/fields.vue.d.ts +177 -0
- package/dist/runtime/components/table.d.vue.ts +63 -59
- package/dist/runtime/components/table.vue +52 -617
- package/dist/runtime/components/table.vue.d.ts +63 -59
- package/dist/runtime/components/ui/app/App.d.vue.ts +86 -0
- package/dist/runtime/components/ui/app/App.vue +414 -0
- package/dist/runtime/components/ui/app/App.vue.d.ts +86 -0
- package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +1 -1
- package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +1 -1
- package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +5 -12
- package/dist/runtime/components/ui/calendar/Calendar.vue +77 -92
- package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +5 -12
- package/dist/runtime/components/ui/calendar/CalendarCellTrigger.vue +1 -1
- package/dist/runtime/components/ui/calendar/index.d.ts +1 -1
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +6 -2
- package/dist/runtime/components/ui/command/CommandGroup.vue +4 -0
- package/dist/runtime/components/ui/dialog/DialogOverlay.vue +1 -1
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +87 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/index.d.ts +1 -0
- package/dist/runtime/components/ui/expression-editor/index.js +1 -0
- package/dist/runtime/components/ui/field/FieldContent.vue +1 -1
- package/dist/runtime/components/ui/field/FieldDescription.vue +1 -1
- package/dist/runtime/components/ui/field/FieldError.vue +2 -2
- package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
- package/dist/runtime/components/ui/field/FieldSeparator.vue +1 -1
- package/dist/runtime/components/ui/field/index.js +7 -5
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +376 -0
- package/dist/runtime/components/ui/fields/Fields.vue +441 -0
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +376 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +163 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +363 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +163 -0
- package/dist/runtime/components/ui/input/Input.d.vue.ts +1 -0
- package/dist/runtime/components/ui/input/Input.vue +3 -1
- package/dist/runtime/components/ui/input/Input.vue.d.ts +1 -0
- package/dist/runtime/components/ui/input-group/InputGroup.vue +3 -0
- package/dist/runtime/components/ui/input-group/InputGroupAddon.vue +4 -1
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +11 -3
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +16 -5
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +11 -3
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.d.vue.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +12 -1
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue.d.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.d.vue.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +10 -4
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue.d.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupText.vue +1 -1
- package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
- package/dist/runtime/components/ui/input-group/index.js +2 -2
- package/dist/runtime/components/ui/label/Label.vue +1 -1
- package/dist/runtime/components/ui/locale/Locale.d.vue.ts +20 -0
- package/dist/runtime/components/ui/locale/Locale.vue +291 -0
- package/dist/runtime/components/ui/locale/Locale.vue.d.ts +20 -0
- package/dist/runtime/components/ui/locale/index.d.ts +1 -0
- package/dist/runtime/components/ui/locale/index.js +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -3
- package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue +4 -1
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +1 -0
- package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
- package/dist/runtime/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
- package/dist/runtime/components/ui/number-field/NumberFieldInput.vue +1 -1
- package/dist/runtime/components/ui/range-calendar/RangeCalendarCell.vue +1 -1
- package/dist/runtime/components/ui/range-calendar/RangeCalendarCellTrigger.vue +1 -1
- package/dist/runtime/components/ui/sheet/SheetOverlay.vue +1 -1
- package/dist/runtime/components/ui/switch/Switch.d.vue.ts +24 -0
- package/dist/runtime/components/ui/switch/Switch.vue +46 -0
- package/dist/runtime/components/ui/switch/Switch.vue.d.ts +24 -0
- package/dist/runtime/components/ui/switch/index.d.ts +1 -0
- package/dist/runtime/components/ui/switch/index.js +1 -0
- package/dist/runtime/components/ui/table/Table.d.vue.ts +81 -0
- package/dist/runtime/components/ui/table/Table.vue +792 -0
- package/dist/runtime/components/ui/table/Table.vue.d.ts +81 -0
- package/dist/runtime/components/ui/table/schema.d.ts +48 -0
- package/dist/runtime/components/ui/table/schema.js +126 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +62 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2233 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +62 -0
- package/dist/runtime/components/ui/table-configurator/menu.d.ts +37 -0
- package/dist/runtime/components/ui/table-configurator/menu.js +227 -0
- package/dist/runtime/components/ui/tabs/Tabs.d.vue.ts +24 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue +30 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue.d.ts +24 -0
- package/dist/runtime/components/ui/tabs/TabsContent.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue +23 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue +25 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue +27 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/index.d.ts +4 -0
- package/dist/runtime/components/ui/tabs/index.js +4 -0
- package/dist/runtime/components/ui/textarea/Textarea.d.vue.ts +1 -0
- package/dist/runtime/components/ui/textarea/Textarea.vue +4 -2
- package/dist/runtime/components/ui/textarea/Textarea.vue.d.ts +1 -0
- package/dist/runtime/components/ui/toggle/Toggle.d.vue.ts +34 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue +32 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue.d.ts +34 -0
- package/dist/runtime/components/ui/toggle/index.d.ts +7 -0
- package/dist/runtime/components/ui/toggle/index.js +22 -0
- package/dist/runtime/composables/useTableRenderers.d.ts +2 -1
- package/dist/runtime/composables/useTableRenderers.js +2 -1
- package/dist/runtime/plugins/cel/env.d.ts +2 -2
- package/dist/runtime/plugins/cel/env.js +5 -4
- package/dist/runtime/plugins/cel/index.d.ts +3 -3
- package/dist/runtime/plugins/cel/index.js +7 -3
- package/dist/runtime/plugins/markdown/index.d.ts +1 -1
- package/dist/runtime/style.css +1 -1
- package/dist/runtime/table-renderers/builtins.js +213 -98
- package/dist/runtime/table-renderers/registry.d.ts +1 -0
- package/dist/runtime/table-renderers/registry.js +3 -0
- package/dist/runtime/utils/coders.d.ts +32 -0
- package/dist/runtime/utils/coders.js +64 -0
- package/dist/runtime/vendor/cel/index.d.ts +17 -0
- package/dist/runtime/vendor/cel/index.js +10 -0
- package/dist/runtime/vendor/cel-js/LICENSE +21 -0
- package/dist/runtime/vendor/cel-js/UPSTREAM.md +17 -0
- package/dist/runtime/vendor/cel-js/lib/errors.d.ts +21 -0
- package/dist/runtime/vendor/cel-js/lib/errors.js +97 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.d.ts +4 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +192 -0
- package/dist/runtime/vendor/cel-js/lib/functions.d.ts +53 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +513 -0
- package/dist/runtime/vendor/cel-js/lib/globals.d.ts +27 -0
- package/dist/runtime/vendor/cel-js/lib/globals.js +33 -0
- package/dist/runtime/vendor/cel-js/lib/index.d.ts +469 -0
- package/dist/runtime/vendor/cel-js/lib/index.js +18 -0
- package/dist/runtime/vendor/cel-js/lib/macros.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/macros.js +230 -0
- package/dist/runtime/vendor/cel-js/lib/operators.d.ts +117 -0
- package/dist/runtime/vendor/cel-js/lib/operators.js +739 -0
- package/dist/runtime/vendor/cel-js/lib/optional.d.ts +14 -0
- package/dist/runtime/vendor/cel-js/lib/optional.js +161 -0
- package/dist/runtime/vendor/cel-js/lib/options.d.ts +23 -0
- package/dist/runtime/vendor/cel-js/lib/options.js +47 -0
- package/dist/runtime/vendor/cel-js/lib/overloads.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/overloads.js +214 -0
- package/dist/runtime/vendor/cel-js/lib/parser.d.ts +56 -0
- package/dist/runtime/vendor/cel-js/lib/parser.js +827 -0
- package/dist/runtime/vendor/cel-js/lib/registry.d.ts +279 -0
- package/dist/runtime/vendor/cel-js/lib/registry.js +1596 -0
- package/dist/runtime/vendor/cel-js/lib/serialize.d.ts +1 -0
- package/dist/runtime/vendor/cel-js/lib/serialize.js +259 -0
- package/dist/runtime/vendor/cel-js/lib/type-checker.d.ts +26 -0
- package/dist/runtime/vendor/cel-js/lib/type-checker.js +81 -0
- package/package.json +9 -4
- package/dist/runtime/components/locale.d.vue.ts +0 -14
- package/dist/runtime/components/locale.vue +0 -89
- package/dist/runtime/components/locale.vue.d.ts +0 -14
- package/dist/runtime/components/query.d.vue.ts +0 -30
- package/dist/runtime/components/query.vue +0 -266
- package/dist/runtime/components/query.vue.d.ts +0 -30
- package/dist/runtime/utilities/query-config/global.d.ts +0 -4
- package/dist/runtime/utilities/query-config/global.js +0 -18
- package/dist/runtime/utilities/query-config/index.d.ts +0 -3
- package/dist/runtime/utilities/query-config/index.js +0 -14
- package/dist/runtime/utilities/query-config/schema.d.ts +0 -96
- package/dist/runtime/utilities/query-config/schema.js +0 -51
- /package/dist/runtime/components/{logo.d.vue.ts → ui/logo/Logo.d.vue.ts} +0 -0
- /package/dist/runtime/components/{logo.vue → ui/logo/Logo.vue} +0 -0
- /package/dist/runtime/components/{logo.vue.d.ts → ui/logo/Logo.vue.d.ts} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ToggleProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import type { ToggleVariants } from '.';
|
|
4
|
+
type __VLS_Props = ToggleProps & {
|
|
5
|
+
class?: HTMLAttributes['class'];
|
|
6
|
+
variant?: ToggleVariants['variant'];
|
|
7
|
+
size?: ToggleVariants['size'];
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_8: {
|
|
10
|
+
modelValue: boolean;
|
|
11
|
+
state: "off" | "on";
|
|
12
|
+
pressed: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_8) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: boolean) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
size: "default" | "sm" | "lg" | null;
|
|
25
|
+
variant: "default" | "outline" | null;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { Toggle, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../utils/cn";
|
|
5
|
+
import { toggleVariants } from ".";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
defaultValue: { type: Boolean, required: false },
|
|
8
|
+
modelValue: { type: [Boolean, null], required: false },
|
|
9
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
10
|
+
asChild: { type: Boolean, required: false },
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
name: { type: String, required: false },
|
|
13
|
+
required: { type: Boolean, required: false },
|
|
14
|
+
class: { type: null, required: false },
|
|
15
|
+
variant: { type: null, required: false, default: "default" },
|
|
16
|
+
size: { type: null, required: false, default: "default" }
|
|
17
|
+
});
|
|
18
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
19
|
+
const delegatedProps = reactiveOmit(props, "class", "size", "variant");
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<Toggle
|
|
25
|
+
v-slot="slotProps"
|
|
26
|
+
data-slot="toggle"
|
|
27
|
+
v-bind="forwarded"
|
|
28
|
+
:class="cn(toggleVariants({ variant, size }), props.class)"
|
|
29
|
+
>
|
|
30
|
+
<slot v-bind="slotProps" />
|
|
31
|
+
</Toggle>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ToggleProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import type { ToggleVariants } from '.';
|
|
4
|
+
type __VLS_Props = ToggleProps & {
|
|
5
|
+
class?: HTMLAttributes['class'];
|
|
6
|
+
variant?: ToggleVariants['variant'];
|
|
7
|
+
size?: ToggleVariants['size'];
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_8: {
|
|
10
|
+
modelValue: boolean;
|
|
11
|
+
state: "off" | "on";
|
|
12
|
+
pressed: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_8) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: boolean) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
size: "default" | "sm" | "lg" | null;
|
|
25
|
+
variant: "default" | "outline" | null;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { default as Toggle } from './Toggle.vue.js';
|
|
3
|
+
export declare const toggleVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "outline" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type ToggleVariants = VariantProps<typeof toggleVariants>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
export { default as Toggle } from "./Toggle.vue";
|
|
3
|
+
export const toggleVariants = cva(
|
|
4
|
+
"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all duration-180 outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-transparent text-zinc-600 hover:bg-zinc-50 hover:text-zinc-900 data-[state=on]:bg-[color-mix(in_srgb,var(--primary)_12%,white)] data-[state=on]:text-(--primary)",
|
|
9
|
+
outline: "border border-zinc-200 bg-white text-zinc-700 shadow-xs hover:bg-zinc-50 hover:text-zinc-900 data-[state=on]:border-[color-mix(in_srgb,var(--primary)_50%,white)] data-[state=on]:bg-[color-mix(in_srgb,var(--primary)_12%,white)] data-[state=on]:text-(--primary)"
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
default: "h-9 min-w-9 px-3",
|
|
13
|
+
sm: "h-8 min-w-8 px-2.5 text-xs",
|
|
14
|
+
lg: "h-10 min-w-10 px-4"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
size: "default"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import '../table-renderers/builtins.js';
|
|
2
|
-
import { getTableRenderer, resolveTableRenderer } from '../table-renderers/registry.js';
|
|
2
|
+
import { getTableRenderer, listTableRenderers, resolveTableRenderer } from '../table-renderers/registry.js';
|
|
3
3
|
export { defineTableRenderer } from '../table-renderers/registry.js';
|
|
4
4
|
export type { TableRenderer, TableRendererCellArgs, TableRendererColumnDefOverrides, TableRendererConfigComponent, TableRendererFooterArgs, TableRendererHeaderArgs, TableRendererId, } from '../table-renderers/registry.js';
|
|
5
5
|
export declare function useTableRenderers(): {
|
|
6
6
|
getTableRenderer: typeof getTableRenderer;
|
|
7
|
+
listTableRenderers: typeof listTableRenderers;
|
|
7
8
|
resolveTableRenderer: typeof resolveTableRenderer;
|
|
8
9
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "../table-renderers/builtins";
|
|
2
|
-
import { getTableRenderer, resolveTableRenderer } from "../table-renderers/registry.js";
|
|
2
|
+
import { getTableRenderer, listTableRenderers, resolveTableRenderer } from "../table-renderers/registry.js";
|
|
3
3
|
export { defineTableRenderer } from "../table-renderers/registry.js";
|
|
4
4
|
export function useTableRenderers() {
|
|
5
5
|
return {
|
|
6
6
|
getTableRenderer,
|
|
7
|
+
listTableRenderers,
|
|
7
8
|
resolveTableRenderer
|
|
8
9
|
};
|
|
9
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment } from '
|
|
2
|
-
export declare function createEnvironment(): Environment;
|
|
1
|
+
import { Environment } from '../../vendor/cel/index.js';
|
|
2
|
+
export declare function createEnvironment(f?: (env: Environment) => Environment): Environment;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Environment, EvaluationError, Optional } from "
|
|
1
|
+
import { Environment, EvaluationError, Optional } from "../../vendor/cel/index.js";
|
|
2
2
|
import { startOfDay, startOfWeek, startOfYear, startOfMonth, endOfDay, endOfWeek, endOfYear, endOfMonth, addYears, addMonths, addDays, addWeeks, setDate, setMonth, setYear, formatDate, isBefore, isAfter, isEqual } from "date-fns";
|
|
3
3
|
import { TZDate } from "@date-fns/tz";
|
|
4
4
|
import { BigNumber } from "bignumber.js";
|
|
5
|
+
import { identity } from "effect";
|
|
5
6
|
const DIGITS = "\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396";
|
|
6
7
|
const SMALL_UNITS = ["", "\u62FE", "\u4F70", "\u4EDF"];
|
|
7
8
|
const BIG_UNITS = ["", "\u4E07", "\u4EBF", "\u4E07\u4EBF"];
|
|
@@ -54,7 +55,7 @@ function encodeSimplifiedChineseUppercaseInteger(s) {
|
|
|
54
55
|
}
|
|
55
56
|
return out;
|
|
56
57
|
}
|
|
57
|
-
export function createEnvironment() {
|
|
58
|
+
export function createEnvironment(f = identity) {
|
|
58
59
|
const env = new Environment({
|
|
59
60
|
enableOptionalTypes: true,
|
|
60
61
|
homogeneousAggregateLiterals: false,
|
|
@@ -68,7 +69,7 @@ export function createEnvironment() {
|
|
|
68
69
|
return Optional.of(value);
|
|
69
70
|
}).registerType("URL", URL).registerFunction("URL.searchParams(): URLSearchParams", (url) => {
|
|
70
71
|
return url.searchParams;
|
|
71
|
-
}).registerVariable("location", "URL").registerType("Date", TZDate).registerVariable("token", "string").registerVariable("now", "Date").registerVariable("today", "Date").registerFunction("date(string): Date", (date) => {
|
|
72
|
+
}).registerVariable("location", "URL").registerType("Date", TZDate).registerVariable("token", "string").registerVariable("locale", "string").registerVariable("now", "Date").registerVariable("today", "Date").registerFunction("date(string): Date", (date) => {
|
|
72
73
|
return new TZDate(date);
|
|
73
74
|
}).registerOperator("Date < Date", (date1, date2) => {
|
|
74
75
|
return isBefore(date1, date2);
|
|
@@ -183,5 +184,5 @@ export function createEnvironment() {
|
|
|
183
184
|
return Optional.none();
|
|
184
185
|
}
|
|
185
186
|
});
|
|
186
|
-
return env;
|
|
187
|
+
return f(env);
|
|
187
188
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Context } from '
|
|
1
|
+
import type { Context } from '../../vendor/cel/index.js';
|
|
2
2
|
declare const _default: import("#app").Plugin<{
|
|
3
3
|
dsl: {
|
|
4
4
|
check: (template: {
|
|
5
5
|
raw: readonly string[] | ArrayLike<string>;
|
|
6
|
-
}, ...substitutions: any[]) => import("
|
|
6
|
+
}, ...substitutions: any[]) => import("../../vendor/cel-js/lib/index.js").TypeCheckResult;
|
|
7
7
|
evaluate: <T>(template: {
|
|
8
8
|
raw: readonly string[] | ArrayLike<string>;
|
|
9
9
|
}, ...substitutions: any[]) => (context?: Context) => T;
|
|
@@ -12,7 +12,7 @@ declare const _default: import("#app").Plugin<{
|
|
|
12
12
|
dsl: {
|
|
13
13
|
check: (template: {
|
|
14
14
|
raw: readonly string[] | ArrayLike<string>;
|
|
15
|
-
}, ...substitutions: any[]) => import("
|
|
15
|
+
}, ...substitutions: any[]) => import("../../vendor/cel-js/lib/index.js").TypeCheckResult;
|
|
16
16
|
evaluate: <T>(template: {
|
|
17
17
|
raw: readonly string[] | ArrayLike<string>;
|
|
18
18
|
}, ...substitutions: any[]) => (context?: Context) => T;
|
|
@@ -2,20 +2,24 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#app";
|
|
|
2
2
|
import defu from "defu";
|
|
3
3
|
import { createEnvironment } from "./env.js";
|
|
4
4
|
import { getGlobalDslContext } from "./context.js";
|
|
5
|
+
import { useNavigatorLanguage } from "@vueuse/core";
|
|
6
|
+
import { TZDate } from "@date-fns/tz";
|
|
5
7
|
export default defineNuxtPlugin({
|
|
6
8
|
name: "shwfed-nuxt:cel",
|
|
7
9
|
setup: () => {
|
|
8
10
|
const config = useRuntimeConfig().public.shwfed;
|
|
11
|
+
const locale = useNavigatorLanguage();
|
|
9
12
|
const env = createEnvironment().registerConstant("git", "map<string, string>", config.git).registerConstant("ci", "map<string, dyn>", {
|
|
10
13
|
...config.ci,
|
|
11
14
|
build: config.ci.build !== void 0 ? BigInt(config.ci.build) : void 0
|
|
12
15
|
});
|
|
13
16
|
const evaluate = (...args) => (context) => {
|
|
14
17
|
return env.evaluate(String.raw(...args), defu({}, getGlobalDslContext(), context, {
|
|
15
|
-
now:
|
|
16
|
-
today:
|
|
18
|
+
now: new TZDate(),
|
|
19
|
+
today: new TZDate(),
|
|
17
20
|
location: new URL(location.href),
|
|
18
|
-
token: sessionStorage.getItem("token") ?? ""
|
|
21
|
+
token: sessionStorage.getItem("token") ?? "",
|
|
22
|
+
locale: locale.language.value
|
|
19
23
|
}));
|
|
20
24
|
};
|
|
21
25
|
if (import.meta.client) {
|
package/dist/runtime/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";@plugin "@tailwindcss/typography";@source "components";@theme{--font-sans:"Noto Sans","Noto Sans SC","Noto Sans JP","sans-serif";--font-mono:"Berkeley Mono","Fira Mono","monospace"}
|
|
1
|
+
@import "tailwindcss";@plugin "@tailwindcss/typography";@source "components";@source "table-renderers";@theme{--font-sans:"Noto Sans","Noto Sans SC","Noto Sans JP","sans-serif";--font-mono:"Berkeley Mono","Fira Mono","monospace"}
|