@shwfed/nuxt 0.7.7 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +22 -32
  3. package/dist/runtime/components/app.d.vue.ts +0 -2
  4. package/dist/runtime/components/app.vue +1 -7
  5. package/dist/runtime/components/app.vue.d.ts +0 -2
  6. package/dist/runtime/components/fields.d.vue.ts +155 -0
  7. package/dist/runtime/components/fields.vue +312 -0
  8. package/dist/runtime/components/fields.vue.d.ts +155 -0
  9. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +1 -1
  10. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +1 -1
  11. package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +5 -12
  12. package/dist/runtime/components/ui/calendar/Calendar.vue +77 -92
  13. package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +5 -12
  14. package/dist/runtime/components/ui/calendar/CalendarCellTrigger.vue +1 -1
  15. package/dist/runtime/components/ui/calendar/index.d.ts +1 -1
  16. package/dist/runtime/components/ui/command/CommandGroup.vue +4 -0
  17. package/dist/runtime/components/ui/dialog/DialogOverlay.vue +1 -1
  18. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  19. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  20. package/dist/runtime/components/ui/field/FieldDescription.vue +1 -1
  21. package/dist/runtime/components/ui/field/FieldError.vue +1 -1
  22. package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
  23. package/dist/runtime/components/ui/field/FieldSeparator.vue +1 -1
  24. package/dist/runtime/components/ui/field/index.js +7 -5
  25. package/dist/runtime/components/ui/input/Input.vue +1 -1
  26. package/dist/runtime/components/ui/input-group/InputGroup.vue +3 -0
  27. package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +4 -1
  28. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +10 -4
  29. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +4 -1
  30. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +3 -1
  31. package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
  32. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
  33. package/dist/runtime/components/ui/input-group/InputGroupText.vue +1 -1
  34. package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
  35. package/dist/runtime/components/ui/input-group/index.js +1 -1
  36. package/dist/runtime/components/ui/label/Label.vue +1 -1
  37. package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -3
  38. package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
  39. package/dist/runtime/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
  40. package/dist/runtime/components/ui/range-calendar/RangeCalendarCell.vue +1 -1
  41. package/dist/runtime/components/ui/range-calendar/RangeCalendarCellTrigger.vue +1 -1
  42. package/dist/runtime/components/ui/sheet/SheetOverlay.vue +1 -1
  43. package/dist/runtime/components/ui/switch/Switch.d.vue.ts +24 -0
  44. package/dist/runtime/components/ui/switch/Switch.vue +46 -0
  45. package/dist/runtime/components/ui/switch/Switch.vue.d.ts +24 -0
  46. package/dist/runtime/components/ui/switch/index.d.ts +1 -0
  47. package/dist/runtime/components/ui/switch/index.js +1 -0
  48. package/dist/runtime/components/ui/textarea/Textarea.vue +1 -1
  49. package/dist/runtime/plugins/cel/env.d.ts +2 -2
  50. package/dist/runtime/plugins/cel/env.js +5 -4
  51. package/dist/runtime/plugins/cel/index.d.ts +3 -3
  52. package/dist/runtime/plugins/cel/index.js +7 -3
  53. package/dist/runtime/plugins/markdown/index.d.ts +1 -1
  54. package/dist/runtime/utils/coders.d.ts +7 -0
  55. package/dist/runtime/utils/coders.js +39 -0
  56. package/dist/runtime/vendor/cel/index.d.ts +17 -0
  57. package/dist/runtime/vendor/cel/index.js +10 -0
  58. package/dist/runtime/vendor/cel-js/LICENSE +21 -0
  59. package/dist/runtime/vendor/cel-js/UPSTREAM.md +17 -0
  60. package/dist/runtime/vendor/cel-js/lib/errors.d.ts +21 -0
  61. package/dist/runtime/vendor/cel-js/lib/errors.js +97 -0
  62. package/dist/runtime/vendor/cel-js/lib/evaluator.d.ts +4 -0
  63. package/dist/runtime/vendor/cel-js/lib/evaluator.js +192 -0
  64. package/dist/runtime/vendor/cel-js/lib/functions.d.ts +53 -0
  65. package/dist/runtime/vendor/cel-js/lib/functions.js +513 -0
  66. package/dist/runtime/vendor/cel-js/lib/globals.d.ts +27 -0
  67. package/dist/runtime/vendor/cel-js/lib/globals.js +33 -0
  68. package/dist/runtime/vendor/cel-js/lib/index.d.ts +469 -0
  69. package/dist/runtime/vendor/cel-js/lib/index.js +18 -0
  70. package/dist/runtime/vendor/cel-js/lib/macros.d.ts +1 -0
  71. package/dist/runtime/vendor/cel-js/lib/macros.js +230 -0
  72. package/dist/runtime/vendor/cel-js/lib/operators.d.ts +117 -0
  73. package/dist/runtime/vendor/cel-js/lib/operators.js +739 -0
  74. package/dist/runtime/vendor/cel-js/lib/optional.d.ts +14 -0
  75. package/dist/runtime/vendor/cel-js/lib/optional.js +161 -0
  76. package/dist/runtime/vendor/cel-js/lib/options.d.ts +23 -0
  77. package/dist/runtime/vendor/cel-js/lib/options.js +47 -0
  78. package/dist/runtime/vendor/cel-js/lib/overloads.d.ts +1 -0
  79. package/dist/runtime/vendor/cel-js/lib/overloads.js +214 -0
  80. package/dist/runtime/vendor/cel-js/lib/parser.d.ts +56 -0
  81. package/dist/runtime/vendor/cel-js/lib/parser.js +827 -0
  82. package/dist/runtime/vendor/cel-js/lib/registry.d.ts +279 -0
  83. package/dist/runtime/vendor/cel-js/lib/registry.js +1596 -0
  84. package/dist/runtime/vendor/cel-js/lib/serialize.d.ts +1 -0
  85. package/dist/runtime/vendor/cel-js/lib/serialize.js +259 -0
  86. package/dist/runtime/vendor/cel-js/lib/type-checker.d.ts +26 -0
  87. package/dist/runtime/vendor/cel-js/lib/type-checker.js +81 -0
  88. package/package.json +7 -4
  89. package/dist/runtime/components/locale.d.vue.ts +0 -14
  90. package/dist/runtime/components/locale.vue +0 -89
  91. package/dist/runtime/components/locale.vue.d.ts +0 -14
  92. package/dist/runtime/components/query.d.vue.ts +0 -30
  93. package/dist/runtime/components/query.vue +0 -266
  94. package/dist/runtime/components/query.vue.d.ts +0 -30
  95. package/dist/runtime/utilities/query-config/global.d.ts +0 -4
  96. package/dist/runtime/utilities/query-config/global.js +0 -18
  97. package/dist/runtime/utilities/query-config/index.d.ts +0 -3
  98. package/dist/runtime/utilities/query-config/index.js +0 -14
  99. package/dist/runtime/utilities/query-config/schema.d.ts +0 -96
  100. package/dist/runtime/utilities/query-config/schema.js +0 -51
