@appsbd/vue3-appsbd-ui 1.0.2 → 1.0.4

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 (87) hide show
  1. package/.ai/ai_ref_AbAvatar.md +1 -11
  2. package/.ai/ai_ref_AbBadge.md +2 -11
  3. package/.ai/ai_ref_AbButton.md +4 -23
  4. package/.ai/ai_ref_AbCard.md +6 -25
  5. package/.ai/ai_ref_AbCarousel.md +1 -12
  6. package/.ai/ai_ref_AbChart.md +16 -57
  7. package/.ai/ai_ref_AbColorPicker.md +1 -14
  8. package/.ai/ai_ref_AbConfirmPopover.md +1 -6
  9. package/.ai/ai_ref_AbCustomField.md +1 -9
  10. package/.ai/ai_ref_AbDarkModeToggler.md +1 -10
  11. package/.ai/ai_ref_AbDateTimePicker.md +4 -38
  12. package/.ai/ai_ref_AbEasyModal.md +2 -8
  13. package/.ai/ai_ref_AbField.md +1 -9
  14. package/.ai/ai_ref_AbFileUploader.md +3 -19
  15. package/.ai/ai_ref_AbFilterPanel.md +0 -4
  16. package/.ai/ai_ref_AbFormCheck.md +2 -19
  17. package/.ai/ai_ref_AbImageRadioInput.md +1 -9
  18. package/.ai/ai_ref_AbInputField.md +1 -9
  19. package/.ai/ai_ref_AbInputTag.md +2 -22
  20. package/.ai/ai_ref_AbKbd.md +0 -12
  21. package/.ai/ai_ref_AbKbdGroup.md +1 -13
  22. package/.ai/ai_ref_AbModal.md +98 -103
  23. package/.ai/ai_ref_AbMultiSelect.md +3 -37
  24. package/.ai/ai_ref_AbNumberField.md +5 -30
  25. package/.ai/ai_ref_AbPinInput.md +1 -13
  26. package/.ai/ai_ref_AbPopover.md +2 -12
  27. package/.ai/ai_ref_AbPricingCard.md +0 -8
  28. package/.ai/ai_ref_AbPricingContainer.md +0 -8
  29. package/.ai/ai_ref_AbPricingTable.md +20 -36
  30. package/.ai/ai_ref_AbProgressbar.md +1 -11
  31. package/.ai/ai_ref_AbScrollbar.md +2 -12
  32. package/.ai/ai_ref_AbSettingsForm.md +1 -9
  33. package/.ai/ai_ref_AbSideMenuItem.md +1 -12
  34. package/.ai/ai_ref_AbSidebar.md +2 -10
  35. package/.ai/ai_ref_AbSkeleton.md +0 -18
  36. package/.ai/ai_ref_AbSlider.md +1 -20
  37. package/.ai/ai_ref_AbTab.md +0 -8
  38. package/.ai/ai_ref_AbTable.md +0 -10
  39. package/.ai/ai_ref_AbTabs.md +1 -11
  40. package/.ai/ai_ref_AbToggle.md +4 -23
  41. package/.ai/ai_ref_AbTooltip.md +1 -15
  42. package/.ai/ai_ref_AbWizard.md +7 -20
  43. package/.ai/ai_ref_AbWizardStep.md +1 -13
  44. package/.ai/ai_ref_abEventBus.md +66 -94
  45. package/.ai/ai_ref_abRequestParam.md +40 -55
  46. package/.ai/ai_ref_abTranslate.md +30 -15
  47. package/.ai/ai_ref_abVeeRules.md +33 -42
  48. package/.ai/ai_ref_global_config.md +7 -17
  49. package/.ai/ai_ref_useAlert.md +45 -63
  50. package/.ai/ai_ref_useFileValidator.md +31 -46
  51. package/.ai/ai_ref_useResponsive.md +41 -55
  52. package/.ai/ai_ref_useTheme.md +28 -39
  53. package/.ai/ai_ref_useToast.md +30 -42
  54. package/AI_REF.md +114 -0
  55. package/AI_REFERENCE.md +83 -1131
  56. package/dist/skins/black.css +1 -1
  57. package/dist/skins/cyan.css +1 -1
  58. package/dist/skins/default.css +1 -1
  59. package/dist/skins/gray.css +1 -1
  60. package/dist/skins/green.css +1 -1
  61. package/dist/skins/orange.css +1 -1
  62. package/dist/skins/pink.css +1 -1
  63. package/dist/skins/purple.css +1 -1
  64. package/dist/skins/red.css +1 -1
  65. package/dist/skins/themes/_blue.scss +35 -35
  66. package/dist/skins/themes/_common_variable.scss +101 -6
  67. package/dist/skins/themes/_cyan.scss +1 -1
  68. package/dist/skins/themes/_gray.scss +2 -1
  69. package/dist/skins/themes/_green.scss +1 -1
  70. package/dist/skins/themes/_grid.scss +4 -1
  71. package/dist/skins/themes/_orange.scss +1 -1
  72. package/dist/skins/themes/_pink.scss +1 -1
  73. package/dist/skins/themes/_purple.scss +1 -1
  74. package/dist/skins/themes/_red.scss +1 -1
  75. package/dist/skins/themes/_violet.scss +1 -1
  76. package/dist/skins/violet.css +1 -1
  77. package/dist/style.css +1 -1
  78. package/dist/vue3-appsbd-ui.cjs.js +93 -61
  79. package/dist/vue3-appsbd-ui.es.js +26647 -17054
  80. package/package.json +7 -1
  81. package/readme.md +59 -1
  82. package/scripts/postinstall.js +55 -0
  83. package/scripts/setup.js +16 -0
  84. package/scripts/skill-groups.js +38 -0
  85. package/skills/commands/generate-module.md +76 -0
  86. package/skills/commands/settings-form.md +175 -0
  87. package/skills/commands/use-appsbd-ui.md +40 -0
