@antify/ui-module 1.7.2 → 1.7.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.
Files changed (60) hide show
  1. package/dist/module.d.mts +1 -9
  2. package/dist/module.d.ts +1 -9
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1 -13
  5. package/dist/runtime/components/crud/AntCrudDetailNav.vue +1 -1
  6. package/dist/runtime/components/dialogs/AntDialog.vue +1 -1
  7. package/dist/runtime/components/forms/AntField.vue +3 -3
  8. package/dist/runtime/components/inputs/AntCheckbox.vue +18 -19
  9. package/dist/runtime/components/inputs/AntCheckboxGroup.vue +4 -4
  10. package/dist/runtime/components/inputs/AntDateInput.vue +8 -1
  11. package/dist/runtime/components/inputs/AntNumberInput.vue +5 -0
  12. package/dist/runtime/components/inputs/AntRadio.vue +45 -31
  13. package/dist/runtime/components/inputs/AntRadioGroup.vue +19 -8
  14. package/dist/runtime/components/inputs/AntSearch.vue +3 -0
  15. package/dist/runtime/components/inputs/AntSelect.vue +13 -5
  16. package/dist/runtime/components/inputs/AntSwitch.vue +1 -1
  17. package/dist/runtime/components/inputs/AntTagInput.vue +18 -10
  18. package/dist/runtime/components/inputs/AntTextInput.vue +3 -0
  19. package/dist/runtime/components/inputs/AntTextarea.vue +11 -5
  20. package/dist/runtime/components/inputs/AntUnitInput.vue +3 -0
  21. package/dist/runtime/components/inputs/Elements/AntBaseInput.vue +22 -7
  22. package/dist/runtime/components/inputs/Elements/AntInputLabel.vue +2 -5
  23. package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.mjs +49 -8
  24. package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.mjs +2 -3
  25. package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.d.ts +1 -0
  26. package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.mjs +141 -1
  27. package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.mjs +14 -6
  28. package/dist/runtime/components/inputs/__types/AntCheckbox.types.d.ts +0 -4
  29. package/dist/runtime/components/inputs/__types/AntCheckbox.types.mjs +0 -5
  30. package/dist/runtime/components/inputs/__types/AntRadio.types.d.ts +0 -4
  31. package/dist/runtime/components/inputs/__types/AntRadio.types.mjs +0 -5
  32. package/dist/runtime/components/table/AntTable.vue +3 -3
  33. package/dist/runtime/components/table/AntTableSortButton.vue +1 -1
  34. package/dist/runtime/components/table/AntTd.vue +1 -1
  35. package/dist/runtime/components/table/AntTh.vue +9 -5
  36. package/dist/types.d.mts +1 -1
  37. package/dist/types.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/src/runtime/components/crud/AntCrudDetailNav.vue +1 -1
  40. package/src/runtime/components/dialogs/AntDialog.vue +1 -1
  41. package/src/runtime/components/forms/AntField.vue +3 -3
  42. package/src/runtime/components/inputs/AntCheckbox.vue +18 -19
  43. package/src/runtime/components/inputs/AntCheckboxGroup.vue +4 -4
  44. package/src/runtime/components/inputs/AntDateInput.vue +8 -1
  45. package/src/runtime/components/inputs/AntNumberInput.vue +5 -0
  46. package/src/runtime/components/inputs/AntRadio.vue +45 -31
  47. package/src/runtime/components/inputs/AntRadioGroup.vue +19 -8
  48. package/src/runtime/components/inputs/AntSearch.vue +3 -0
  49. package/src/runtime/components/inputs/AntSelect.vue +13 -5
  50. package/src/runtime/components/inputs/AntSwitch.vue +1 -1
  51. package/src/runtime/components/inputs/AntTagInput.vue +18 -10
  52. package/src/runtime/components/inputs/AntTextInput.vue +3 -0
  53. package/src/runtime/components/inputs/AntTextarea.vue +11 -5
  54. package/src/runtime/components/inputs/AntUnitInput.vue +3 -0
  55. package/src/runtime/components/inputs/Elements/AntBaseInput.vue +22 -7
  56. package/src/runtime/components/inputs/Elements/AntInputLabel.vue +2 -5
  57. package/src/runtime/components/table/AntTable.vue +3 -3
  58. package/src/runtime/components/table/AntTableSortButton.vue +1 -1
  59. package/src/runtime/components/table/AntTd.vue +1 -1
  60. package/src/runtime/components/table/AntTh.vue +9 -5
