@citizenplane/pimp 18.23.2 → 18.23.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "18.23.2",
3
+ "version": "18.23.3",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -21,6 +21,7 @@
21
21
  appearance="secondary"
22
22
  class="cpAncillaryItem__addButton"
23
23
  color="accent"
24
+ :disabled="disabled"
24
25
  size="sm"
25
26
  @click="selectFirstQuantity"
26
27
  >
@@ -82,6 +83,7 @@ interface Props {
82
83
  currency?: string
83
84
  description: string
84
85
  disableAnimation?: boolean
86
+ disabled?: boolean
85
87
  layout?: 'card' | 'list'
86
88
  locale?: string
87
89
  maxQuantity?: number | null
@@ -34,6 +34,7 @@ import CpTransitionCounter from '@/components/CpTransitionCounter.vue'
34
34
  interface Props {
35
35
  decreaseLabel: string
36
36
  disableAnimation?: boolean
37
+ disabled?: boolean
37
38
  increaseLabel: string
38
39
  max?: number | null
39
40
  min?: number
@@ -43,8 +44,8 @@ const props = withDefaults(defineProps<Props>(), { disableAnimation: false, max:
43
44
 
44
45
  const modelValue = defineModel<number>({ required: true })
45
46
 
46
- const isDecrementDisabled = computed(() => modelValue.value <= props.min)
47
- const isIncrementDisabled = computed(() => props.max !== null && modelValue.value >= props.max)
47
+ const isDecrementDisabled = computed(() => props.disabled || modelValue.value <= props.min)
48
+ const isIncrementDisabled = computed(() => props.disabled || (props.max !== null && modelValue.value >= props.max))
48
49
 
49
50
  const decrement = () => {
50
51
  if (isDecrementDisabled.value) return
@@ -53,6 +53,10 @@ const meta = {
53
53
  control: 'text',
54
54
  description: 'Description text for the ancillary',
55
55
  },
56
+ disabled: {
57
+ control: 'boolean',
58
+ description: 'Whether the ancillary is disabled',
59
+ },
56
60
  layout: {
57
61
  control: 'select',
58
62
  options: ['card', 'list'],