@@ -1,55 +1,40 @@
1
- # abRequestParam (Library)
2
-
3
- Data-transfer classes used to build structured API request parameters for paginated, sorted, and filtered data queries.
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- ```javascript
14
- import abRequestParam from "@vue3-appsbd-ui/libraries/abRequestParam";
15
-
16
- const params = new abRequestParam();
17
-
18
- // Pagination
19
- params.limit = 25;
20
- params.page = 1;
21
-
22
- // Sorting
23
- params.AddSortItem("created_at", "desc");
24
-
25
- // Filtering
26
- params.AddSrcItem("status", "active", "eq");
27
- params.AddSrcItem("name", "John", "like");
28
-
29
- // Output suitable for axios or fetch payload
30
- console.log(params);
31
- ```
32
-
33
- ## API Reference
34
-
35
- ### `abRequestParam` Class
36
-
37
- **Properties**
38
-
39
- | Property | Type | Description |
40
- |---|---|---|
41
- | `data` | `any` | Arbitrary payload attached to the request (e.g. form data). |
42
- | `limit` | `string\|number` | Number of records per page. |
43
- | `page` | `string\|number` | Current page number. |
44
- | `filter_prop` | `string` | Optional filter property identifier. |
45
- | `sort_by` | `abSortParam[]` | Array of sort descriptors. |
46
- | `src_by` | `abSrcParam[]` | Array of filter/search descriptors. |
47
- | `group_by` | `string[]` | Array of property names to group results by. |
48
- | `force` | `boolean` | Forces the server to bypass cache. |
49
-
50
- **Methods**
51
-
52
- | Method | Signature | Description |
53
- |---|---|---|
54
- | `AddSortItem(prop, ord)` | `Function` | Appends a sort rule. `ord` defaults to `'asc'`, accepts `'asc' \| 'desc'`. |
55
- | `AddSrcItem(prop, val, opr)` | `Function` | Appends a search rule. `opr` defaults to `'eq'`, accepts `'eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'like', 'in'`. |
1
+ # abRequestParam (Library)
2
+
3
+ Data-transfer classes for building structured API request parameters for paginated, sorted, and filtered data queries.
4
+
5
+ ## Usage
6
+
7
+ ```javascript
8
+ import abRequestParam from "@vue3-appsbd-ui/libraries/abRequestParam";
9
+
10
+ const params = new abRequestParam();
11
+ params.limit = 25;
12
+ params.page = 1;
13
+ params.AddSortItem("created_at", "desc");
14
+ params.AddSrcItem("status", "active", "eq");
15
+ params.AddSrcItem("name", "John", "like");
16
+ ```
17
+
18
+ ## API Reference
19
+
20
+ ### `abRequestParam` Class
21
+
22
+ **Properties**
23
+
24
+ | Property | Type | Description |
25
+ |---|---|---|
26
+ | `data` | `any` | Arbitrary payload attached to the request. |
27
+ | `limit` | `string\|number` | Number of records per page. |
28
+ | `page` | `string\|number` | Current page number. |
29
+ | `filter_prop` | `string` | Optional filter property identifier. |
30
+ | `sort_by` | `abSortParam[]` | Array of sort descriptors. |
31
+ | `src_by` | `abSrcParam[]` | Array of filter/search descriptors. |
32
+ | `group_by` | `string[]` | Array of property names to group results by. |
33
+ | `force` | `boolean` | Forces the server to bypass cache. |
34
+
35
+ **Methods**
36
+
37
+ | Method | Signature | Description |
38
+ |---|---|---|
39
+ | `AddSortItem(prop, ord)` | `Function` | Appends a sort rule. `ord` defaults to `'asc'`, accepts `'asc' \| 'desc'`. |
40
+ | `AddSrcItem(prop, val, opr)` | `Function` | Appends a search rule. `opr` defaults to `'eq'`, accepts `'eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'like', 'in'`. |
@@ -1,33 +1,48 @@
1
1
  # abTranslate (Library)
