@sfxcode/formkit-primevue 2.4.10 → 2.4.12

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.
@@ -53,7 +53,7 @@ const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context)
53
53
  :variant="context.variant"
54
54
  :pt-options="context.ptOptions"
55
55
  :unstyled="unstyled"
56
- @input="handleInput"
56
+ @update:model-value="handleInput"
57
57
  @blur="handleBlur"
58
58
  />
59
59
  <InputIcon v-if="hasSuffixIcon" :class="context?.iconSuffix" />
@@ -33,11 +33,15 @@ const props = defineProps({
33
33
  },
34
34
  })
35
35
 
36
- const { unstyled, isInvalid, handleInput } = useFormKitInput(props.context)
36
+ const { unstyled, isInvalid } = useFormKitInput(props.context)
37
37
 
38
38
  function handleBlur(e: InputNumberBlurEvent) {
39
39
  props.context?.handlers.blur(e.originalEvent)
40
40
  }
41
+
42
+ function handleInput(_: any) {
43
+ props.context?.node.input(_.value)
44
+ }
41
45
  </script>
42
46
 
43
47
  <template>
@@ -7,15 +7,22 @@ exports.useFormKitInput = useFormKitInput;
7
7
  var _config = require("primevue/config");
8
8
  var _vue = require("vue");
9
9
  function useFormKitInput(context) {
10
- const primevue = (0, _config.usePrimeVue)();
11
10
  const isInvalid = (0, _vue.computed)(() => {
12
11
  return context?.state.validationVisible && !context?.state.valid;
13
12
  });
14
13
  const styleClass = (0, _vue.computed)(() => {
15
14
  return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
16
15
  });
16
+ function isGlobalUnstyledMode() {
17
+ let result = false;
18
+ try {
19
+ const primevue = (0, _config.usePrimeVue)();
20
+ result = primevue?.config?.unstyled || false;
21
+ } catch (e) {}
22
+ return result;
23
+ }
17
24
  const unstyled = (0, _vue.computed)(() => {
18
- return context?.unstyled ?? primevue?.config?.unstyled;
25
+ return context?.unstyled ?? isGlobalUnstyledMode();
19
26
  });
20
27
  function handleBlur(event) {
21
28
  context?.handlers.blur(event);
@@ -1,15 +1,23 @@
1
1
  import { usePrimeVue } from "primevue/config";
2
2
  import { computed } from "vue";
3
3
  export function useFormKitInput(context) {
4
- const primevue = usePrimeVue();
5
4
  const isInvalid = computed(() => {
6
5
  return context?.state.validationVisible && !context?.state.valid;
7
6
  });
8
7
  const styleClass = computed(() => {
9
8
  return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
10
9
  });
10
+ function isGlobalUnstyledMode() {
11
+ let result = false;
12
+ try {
13
+ const primevue = usePrimeVue();
14
+ result = primevue?.config?.unstyled || false;
15
+ } catch (e) {
16
+ }
17
+ return result;
18
+ }
11
19
  const unstyled = computed(() => {
12
- return context?.unstyled ?? primevue?.config?.unstyled;
20
+ return context?.unstyled ?? isGlobalUnstyledMode();
13
21
  });
14
22
  function handleBlur(event) {
15
23
  context?.handlers.blur(event);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "2.4.10",
4
+ "version": "2.4.12",
5
5
  "packageManager": "pnpm@9.9.0+sha256.7a4261e50d9a44d9240baf6c9d6e10089dcf0a79d0007f2a26985a6927324177",
6
6
  "author": {
7
7
  "name": "Tom",