@sfxcode/formkit-primevue 3.0.0 → 3.0.1

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.
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import type { PropType } from 'vue'
3
+
4
+ export interface FormKitIconProps {
5
+ onIconPrefixClicked?: () => void
6
+ onIconSuffixClicked?: () => void
7
+ }
8
+
9
+ defineProps({
10
+ iconClass: {
11
+ type: String,
12
+ default: '',
13
+ },
14
+ onClick: { type: Function as PropType<() => void>, default: undefined },
15
+ position: {
16
+ type: String,
17
+ required: true,
18
+ validator: (val: string) => ['prefix', 'suffix'].includes(val),
19
+ },
20
+ })
21
+ </script>
22
+
23
+ <template>
24
+ <i :class="[`formkit-${position}-icon`, iconClass]" @click="onClick" />
25
+ </template>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ defineProps({
3
+ prefix: String,
4
+ })
5
+ </script>
6
+
7
+ <template>
8
+ <span class="formkit-prefix">
9
+ {{ prefix }}
10
+ </span>
11
+ </template>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ defineProps({
3
+ suffix: String,
4
+ })
5
+ </script>
6
+
7
+ <template>
8
+ <span class="formkit-suffix">
9
+ {{ suffix }}
10
+ </span>
11
+ </template>
@@ -1,13 +1,17 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useI18n } from 'vue-i18n'
6
7
  import { useFormKitSection } from '../composables'
8
+ import FormKitIcon from './FormKitIcon.vue'
9
+ import FormKitPrefix from './FormKitPrefix.vue'
10
+ import FormKitSuffix from './FormKitSuffix.vue'
7
11
 
8
12
  const props = defineProps({
9
13
  context: {
10
- type: Object as PropType<FormKitFrameworkContext>,
14
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
11
15
  required: true,
12
16
  },
13
17
  })