2
2
 
3
- A localization utility wrapping `vue3-gettext`. Exposes helper methods `translateGettext` and `translateGetMsg` that automatically interpolate parameters and translate strings, falling back safely if gettext isn't initialized.
3
+ Localization utility wrapping `vue3-gettext`. Exposes `translateGettext` (translates + interpolates) and `translateGetMsg` (interpolates only).
4
4
 
5
- ## Installation
5
+ ## Setup
6
6
 
7
7
  ```javascript
8
- npm install @vue3-appsbd-ui
8
+ // Option 1 — recommended: auto-registers the instance
9
+ import { abCreateGettext } from "@appsbd/vue3-appsbd-ui";
10
+ import translations from "./translations.json";
11
+
12
+ const gettext = abCreateGettext({
13
+ availableLanguages: { en_US: "English", bn_BD: "Bengali" },
14
+ defaultLanguage: "en_US",
15
+ translations,
16
+ });
17
+ app.use(gettext);
18
+
19
+ // Option 2 — manual registration
20
+ import { createGettext } from "vue3-gettext";
21
+ import { initTranslate } from "@appsbd/vue3-appsbd-ui";
22
+
23
+ const gettext = createGettext(options);
24
+ initTranslate(gettext);
9
25
  ```
10
26
 
11
27
  ## Usage
12
28
 
13
29
  ```javascript
14
- import { translateGettext, translateGetMsg } from "@vue3-appsbd-ui/libraries/abTranslate";
30
+ import { translateGettext, translateGetMsg } from "@appsbd/vue3-appsbd-ui";
15
31
 
16
- // Simple translation
17
- const greeting = translateGettext("Hello World");
32
+ // Translates the base string AND each param value
33
+ translateGettext("Welcome %{name}", { name: "Admin" });
34
+ // → "স্বাগতম প্রশাসক" (if both strings are translated)
18
35
 
19
- // Translation with interpolation (assuming vue3-gettext translates "Welcome %{name}")
20
- const welcome = translateGettext("Welcome %{name}", { name: "John" });
21
-
22
- // Only interpolates without translating the base string
23
- const msg = translateGetMsg("Error code: %{code}", { code: "404" });
36
+ // Interpolates only does NOT translate anything
37
+ translateGetMsg("Error code: %{code}", { code: "404" });
38
+ // → "Error code: 404"
24
39
  ```
25
40
 
26
41
  ## API Reference
27
42
 
28
43
  | Export | Signature | Description |
29
- |---|---|---|
30
- | `initTranslate(gettextInstance)` | `Function` | Registers the global gettext instance to be used outside of Vue components. |
44
+ | --- | --- | --- |
31
45
  | `abCreateGettext(options)` | `Function` | Creates a gettext instance and auto-registers it via `initTranslate`. |