@@ -1,9 +1,12 @@
1
1
  import { type PopoverContentProps } from 'reka-ui';
2
+ type __VLS_Props = PopoverContentProps & {
3
+ disabled?: boolean;
4
+ };
2
5
  declare var __VLS_48: {};
3
6
  type __VLS_Slots = {} & {
4
7
  default?: (props: typeof __VLS_48) => any;
5
8
  };
6
- declare const __VLS_base: import("vue").DefineComponent<PopoverContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PopoverContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
10
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
11
  declare const _default: typeof __VLS_export;
9
12
  export default _default;
@@ -5,6 +5,7 @@ import InputGroupComboboxInput from "./InputGroupComboboxInput.vue";
5
5
  import { useI18n } from "vue-i18n";
6
6
  import { Icon } from "@iconify/vue";
7
7
  import { useForwardProps } from "reka-ui";
8
+ import { reactiveOmit } from "@vueuse/core";
8
9
  import { getInputGroupReference } from ".";
9
10
  const { t } = useI18n();
10
11
  const props = defineProps({
@@ -29,13 +30,18 @@ const props = defineProps({
29
30
  reference: { type: null, required: false },
30
31
  asChild: { type: Boolean, required: false },
31
32
  as: { type: null, required: false },
32
- disableOutsidePointerEvents: { type: Boolean, required: false }
33
+ disableOutsidePointerEvents: { type: Boolean, required: false },
34
+ disabled: { type: Boolean, required: false }
33
35
  });
34
- const forwarded = useForwardProps(props);
36
+ const delegatedProps = reactiveOmit(props, "disabled");
37
+ const forwarded = useForwardProps(delegatedProps);
35
38
  </script>
36
39
 
37
40
  <template>
38
- <Command as-child>
41
+ <Command
42
+ as-child
43
+ :disabled="props.disabled"
44
+ >
39
45
  <Popover>
40
46
  <PopoverTrigger
41
47
  as="input"
@@ -47,7 +53,7 @@ const forwarded = useForwardProps(props);
47
53
  v-bind="forwarded"
48
54
  :reference="getInputGroupReference().value ?? void 0"
49
55
  :style="{
50
- minWidth: 'var(--reka-popover-trigger-width)'
56
+ width: 'var(--reka-popover-trigger-width)'
51
57
  }"
52
58
  >
53
59
  <CommandList>
@@ -1,9 +1,12 @@
1
1
  import { type PopoverContentProps } from 'reka-ui';
2
+ type __VLS_Props = PopoverContentProps & {
3
+ disabled?: boolean;
4
+ };
2
5
  declare var __VLS_48: {};
3
6
  type __VLS_Slots = {} & {
4
7
  default?: (props: typeof __VLS_48) => any;
5
8
  };
6
- declare const __VLS_base: import("vue").DefineComponent<PopoverContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PopoverContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
10
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
11
  declare const _default: typeof __VLS_export;
9
12
  export default _default;
@@ -8,9 +8,11 @@ const { filterState } = useCommand();
8
8
  <template>
9
9
  <ListboxFilter
10
10
  v-model="filterState.search"
11
+ data-slot="input-group-control"
11
12
  :data-value="!!filterState.search"
12
13
  :class="cn(
13
- 'flex-1 px-2 rounded-none border-none bg-transparent shadow-none dark:bg-transparent peer outline-none'
14
+ 'flex-1 px-2 rounded-none border-none bg-transparent shadow-none dark:bg-transparent peer outline-none disabled:cursor-not-allowed disabled:text-zinc-600 disabled:opacity-100'
14
15
  )"
