@appsbd/vue3-appsbd-ui 1.0.3 → 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.
- package/.ai/ai_ref_AbAvatar.md +1 -11
- package/.ai/ai_ref_AbBadge.md +2 -11
- package/.ai/ai_ref_AbButton.md +4 -23
- package/.ai/ai_ref_AbCard.md +6 -25
- package/.ai/ai_ref_AbCarousel.md +1 -12
- package/.ai/ai_ref_AbChart.md +16 -57
- package/.ai/ai_ref_AbColorPicker.md +1 -14
- package/.ai/ai_ref_AbConfirmPopover.md +1 -6
- package/.ai/ai_ref_AbCustomField.md +1 -9
- package/.ai/ai_ref_AbDarkModeToggler.md +1 -10
- package/.ai/ai_ref_AbDateTimePicker.md +4 -38
- package/.ai/ai_ref_AbEasyModal.md +2 -8
- package/.ai/ai_ref_AbField.md +1 -9
- package/.ai/ai_ref_AbFileUploader.md +3 -19
- package/.ai/ai_ref_AbFilterPanel.md +0 -4
- package/.ai/ai_ref_AbFormCheck.md +2 -19
- package/.ai/ai_ref_AbImageRadioInput.md +1 -9
- package/.ai/ai_ref_AbInputField.md +1 -9
- package/.ai/ai_ref_AbInputTag.md +2 -22
- package/.ai/ai_ref_AbKbd.md +0 -12
- package/.ai/ai_ref_AbKbdGroup.md +1 -13
- package/.ai/ai_ref_AbModal.md +98 -103
- package/.ai/ai_ref_AbMultiSelect.md +3 -37
- package/.ai/ai_ref_AbNumberField.md +5 -30
- package/.ai/ai_ref_AbPinInput.md +1 -13
- package/.ai/ai_ref_AbPopover.md +2 -12
- package/.ai/ai_ref_AbPricingCard.md +0 -8
- package/.ai/ai_ref_AbPricingContainer.md +0 -8
- package/.ai/ai_ref_AbPricingTable.md +20 -36
- package/.ai/ai_ref_AbProgressbar.md +1 -11
- package/.ai/ai_ref_AbScrollbar.md +2 -12
- package/.ai/ai_ref_AbSettingsForm.md +1 -9
- package/.ai/ai_ref_AbSideMenuItem.md +1 -12
- package/.ai/ai_ref_AbSidebar.md +2 -10
- package/.ai/ai_ref_AbSkeleton.md +0 -18
- package/.ai/ai_ref_AbSlider.md +1 -20
- package/.ai/ai_ref_AbTab.md +0 -8
- package/.ai/ai_ref_AbTable.md +0 -10
- package/.ai/ai_ref_AbTabs.md +1 -11
- package/.ai/ai_ref_AbToggle.md +4 -23
- package/.ai/ai_ref_AbTooltip.md +1 -15
- package/.ai/ai_ref_AbWizard.md +7 -20
- package/.ai/ai_ref_AbWizardStep.md +1 -13
- package/.ai/ai_ref_abEventBus.md +66 -94
- package/.ai/ai_ref_abRequestParam.md +40 -55
- package/.ai/ai_ref_abTranslate.md +30 -15
- package/.ai/ai_ref_abVeeRules.md +33 -42
- package/.ai/ai_ref_global_config.md +7 -17
- package/.ai/ai_ref_useAlert.md +45 -63
- package/.ai/ai_ref_useFileValidator.md +31 -46
- package/.ai/ai_ref_useResponsive.md +41 -55
- package/.ai/ai_ref_useTheme.md +28 -39
- package/.ai/ai_ref_useToast.md +30 -42
- package/AI_REF.md +114 -0
- package/AI_REFERENCE.md +82 -1153
- package/dist/skins/black.css +1 -1
- package/dist/skins/cyan.css +1 -1
- package/dist/skins/default.css +1 -1
- package/dist/skins/gray.css +1 -1
- package/dist/skins/green.css +1 -1
- package/dist/skins/orange.css +1 -1
- package/dist/skins/pink.css +1 -1
- package/dist/skins/purple.css +1 -1
- package/dist/skins/red.css +1 -1
- package/dist/skins/themes/_blue.scss +35 -35
- package/dist/skins/themes/_common_variable.scss +101 -6
- package/dist/skins/themes/_cyan.scss +1 -1
- package/dist/skins/themes/_gray.scss +2 -1
- package/dist/skins/themes/_green.scss +1 -1
- package/dist/skins/themes/_grid.scss +4 -1
- package/dist/skins/themes/_orange.scss +1 -1
- package/dist/skins/themes/_pink.scss +1 -1
- package/dist/skins/themes/_purple.scss +1 -1
- package/dist/skins/themes/_red.scss +1 -1
- package/dist/skins/themes/_violet.scss +1 -1
- package/dist/skins/violet.css +1 -1
- package/dist/style.css +1 -1
- package/dist/vue3-appsbd-ui.cjs.js +93 -61
- package/dist/vue3-appsbd-ui.es.js +26869 -17342
- package/package.json +7 -1
- package/readme.md +59 -1
- package/scripts/postinstall.js +55 -0
- package/scripts/setup.js +16 -0
- package/scripts/skill-groups.js +38 -0
- package/skills/commands/generate-module.md +76 -0
- package/skills/commands/settings-form.md +175 -0
- package/skills/commands/use-appsbd-ui.md +40 -0
|
@@ -1,55 +1,40 @@
|
|
|
1
|
-
# abRequestParam (Library)
|
|
2
|
-
|
|
3
|
-
Data-transfer classes
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```javascript
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
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
|
-
|
|
3
|
+
Localization utility wrapping `vue3-gettext`. Exposes `translateGettext` (translates + interpolates) and `translateGetMsg` (interpolates only).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Setup
|
|
6
6
|
|
|
7
7
|
```javascript
|
|
8
|
-
|
|
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
|
|
30
|
+
import { translateGettext, translateGetMsg } from "@appsbd/vue3-appsbd-ui";
|
|
15
31
|
|
|
16
|
-
//
|
|
17
|
-
|
|
32
|
+
// Translates the base string AND each param value
|
|
33
|
+
translateGettext("Welcome %{name}", { name: "Admin" });
|
|
34
|
+
// → "স্বাগতম প্রশাসক" (if both strings are translated)
|
|
18
35
|
|
|
19
|
-
//
|
|
20
|
-
|
|
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
|
-
| `
|
|
33
|
-
| `
|
|
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. |
|
package/.ai/ai_ref_abVeeRules.md
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
# abVeeRules (Library)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```javascript
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
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
|
-
|
|
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
|
-
##
|
|
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)` |
|
|
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
|
-
|
|
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. |
|
package/.ai/ai_ref_useAlert.md
CHANGED
|
@@ -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
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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`). |
|
package/.ai/ai_ref_useTheme.md
CHANGED
|
@@ -1,39 +1,28 @@
|
|
|
1
|
-
# useTheme (Composable)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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'`. |
|