32
- | `translateGettext(msg, params)` | `Function` | Translates a string `msg` and interpolates any variables provided in `params` object. |
33
- | `translateGetMsg(msg, params)` | `Function` | Interpolates the `params` into `msg` but does not translate the base string. |
46
+ | `initTranslate(gettextInstance)` | `Function` | Registers an existing gettext instance for use outside Vue components. |
47
+ | `translateGettext(msg, params)` | `Function` | Translates `msg` and interpolates `params`; also translates param values. |
48
+ | `translateGetMsg(msg, params)` | `Function` | Interpolates `params` into `msg` without translating. |
@@ -1,42 +1,33 @@
1
- # abVeeRules (Library)
2
-
3
- A collection of pre-configured VeeValidate validation rules integrated with localization via `abTranslate`.
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- These rules are typically used internally by the library's `AbField` or form components, but can be imported and registered globally if needed.
14
-
15
- ```javascript
16
- import { abAllRules } from "@vue3-appsbd-ui/libraries/abVeeRules";
17
- import { defineRule } from "vee-validate";
18
-
19
- // Register all custom library rules manually if needed
20
- Object.keys(abAllRules).forEach(rule => {
21
- defineRule(rule, abAllRules[rule]);
22
- });
23
- ```
24
-
25
- ## API Reference
26
-
27
- ### `abAllRules` Object
28
-
29
- An object containing validation functions conforming to VeeValidate's custom rule signature `(value, params, field)`.
30
-
31
- Included rules:
32
- - `required`: Returns translated `%{fld_name} is required`.
33
- - `numeric`: Returns translated `%{fld_name} should be numeric`.
34
- - `email`: Returns translated `%{fld_name} not a valid email address`.
35
- - `min`: Native min validation.
36
- - `min_value`: Returns translated `%{fld_name} should be more than X`.
37
- - `max`: Native max validation.
38
- - `max_value`: Returns translated `%{fld_name} should be less than X`.
39
- - `confirmed`: Checks password confirmation match.
40
- - `url`: Validates URL format.
41
- - `isUnique`: Custom stub for async uniqueness check.
42
- - `isValid`: Custom stub for async validity check.
1
+ # abVeeRules (Library)
2
+
3
+ Pre-configured VeeValidate validation rules integrated with localization via `abTranslate`.
4
+
5
+ ## Usage
6
+
7
+ ```javascript
8
+ import { abAllRules } from "@vue3-appsbd-ui/libraries/abVeeRules";
9
+ import { defineRule } from "vee-validate";
10
+
11
+ Object.keys(abAllRules).forEach(rule => {
12
+ defineRule(rule, abAllRules[rule]);
13
+ });
14
+ ```
15
+
16
+ ## API Reference
17
+
18
+ ### `abAllRules` Object
19
+
20
+ Validation functions conforming to VeeValidate's custom rule signature `(value, params, field)`.
21
+
22
+ Included rules:
23
+ - `required`: Returns translated `%{fld_name} is required`.
24
+ - `numeric`: Returns translated `%{fld_name} should be numeric`.
25
+ - `email`: Returns translated `%{fld_name} not a valid email address`.
26
+ - `min`: Native min validation.
27
+ - `min_value`: Returns translated `%{fld_name} should be more than X`.
28
+ - `max`: Native max validation.
29
+ - `max_value`: Returns translated `%{fld_name} should be less than X`.
30
+ - `confirmed`: Checks password confirmation match.
31
+ - `url`: Validates URL format.
32
+ - `isUnique`: Custom stub for async uniqueness check.
33
+ - `isValid`: Custom stub for async validity check.
@@ -1,10 +1,8 @@
1
1
  # Global UI Configuration (`AppsbdUIConfigure`)
2
2
 
3
- **Purpose**: Configure library-wide locale and formatting defaults (like month names, digits, range separator) so every instance of a library component renders consistently without needing manual prop wiring.
3
+ Call `AppsbdUIConfigure` once during app initialization to set library-wide locale and formatting defaults. Components follow a strict "prop > global config > built-in default" resolution order.
4
4
 
5
- ## Installation / Usage
6
-
7
- Call `AppsbdUIConfigure` once during your app initialization (e.g., in `main.js`, or when a locale dynamically changes).
5
+ ## Usage
8
6
 