16
+ @blur="filterState.search = ''"
15
17
  />
16
18
  </template>
@@ -13,7 +13,7 @@ const props = defineProps({
13
13
  data-slot="input-group-control"
14
14
  :treat-empty-as-different-state-from-null="treatEmptyAsDifferentStateFromNull"
15
15
  :class="cn(
16
- 'flex-1 rounded-none border-0 bg-transparent shadow-none dark:bg-transparent peer',
16
+ 'flex-1 rounded-none border-0 bg-transparent shadow-none dark:bg-transparent peer disabled:text-zinc-600 disabled:opacity-100',
17
17
  props.class
18
18
  )"
19
19
  />
@@ -38,7 +38,7 @@ const delegatedProps = reactiveOmit(props, "class");
38
38
  data-slot="input-group-control"
39
39
  :data-value="typeof delegatedProps.modelValue === 'number'"
40
40
  :class="cn(
41
- 'flex-1 px-2 py-1 rounded-none w-full text-sm text-slate-700 border-0 bg-transparent shadow-none dark:bg-transparent outline-none peer'
41
+ 'flex-1 px-2 py-1 rounded-none w-full text-sm text-zinc-700 border-0 bg-transparent shadow-none dark:bg-transparent outline-none peer disabled:cursor-not-allowed disabled:text-zinc-600 disabled:opacity-100'
42
42
  )"
43
43
  />
44
44
  </NumberField>