@@ -26,16 +30,12 @@ const translated = computed(() => {
26
30
 
27
31
  <template>
28
32
  <div class="p-formkit p-output-boolean">
29
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
30
- <span v-if="hasPrefix" class="formkit-prefix">
31
- {{ context?.prefix }}
32
- </span>
33
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
34
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
33
35
  <span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
34
36
  {{ translated }}
35
37
  </span>
36
- <span v-if="hasSuffix" class="formkit-suffix">
37
- {{ context?.suffix }}
38
- </span>
39
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
38
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
39
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
40
40
  </div>
41
41
  </template>
@@ -1,16 +1,21 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useI18n } from 'vue-i18n'
6
7
  import { useFormKitSection } from '../composables'
8
+ import FormKitIcon from './FormKitIcon.vue'
9
+ import FormKitPrefix from './FormKitPrefix.vue'
10
+ import FormKitSuffix from './FormKitSuffix.vue'
7
11
 
8
12
  const props = defineProps({
9
13
  context: {
10
- type: Object as PropType<FormKitFrameworkContext>,
14
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
11
15
  required: true,
12
16
  },
13
17
  })
18
+
14
19
  const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
15
20
 
16
21
  const { d } = useI18n()
@@ -35,16 +40,12 @@ const converted = computed(() => {
35
40
 
36
41
  <template>
37
42
  <div class="p-formkit p-output-date">
38
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
39
- <span v-if="hasPrefix" class="formkit-prefix">
40
- {{ context?.prefix }}
41
- </span>
43
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
44
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
42
45
  <span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
43
46
  {{ converted }}
44
47
  </span>
45
- <span v-if="hasSuffix" class="formkit-suffix">
46
- {{ context?.suffix }}
47
- </span>
48
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
48
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
49
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
49
50
  </div>
50
51
  </template>
@@ -1,14 +1,19 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { useFormKitSection, useOutputDuration } from '../composables'
6
+ import FormKitIcon from './FormKitIcon.vue'
7
+ import FormKitPrefix from './FormKitPrefix.vue'
8
+ import FormKitSuffix from './FormKitSuffix.vue'
5
9
 
6
10
  const props = defineProps({
7
11
  context: {
8
- type: Object as PropType<FormKitFrameworkContext>,
12
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
9
13
  required: true,
10
14
  },
11
15
  })
16
+
12
17
  const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
13
18
 
14
19
  const { formattedDuration } = useOutputDuration()
@@ -16,16 +21,12 @@ const { formattedDuration } = useOutputDuration()
16
21
 
17
22
  <template>
18
23
  <div class="p-formkit p-output-duration">
19
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
20
- <span v-if="hasPrefix" class="formkit-prefix">
21
- {{ context?.prefix }}
22
- </span>
24
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
25
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
23
26
  <span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
24
27
  {{ formattedDuration(context?._value) }}
25
28
  </span>
26
- <span v-if="hasSuffix" class="formkit-suffix">
27
- {{ context?.suffix }}
28
- </span>
29
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
29
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
30
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
30
31
  </div>
31
32
  </template>
@@ -1,12 +1,16 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useFormKitSection } from '../composables'
7
+ import FormKitIcon from './FormKitIcon.vue'
8
+ import FormKitPrefix from './FormKitPrefix.vue'
9
+ import FormKitSuffix from './FormKitSuffix.vue'
6
10
 
7
11
  const props = defineProps({
8
12
  context: {
9
- type: Object as PropType<FormKitFrameworkContext>,
13
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
10
14
  required: true,
11
15
  },
12
16
  })
@@ -28,10 +32,8 @@ const title = computed(() => {
28
32
 
29
33
  <template>
30
34
  <div class="p-formkit p-output-link">
31
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
32
- <span v-if="hasPrefix" class="formkit-prefix">
33
- {{ context?.prefix }}
34
- </span>
35
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
36
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
35
37
  <a
36
38
  v-if="context?.value"
37
39
  :id="context?.id"
@@ -42,9 +44,7 @@ const title = computed(() => {
42
44
  >
43
45
  <span>{{ title }}</span>
44
46
  </a>
45
- <span v-if="hasSuffix" class="formkit-suffix">
46
- {{ context?.suffix }}
47
- </span>
48
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
47
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
48
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
49
49
  </div>
50
50
  </template>
@@ -1,16 +1,16 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useFormKitSection } from '../composables'
6
-
7
- export interface FormKitOutputListProps {
8
- listStyle?: 'div' | 'ul' | 'ol' | 'span'
9
- }
7
+ import FormKitIcon from './FormKitIcon.vue'
8
+ import FormKitPrefix from './FormKitPrefix.vue'
9
+ import FormKitSuffix from './FormKitSuffix.vue'
10
10
 
11
11
  const props = defineProps({
12
12
  context: {
13
- type: Object as PropType<FormKitFrameworkContext & FormKitOutputListProps>,
13
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
14
14
  required: true,
15
15
  },
16
16
  })
@@ -24,10 +24,8 @@ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection
24
24
 
25
25
  <template>
26
26
  <div class="p-formkit p-output-list">
27
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
28
- <span v-if="hasPrefix && listStyle === 'span'" class="formkit-prefix">
29
- {{ context?.prefix }}
30
- </span>
27
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
28
+ <FormKitPrefix v-if="hasPrefix && listStyle === 'span'" :prefix="context?.prefix as string" />
31
29
  <span v-if="listStyle === 'span'" :id="context?.id" :style="context?.attrs?.style" class="p-output-list-items" :class="context?.attrs?.class">
32
30
  <template v-for="(value, index) of context?._value" :key="index">
33
31
  <span v-if="index !== 0" class="p-output-list-divider" :class="context?.dividerClass">{{ context?.divider ?? ', ' }}</span>
@@ -55,9 +53,7 @@ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection
55
53
  </span>
56
54
  </li>
57
55
  </ol>
58
- <span v-if="hasSuffix && listStyle === 'span'" class="formkit-suffix">
59
- {{ context?.suffix }}
60
- </span>
61
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
56
+ <FormKitSuffix v-if="hasSuffix && listStyle === 'span'" :suffix="context?.suffix as string" />
57
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
62
58
  </div>
63
59
  </template>
@@ -1,17 +1,22 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
- import { computed } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
5
5
 
6
+ import { computed } from 'vue'
6
7
  import { useI18n } from 'vue-i18n'
7
8
  import { useFormKitSection } from '../composables'
9
+ import FormKitIcon from './FormKitIcon.vue'
10
+ import FormKitPrefix from './FormKitPrefix.vue'
11
+ import FormKitSuffix from './FormKitSuffix.vue'
8
12
 
9
13
  const props = defineProps({
10
14
  context: {
11
- type: Object as PropType<FormKitFrameworkContext>,
15
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
12
16
  required: true,
13
17
  },
14
18
  })
19
+
15
20
  const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
16
21
 
17
22
  const { n } = useI18n()
@@ -43,16 +48,12 @@ const converted = computed(() => {
43
48
 
44
49
  <template>
45
50
  <div class="p-formkit p-output-number">
46
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
47
- <span v-if="hasPrefix" class="formkit-prefix">
48
- {{ context?.prefix }}
49
- </span>
51
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
52
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
50
53
  <span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
51
54
  {{ converted }}
52
55
  </span>
53
- <span v-if="hasSuffix" class="formkit-suffix">
54
- {{ context?.suffix }}
55
- </span>
56
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
56
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
57
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
57
58
  </div>
58
59
  </template>
@@ -1,12 +1,16 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useFormKitSection } from '../composables'
7
+ import FormKitIcon from './FormKitIcon.vue'
8
+ import FormKitPrefix from './FormKitPrefix.vue'
9
+ import FormKitSuffix from './FormKitSuffix.vue'
6
10
 
7
11
  const props = defineProps({
8
12
  context: {
9
- type: Object as PropType<FormKitFrameworkContext>,
13
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
10
14
  required: true,
11
15
  },
12
16
  })
@@ -30,10 +34,8 @@ const title = computed(() => {
30
34
 
31
35
  <template>
32
36
  <div class="p-formkit p-output-reference">
33
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
34
- <span v-if="hasPrefix" class="formkit-prefix">
35
- {{ context?.prefix }}
36
- </span>
37
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
38
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
37
39
  <component
38
40
  :is="context?.linkComponentName ? context?.linkComponentName : 'RouterLink'"
39
41
  v-if="context?.internal"
@@ -54,9 +56,7 @@ const title = computed(() => {
54
56
  >
55
57
  {{ title }}
56
58
  </a>
57
- <span v-if="hasSuffix" class="formkit-suffix">
58
- {{ context?.suffix }}
59
- </span>
60
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
59
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
60
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
61
61
  </div>
62
62
  </template>
@@ -1,13 +1,17 @@
1
1
  <script setup lang='ts'>
2
2
  import type { FormKitFrameworkContext } from '@formkit/core'
3
3
  import type { PropType } from 'vue'
4
+ import type { FormKitIconProps } from './FormKitIcon.vue'
4
5
  import { computed } from 'vue'
5
6
  import { useI18n } from 'vue-i18n'
6
7
  import { useFormKitSection } from '../composables'
8
+ import FormKitIcon from './FormKitIcon.vue'
9
+ import FormKitPrefix from './FormKitPrefix.vue'
10
+ import FormKitSuffix from './FormKitSuffix.vue'
7
11
 
8
12
  const props = defineProps({
9
13
  context: {
10
- type: Object as PropType<FormKitFrameworkContext>,
14
+ type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
11
15
  required: true,
12
16
  },
13
17
  })
@@ -31,15 +35,11 @@ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection
31
35
 
32
36
  <template>
33
37
  <div class="p-formkit p-output-text">
34
- <i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.iconPrefix" />
35
- <span v-if="hasPrefix" class="formkit-prefix">
36
- {{ context?.prefix }}
37
- </span>
38
+ <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
39
+ <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
38
40
  <span v-if="context?.html" :id="context?.id" :class="context?.attrs?.class" :style="context?.attrs?.style" v-html="textValue" />
39
41
  <span v-else :id="context?.id" :class="context?.attrs?.class" :style="context?.attrs?.style" v-text="textValue" />
40
- <span v-if="hasSuffix" class="formkit-suffix">
41
- {{ context?.suffix }}
42
- </span>
43
- <i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.iconSuffix" />
42
+ <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
43
+ <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
44
44
  </div>
45
45
  </template>
@@ -15,26 +15,26 @@ var _PrimeOutputReference = _interopRequireDefault(require("../components/PrimeO
15
15
  var _PrimeOutputText = _interopRequireDefault(require("../components/PrimeOutputText.vue"));
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  const primeOutputTextDefinition = exports.primeOutputTextDefinition = (0, _vue.createInput)(_PrimeOutputText.default, {
18
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html"]
18
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked"]
19
19
  });
20
20
  const primeOutputDateDefinition = exports.primeOutputDateDefinition = (0, _vue.createInput)(_PrimeOutputDate.default, {
21
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
21
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
22
22
  });
23
23
  const primeOutputNumberDefinition = exports.primeOutputNumberDefinition = (0, _vue.createInput)(_PrimeOutputNumber.default, {
24
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
24
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
25
25
  });
26
26
  const primeOutputLinkDefinition = exports.primeOutputLinkDefinition = (0, _vue.createInput)(_PrimeOutputLink.default, {
27
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "title"]
27
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "title", "onIconPrefixClicked", "onIconSuffixClicked"]
28
28
  });
29
29
  const primeOutputReferenceDefinition = exports.primeOutputReferenceDefinition = (0, _vue.createInput)(_PrimeOutputReference.default, {
30
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "reference", "internal", "linkComponentName", "title"]
30
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "reference", "internal", "linkComponentName", "title", "onIconPrefixClicked", "onIconSuffixClicked"]
31
31
  });
32
32
  const primeOutputBooleanDefinition = exports.primeOutputBooleanDefinition = (0, _vue.createInput)(_PrimeOutputBoolean.default, {
33
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "trueValue", "falseValue"]
33
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "trueValue", "falseValue", "onIconPrefixClicked", "onIconSuffixClicked"]
34
34
  });
35
35
  const primeOutputDurationDefinition = exports.primeOutputDurationDefinition = (0, _vue.createInput)(_PrimeOutputDuration.default, {
36
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
36
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
37
37
  });
38
38
  const primeOutputListDefinition = exports.primeOutputListDefinition = (0, _vue.createInput)(_PrimeOutputList.default, {
39
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "divider", "itemClass", "dividerClass", "listStyle"]
39
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "divider", "itemClass", "dividerClass", "listStyle", "onIconPrefixClicked", "onIconSuffixClicked"]
40
40
  });
@@ -8,26 +8,26 @@ import PrimeOutputNumber from "../components/PrimeOutputNumber.vue";
8
8
  import PrimeOutputReference from "../components/PrimeOutputReference.vue";
9
9
  import PrimeOutputText from "../components/PrimeOutputText.vue";
10
10
  export const primeOutputTextDefinition = createInput(PrimeOutputText, {
11
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html"]
11
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked"]
12
12
  });
13
13
  export const primeOutputDateDefinition = createInput(PrimeOutputDate, {
14
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
14
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
15
15
  });
16
16
  export const primeOutputNumberDefinition = createInput(PrimeOutputNumber, {
17
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
17
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
18
18
  });
19
19
  export const primeOutputLinkDefinition = createInput(PrimeOutputLink, {
20
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "title"]
20
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "title", "onIconPrefixClicked", "onIconSuffixClicked"]
21
21
  });
22
22
  export const primeOutputReferenceDefinition = createInput(PrimeOutputReference, {
23
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "reference", "internal", "linkComponentName", "title"]
23
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "reference", "internal", "linkComponentName", "title", "onIconPrefixClicked", "onIconSuffixClicked"]
24
24
  });