9
7
  ```javascript
10
8
  import { AppsbdUIConfigure } from "@vue3-appsbd-ui";
@@ -12,14 +10,8 @@ import { AppsbdUIConfigure } from "@vue3-appsbd-ui";
12
10
  const banglaDigits = ["০", "১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯"];
13
11
 
14
12
  AppsbdUIConfigure({
15
- monthNames: [
16
- "জানুয়ারি", "ফেব্রুয়ারি", "মার্চ", "এপ্রিল", "মে", "জুন",
17
- "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"
18
- ],
19
- monthNamesShort: [
20
- "জানু", "ফেব্রু", "মার্চ", "এপ্রি", "মে", "জুন",
21
- "জুলাই", "আগস্ট", "সেপ্টে", "অক্টো", "নভে", "ডিসে"
22
- ],
13
+ monthNames: ["জানুয়ারি", "ফেব্রুয়ারি", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"],
14
+ monthNamesShort: ["জানু", "ফেব্রু", "মার্চ", "এপ্রি", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টে", "অক্টো", "নভে", "ডিসে"],
23
15
  dayNames: ["শনি", "রবি", "সোম", "মঙ্গল", "বুধ", "বৃহঃ", "শুক্র"],
24
16
  formatDigit: (val) => String(val).replace(/\d/g, (d) => banglaDigits[d]),
25
17
  is24Hour: false,
@@ -40,7 +32,7 @@ AppsbdUIConfigure({
40
32
  | `monthNames` | `String[]` | English full names | Array of 12 full month names. |
41
33
  | `monthNamesShort` | `String[]` | English short names | Array of 12 short month names. |
42
34
  | `dayNames` | `String[]` | English 3-letter names | Array of 7 short day names (Sat-first). |
43
- | `formatDigit` | `Function` | `(val) => String(val)` | Function to format digits. Applied dynamically to `AbNumberField` (display-only) and `AbDateTimePicker`. |
35
+ | `formatDigit` | `Function` | `(val) => String(val)` | Digit formatter applied to `AbNumberField` (display-only) and `AbDateTimePicker`. |
44
36
  | `rangeSeparator` | `String` | `' ↔ '` | Separator for date ranges in `AbDateTimePicker`. |
45
37
  | `is24Hour` | `Boolean` | `false` | Whether to use 24-hour format in `AbDateTimePicker`. |
46
38
  | `dateDataFormat` | `String` | `'YYYY-MM-DD'` | Global format for date data. |
@@ -60,7 +52,5 @@ AppsbdUIConfigure({
60
52
  | `trueValue` | `any` | `'Y'` | Default true value for toggles/switches. |
61
53
  | `falseValue` | `any` | `'N'` | Default false value for toggles/switches. |
62
54
  | `size` | `String` | `'md'` | Global size for components. |
63
-
64
- ## Precedence Rule
65
-
66
- Components follow a strict "prop > global config > built-in default" resolution order. For example, if you pass `:is-24-hour="true"` directly to an `<AbDateTimePicker>`, it will override the global config setting for that specific instance.
55
+ | `iconPosition` | `String` | `'right'` | Global default icon position (`left`, `right`). |
56
+ | `isModalBorder` | `Boolean` | `true` | Global default modal border. |
@@ -1,63 +1,45 @@
1
- # useAlert (Composable)
2
-
3
- Provides a procedural API to trigger modal alerts, notifications, and confirmations using the global `$alert` instance.
4
-
5
- ## Installation
6
-
7
- Ensure the library is installed:
8
-
9
- ```javascript
10
- npm install @vue3-appsbd-ui
11
- ```
12
-
13
- ## Usage
14
-
15
- Import the composable in your `<script setup>` and call it. The `alert` function returns a Promise that resolves when the user dismisses or confirms the dialog.
16
-
17
- ```html
18
- <script setup>
19
- import { useAlert } from "@vue3-appsbd-ui";
20
-
21
- const { alert } = useAlert();
22
-
23
- async function handleAction() {
24
- const result = await alert({
25
- type: "confirm",
26
- title: "Delete item?",
27
- message: "Are you sure you want to delete this?",
28
- icon: "warning",
29
- confirmText: "Yes, delete",
30
- cancelText: "Cancel"
31
- });
32
-
33
- if (result) {
34
- // User confirmed
35
- }
36
- }
37
- </script>
38
-
39
- <template>
40
- <button @click="handleAction">Delete</button>
41
- </template>
42
- ```
43
-
44
- ## API Reference
45
-
46
- ### `alert(options)`
47
-
48
- The `alert` method accepts an options object to configure the dialog.
49
-
50
- **Options**
51
-
52
- | Property | Type | Default | Description |
53
- |---|---|---|---|
54
- | `type` | `string` | `"alert"` | Variant: `"alert"`, `"confirm"`, or `"confirm-ajax"`. |
55
- | `title` | `string` | - | Headline text for the dialog. |
56
- | `message` | `string` | - | Detailed body text. |
57
- | `icon` | `string` | - | Status icon: `"success"`, `"error"`, `"warning"`, `"info"`, `"question"`. |
58
- | `variation` | `string` | `"default"` | Visual style: `"default"`, `"modern"`, `"minimal"`, `"top-color-bar"`. |
59
- | `size` | `string` | `"md"` | Width limit: `"sm"`, `"md"`, `"lg"`, `"xl"`, `"auto"`. |
60
- | `confirmText`| `string` | `"OK"` | Label for the primary accept button. |
61
- | `cancelText` | `string` | `"Cancel"` | Label for the cancel/decline button. |
62
- | `onConfirm` | `Function` | - | Async callback executed when accepting a `"confirm-ajax"` modal. |
63
- | `timer` | `number` | - | Auto-close timer in milliseconds (only for `"alert"` type). |
1
+ # useAlert (Composable)
2
+
3
+ Provides a procedural API to trigger modal alerts, notifications, and confirmations using the global `$alert` instance.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <script setup>
9
+ import { useAlert } from "@vue3-appsbd-ui";
10
+
11
+ const { alert } = useAlert();
12
+
13
+ async function handleAction() {
14
+ const result = await alert({
15
+ type: "confirm",
16
+ title: "Delete item?",
17
+ message: "Are you sure you want to delete this?",
18
+ icon: "warning",
19
+ confirmText: "Yes, delete",
20
+ cancelText: "Cancel"
21
+ });
22
+
23
+ if (result) {
24
+ // User confirmed
25
+ }
26
+ }
27
+ </script>
28
+ ```
29
+
30
+ ## API Reference
31
+
32
+ ### `alert(options)`
33
+
34
+ | Property | Type | Default | Description |
35
+ |---|---|---|---|
36
+ | `type` | `string` | `"alert"` | Variant: `"alert"`, `"confirm"`, or `"confirm-ajax"`. |
37
+ | `title` | `string` | - | Headline text for the dialog. |
38
+ | `message` | `string` | - | Detailed body text. |
39
+ | `icon` | `string` | - | Status icon: `"success"`, `"error"`, `"warning"`, `"info"`, `"question"`. |
40
+ | `variation` | `string` | `"default"` | Visual style: `"default"`, `"modern"`, `"minimal"`, `"top-color-bar"`. |
41
+ | `size` | `string` | `"md"` | Width limit: `"sm"`, `"md"`, `"lg"`, `"xl"`, `"auto"`. |
42
+ | `confirmText` | `string` | `"OK"` | Label for the primary accept button. |
43
+ | `cancelText` | `string` | `"Cancel"` | Label for the cancel/decline button. |
44
+ | `onConfirm` | `Function` | - | Async callback executed when accepting a `"confirm-ajax"` modal. |
45
+ | `timer` | `number` | - | Auto-close timer in milliseconds (only for `"alert"` type). |
@@ -1,46 +1,31 @@
1
- # useFileValidator (Composable)
2
-
3
- Provides file validation utilities to check file extensions, MIME types, and file sizes. Automatically spawns error toasts if validation fails, and returns a structured file object with icon metadata for UI display.
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <script setup>
15
- import { useFileValidator } from "@vue3-appsbd-ui";
16
-
17
- const { getFileInfo, getFileIconByExt } = useFileValidator();
18
-
19
- function handleFileUpload(event) {
20
- const file = event.target.files[0];
21
- if (!file) return;
22
-
23
- // Validates if file is <= 2.0 MB and is a supported type
24
- const validatedFile = getFileInfo(file, 2.0);
25
-
26
- if (validatedFile) {
27
- console.log("File is valid!", validatedFile);
28
- // validatedFile.isImage
29
- // validatedFile.fileIcon
30
- }
31
- }
32
- </script>
33
-
34
- <template>
35
- <input type="file" @change="handleFileUpload" />
36
- </template>
37
- ```
38
-
39
- ## API Reference
40
-
41
- ### Returned Methods
42
-
43
- | Method | Signature | Description |
44
- |---|---|---|
45
- | `getFileInfo(file, sizeLimitMb)` | `Function` | Validates a `File` object against allowed MIME types and max size (`sizeLimitMb`, default `1.0`). If invalid, spawns a toast error and returns `null`. If valid, returns the `file` object augmented with `isImage` and `fileIcon` properties. |
46
- | `getFileIconByExt(ext, type)` | `Function` | Returns an object `{ isImage: boolean, fileIcon: Component\|String }` based on the file extension and MIME type. Uses `lucide-vue-next` icons for known formats (pdf, zip, doc, xls, ppt, mp4). |
1
+ # useFileValidator (Composable)
2
+
3
+ Provides file validation utilities to check extensions, MIME types, and file sizes. Automatically spawns error toasts on validation failure and returns a structured file object with icon metadata.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <script setup>
9
+ import { useFileValidator } from "@vue3-appsbd-ui";
10
+
11
+ const { getFileInfo, getFileIconByExt } = useFileValidator();
12
+
13
+ function handleFileUpload(event) {
14
+ const file = event.target.files[0];
15
+ if (!file) return;
16
+
17
+ const validatedFile = getFileInfo(file, 2.0);
18
+ if (validatedFile) {
19
+ // validatedFile.isImage
20
+ // validatedFile.fileIcon
21
+ }
22
+ }
23
+ </script>
24
+ ```
25
+
26
+ ## API Reference
27
+
28
+ | Method | Signature | Description |
29
+ |---|---|---|
30
+ | `getFileInfo(file, sizeLimitMb)` | `Function` | Validates a `File` object against allowed MIME types and max size (`sizeLimitMb`, default `1.0`). If invalid, spawns a toast error and returns `null`. If valid, returns the `file` augmented with `isImage` and `fileIcon` properties. |
31
+ | `getFileIconByExt(ext, type)` | `Function` | Returns `{ isImage: boolean, fileIcon: Component\|String }` based on file extension and MIME type. Uses `lucide-vue-next` icons for known formats (pdf, zip, doc, xls, ppt, mp4). |
@@ -1,55 +1,41 @@
1
- # useResponsive (Composable)
2
-
3
- A Vue 3 composable that tracks the browser viewport width in real-time and exposes reactive helpers for responsive layout decisions. Aligned with Bootstrap 5 breakpoints.
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <script setup>
15
- import { useResponsive } from "@vue3-appsbd-ui";
16
-
17
- // Track screen size dynamically
18
- const { ScreenWidth, ScreenType, isUptoTab } = useResponsive();
19
-
20
- // Or provide a custom tablet max-width threshold in pixels
21
- // const { isUptoTab } = useResponsive({ tabMaxWidth: 900 });
22
- </script>
23
-
24
- <template>
25
- <div>
26
- <p>Current Width: {{ ScreenWidth }}px</p>
27
- <p>Breakpoint: {{ ScreenType }}</p>
28
-
29
- <div v-if="isUptoTab">
30
- Showing Mobile / Tablet Layout
31
- </div>
32
- <div v-else>
33
- Showing Desktop Layout
34
- </div>
35
- </div>
36
- </template>
37
- ```
38
-
39
- ## API Reference
40
-
41
- ### `useResponsive(options)`
42
-
43
- **Options**
44
-
45
- | Property | Type | Default | Description |
46
- |---|---|---|---|
47
- | `tabMaxWidth` | `number` | `0` | Custom max-width (px) to treat as "up-to tab". When `> 0`, screens at or below this width are considered tablet-sized regardless of breakpoint. |
48
-
49
- **Returned Properties**
50
-
51
- | Property | Type | Description |
52
- |---|---|---|
53
- | `ScreenWidth` | `ComputedRef<number>` | Raw viewport width in pixels. |
54
- | `ScreenType` | `ComputedRef<string>` | Current Bootstrap-style breakpoint (`'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'xxl'`). |
55
- | `isUptoTab` | `ComputedRef<boolean>` | `true` when the viewport is tablet-sized or smaller (`xs`, `sm`, or `<=` `tabMaxWidth`). |
1
+ # useResponsive (Composable)
2
+
3
+ Tracks browser viewport width in real-time with reactive helpers for responsive layout decisions, aligned with Bootstrap 5 breakpoints.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <script setup>
9
+ import { useResponsive } from "@vue3-appsbd-ui";
10
+
11
+ const { ScreenWidth, ScreenType, isUptoTab } = useResponsive();
12
+ // Or with custom tablet threshold:
13
+ // const { isUptoTab } = useResponsive({ tabMaxWidth: 900 });
14
+ </script>
15
+
16
+ <template>
17
+ <div>
18
+ <p>Current Width: {{ ScreenWidth }}px Breakpoint: {{ ScreenType }}</p>
19
+ <div v-if="isUptoTab">Mobile / Tablet Layout</div>
20
+ <div v-else>Desktop Layout</div>
21
+ </div>
22
+ </template>
23
+ ```
24
+
25
+ ## API Reference
26
+
27
+ ### `useResponsive(options)`
28
+
29
+ **Options**
30
+
31
+ | Property | Type | Default | Description |
32
+ |---|---|---|---|
33
+ | `tabMaxWidth` | `number` | `0` | Custom max-width (px) to treat as "up-to tab". When `> 0`, screens at or below this width are considered tablet-sized regardless of breakpoint. |
34
+
35
+ **Returned Properties**
36
+
37
+ | Property | Type | Description |
38
+ |---|---|---|
39
+ | `ScreenWidth` | `ComputedRef<number>` | Raw viewport width in pixels. |
40
+ | `ScreenType` | `ComputedRef<string>` | Current Bootstrap-style breakpoint (`'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'xxl'`). |
41
+ | `isUptoTab` | `ComputedRef<boolean>` | `true` when viewport is tablet-sized or smaller (`xs`, `sm`, or `<=` `tabMaxWidth`). |
@@ -1,39 +1,28 @@
1
- # useTheme (Composable)
2
-
3
- A Vue composable that handles light and dark theme toggling, stores the user's preference in `localStorage`, and reacts to system theme changes (`prefers-color-scheme: dark`).
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <script setup>
15
- import { useTheme } from "@vue3-appsbd-ui";
16
-
17
- const { theme, toggleTheme, applyTheme } = useTheme();
18
-
19
- // Manually switch to 'dark' or 'light'
20
- // applyTheme('dark');
21
- </script>
22
-
23
- <template>
24
- <div>
25
- <p>Current Theme: {{ theme }}</p>
26
- <button @click="toggleTheme">Toggle Theme</button>
27
- </div>
28
- </template>
29
- ```
30
-
31
- ## API Reference
32
-
33
- ### Returned Properties & Methods
34
-
35
- | Name | Type | Description |
36
- |---|---|---|
37
- | `theme` | `Ref<string>` | A reactive reference containing the current theme (`'light'` or `'dark'`). |
38
- | `toggleTheme` | `Function` | Toggles the current theme between `'light'` and `'dark'`, updates the DOM (`data-bs-theme`), and saves to `localStorage`. |
39
- | `applyTheme(value)` | `Function` | Explicitly sets the theme to the provided `value` (`'light'` or `'dark'`). |
1
+ # useTheme (Composable)
2
+
3
+ Handles light/dark theme toggling, stores preference in `localStorage`, and reacts to system `prefers-color-scheme: dark` changes.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <script setup>
9
+ import { useTheme } from "@vue3-appsbd-ui";
10
+
11
+ const { theme, toggleTheme, applyTheme } = useTheme();
12
+ </script>
13
+
14
+ <template>
15
+ <div>
16
+ <p>Current Theme: {{ theme }}</p>
17
+ <button @click="toggleTheme">Toggle Theme</button>
18
+ </div>
19
+ </template>
20
+ ```
21
+
22
+ ## API Reference
23
+
24
+ | Name | Type | Description |
25
+ |---|---|---|
26
+ | `theme` | `Ref<string>` | Reactive current theme (`'light'` or `'dark'`). |
27
+ | `toggleTheme` | `Function` | Toggles between `'light'` and `'dark'`, updates the DOM (`data-bs-theme`), and saves to `localStorage`. |
28
+ | `applyTheme(value)` | `Function` | Explicitly sets the theme to `'light'` or `'dark'`. |