orio-ui 1.11.8 → 1.11.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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0 || ^4.0.0"
6
6
  },
7
- "version": "1.11.8",
7
+ "version": "1.11.10",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -62,6 +62,7 @@ button {
62
62
  line-height: 1.5;
63
63
  cursor: pointer;
64
64
  display: inline-flex;
65
+ justify-content: center;
65
66
  align-items: center;
66
67
  gap: 0.5rem;
67
68
  user-select: none;
@@ -8,7 +8,7 @@ const props = defineProps({
8
8
  origin: { type: [Object, null], required: true }
9
9
  });
10
10
  const show = defineModel("show", { type: Boolean });
11
- const isLocked = useScrollLock(document.body);
11
+ const isLocked = import.meta.client ? useScrollLock(document.body) : ref(false);
12
12
  const wrapper = ref(null);
13
13
  const { width: windowWidth, height: windowHeight } = useWindowSize();
14
14
  function animateToCenter(el) {
@@ -7,9 +7,10 @@ export interface ValidationRule {
7
7
  }
8
8
  export declare function isFilled(model: MaybeRef<string | []>): boolean;
9
9
  export declare function isEmail(model: MaybeRef<string>): boolean;
10
- export declare function useValidation(rules: ValidationRule[]): {
10
+ export declare function useValidation(rules?: ValidationRule[]): {
11
11
  checkValidity: () => boolean;
12
12
  errors: Record<string, string | null>;
13
13
  clearError: (id: string) => void;
14
14
  clearAllErrors: () => void;
15
+ changeRules: (rules: ValidationRule[]) => void;
15
16
  };
@@ -1,4 +1,4 @@
1
- import { reactive, isRef } from "vue";
1
+ import { reactive, isRef, ref } from "vue";
2
2
  export function isFilled(model) {
3
3
  return isRef(model) ? !!model.value.length : !!model.length;
4
4
  }
@@ -9,6 +9,7 @@ export function isEmail(model) {
9
9
  return emailRegex.test(value);
10
10
  }
11
11
  export function useValidation(rules) {
12
+ const validationRules = ref(rules ?? []);
12
13
  const errors = reactive({});
13
14
  function validate({
14
15
  model,
@@ -30,7 +31,10 @@ export function useValidation(rules) {
30
31
  }
31
32
  function checkValidity() {
32
33
  clearAllErrors();
33
- return rules.reduceRight((valid, rule) => validate(rule) && valid, true);
34
+ return validationRules.value.reduceRight(
35
+ (valid, rule) => validate(rule) && valid,
36
+ true
37
+ );
34
38
  }
35
39
  function clearError(id) {
36
40
  errors[id] = null;
@@ -38,5 +42,8 @@ export function useValidation(rules) {
38
42
  function clearAllErrors() {
39
43
  Object.keys(errors).forEach((key) => errors[key] = null);
40
44
  }
41
- return { checkValidity, errors, clearError, clearAllErrors };
45
+ function changeRules(rules2) {
46
+ validationRules.value = rules2;
47
+ }
48
+ return { checkValidity, errors, clearError, clearAllErrors, changeRules };
42
49
  }
@@ -28,7 +28,7 @@ export { default as ViewDates } from "./components/view/Dates.vue.js";
28
28
  export { default as ViewSeparator } from "./components/view/Separator.vue.js";
29
29
  export { useApi, type ApiOptions, type RequestBody, type RequestMethod, } from "./composables/useApi.js";
30
30
  export { useFuzzySearch } from "./composables/useFuzzySearch.js";
31
- export { useModal, type ModalProps, type OriginRect } from "./composables/useModal.js";
31
+ export { useModal, type ModalProps, type OriginRect, } from "./composables/useModal.js";
32
32
  export { useTheme } from "./composables/useTheme.js";
33
33
  export { useDecimalFormatter } from "./composables/useDecimalFormatter.js";
34
34
  export { usePressAndHold } from "./composables/usePressAndHold.js";
@@ -30,7 +30,9 @@ export {
30
30
  useApi
31
31
  } from "./composables/useApi.js";
32
32
  export { useFuzzySearch } from "./composables/useFuzzySearch.js";
33
- export { useModal } from "./composables/useModal.js";
33
+ export {
34
+ useModal
35
+ } from "./composables/useModal.js";
34
36
  export { useTheme } from "./composables/useTheme.js";
35
37
  export { useDecimalFormatter } from "./composables/useDecimalFormatter.js";
36
38
  export { usePressAndHold } from "./composables/usePressAndHold.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orio-ui",
3
- "version": "1.11.8",
3
+ "version": "1.11.10",
4
4
  "description": "Modern Nuxt component library with theme support",
5
5
  "type": "module",
6
6
  "main": "./dist/module.mjs",
@@ -9,6 +9,10 @@
9
9
  "types": "./dist/types.d.mts",
10
10
  "import": "./dist/module.mjs"
11
11
  },
12
+ "./runtime": {
13
+ "types": "./dist/runtime/index.d.ts",
14
+ "import": "./dist/runtime/index.mjs"
15
+ },
12
16
  "./styles": "./dist/runtime/assets/css/main.css",
13
17
  "./theme": "./dist/runtime/assets/css/colors.css"
14
18
  },