25
25
  export const primeOutputBooleanDefinition = createInput(PrimeOutputBoolean, {
26
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "trueValue", "falseValue"]
26
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "trueValue", "falseValue", "onIconPrefixClicked", "onIconSuffixClicked"]
27
27
  });
28
28
  export const primeOutputDurationDefinition = createInput(PrimeOutputDuration, {
29
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
29
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
30
30
  });
31
31
  export const primeOutputListDefinition = createInput(PrimeOutputList, {
32
- props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "divider", "itemClass", "dividerClass", "listStyle"]
32
+ props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "divider", "itemClass", "dividerClass", "listStyle", "onIconPrefixClicked", "onIconSuffixClicked"]
33
33
  });
@@ -1,2 +1,3 @@
1
1
  import type { FormKitNode } from '@formkit/core';
2
2
  export declare function addPrimeAsteriskPlugin(node: FormKitNode): void;
3
+ export declare function addLabelPlugin(node: FormKitNode): void;
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.addLabelPlugin = addLabelPlugin;
6
7
  exports.addPrimeAsteriskPlugin = addPrimeAsteriskPlugin;
7
8
  function addPrimeAsteriskPlugin(node) {
8
9
  if (!node.props.type.startsWith("prime")) return;
@@ -24,4 +25,36 @@ function addPrimeAsteriskPlugin(node) {
24
25
  };
25
26
  }