@@ -8,7 +8,7 @@ const props = defineProps({
8
8
  <template>
9
9
  <span
10
10
  :class="cn(
11
- 'text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4',
11
+ 'text-zinc-400 flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4',
12
12
  props.class
13
13
  )"
14
14
  >
@@ -10,7 +10,7 @@ const props = defineProps({
10
10
  <Textarea
11
11
  data-slot="input-group-control"
12
12
  :class="cn(
13
- 'flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent',
13
+ 'flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none dark:bg-transparent',
14
14
  props.class
15
15
  )"
16
16
  />
@@ -9,7 +9,7 @@ export { default as InputGroupTextarea } from "./InputGroupTextarea.vue";
9
9
  export { default as InputGroupCombobox } from "./InputGroupCombobox.vue";
10
10
  export { default as InputGroupNumberField } from "./InputGroupNumberField.vue";
11
11
  export const inputGroupAddonVariants = cva(
12
- "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
12
+ "text-zinc-500 flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:text-zinc-400",
13
13
  {
14
14
  variants: {
15
15
  align: {
@@ -17,7 +17,7 @@ const delegatedProps = reactiveOmit(props, "class");
17
17
  v-bind="delegatedProps"
18
18
  :class="
19
19
  cn(
20
- 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
20
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed text-zinc-700 peer-disabled:opacity-50',
21
21
  props.class
22
22
  )
23
23
  "
@@ -27,9 +27,9 @@ const delegatedProps = reactiveOmit(props, "class");
27
27
  v-model="modelValue"
28
28
  data-slot="native-select"
29
29
  :class="cn(
30
- 'border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',
31
- 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
32
- 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
30
+ 'border-zinc-200 placeholder:text-zinc-400 selection:bg-primary selection:text-primary-foreground dark:bg-zinc-200/30 dark:hover:bg-zinc-200/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',
31
+ 'focus-visible:border-(--primary)',
32
+ 'aria-invalid:border-red-400',
33
33
  props.class
34
34
  )"
35
35
  >
@@ -20,7 +20,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
20
20
  <NavigationMenuLink
21
21
  data-slot="navigation-menu-link"
22
22
  v-bind="forwarded"
23
- :class="cn('data-active:focus:bg-slate-100 data-active:hover:bg-slate-100 data-active:bg-slate-100 data-active:text-slate-900 hover:bg-slate-100 hover:text-slate-900 focus:bg-slate-100 focus:text-slate-900 [&_svg:not([class*=\'text-\'])]:text-zinc-500 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:outline-1 [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
23
+ :class="cn('data-active:focus:bg-zinc-100 data-active:hover:bg-zinc-100 data-active:bg-zinc-100 data-active:text-zinc-900 hover:bg-zinc-100 hover:text-zinc-900 focus:bg-zinc-100 focus:text-zinc-900 [&_svg:not([class*=\'text-\'])]:text-zinc-500 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:outline-1 [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
24
24
  >
25
25
  <slot />
26
26
  </NavigationMenuLink>
@@ -23,7 +23,7 @@ const forwardedProps = useForwardProps(delegatedProps);
23
23
  v-bind="forwardedProps"
24
24
  :class="
25
25
  cn(
26
- 'origin-top-center bg-white text-slate-700 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-(--reka-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border shadow md:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)',
26
+ 'origin-top-center bg-white text-zinc-700 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-(--reka-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border shadow md:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)',
27
27
  props.class
28
28
  )
29
29
  "
@@ -15,7 +15,7 @@ const forwardedProps = useForwardProps(delegatedProps);
15
15
  <template>
16
16
  <RangeCalendarCell
17
17
  data-slot="range-calendar-cell"
18
- :class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md', props.class)"
18
+ :class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-zinc-100 first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md', props.class)"
19
19
  v-bind="forwardedProps"
20
20
  >
21
21
  <slot />
@@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps);
20
20
  :class="cn(
21
21
  buttonVariants({ variant: 'ghost' }),
22
22
  'h-8 w-8 p-0 font-normal data-selected:opacity-100',
23
- '[&[data-today]:not([data-selected])]:bg-white [&[data-today]:not([data-selected])]:text-accent-foreground',
23
+ '[&[data-today]:not([data-selected])]:bg-white [&[data-today]:not([data-selected])]:text-zinc-700',
24
24
  // Selection Start
25
25
  'data-selection-start:bg-[color-mix(in_srgb,var(--primary)_20%,white)] data-selection-start:text-white data-selection-start:hover:bg-[color-mix(in_srgb,var(--primary)_40%,white)] data-selection-start:hover:text-white data-selection-start:focus:bg-[color-mix(in_srgb,var(--primary)_40%,white)] data-selection-start:focus:text-white',
26
26
  // Selection End
@@ -14,7 +14,7 @@ const delegatedProps = reactiveOmit(props, "class");
14
14
  <template>
15
15
  <DialogOverlay
16
16
  data-slot="sheet-overlay"
17
- :class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80', props.class)"
17
+ :class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-zinc-900/80', props.class)"
18
18
  v-bind="delegatedProps"
19
19
  >
20
20
  <slot />
@@ -0,0 +1,24 @@
1
+ import type { SwitchRootProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SwitchRootProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
6
+ declare var __VLS_14: {
7
+ modelValue: boolean;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ thumb?: (props: typeof __VLS_14) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (payload: boolean) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:modelValue"?: ((payload: boolean) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,46 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import {
4
+ SwitchRoot,
5
+ SwitchThumb,
6
+ useForwardPropsEmits
7
+ } from "reka-ui";
8
+ import { cn } from "../../../utils/cn";
9
+ const props = defineProps({
10
+ defaultValue: { type: Boolean, required: false },
11
+ modelValue: { type: [Boolean, null], required: false },
12
+ disabled: { type: Boolean, required: false },
13
+ id: { type: String, required: false },
14
+ value: { type: String, required: false },
15
+ asChild: { type: Boolean, required: false },
16
+ as: { type: null, required: false },
17
+ name: { type: String, required: false },
18
+ required: { type: Boolean, required: false },
19
+ class: { type: null, required: false }
20
+ });
21
+ const emits = defineEmits(["update:modelValue"]);
22
+ const delegatedProps = reactiveOmit(props, "class");
23
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
24
+ </script>
25
+
26
+ <template>
27
+ <SwitchRoot
28
+ v-slot="slotProps"
29
+ data-slot="switch"
30
+ v-bind="forwarded"
31
+ :class="cn(
32
+ 'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-zinc-200 focus-visible:border-(--primary) dark:data-[state=unchecked]:bg-zinc-200/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50',
33
+ props.class
34
+ )"
35
+ >
36
+ <SwitchThumb
37
+ data-slot="switch-thumb"
38
+ :class="cn('bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-800 dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0')"
39
+ >
40
+ <slot
41
+ name="thumb"
42
+ v-bind="slotProps"
43
+ />
44
+ </SwitchThumb>
45
+ </SwitchRoot>
46
+ </template>
@@ -0,0 +1,24 @@
1
+ import type { SwitchRootProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SwitchRootProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
6
+ declare var __VLS_14: {
7
+ modelValue: boolean;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ thumb?: (props: typeof __VLS_14) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (payload: boolean) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:modelValue"?: ((payload: boolean) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1 @@
1
+ export { default as Switch } from './Switch.vue.js';
@@ -0,0 +1 @@
1
+ export { default as Switch } from "./Switch.vue";
@@ -17,6 +17,6 @@ const modelValue = useVModel(props, "modelValue", emits, {
17
17
  <textarea
18
18
  v-model="modelValue"
19
19
  data-slot="textarea"
20
- :class="cn('border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', props.class)"
20
+ :class="cn('border-zinc-200 placeholder:text-zinc-400 focus-visible:border-(--primary) aria-invalid:border-red-400 dark:bg-zinc-200/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', props.class)"
21
21
  />
22
22
  </template>
@@ -1,2 +1,2 @@
1
- import { Environment } from '@marcbachmann/cel-js';
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 "@marcbachmann/cel-js";
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 '@marcbachmann/cel-js';
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("@marcbachmann/cel-js").TypeCheckResult;
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("@marcbachmann/cel-js").TypeCheckResult;
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: /* @__PURE__ */ new Date(),
16
- today: /* @__PURE__ */ new Date(),
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) {
@@ -1,5 +1,5 @@
1
1
  import { md } from './md.js';
2
- import type { Context } from '@marcbachmann/cel-js';
2
+ import type { Context } from '../../vendor/cel/index.js';
3
3
  declare const _default: import("#app").Plugin<{
4
4
  md: {
5
5
  raw: typeof md;
@@ -0,0 +1,7 @@
1
+ import z from 'zod';
2
+ export declare const localeC: z.ZodObject<{
3
+ locale: z.ZodString;
4
+ message: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const dotPropC: z.ZodString;
7
+ export declare const expressionC: (tt: ReadonlyArray<RegExp | string> | string | RegExp, vars?: Record<string, string>) => z.ZodString;
@@ -0,0 +1,39 @@
1
+ import z from "zod";
2
+ import { parsePath } from "dot-prop";
3
+ import { md } from "../plugins/markdown/md.js";
4
+ import { createEnvironment } from "../plugins/cel/env.js";
5
+ export const localeC = z.object({
6
+ locale: z.string().regex(/^[a-z]{2}$/).describe("ISO 639-1 \u53CC\u5B57\u7B26\u8BED\u8A00\u7801"),
7
+ message: z.string().describe("\u9488\u5BF9\u8BE5\u8BED\u8A00\u7684 UI \u6587\u672C")
8
+ }).describe("\u9488\u5BF9\u67D0\u4E2A\u8BED\u8A00\u7684\u672C\u5730\u5316\u5185\u5BB9");
9
+ export const dotPropC = z.string().refine(
10
+ (val) => {
11
+ if (val.length === 0) return false;
12
+ try {
13
+ return parsePath(val).length > 0;
14
+ } catch {
15
+ return false;
16
+ }
17
+ },
18
+ { error: "\u65E0\u6548\u7684 dot-prop \u8DEF\u5F84" }
19
+ ).describe(md`
20
+ NPM \`dot-prop\` 包支持的语法,如
21
+
22
+ - \`foo.bar\`
23
+ - \`foo[0].bar\`
24
+ `);
25
+ export const expressionC = (tt, vars) => {
26
+ return z.string().refine(
27
+ (val) => {
28
+ const env = createEnvironment((env2) => {
29
+ for (const [key, type] of Object.entries(vars ?? {})) {
30
+ env2.registerVariable(key, type);
31
+ }
32
+ return env2;
33
+ });
34
+ const result = env.check(val);
35
+ return result.valid && (Array.isArray(tt) ? tt : [tt]).some((reg) => reg instanceof RegExp ? result.type.match(reg) : result.type === reg);
36
+ },
37
+ { error: "\u65E0\u6548\u7684 CEL \u8868\u8FBE\u5F0F\u6216\u8FD4\u56DE\u7C7B\u578B\u4E0D\u5339\u914D" }
38
+ );
39
+ };
@@ -0,0 +1,17 @@
1
+ export {
2
+ Environment,
3
+ EvaluationError,
4
+ evaluate,
5
+ Optional,
6
+ ParseError,
7
+ parse,
8
+ serialize,
9
+ TypeError,
10
+ } from '../cel-js/lib/index.js'
11
+
12
+ export type {
13
+ ASTNode,
14
+ Context,
15
+ ParseResult,
16
+ TypeCheckResult,
17
+ } from '../cel-js/lib/index.js'
@@ -0,0 +1,10 @@
1
+ export {
2
+ Environment,
3
+ EvaluationError,
4
+ evaluate,
5
+ Optional,
6
+ ParseError,
7
+ parse,
8
+ serialize,
9
+ TypeError,
10
+ } from '../cel-js/lib/index.js'
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Marc Bachmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ Vendored from `@marcbachmann/cel-js` `v7.5.2`.
2
+
3
+ - Upstream repository: `https://github.com/marcbachmann/cel-js`
4
+ - Upstream tag: `v7.5.2`
5
+ - Upstream commit: `4dd97919826967c709e9b8522663ab07bc51c960`
6
+ - Vendored scope: `lib/` runtime sources plus upstream `LICENSE`
7
+
8
+ Sync rules:
9
+
10
+ 1. Treat `src/runtime/vendor/cel-js/lib/` as an upstream mirror and keep diffs minimal.
11
+ 2. Put local integration changes in `src/runtime/vendor/cel/` or higher-level runtime code first.
12
+ 3. If upstream files must change, document the delta in this file when it happens.
13
+
14
+ Local deltas:
15
+
16
+ - `lib/registry.js`
17
+ Read `obj[key]` before `hasOwn(obj, key)` in `#getMapField` so Vue reactive proxies track missing-to-present field access. This cannot live in `src/runtime/vendor/cel/` because `#getMapField` is a private method on the upstream class.
@@ -0,0 +1,21 @@
1
+ export class ParseError extends Error {
2
+ constructor(message: any, node: any, cause: any);
3
+ message: any;
4
+ get node(): any;
5
+ withAst(node: any): this;
6
+ #private;
7
+ }
8
+ export class EvaluationError extends Error {
9
+ constructor(message: any, node: any, cause: any);
10
+ message: any;
11
+ get node(): any;
12
+ withAst(node: any): this;
13
+ #private;
14
+ }
15
+ export class TypeError extends Error {
16
+ constructor(message: any, node: any, cause: any);
17
+ message: any;
18
+ get node(): any;
19
+ withAst(node: any): this;
20
+ #private;
21
+ }