@appsbd/vue3-appsbd-ui 1.0.11 → 1.0.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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Radio-style color swatch picker. Takes a list of named colors and lets users pick one.
4
4
 
5
+ > Also available inside `AbCustomField` via the `CP` field type — see [.ai/ai_ref_AbCustomField.md](./ai_ref_AbCustomField.md).
6
+
5
7
  ## Usage
6
8
 
7
9
  ```vue
@@ -34,6 +36,8 @@ const themeColor = ref('blue');
34
36
  | `align` | `String` | `"left"` | Flex alignment (`left`, `center`, `right`, …). |
35
37
  | `borderRadius` | `String` | `"50%"` | Swatch border-radius. |
36
38
  | `size` | `String` | `"md"` | Item size (`xs`, `sm`, `md`, `lg`, `xl`, `xxl`). |
39
+ | `label` | `String` | `""` | Optional text label rendered above picker. |
40
+ | `containerClass` | `String` | `undefined` | Additional class for wrapper div. Falls back to globalConfig.inputContainerClass. |
37
41
 
38
42
  ## Events
39
43
 
@@ -26,6 +26,57 @@ const fields = [
26
26
  </script>
27
27
  ```
28
28
 
29
+ ### Radio / checkbox with card, segmented or pill variant
30
+
31
+ `R` (radio) and `C` (checkbox) fields render through `AbFormCheck` internally, so its `variant`, `card_width`, `icon_size` and `icon_gap` options pass straight through:
32
+
33
+ ```vue
34
+ <template>
35
+ <ab-custom-field :field-inputs="fields" :custom-props="form" />
36
+ </template>
37
+
38
+ <script setup>
39
+ import { reactive } from 'vue';
40
+
41
+ const form = reactive({ plan: 'pro', notify: [] });
42
+
43
+ const fields = [
44
+ { id: 'plan', type: 'R', label: 'Plan', variant: 'card', card_width: '160px', options: [
45
+ { val: 'free', title: 'Free' },
46
+ { val: 'pro', title: 'Pro', description: 'For growing teams' },
47
+ ] },
48
+ { id: 'notify', type: 'C', label: 'Notify via', variant: 'segmented', options: [
49
+ { val: 'email', title: 'Email' },
50
+ { val: 'sms', title: 'SMS' },
51
+ ] },
52
+ ];
53
+ </script>
54
+ ```
55
+
56
+ ### Color picker & file uploader fields
57
+
58
+ `CP` renders `AbColorPicker` and `FU` renders `AbFileUploader`. Neither integrates with Vee-Validate (`rules` is ignored for these two types):
59
+
60
+ ```vue
61
+ <template>
62
+ <ab-custom-field :field-inputs="fields" :custom-props="form" />
63
+ </template>
64
+
65
+ <script setup>
66
+ import { reactive } from 'vue';
67
+
68
+ const form = reactive({ theme: '', avatar: null });
69
+
70
+ const fields = [
71
+ { id: 'theme', type: 'CP', label: 'Theme Color', options: [
72
+ { name: 'blue', color: '#0d6efd', title: 'Blue' },
73
+ { name: 'green', color: '#198754', title: 'Green' },
74
+ ] },
75
+ { id: 'avatar', type: 'FU', label: 'Avatar', max_size: 2 },
76
+ ];
77
+ </script>
78
+ ```
79
+
29
80
  ## Props
30
81
 
31
82
  | Name | Type | Default | Description |
@@ -50,6 +101,8 @@ const fields = [
50
101
  | `W` | Dropdown / select |
51
102
  | `S` | Switch / toggle |
52
103
  | `C` | Checkbox |
104
+ | `CP` | Color picker (`AbColorPicker`) |
105
+ | `FU` | File uploader (`AbFileUploader`) |
53
106
 
54
107
  ### Field Properties
55
108
 
@@ -61,6 +114,14 @@ Each object in `fieldInputs` supports several properties. The `rules` property d
61
114
  | `type` | `String` | Component type code (e.g. `T`, `N`). |
62
115
  | `label` | `String` | Field label. |
63
116
  | `rules` | `String` \| `Array` | Standard Vee-Validate rules (e.g., `"required|url"`). Replaces legacy `is_required`. |
117
+ | `options` | `Array` | Choices for `R` (radio), `C` (checkbox) and `W` (dropdown) fields — item shape `{ val, title, description?, disable?, img_src?, icon?, iconComponent? }`. For `CP` (color picker) it's forwarded as `AbColorPicker`'s `colors` prop — item shape `{ name, color, title? }` instead. |
118
+ | `variant` | `String` | **`R`/`C` only.** Forwarded to `AbFormCheck`'s `variant` prop: `"default"` (plain, initial value), `"card"`, `"segmented"`, or `"pill"`. |
119
+ | `card_width` | `String` | **`R`/`C` only, with `variant`.** Forwarded to `AbFormCheck`'s `card-width` prop, e.g. `"160px"`, `"50%"`. Default `"auto"`. |
120
+ | `icon_size` | `String` | **`R`/`C` only, with `variant`.** Forwarded to `AbFormCheck`'s `icon-size` prop. Default `"24px"`. |
121
+ | `icon_gap` | `String` | **`R`/`C` only, with `variant`.** Forwarded to `AbFormCheck`'s `icon-gap` prop. Default `"10px"`. |
122
+ | `align` | `String` | **`CP` only.** Forwarded to `AbColorPicker`'s `align` prop (`"left"`, `"center"`, `"right"`...). Default `"left"`. |
123
+ | `border_radius` | `String` | **`CP` only.** Forwarded to `AbColorPicker`'s `border-radius` prop, e.g. `"50%"`, `"6px"`. Default `"50%"`. |
124
+ | `max_size` | `Number` | **`FU` only.** Forwarded to `AbFileUploader`'s `max-size` prop — max file size in MB. Default `2.0`. |
64
125
 
65
126
  ## Slots (scoped by field id)
66
127
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  File upload input with drag-and-drop, size validation, and preview. Can render a default uploader UI or accept a custom one via slots.
4
4
 
5
+ > Also available inside `AbCustomField` via the `FU` field type — see [.ai/ai_ref_AbCustomField.md](./ai_ref_AbCustomField.md).
6
+
5
7
  ## Usage
6
8
 
7
9
  ```vue
@@ -29,7 +31,7 @@ function handleFiles(files) { console.log('Selected files:', files); }
29
31
  | `modelValue` | `File \| Array \| String` | `null` | Selected file (or URL string / array). |
30
32
  | `maxSize` | `Number` | `2.0` | Max file size in MB. |
31
33
  | `label` | `String` | `""` | Field label. |
32
- | `containerClass` | `String` | `""` | Wrapper class. |
34
+ | `containerClass` | `String` | `undefined` | Wrapper class (falls back to globalConfig.inputContainerClass). |
33
35
 
34
36
  ## Events
35
37
 
@@ -38,6 +38,7 @@ Checkbox or radio group with card, segmented, and pill visual variants. `AbRadio
38
38
  | `iconSize` | `String` | `"24px"` | Icon size (when option has an icon). |
39
39
  | `iconGap` | `String` | `"10px"` | Gap between icon and label. |
40
40
  | `variant` | `String` | `"default"` | `default`, `card`, `segmented`, `pill`. |
41
+ | `cardWidth` | `String` | `"auto"` | Width of card options (e.g. `"160px"`, `"50%"`, `"12rem"`). |
41
42
 
42
43
  ## Events
43
44