@sfxcode/formkit-primevue 2.3.6 → 2.3.7

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.
@@ -23,6 +23,10 @@ const props = defineProps({
23
23
  type: String,
24
24
  default: 'Save',
25
25
  },
26
+ formClass: {
27
+ type: String,
28
+ default: '',
29
+ },
26
30
  })
27
31
 
28
32
  const emit = defineEmits(['dataSaved'])
@@ -40,11 +44,13 @@ function handleSave() {
40
44
  <FormKit
41
45
  id="form"
42
46
  v-model="formData"
47
+ :form-class="formClass"
43
48
  type="form"
44
49
  :submit-label="submitLabel"
45
50
  :submit-attrs="{
46
51
  inputClass: 'p-button p-component p-formkit-button',
47
52
  }"
53
+
48
54
  @submit="handleSave"
49
55
  >
50
56
  <FormKitSchema :schema="formSchema" :data="formData" />
@@ -11,6 +11,10 @@ const props = defineProps({
11
11
  type: Object,
12
12
  default: null,
13
13
  },
14
+ formClass: {
15
+ type: String,
16
+ default: '',
17
+ },
14
18
  debugData: {
15
19
  type: Boolean,
16
20
  default: false,
@@ -30,6 +34,7 @@ const formData = ref(props.data)
30
34
  <FormKit
31
35
  v-model="formData"
32
36
  type="form"
37
+ :form-class="formClass"
33
38
  :submit-attrs="{
34
39
  style: 'display: none;',
35
40
  }"
@@ -12,14 +12,21 @@ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection
12
12
  const { n } = useI18n()
13
13
 
14
14
  const converted = computed(() => {
15
- if (props?.context?._value) {
15
+ const value = props?.context?._value
16
+ if (value) {
16
17
  let result = ''
17
18
  const format = props?.context?.attrs?.format ? props?.context?.attrs?.format : 'short'
18
19
  try {
19
- result = n(props?.context?._value, format)
20
+ result = n(value, format)
20
21
  }
21
22
  // eslint-disable-next-line unused-imports/no-unused-vars
22
23
  catch (e) {
24
+ try {
25
+ result = n(+value, format)
26
+ }
27
+ // eslint-disable-next-line unused-imports/no-unused-vars
28
+ catch (e) {
29
+ }
23
30
  }
24
31
  return result
25
32
  }
@@ -129,14 +129,21 @@ function useInputEditorSchema() {
129
129
  label: "Input Help",
130
130
  key: "schema_help",
131
131
  preserve: true
132
- }, {
132
+ }, addGridElement([{
133
133
  $formkit: "primeInputText",
134
134
  if: "$get(selectButton).value === 'showBasic'",
135
135
  name: "value",
136
136
  label: "Input Value",
137
137
  key: "schema_value",
138
138
  preserve: true
139
- }, addGridElement([{
139
+ }, {
140
+ $formkit: "primeInputText",
141
+ if: "$get(selectButton).value === 'showBasic'",
142
+ name: "format",
143
+ label: "Value Format",
144
+ key: "schema_format",
145
+ preserve: true
146
+ }]), addGridElement([{
140
147
  $formkit: "primeInputText",
141
148
  if: "$get(selectButton).value === 'showBasic'",
142
149
  name: "id",
@@ -94,14 +94,24 @@ export function useInputEditorSchema() {
94
94
  key: "schema_help",
95
95
  preserve: true
96
96
  },
97
- {
98
- $formkit: "primeInputText",
99
- if: "$get(selectButton).value === 'showBasic'",
100
- name: "value",
101
- label: "Input Value",
102
- key: "schema_value",
103
- preserve: true
104
- },
97
+ addGridElement([
98
+ {
99
+ $formkit: "primeInputText",
100
+ if: "$get(selectButton).value === 'showBasic'",
101
+ name: "value",
102
+ label: "Input Value",
103
+ key: "schema_value",
104
+ preserve: true
105
+ },
106
+ {
107
+ $formkit: "primeInputText",
108
+ if: "$get(selectButton).value === 'showBasic'",
109
+ name: "format",
110
+ label: "Value Format",
111
+ key: "schema_format",
112
+ preserve: true
113
+ }
114
+ ]),
105
115
  addGridElement([
106
116
  {
107
117
  $formkit: "primeInputText",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "2.3.6",
4
+ "version": "2.3.7",
5
5
  "packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
6
6
  "author": {
7
7
  "name": "Tom",