26
27
  });
28
+ }
29
+ function addLabelPlugin(node) {
30
+ if (!node.props.type.startsWith("prime")) return;
31
+ node.on("created", () => {
32
+ if (node.props.definition?.schema) {
33
+ const schemaFn = node.props.definition?.schema;
34
+ node.props.definition.schema = (sectionsSchema = {}) => {
35
+ sectionsSchema.label = {
36
+ children: [{
37
+ $el: "span",
38
+ attrs: {
39
+ title: "$help",
40
+ class: "p-formkit-label"
41
+ },
42
+ children: ["$label"]
43
+ }, {
44
+ $el: "span",
45
+ if: "$state.required",
46
+ attrs: {
47
+ class: "p-formkit-required",
48
+ title: "$help"
49
+ },
50
+ children: ["*"]
51
+ }]
52
+ };
53
+ sectionsSchema.help = {
54
+ children: []
55
+ };
56
+ return schemaFn(sectionsSchema);
57
+ };
58
+ }
59
+ });
27
60
  }
@@ -20,3 +20,36 @@ export function addPrimeAsteriskPlugin(node) {
20
20
  }
21
21
  });
22
22
  }
23
+ export function addLabelPlugin(node) {
24
+ if (!node.props.type.startsWith("prime"))
25
+ return;
26
+ node.on("created", () => {
27
+ if (node.props.definition?.schema) {
28
+ const schemaFn = node.props.definition?.schema;
29
+ node.props.definition.schema = (sectionsSchema = {}) => {
30
+ sectionsSchema.label = {
31
+ children: [{
32
+ $el: "span",
33
+ attrs: {
34
+ title: "$help",
35
+ class: "p-formkit-label"
36
+ },
37
+ children: ["$label"]
38
+ }, {
39
+ $el: "span",
40
+ if: "$state.required",
41
+ attrs: {
42
+ class: "p-formkit-required",
43
+ title: "$help"
44
+ },
45
+ children: ["*"]
46
+ }]
47
+ };
48
+ sectionsSchema.help = {
49
+ children: []
50
+ };
51
+ return schemaFn(sectionsSchema);
52
+ };
53
+ }
54
+ });
55
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "3.0.0",
4
+ "version": "3.0.1",
5
5
  "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad",
6
6
  "author": {
7
7
  "name": "Tom",
@@ -72,7 +72,7 @@
72
72
  "dev": "vite serve dev",
73
73
  "dev:build": "vite build dev",
74
74
  "dev:preview": "vite preview dev",
75
- "release": "npm run lint && npm run build && changelogen --major --release && npm publish --access public && git push --follow-tags",
75
+ "release": "npm run lint && npm run build && changelogen --patch --release && npm publish --access public && git push --follow-tags",
76
76
  "lint": "eslint .",
77
77
  "lint:fix": "eslint . --fix",
78
78
  "prepublishOnly": "pnpm build",
@@ -100,19 +100,19 @@
100
100
  "@antfu/eslint-config": "^5.0.0",
101
101
  "@formkit/core": "^1.6.9",
102
102
  "@formkit/drag-and-drop": "^0.5.3",
103
- "@primeuix/themes": "^1.2.1",
103
+ "@primeuix/themes": "^1.2.2",
104
104
  "@types/node": "^24.1.0",
105
105
  "@types/uuid": "^10.0.0",
106
106
  "@unocss/preset-icons": "66.3.3",
107
107
  "@unocss/preset-uno": "66.3.3",
108
- "@vitejs/plugin-vue": "^6.0.0",
108
+ "@vitejs/plugin-vue": "^6.0.1",
109
109
  "@vitest/coverage-v8": "^3.2.4",
110
110
  "@vitest/ui": "^3.2.4",
111
111
  "@vue/compiler-sfc": "^3.5.18",
112
112
  "@vue/server-renderer": "^3.5.18",
113
113
  "@vue/test-utils": "^2.4.6",
114
114
  "@vue/tsconfig": "^0.7.0",
115
- "@vueuse/core": "^13.5.0",
115
+ "@vueuse/core": "^13.6.0",
116
116
  "@vueuse/head": "^2.0.0",
117
117
  "changelogen": "^0.6.2",
118
118
  "chart.js": "^4.5.0",