@@ -25,6 +25,7 @@ const props = withDefaults(
25
25
  size?: AntTagInputSize;
26
26
  state?: InputState;
27
27
  disabled?: boolean;
28
+ readonly?: boolean;
28
29
  skeleton?: boolean;
29
30
  name?: string;
30
31
  expanded?: boolean;
@@ -46,6 +47,9 @@ const props = withDefaults(
46
47
  allowCreate: false,
47
48
  allowDuplicates: false,
48
49
  openOnFocus: true,
50
+ readonly: false,
51
+ disabled: false,
52
+ skeleton: false,
49
53
  autoCloseAfterSelection: false,
50
54
  placeholder: 'Add new tag'
51
55
  }
@@ -54,13 +58,14 @@ const props = withDefaults(
54
58
  const _modelValue: Ref<(string | number)[] | null> = useVModel(props, 'modelValue', emit);
55
59
  const _skeleton = useVModel(props, 'skeleton', emit);
56
60
  const dropDownOpen = ref(false);
61
+ const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
57
62
  const focusedDropDownItem: Ref<string | number | null> = ref(null);
58
63
  const tagInput = ref('');
59
64
  const filteredOptions = ref(props.options);
60
65
  const inputRef: Ref<HTMLElement | null> = ref(null);
61
66
  const inputContainerClasses = computed(() => {
62
67
  const variants: Record<InputState, string> = {
63
- [InputState.base]: 'outline-neutral-300 focus-within:outline-primary-500 focus-within:ring-primary-200 bg-white',
68
+ [InputState.base]: 'outline-neutral-300 focus-within:outline-neutral-300 focus-within:ring-primary-200 bg-white',
64
69
  [InputState.danger]: 'outline-danger-500 focus-within:outline-danger-500 focus-within:ring-danger-200 bg-danger-100',
65
70
  [InputState.info]: 'outline-info-500 focus-within:outline-info-500 focus-within:ring-info-200 bg-info-100',
66
71
  [InputState.success]: 'outline-success-500 focus-within:outline-success-500 focus-within:ring-success-200 bg-success-100',
@@ -73,16 +78,18 @@ const inputContainerClasses = computed(() => {
73
78
  'outline-offset-[-1px] outline-1 focus-within:outline-offset-[-1px] focus-within:outline-1': true,
74
79
  'opacity-50 cursor-not-allowed': props.disabled,
75
80
  [variants[props.state]]: true,
76
- // Size
77
- 'focus-within:ring-2 p-1.5 text-sm': props.size === AntTagInputSize.sm,
78
- 'focus-within:ring-4 p-2 text-sm': props.size === AntTagInputSize.md,
79
- 'focus-within:ring-4 p-2.5 text-sm': props.size === AntTagInputSize.lg,
81
+ // AntTagInputSize
82
+ 'p-1.5 text-sm': props.size === AntTagInputSize.sm,
83
+ 'p-2 text-sm': props.size === AntTagInputSize.md,
84
+ 'p-2.5 text-sm': props.size === AntTagInputSize.lg,
85
+ 'focus-within:ring-2': !hasInputState.value && props.size === AntTagInputSize.sm,
86
+ 'focus-within:ring-4': !hasInputState.value && (props.size === AntTagInputSize.lg || props.size === AntTagInputSize.md),
80
87
  // Grouping
81
88
  'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
82
89
  'rounded-none': props.grouped === Grouped.center,
83
90
  'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
84
91
  'rounded-md': props.grouped === Grouped.none,
85
- 'rounded-bl-none rounded-br-none': dropDownOpen.value && (!props.options || props.options.length > 0),
92
+ 'rounded-bl-none rounded-br-none': dropDownOpen.value && (!props.options || props.options.length > 0) && !props.readonly,
86
93
  'invisible': props.skeleton,
87
94
  };
88
95
  });
@@ -178,7 +185,7 @@ function removeLastTag() {
178
185
  }
179
186
 
180
187
  function removeTag(tag: string | number) {
181
- if (_modelValue.value && !props.disabled && !props.skeleton) {
188
+ if (_modelValue.value && !props.disabled && !props.skeleton && !props.readonly) {
182
189
  _modelValue.value.splice(_modelValue.value.findIndex((_value) => _value === tag), 1);
183
190
 
184
191
  filterDropDown();
@@ -246,7 +253,7 @@ onMounted(() => {
246
253
  <template>
247
254
  <AntField
248
255
  :label="label"
249
- :size="Size.sm"
256
+ :size="size as unknown as Size"
250
257
  :skeleton="_skeleton"
251
258
  :description="description"
252
259
  :state="state"
@@ -276,7 +283,7 @@ onMounted(() => {
276
283
  :key="`tag-input-tag-${index}`"
277
284
  :size="AntTagSize.xs3"
278
285
  :state="state as unknown as TagState"
279
- :dismiss="true"
286
+ :dismiss="!readonly"
280
287
  @close="removeTag(tag)"
281
288
  >
282
289
  {{ options.find((option: SelectOption) => option.value === tag)?.label }}
@@ -297,6 +304,7 @@ onMounted(() => {
297
304
  :placeholder="placeholder"
298
305
  :class="inputClasses"
299
306
  :disabled="disabled"
307
+ :readonly="readonly"
300
308
  @focus="changeFocus"
301
309
  @input="filterDropDown"
302
310
  @keydown.delete="removeLastTag"
@@ -307,7 +315,7 @@ onMounted(() => {
307
315
  </div>
308
316
 
309
317
  <AntDropDown
310
- v-if="filteredOptions && !disabled"
318
+ v-if="filteredOptions && !disabled && !readonly"
311
319
  ref="dropDownRef"
312
320
  v-model:focused="focusedDropDownItem"
313
321
  v-model:open="dropDownOpen"
@@ -20,6 +20,7 @@ const props = withDefaults(defineProps<{
20
20
  size?: Size;
21
21
  state?: InputState;
22
22
  disabled?: boolean;
23
+ readonly?: boolean;
23
24
  skeleton?: boolean;
24
25
  type?: TextInputType;
25
26
  limiter?: boolean;
@@ -28,6 +29,7 @@ const props = withDefaults(defineProps<{
28
29
  }>(), {
29
30
  state: InputState.base,
30
31
  disabled: false,
32
+ readonly: false,
31
33
  skeleton: false,
32
34
  size: Size.md,
33
35
  type: TextInputType.text,
@@ -63,6 +65,7 @@ onMounted(() => {
63
65
  :size="size"
64
66
  :skeleton="skeleton"
65
67
  :disabled="disabled"
68
+ :readonly="readonly"
66
69
  :placeholder="placeholder !== undefined ? placeholder : label"
67
70
  :show-icon="true"
68
71
  v-bind="$attrs"
@@ -25,6 +25,7 @@ const props = withDefaults(defineProps<{
25
25
  size?: Size;
26
26
  state?: InputState;
27
27
  disabled?: boolean;
28
+ readonly?: boolean;
28
29
  skeleton?: boolean;
29
30
  grouped?: Grouped;
30
31
  wrapperClass?: string | Record<string, boolean>;
@@ -38,6 +39,7 @@ const props = withDefaults(defineProps<{
38
39
  }>(), {
39
40
  state: InputState.base,
40
41
  disabled: false,
42
+ readonly: false,
41
43
  size: Size.md,
42
44
  skeleton: false,
43
45
  grouped: Grouped.none,
@@ -46,6 +48,7 @@ const props = withDefaults(defineProps<{
46
48
  messages: () => []
47
49
  });
48
50
  const _modelValue = useVModel(props, 'modelValue', emit);
51
+ const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
49
52
  const icons = {
50
53
  [InputState.info]: faCircleInfo,
51
54
  [InputState.warning]: faExclamationTriangle,
@@ -69,11 +72,13 @@ const inputClasses = computed(() => {
69
72
  'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
70
73
  [variants[props.state]]: true,
71
74
  // Size
72
- 'focus:ring-2 p-1 text-xs': props.size === Size.xs2,
73
- 'focus:ring-2 p-1.5 text-xs': props.size === Size.xs,
74
- 'focus:ring-2 p-1.5 text-sm': props.size === Size.sm,
75
- 'focus:ring-4 p-2 text-sm': props.size === Size.md,
76
- 'focus:ring-4 p-2.5 text-sm': props.size === Size.lg,
75
+ 'p-1 text-xs': props.size === Size.xs2,
76
+ 'p-1.5 text-xs': props.size === Size.xs,
77
+ 'p-1.5 text-sm': props.size === Size.sm,
78
+ 'p-2 text-sm': props.size === Size.md,
79
+ 'p-2.5 text-sm': props.size === Size.lg,
80
+ 'focus:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
81
+ 'focus:ring-4': !hasInputState.value && (props.size === Size.lg || props.size === Size.md),
77
82
  // Icon right
78
83
  'pr-6': props.size === Size.xs2 && props.showIcon && icon.value,
79
84
  'pr-7': props.size === Size.xs && props.showIcon && icon.value,
@@ -158,6 +163,7 @@ function onBlur(e: FocusEvent) {
158
163
  :class="inputClasses"
159
164
  :placeholder="placeholder !== undefined ? placeholder : label"
160
165
  :disabled="disabled || skeleton"
166
+ :readonly="readonly"
161
167
  v-bind="$attrs"
162
168
  @blur="onBlur"
163
169
  />
@@ -25,12 +25,14 @@ const props = withDefaults(defineProps<{
25
25
  size?: Size;
26
26
  state?: InputState;
27
27
  disabled?: boolean;
28
+ readonly?: boolean;
28
29
  skeleton?: boolean;
29
30
  wrapperClass?: string | Record<string, boolean>;
30
31
  messages?: string[];
31
32
  }>(), {
32
33
  state: InputState.base,
33
34
  disabled: false,
35
+ readonly: false,
34
36
  skeleton: false,
35
37
  size: Size.md,
36
38
  limiter: false,
@@ -70,6 +72,7 @@ onMounted(() => {
70
72
  :max="max"
71
73
  :skeleton="skeleton"
72
74
  :disabled="disabled"
75
+ :readonly="readonly"
73
76
  :placeholder="placeholder || label"
74
77
  :show-icon="false"
75
78
  v-bind="$attrs"
@@ -26,6 +26,7 @@ const props = withDefaults(defineProps<{
26
26
  size?: Size;
27
27
  state?: InputState;
28
28
  disabled?: boolean;
29
+ readonly?: boolean;
29
30
  placeholder?: string;
30
31
  skeleton?: boolean;
31
32
  type?: BaseInputType;
@@ -38,6 +39,7 @@ const props = withDefaults(defineProps<{
38
39
  }>(), {
39
40
  state: InputState.base,
40
41
  disabled: false,
42
+ readonly: false,
41
43
  size: Size.md,
42
44
  skeleton: false,
43
45
  type: BaseInputType.text,
@@ -48,6 +50,7 @@ const props = withDefaults(defineProps<{
48
50
  inputRef: null
49
51
  });
50
52
  const slot = useSlots();
53
+ const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
51
54
  const icons = {
52
55
  [InputState.info]: faCircleInfo,
53
56
  [InputState.warning]: faExclamationTriangle,
@@ -71,11 +74,14 @@ const inputClasses = computed(() => {
71
74
  'text-right': props.type === BaseInputType.number,
72
75
  [variants[props.state]]: true,
73
76
  // Size
74
- 'focus:ring-2 p-1 text-xs': props.size === Size.xs2,
75
- 'focus:ring-2 p-1.5 text-xs': props.size === Size.xs,
76
- 'focus:ring-2 p-1.5 text-sm': props.size === Size.sm,
77
- 'focus:ring-4 p-2 text-sm': props.size === Size.md,
78
- 'focus:ring-4 p-2.5 text-sm': props.size === Size.lg,
77
+ 'p-1 text-xs': props.size === Size.xs2,
78
+ 'p-1.5 text-xs': props.size === Size.xs,
79
+ 'p-1.5 text-sm': props.size === Size.sm,
80
+ 'p-2 text-sm': props.size === Size.md,
81
+ 'p-2.5 text-sm': props.size === Size.lg,
82
+ 'focus:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
83
+ 'focus:ring-4': !hasInputState.value && (props.size === Size.lg || props.size === Size.md),
84
+
79
85
  // Icon left
80
86
  'pl-6': props.size === Size.xs2 && props.iconLeft,
81
87
  'pl-7': props.size === Size.sm && props.iconLeft || props.size === Size.xs && props.iconLeft,
@@ -197,7 +203,14 @@ function onClickClearIcon() {
197
203
  <div
198
204
  v-if="iconLeft"
199
205
  class="absolute h-full flex items-center justify-center z-20"
200
- :class="{'w-6': size === Size.xs2, 'w-7': size === Size.xs || size === Size.sm, 'w-8': size === Size.md, 'w-9': size === Size.lg}"
206
+ :class="{
207
+ 'w-6': size === Size.xs2,
208
+ 'w-7': size === Size.sm,
209
+ 'w-8': size === Size.xs,
210
+ 'w-9': size === Size.md,
211
+ 'w-10': size === Size.lg,
212
+ 'opacity-50': disabled,
213
+ }"
201
214
  >
202
215
  <AntIcon
203
216
  :icon="iconLeft"
@@ -213,6 +226,8 @@ function onClickClearIcon() {
213
226
  :type="type"
214
227
  :placeholder="placeholder"
215
228
  :disabled="disabled || skeleton"
229
+ :readonly="readonly"
230
+ :tabindex="hasInputState ? -1 : 0"
216
231
  v-bind="$attrs"
217
232
  @blur="onBlur"
218
233
  >
@@ -220,7 +235,7 @@ function onClickClearIcon() {
220
235
  <div
221
236
  v-if="(nullable && _modelValue !== null && _modelValue !== '') || (showIcon && icon) || hasSlotContent(slot['icon-right'])"
222
237
  class="absolute h-full flex items-center justify-center right-0 top-0 transition-all z-20"
223
- :class="{'w-6': size === Size.xs2, 'w-7': size === Size.xs || size === Size.sm, 'w-8': size === Size.md, 'w-9': size === Size.lg}"
238
+ :class="{'w-6': size === Size.xs2, 'w-7': size === Size.xs2, 'w-8': size === Size.sm, 'w-9': size === Size.md, 'w-10': size === Size.lg}"
224
239
  >
225
240
  <slot name="icon-right">
226
241
  <AntIcon
@@ -17,11 +17,8 @@ const props = withDefaults(defineProps<{
17
17
 
18
18
  const fontClasses = computed(() => ({
19
19
  'relative font-medium w-fit text-for-white-bg-font': true,
20
- 'text-2xs': props.size === Size.xs2,
21
- 'text-xs': props.size === Size.xs,
22
- 'text-sm': props.size === Size.sm,
23
- 'text-md': props.size === Size.md,
24
- 'text-lg': props.size === Size.lg
20
+ 'text-xs': props.size === Size.xs || props.size === Size.xs2,
21
+ 'text-sm': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
25
22
  }));
26
23
  const gapSize = computed(() => ({
27
24
  'gap-2.5': props.size === Size.lg,
@@ -1,8 +1,7 @@
1
1
  import AntCheckbox from "../AntCheckbox.vue";
2
2
  import { computed, ref } from "vue";
3
- import { InputState } from "../../../enums/index.mjs";
3
+ import { InputState, Size } from "../../../enums/index.mjs";
4
4
  import { useFieldValidator } from "@antify/validate";
5
- import { AntCheckboxSize } from "../__types/AntCheckbox.types.mjs";
6
5
  import AntFormGroup from "../../forms/AntFormGroup.vue";
7
6
  import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
8
7
  const meta = {
@@ -16,7 +15,7 @@ const meta = {
16
15
  },
17
16
  size: {
18
17
  control: { type: "select" },
19
- options: Object.values(AntCheckboxSize)
18
+ options: Object.values(Size)
20
19
  }
21
20
  }
22
21
  };
@@ -91,7 +90,7 @@ export const Summary = {
91
90
  offValue,
92
91
  onValue,
93
92
  InputState,
94
- AntCheckboxSize
93
+ Size
95
94
  };
96
95
  },
97
96
  template: `
@@ -189,28 +188,70 @@ export const Summary = {
189
188
  <AntCheckbox
190
189
  v-model="offValue"
191
190
  class="w-28"
192
- :size="AntCheckboxSize.md"
191
+ :size="Size.lg"
193
192
  label="Label"
194
193
  description="Lorem ipsum dolor sit amet"
195
194
  />
196
195
  <AntCheckbox
197
196
  v-model="onValue"
198
197
  class="w-28"
199
- :size="AntCheckboxSize.md"
198
+ :size="Size.lg"
200
199
  label="Label"
201
200
  description="Lorem ipsum dolor sit amet"
202
201
  />
203
202
  <AntCheckbox
204
203
  v-model="offValue"
205
204
  class="w-28"
206
- :size="AntCheckboxSize.sm"
205
+ :size="Size.md"
207
206
  label="Label"
208
207
  description="Lorem ipsum dolor sit amet"
209
208
  />
210
209
  <AntCheckbox
211
210
  v-model="onValue"
212
211
  class="w-28"
213
- :size="AntCheckboxSize.sm"
212
+ :size="Size.md"
213
+ label="Label"
214
+ description="Lorem ipsum dolor sit amet"
215
+ />
216
+ <AntCheckbox
217
+ v-model="offValue"
218
+ class="w-28"
219
+ :size="Size.sm"
220
+ label="Label"
221
+ description="Lorem ipsum dolor sit amet"
222
+ />
223
+ <AntCheckbox
224
+ v-model="onValue"
225
+ class="w-28"
226
+ :size="Size.sm"
227
+ label="Label"
228
+ description="Lorem ipsum dolor sit amet"
229
+ />
230
+ <AntCheckbox
231
+ v-model="offValue"
232
+ class="w-28"
233
+ :size="Size.xs"
234
+ label="Label"
235
+ description="Lorem ipsum dolor sit amet"
236
+ />
237
+ <AntCheckbox
238
+ v-model="onValue"
239
+ class="w-28"
240
+ :size="Size.xs"
241
+ label="Label"
242
+ description="Lorem ipsum dolor sit amet"
243
+ />
244
+ <AntCheckbox
245
+ v-model="offValue"
246
+ class="w-28"
247
+ :size="Size.xs2"
248
+ label="Label"
249
+ description="Lorem ipsum dolor sit amet"
250
+ />
251
+ <AntCheckbox
252
+ v-model="onValue"
253
+ class="w-28"
254
+ :size="Size.xs"
214
255
  label="Label"
215
256
  description="Lorem ipsum dolor sit amet"
216
257
  />
@@ -1,9 +1,8 @@
1
1
  import AntCheckboxGroup from "../AntCheckboxGroup.vue";
2
2
  import { reactive } from "vue";
3
- import { InputState } from "../../../enums/index.mjs";
3
+ import { InputState, Size } from "../../../enums/index.mjs";
4
4
  import { Direction } from "../../../enums/Direction.enum.mjs";
5
5
  import { useFieldValidator } from "@antify/validate";
6
- import { AntCheckboxSize } from "../__types/AntCheckbox.types.mjs";
7
6
  const meta = {
8
7
  title: "Inputs/Checkbox Group",
9
8
  component: AntCheckboxGroup,
@@ -21,7 +20,7 @@ const meta = {
21
20
  },
22
21
  size: {
23
22
  control: { type: "select" },
24
- options: Object.values(AntCheckboxSize)
23
+ options: Object.values(Size)
25
24
  },
26
25
  direction: {
27
26
  control: { type: "select" },
@@ -7,3 +7,4 @@ export declare const Docs: Story;
7
7
  export declare const withValidator: Story;
8
8
  export declare const Limited: Story;
9
9
  export declare const WithIndicators: Story;
10
+ export declare const Summary: Story;
@@ -2,8 +2,11 @@ import { Size } from "../../../enums/Size.enum.mjs";
2
2
  import AntNumberInput from "../AntNumberInput.vue";
3
3
  import { InputState } from "../../../enums/State.enum.mjs";
4
4
  import { isRequiredRule, useFieldValidator } from "@antify/validate";
5
- import { reactive } from "vue";
5
+ import { reactive, ref } from "vue";
6
+ import AntFormGroup from "../../forms/AntFormGroup.vue";
7
+ import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
6
8
  const meta = {
9
+ components: { AntFormGroupLabel, AntFormGroup },
7
10
  title: "Inputs/Number Input",
8
11
  component: AntNumberInput,
9
12
  parameters: { controls: { sort: "requiredFirst" } },
@@ -104,3 +107,140 @@ export const WithIndicators = {
104
107
  indicators: true
105
108
  }
106
109
  };
110
+ export const Summary = {
111
+ parameters: {
112
+ chromatic: { disableSnapshot: false }
113
+ },
114
+ render: (args) => ({
115
+ components: { AntNumberInput, AntFormGroup, AntFormGroupLabel },
116
+ setup() {
117
+ const value = ref(100.5);
118
+ return { args, value, InputState, Size };
119
+ },
120
+ template: `
121
+ <AntFormGroup>
122
+ <AntFormGroupLabel>States</AntFormGroupLabel>
123
+ <AntFormGroup direction="row">
124
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label"
125
+ description="Lorem ipsum dolor sit amet"/>
126
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label" description="Lorem ipsum dolor sit amet"
127
+ :state="InputState.info"/>
128
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label" description="Lorem ipsum dolor sit amet"
129
+ :state="InputState.success"/>
130
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label" description="Lorem ipsum dolor sit amet"
131
+ :state="InputState.warning"/>
132
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label" description="Lorem ipsum dolor sit amet"
133
+ :state="InputState.danger"/>
134
+ </AntFormGroup>
135
+ <AntFormGroup direction="row">
136
+ <AntNumberInput v-bind="args" v-model="value" label="Label" description="Lorem ipsum dolor sit amet"/>
137
+ <AntNumberInput v-bind="args" v-model="value" label="Label" description="Lorem ipsum dolor sit amet"
138
+ :state="InputState.info"/>
139
+ <AntNumberInput v-bind="args" v-model="value" label="Label" description="Lorem ipsum dolor sit amet"
140
+ :state="InputState.success"/>
141
+ <AntNumberInput v-bind="args" v-model="value" label="Label" description="Lorem ipsum dolor sit amet"
142
+ :state="InputState.warning"/>
143
+ <AntNumberInput v-bind="args" v-model="value" label="Label" description="Lorem ipsum dolor sit amet"
144
+ :state="InputState.danger"/>
145
+ </AntFormGroup>
146
+ <AntFormGroup direction="row">
147
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators label="Label"
148
+ description="Lorem ipsum dolor sit amet"/>
149
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators label="Label"
150
+ description="Lorem ipsum dolor sit amet" :state="InputState.info"/>
151
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators label="Label"
152
+ description="Lorem ipsum dolor sit amet" :state="InputState.success"/>
153
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators label="Label"
154
+ description="Lorem ipsum dolor sit amet" :state="InputState.warning"/>
155
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators label="Label"
156
+ description="Lorem ipsum dolor sit amet" :state="InputState.danger"/>
157
+ </AntFormGroup>
158
+ <AntFormGroup direction="row">
159
+ <AntNumberInput v-bind="args" v-model="value" indicators label="Label"
160
+ description="Lorem ipsum dolor sit amet"/>
161
+ <AntNumberInput v-bind="args" v-model="value" indicators label="Label"
162
+ description="Lorem ipsum dolor sit amet" :state="InputState.info"/>
163
+ <AntNumberInput v-bind="args" v-model="value" indicators label="Label"
164
+ description="Lorem ipsum dolor sit amet" :state="InputState.success"/>
165
+ <AntNumberInput v-bind="args" v-model="value" indicators label="Label"
166
+ description="Lorem ipsum dolor sit amet" :state="InputState.warning"/>
167
+ <AntNumberInput v-bind="args" v-model="value" indicators label="Label"
168
+ description="Lorem ipsum dolor sit amet" :state="InputState.danger"/>
169
+ </AntFormGroup>
170
+ <AntFormGroupLabel>Sizes</AntFormGroupLabel>
171
+ <AntFormGroup direction="row">
172
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :size="Size.lg" label="Label"
173
+ description="Lorem ipsum dolor sit amet"/>
174
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :size="Size.md" label="Label"
175
+ description="Lorem ipsum dolor sit amet"/>
176
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :size="Size.sm" label="Label"
177
+ description="Lorem ipsum dolor sit amet"/>
178
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :size="Size.xs" label="Label"
179
+ description="Lorem ipsum dolor sit amet"/>
180
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :size="Size.xs2" label="Label"
181
+ description="Lorem ipsum dolor sit amet"/>
182
+ </AntFormGroup>
183
+ <AntFormGroup direction="row">
184
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators :size="Size.lg" label="Label"
185
+ description="Lorem ipsum dolor sit amet"/>
186
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators :size="Size.md" label="Label"
187
+ description="Lorem ipsum dolor sit amet"/>
188
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators :size="Size.sm" label="Label"
189
+ description="Lorem ipsum dolor sit amet"/>
190
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators :size="Size.xs" label="Label"
191
+ description="Lorem ipsum dolor sit amet"/>
192
+ <AntNumberInput v-bind="args" v-model="args.modelValue" indicators :size="Size.xs2" label="Label"
193
+ description="Lorem ipsum dolor sit amet"/>
194
+ </AntFormGroup>
195
+ <AntFormGroup direction="row">
196
+ <AntFormGroup>
197
+ <AntFormGroupLabel>Disabled</AntFormGroupLabel>
198
+ <AntNumberInput v-bind="args" v-model="args.modelValue" disabled label="Label"
199
+ description="Lorem ipsum dolor sit amet"/>
200
+ <AntNumberInput v-bind="args" v-model="args.modelValue" disabled indicators label="Label"
201
+ description="Lorem ipsum dolor sit amet"/>
202
+ </AntFormGroup>
203
+ <AntFormGroup>
204
+ <AntFormGroupLabel>Readonly</AntFormGroupLabel>
205
+ <AntNumberInput v-bind="args" v-model="args.modelValue" readonly label="Label"
206
+ description="Lorem ipsum dolor sit amet"/>
207
+ <AntNumberInput v-bind="args" v-model="args.modelValue" readonly indicators label="Label"
208
+ description="Lorem ipsum dolor sit amet"/>
209
+ </AntFormGroup>
210
+ <AntFormGroup>
211
+ <AntFormGroupLabel>Skeleton</AntFormGroupLabel>
212
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :skeleton="true" label="Label"
213
+ description="Lorem ipsum dolor sit amet"/>
214
+ <AntNumberInput v-bind="args" v-model="args.modelValue" :skeleton="true" indicators label="Label"
215
+ description="Lorem ipsum dolor sit amet"/>
216
+ </AntFormGroup>
217
+ </AntFormGroup>
218
+ <AntFormGroupLabel>Plain</AntFormGroupLabel>
219
+ <AntFormGroup class="w-72">
220
+ <AntNumberInput v-bind="args" v-model="args.modelValue" placeholder="Placeholder"/>
221
+ <AntNumberInput v-bind="args" indicators v-model="args.modelValue" placeholder="Placeholder"/>
222
+ </AntFormGroup>
223
+ <AntFormGroupLabel>With label</AntFormGroupLabel>
224
+ <AntFormGroup class="w-72">
225
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label"/>
226
+ <AntNumberInput v-bind="args" indicators v-model="args.modelValue" label="Label"/>
227
+ </AntFormGroup>
228
+ <AntFormGroupLabel>With description</AntFormGroupLabel>
229
+ <AntFormGroup class="w-72">
230
+ <AntNumberInput v-bind="args" v-model="args.modelValue" description="Lorem ipsum dolor sit amet"/>
231
+ <AntNumberInput v-bind="args" indicators v-model="args.modelValue" description="Lorem ipsum dolor sit amet"/>
232
+ </AntFormGroup>
233
+ <AntFormGroupLabel>With label + description</AntFormGroupLabel>
234
+ <AntFormGroup class="w-72">
235
+ <AntNumberInput v-bind="args" v-model="args.modelValue" label="Label"
236
+ description="Lorem ipsum dolor sit amet"/>
237
+ <AntNumberInput v-bind="args" indicators v-model="args.modelValue" label="Label"
238
+ description="Lorem ipsum dolor sit amet"/>
239
+ </AntFormGroup>
240
+ </AntFormGroup>
241
+ `
242
+ }),
243
+ args: {
244
+ modelValue: null
245
+ }
246
+ };
@@ -1,7 +1,6 @@
1
1
  import { ref } from "vue";
2
2
  import AntRadioGroup from "../AntRadioGroup.vue";
3
- import { InputState } from "../../../enums/index.mjs";
4
- import { AntRadioSize } from "../__types/AntRadio.types.mjs";
3
+ import { InputState, Size } from "../../../enums/index.mjs";
5
4
  import { useFieldValidator } from "@antify/validate";
6
5
  import { Direction } from "../../../enums/Direction.enum.mjs";
7
6
  import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
@@ -51,7 +50,7 @@ const meta = {
51
50
  },
52
51
  size: {
53
52
  control: { type: "select" },
54
- options: Object.values(AntRadioSize)
53
+ options: Object.values(Size)
55
54
  }
56
55
  }
57
56
  };
@@ -140,11 +139,14 @@ export const WithValidator = {
140
139
  }
141
140
  };
142
141
  export const summary = {
142
+ parameters: {
143
+ chromatic: { disableSnapshot: false }
144
+ },
143
145
  render: (args) => ({
144
146
  components: { AntRadioGroup, AntFormGroupLabel, AntFormGroup },
145
147
  setup() {
146
148
  const value = ref("radio-3");
147
- return { args, value, InputState, AntRadioSize };
149
+ return { args, value, InputState, Size };
148
150
  },
149
151
  template: `
150
152
  <AntFormGroup>
@@ -193,9 +195,15 @@ export const summary = {
193
195
 
194
196
  <AntFormGroupLabel>Size</AntFormGroupLabel>
195
197
  <AntFormGroup direction="row">
196
- <AntRadioGroup v-bind="args" v-model="value" :size="AntRadioSize.md" label="Label"
198
+ <AntRadioGroup v-bind="args" v-model="value" :size="Size.lg" label="Label"
199
+ description="Lorem ipsum dolor sit amet"/>
200
+ <AntRadioGroup v-bind="args" v-model="value" :size="Size.md" label="Label"
201
+ description="Lorem ipsum dolor sit amet"/>
202
+ <AntRadioGroup v-bind="args" v-model="value" :size="Size.sm" label="Label"
203
+ description="Lorem ipsum dolor sit amet"/>
204
+ <AntRadioGroup v-bind="args" v-model="value" :size="Size.xs" label="Label"
197
205
  description="Lorem ipsum dolor sit amet"/>
198
- <AntRadioGroup v-bind="args" v-model="value" :size="AntRadioSize.sm" label="Label"
206
+ <AntRadioGroup v-bind="args" v-model="value" :size="Size.xs2" label="Label"
199
207
  description="Lorem ipsum dolor sit amet"/>
200
208
  </AntFormGroup>
201
209
 
@@ -4,7 +4,3 @@ export type AntCheckboxType = {
4
4
  disabled?: boolean;
5
5
  readonly?: boolean;
6
6
  };
7
- export declare enum AntCheckboxSize {
8
- md = "md",
9
- sm = "sm"
10
- }
@@ -1,5 +0,0 @@
1
- export var AntCheckboxSize = /* @__PURE__ */ ((AntCheckboxSize2) => {
2
- AntCheckboxSize2["md"] = "md";
3
- AntCheckboxSize2["sm"] = "sm";
4
- return AntCheckboxSize2;
5
- })(AntCheckboxSize || {});
@@ -1,8 +1,4 @@
1
1
  import { InputState } from '../../../enums';
2
- export declare enum AntRadioSize {
3
- md = "md",
4
- sm = "sm"
5
- }
6
2
  export type AntRadioTypes = {
7
3
  value: string;
8
4
  label?: string;
@@ -1,5 +0,0 @@
1
- export var AntRadioSize = /* @__PURE__ */ ((AntRadioSize2) => {
2
- AntRadioSize2["md"] = "md";
3
- AntRadioSize2["sm"] = "sm";
4
- return AntRadioSize2;
5
- })(AntRadioSize || {});