@appsbd/vue3-appsbd-ui 1.0.3 → 1.0.5

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 (100) hide show
  1. package/.ai/ai_ref_AbAvatar.md +41 -51
  2. package/.ai/ai_ref_AbBadge.md +36 -45
  3. package/.ai/ai_ref_AbButton.md +52 -70
  4. package/.ai/ai_ref_AbCard.md +51 -70
  5. package/.ai/ai_ref_AbCarousel.md +36 -47
  6. package/.ai/ai_ref_AbChart.md +46 -87
  7. package/.ai/ai_ref_AbColorPicker.md +42 -55
  8. package/.ai/ai_ref_AbConfirmPopover.md +54 -59
  9. package/.ai/ai_ref_AbCustomField.md +66 -74
  10. package/.ai/ai_ref_AbDarkModeToggler.md +33 -42
  11. package/.ai/ai_ref_AbDateTimePicker.md +74 -108
  12. package/.ai/ai_ref_AbEasyModal.md +56 -62
  13. package/.ai/ai_ref_AbField.md +88 -96
  14. package/.ai/ai_ref_AbFileUploader.md +47 -63
  15. package/.ai/ai_ref_AbFilterPanel.md +67 -71
  16. package/.ai/ai_ref_AbFormCheck.md +58 -75
  17. package/.ai/ai_ref_AbImageRadioInput.md +55 -63
  18. package/.ai/ai_ref_AbInputField.md +66 -74
  19. package/.ai/ai_ref_AbInputTag.md +56 -76
  20. package/.ai/ai_ref_AbKbd.md +23 -35
  21. package/.ai/ai_ref_AbKbdGroup.md +21 -33
  22. package/.ai/ai_ref_AbMainLayout.md +106 -0
  23. package/.ai/ai_ref_AbModal.md +98 -103
  24. package/.ai/ai_ref_AbMultiSelect.md +78 -112
  25. package/.ai/ai_ref_AbNumberField.md +59 -84
  26. package/.ai/ai_ref_AbPinInput.md +33 -45
  27. package/.ai/ai_ref_AbPopover.md +54 -64
  28. package/.ai/ai_ref_AbPricingCard.md +56 -64
  29. package/.ai/ai_ref_AbPricingContainer.md +41 -49
  30. package/.ai/ai_ref_AbPricingTable.md +56 -72
  31. package/.ai/ai_ref_AbProgressbar.md +34 -44
  32. package/.ai/ai_ref_AbScrollbar.md +38 -48
  33. package/.ai/ai_ref_AbSettingsForm.md +46 -54
  34. package/.ai/ai_ref_AbSideMenuItem.md +47 -58
  35. package/.ai/ai_ref_AbSidebar.md +62 -70
  36. package/.ai/ai_ref_AbSkeleton.md +23 -41
  37. package/.ai/ai_ref_AbSlider.md +52 -71
  38. package/.ai/ai_ref_AbTab.md +30 -38
  39. package/.ai/ai_ref_AbTable.md +49 -59
  40. package/.ai/ai_ref_AbTabs.md +37 -47
  41. package/.ai/ai_ref_AbToggle.md +46 -65
  42. package/.ai/ai_ref_AbTooltip.md +39 -53
  43. package/.ai/ai_ref_AbWizard.md +64 -77
  44. package/.ai/ai_ref_AbWizardStep.md +36 -48
  45. package/.ai/ai_ref_abEventBus.md +9 -37
  46. package/.ai/ai_ref_abRequestParam.md +2 -17
  47. package/.ai/ai_ref_abTranslate.md +30 -15
  48. package/.ai/ai_ref_abVeeRules.md +2 -11
  49. package/.ai/ai_ref_global_config.md +57 -66
  50. package/.ai/ai_ref_useAlert.md +7 -20
  51. package/.ai/ai_ref_useFileValidator.md +3 -18
  52. package/.ai/ai_ref_useResponsive.md +6 -20
  53. package/.ai/ai_ref_useTheme.md +4 -15
  54. package/.ai/ai_ref_useToast.md +5 -17
  55. package/AI_REF.md +114 -0
  56. package/AI_REFERENCE.md +87 -1157
  57. package/design-system.md +403 -403
  58. package/dist/skins/black.css +1 -1
  59. package/dist/skins/black.scss +3 -3
  60. package/dist/skins/cyan.css +1 -1
  61. package/dist/skins/cyan.scss +3 -3
  62. package/dist/skins/default.css +1 -1
  63. package/dist/skins/default.scss +5 -5
  64. package/dist/skins/gray.css +1 -1
  65. package/dist/skins/gray.scss +3 -3
  66. package/dist/skins/green.css +1 -1
  67. package/dist/skins/green.scss +5 -5
  68. package/dist/skins/orange.css +1 -1
  69. package/dist/skins/orange.scss +3 -3
  70. package/dist/skins/pink.css +1 -1
  71. package/dist/skins/pink.scss +3 -3
  72. package/dist/skins/purple.css +1 -1
  73. package/dist/skins/purple.scss +3 -3
  74. package/dist/skins/red.css +1 -1
  75. package/dist/skins/red.scss +3 -3
  76. package/dist/skins/themes/_black.scss +18 -6
  77. package/dist/skins/themes/_blue.scss +18 -43
  78. package/dist/skins/themes/_common_variable.scss +695 -590
  79. package/dist/skins/themes/_cyan.scss +18 -6
  80. package/dist/skins/themes/_gray.scss +18 -6
  81. package/dist/skins/themes/_green.scss +18 -6
  82. package/dist/skins/themes/_grid.scss +32 -27
  83. package/dist/skins/themes/_orange.scss +18 -6
  84. package/dist/skins/themes/_pink.scss +18 -6
  85. package/dist/skins/themes/_purple.scss +18 -6
  86. package/dist/skins/themes/_red.scss +18 -6
  87. package/dist/skins/themes/_violet.scss +18 -6
  88. package/dist/skins/violet.css +1 -1
  89. package/dist/skins/violet.scss +3 -3
  90. package/dist/style.css +1 -1
  91. package/dist/vue3-appsbd-ui.cjs.js +145 -125
  92. package/dist/vue3-appsbd-ui.es.js +27822 -16778
  93. package/package.json +72 -66
  94. package/readme.md +194 -136
  95. package/scripts/postinstall.js +55 -0
  96. package/scripts/setup.js +16 -0
  97. package/scripts/skill-groups.js +38 -0
  98. package/skills/commands/generate-module.md +76 -0
  99. package/skills/commands/settings-form.md +175 -0
  100. package/skills/commands/use-appsbd-ui.md +40 -0
@@ -1,53 +1,39 @@
1
- # AbTooltip — AI Reference
2
-
3
- Programmatic tooltip component. Complements the `v-tooltip` directive — use this when you need slot-driven rich content or interactive tooltips.
4
-
5
- ## Installation
6
-
7
- Globally registered by the plugin.
8
-
9
- ## Usage
10
-
11
- ```vue
12
- <template>
13
- <!-- Simple -->
14
- <ab-tooltip content="Save changes" placement="top">
15
- <ab-button class="btn-primary"><i class="bi bi-save"></i></ab-button>
16
- </ab-tooltip>
17
-
18
- <!-- Rich content -->
19
- <ab-tooltip placement="bottom" interactive>
20
- <ab-button class="btn-outline-secondary">Info</ab-button>
21
- <template #content>
22
- <strong>Pro tip</strong>
23
- <p>Press <ab-kbd>⌘</ab-kbd> + <ab-kbd>S</ab-kbd> to save.</p>
24
- </template>
25
- </ab-tooltip>
26
- </template>
27
- ```
28
-
29
- ## Props
30
-
31
- | Name | Type | Default | Description |
32
- | --- | --- | --- | --- |
33
- | `content` | `String` | `""` | Tooltip text (used when `#content` slot is absent). |
34
- | `placement` | `String` | `"top"` | `top`, `bottom`, `left`, `right`, or `auto-*`. |
35
- | `offset` | `Number \| String` | `8` | Offset from the reference element. |
36
- | `disabled` | `Boolean` | `false` | Disable the tooltip. |
37
- | `arrow` | `Boolean` | `true` | Show the arrow pointer. |
38
- | `interactive` | `Boolean` | `false` | Allow hovering the tooltip without it hiding. |
39
-
40
- ## Events
41
-
42
- None.
43
-
44
- ## Slots
45
-
46
- | Name | Description |
47
- | --- | --- |
48
- | `default` | Trigger element. |
49
- | `content` | Tooltip body (overrides the `content` prop). |
50
-
51
- ## See also
52
-
53
- - `v-tooltip` directive for simple string hints (`<ab-button v-tooltip="'Hello'">`).
1
+ # AbTooltip — AI Reference
2
+
3
+ Programmatic tooltip component. Use when you need slot-driven rich content or interactive tooltips; use the `v-tooltip` directive for simple string hints.
4
+
5
+ ## Usage
6
+
7
+ ```vue
8
+ <template>
9
+ <ab-tooltip content="Save changes" placement="top">
10
+ <ab-button class="btn-primary"><i class="bi bi-save"></i></ab-button>
11
+ </ab-tooltip>
12
+
13
+ <ab-tooltip placement="bottom" interactive>
14
+ <ab-button class="btn-outline-secondary">Info</ab-button>
15
+ <template #content>
16
+ <strong>Pro tip</strong>
17
+ <p>Press <ab-kbd>⌘</ab-kbd> + <ab-kbd>S</ab-kbd> to save.</p>
18
+ </template>
19
+ </ab-tooltip>
20
+ </template>
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | Name | Type | Default | Description |
26
+ | --- | --- | --- | --- |
27
+ | `content` | `String` | `""` | Tooltip text (used when `#content` slot is absent). |
28
+ | `placement` | `String` | `"top"` | `top`, `bottom`, `left`, `right`, or `auto-*`. |
29
+ | `offset` | `Number \| String` | `8` | Offset from the reference element. |
30
+ | `disabled` | `Boolean` | `false` | Disable the tooltip. |
31
+ | `arrow` | `Boolean` | `true` | Show the arrow pointer. |
32
+ | `interactive` | `Boolean` | `false` | Allow hovering the tooltip without it hiding. |
33
+
34
+ ## Slots
35
+
36
+ | Name | Description |
37
+ | --- | --- |
38
+ | `default` | Trigger element. |
39
+ | `content` | Tooltip body (overrides the `content` prop). |
@@ -1,77 +1,64 @@
1
- # AbWizard — AI Reference
2
-
3
- Multi-step wizard container. Hosts `AbWizardStep` children, supports horizontal / vertical orientations, and multiple visual variants (including modal-rendered wizards).
4
-
5
- ## Installation
6
-
7
- Globally registered by the plugin.
8
-
9
- ## Usage
10
-
11
- ```vue
12
- <template>
13
- <ab-wizard
14
- orientation="horizontal"
15
- variant="circular"
16
- :before-next="handleBeforeNext"
17
- @finished="handleFinished"
18
- @step-changed="onStepChange"
19
- >
20
- <ab-wizard-step title="Account" description="Basic info">
21
- <!-- step content -->
22
- </ab-wizard-step>
23
-
24
- <ab-wizard-step title="Profile">
25
- <!-- step content -->
26
- </ab-wizard-step>
27
-
28
- <ab-wizard-step title="Confirm">
29
- <!-- step content -->
30
- </ab-wizard-step>
31
- </ab-wizard>
32
- </template>
33
-
34
- <script setup>
35
- async function handleBeforeNext(currentStepIndex) {
36
- // Return false to block navigation
37
- return true;
38
- }
39
- function handleFinished() { /* all steps done */ }
40
- function onStepChange(newIndex) { /* active step changed */ }
41
- </script>
42
- ```
43
-
44
- ## Props
45
-
46
- | Name | Type | Default | Description |
47
- | --- | --- | --- | --- |
48
- | `beforeNext` | `Function` | `async () => true` | Hook before moving forward; return `false` to cancel. |
49
- | `beforePrev` | `Function` | `async () => true` | Hook before moving back. |
50
- | `beforeFinish` | `Function` | `async () => true` | Hook before `finished` fires. |
51
- | `orientation` | `String` | `"horizontal"` | `horizontal` or `vertical`. |
52
- | `variant` | `String` | `"default"` | `default`, `circular`, `modal`, `circular-modal`, etc. |
53
- | `stepperSize` | `String` | `"md"` | `sm` or `md`. |
54
- | `hideControls` | `Boolean` | `false` | Hide the built-in next/prev buttons. |
55
- | `nextText` | `String` | `"Next"` | Next button label. |
56
- | `prevText` | `String` | `"Back"` | Previous button label. |
57
- | `finishText` | `String` | `"Finish"` | Finish button label. |
58
- | `disableClose` | `Boolean` | `false` | Disable the close button (modal variants). |
59
- | `modalClass` | `String` | `"modal-lg"` | Modal size class (modal variants only). |
60
-
61
- ## Events
62
-
63
- | Event | Payload | Description |
64
- | --- | --- | --- |
65
- | `finished` | — | User completed the final step. |
66
- | `step-changed` | `stepIndex` | Active step changed. |
67
-
68
- ## Slots
69
-
70
- | Name | Description |
71
- | --- | --- |
72
- | `default` | `<ab-wizard-step>` children. |
73
-
74
- ## Provides
75
-
76
- - `AbWizard` injection key for step registration.
77
- - `registerStepValidator(stepId, fn)` — used by `AbSettingsForm` to register per-step validators.
1
+ # AbWizard — AI Reference
2
+
3
+ Multi-step wizard container. Hosts `AbWizardStep` children, supports horizontal/vertical orientations, and multiple visual variants including modal-rendered wizards.
4
+
5
+ ## Usage
6
+
7
+ ```vue
8
+ <template>
9
+ <ab-wizard
10
+ orientation="horizontal"
11
+ variant="circular"
12
+ :before-next="handleBeforeNext"
13
+ @finished="handleFinished"
14
+ @step-changed="onStepChange"
15
+ >
16
+ <ab-wizard-step title="Account" description="Basic info"><!-- step content --></ab-wizard-step>
17
+ <ab-wizard-step title="Profile"><!-- step content --></ab-wizard-step>
18
+ <ab-wizard-step title="Confirm"><!-- step content --></ab-wizard-step>
19
+ </ab-wizard>
20
+ </template>
21
+
22
+ <script setup>
23
+ async function handleBeforeNext(currentStepIndex) {
24
+ return true; // return false to block navigation
25
+ }
26
+ function handleFinished() {}
27
+ function onStepChange(newIndex) {}
28
+ </script>
29
+ ```
30
+
31
+ ## Props
32
+
33
+ | Name | Type | Default | Description |
34
+ | --- | --- | --- | --- |
35
+ | `beforeNext` | `Function` | `async () => true` | Hook before moving forward; return `false` to cancel. |
36
+ | `beforePrev` | `Function` | `async () => true` | Hook before moving back. |
37
+ | `beforeFinish` | `Function` | `async () => true` | Hook before `finished` fires. |
38
+ | `orientation` | `String` | `"horizontal"` | `horizontal` or `vertical`. |
39
+ | `variant` | `String` | `"default"` | `default`, `circular`, `modal`, `circular-modal`, etc. |
40
+ | `stepperSize` | `String` | `"md"` | `sm` or `md`. |
41
+ | `hideControls` | `Boolean` | `false` | Hide the built-in next/prev buttons. |
42
+ | `nextText` | `String` | `"Next"` | Next button label. |
43
+ | `prevText` | `String` | `"Back"` | Previous button label. |
44
+ | `finishText` | `String` | `"Finish"` | Finish button label. |
45
+ | `disableClose` | `Boolean` | `false` | Disable the close button (modal variants). |
46
+ | `modalClass` | `String` | `"modal-lg"` | Modal size class (modal variants only). |
47
+
48
+ ## Events
49
+
50
+ | Event | Payload | Description |
51
+ | --- | --- | --- |
52
+ | `finished` | | User completed the final step. |
53
+ | `step-changed` | `stepIndex` | Active step changed. |
54
+
55
+ ## Slots
56
+
57
+ | Name | Description |
58
+ | --- | --- |
59
+ | `default` | `<ab-wizard-step>` children. |
60
+
61
+ ## Provides
62
+
63
+ - `AbWizard` injection key for step registration.
64
+ - `registerStepValidator(stepId, fn)` used by `AbSettingsForm` to register per-step validators.
@@ -1,48 +1,36 @@
1
- # AbWizardStep — AI Reference
2
-
3
- Single step inside an `AbWizard`. Declares its title, optional description, and an optional icon shown in the stepper.
4
-
5
- ## Installation
6
-
7
- Globally registered by the plugin.
8
-
9
- ## Usage
10
-
11
- ```vue
12
- <ab-wizard>
13
- <ab-wizard-step
14
- title="Account"
15
- description="Create your account"
16
- :icon="UserIcon"
17
- >
18
- <ab-input-field v-model="form.email" name="email" label="Email" rules="required|email" />
19
- </ab-wizard-step>
20
-
21
- <ab-wizard-step title="Confirm" disable-close>
22
- Ready to submit?
23
- </ab-wizard-step>
24
- </ab-wizard>
25
- ```
26
-
27
- ## Props
28
-
29
- | Name | Type | Default | Description |
30
- | --- | --- | --- | --- |
31
- | `title` | `String` | **required** | Step title shown in the stepper. |
32
- | `description` | `String` | `""` | Step description / subtitle. |
33
- | `icon` | `Object \| String \| Function` | `null` | Icon component, icon class string, or render function. |
34
- | `disableClose` | `Boolean` | `false` | Disable the close button while this step is active. |
35
-
36
- ## Events
37
-
38
- None.
39
-
40
- ## Slots
41
-
42
- | Name | Description |
43
- | --- | --- |
44
- | `default` | Step body content. |
45
-
46
- ## Provides
47
-
48
- An `AbWizardStep` injection key so children (e.g. `AbSettingsForm`) can register themselves as step validators.
1
+ # AbWizardStep — AI Reference
2
+
3
+ Single step inside an `AbWizard`. Declares its title, optional description, and an optional icon shown in the stepper.
4
+
5
+ ## Usage
6
+
7
+ ```vue
8
+ <ab-wizard>
9
+ <ab-wizard-step title="Account" description="Create your account" :icon="UserIcon">
10
+ <ab-input-field v-model="form.email" name="email" label="Email" rules="required|email" />
11
+ </ab-wizard-step>
12
+
13
+ <ab-wizard-step title="Confirm" disable-close>
14
+ Ready to submit?
15
+ </ab-wizard-step>
16
+ </ab-wizard>
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | Name | Type | Default | Description |
22
+ | --- | --- | --- | --- |
23
+ | `title` | `String` | **required** | Step title shown in the stepper. |
24
+ | `description` | `String` | `""` | Step description / subtitle. |
25
+ | `icon` | `Object \| String \| Function` | `null` | Icon component, icon class string, or render function. |
26
+ | `disableClose` | `Boolean` | `false` | Disable the close button while this step is active. |
27
+
28
+ ## Slots
29
+
30
+ | Name | Description |
31
+ | --- | --- |
32
+ | `default` | Step body content. |
33
+
34
+ ## Provides
35
+
36
+ An `AbWizardStep` injection key so children (e.g. `AbSettingsForm`) can register themselves as step validators.
@@ -1,77 +1,49 @@
1
1
  # abEventBus (abEmitter)
2
2
 
3
- A lightweight, global event bus built on top of `tiny-emitter`. Provides a Vue 3 plugin for the `$eventBus` global property and a standalone `emitterObj` for non-component usage.
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- npm install @vue3-appsbd-ui
9
- ```
3
+ Lightweight global event bus built on `tiny-emitter`. Provides a Vue 3 plugin for the `$eventBus` global property and a standalone `emitterObj` for non-component usage.
10
4
 
11
5
  ## Usage
12
6
 
13
7
  ### Standalone (Composable / Utilities)
14
8
 
15
- Import `emitterObj` directly for use outside of Vue components — utilities, stores, service modules, etc.
16
-
17
9
  ```javascript
18
10
  import { emitterObj } from "@vue3-appsbd-ui";
19
11
  import { onUnmounted } from "vue";
20
12
 
21
- function handler(data) {
22
- console.log("Received:", data);
23
- }
13
+ function handler(data) { console.log("Received:", data); }
24
14
 
25
- // Subscribe
26
15
  emitterObj.$on("my-event", handler);
27
-
28
- // Emit
29
16
  emitterObj.$emit("my-event", { message: "Hello" });
30
17
 
31
- // Cleanup
32
18
  onUnmounted(() => {
33
19
  emitterObj.$off("my-event", handler);
34
20
  });
35
21
  ```
36
22
 
37
- ### Plugin Usage (Options API or `this` context)
38
-
39
- Register the event bus as a Vue plugin to access `$eventBus` from any component via `this.$eventBus`.
23
+ ### Plugin Usage (Options API)
40
24
 
41
25
  ```javascript
42
26
  // main.js
43
- import { createApp } from "vue";
44
27
  import abEventBus from "@vue3-appsbd-ui/libraries/abEmitter";
45
-
46
- const app = createApp(App);
47
28
  app.use(abEventBus);
48
- app.mount("#app");
49
29
  ```
50
30
 
51
31
  ```javascript
52
32
  // Inside any Options-API component:
53
33
  export default {
54
- mounted() {
55
- this.$eventBus.$on("my-event", this.handleEvent);
56
- },
57
- beforeUnmount() {
58
- this.$eventBus.$off("my-event", this.handleEvent);
59
- },
34
+ mounted() { this.$eventBus.$on("my-event", this.handleEvent); },
35
+ beforeUnmount() { this.$eventBus.$off("my-event", this.handleEvent); },
60
36
  methods: {
61
- handleEvent(payload) {
62
- console.log("Received:", payload);
63
- }
37
+ handleEvent(payload) { console.log("Received:", payload); }
64
38
  }
65
39
  }
66
40
  ```
67
41
 
68
42
  ### One-Time Listener
69
43
 
70
- Use `$once` to subscribe to an event that automatically unsubscribes after the first invocation.
71
-
72
44
  ```javascript
73
45
  emitterObj.$once("init-complete", () => {
74
- console.log("Initialization done — this runs only once.");
46
+ console.log("Runs only once.");
75
47
  });
76
48
  ```
77
49
 
@@ -82,8 +54,8 @@ emitterObj.$once("init-complete", () => {
82
54
  | Method | Signature | Description |
83
55
  |---|---|---|
84
56
  | `$on` | `(event: string, callback: Function)` | Subscribe to an event. |
85
- | `$once` | `(event: string, callback: Function)` | Subscribe to an event; auto-unsubscribe after first fire. |
86
- | `$off` | `(event: string, callback: Function)` | Unsubscribe from an event (pass the same handler reference). |
57
+ | `$once` | `(event: string, callback: Function)` | Subscribe; auto-unsubscribe after first fire. |
58
+ | `$off` | `(event: string, callback: Function)` | Unsubscribe (pass the same handler reference). |
87
59
  | `$emit` | `(event: string, ...args: any[])` | Fire an event with optional payload arguments. |
88
60
 
89
61
  ### Plugin (default export)
@@ -1,12 +1,6 @@
1
1
  # abRequestParam (Library)
2
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
- ```
3
+ Data-transfer classes for building structured API request parameters for paginated, sorted, and filtered data queries.
10
4
 
11
5
  ## Usage
12
6
 
@@ -14,20 +8,11 @@ npm install @vue3-appsbd-ui
14
8
  import abRequestParam from "@vue3-appsbd-ui/libraries/abRequestParam";
15
9
 
16
10
  const params = new abRequestParam();
17
-
18
- // Pagination
19
11
  params.limit = 25;
20
12
  params.page = 1;
21
-
22
- // Sorting
23
13
  params.AddSortItem("created_at", "desc");
24
-
25
- // Filtering
26
14
  params.AddSrcItem("status", "active", "eq");
27
15
  params.AddSrcItem("name", "John", "like");
28
-
29
- // Output suitable for axios or fetch payload
30
- console.log(params);
31
16
  ```
32
17
 
33
18
  ## API Reference
@@ -38,7 +23,7 @@ console.log(params);
38
23
 
39
24
  | Property | Type | Description |
40
25
  |---|---|---|
41
- | `data` | `any` | Arbitrary payload attached to the request (e.g. form data). |
26
+ | `data` | `any` | Arbitrary payload attached to the request. |
42
27
  | `limit` | `string\|number` | Number of records per page. |
43
28
  | `page` | `string\|number` | Current page number. |
44
29
  | `filter_prop` | `string` | Optional filter property identifier. |
@@ -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,22 +1,13 @@
1
1
  # abVeeRules (Library)
2
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
- ```
3
+ Pre-configured VeeValidate validation rules integrated with localization via `abTranslate`.
10
4
 
11
5
  ## Usage
12
6
 
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
7
  ```javascript
16
8
  import { abAllRules } from "@vue3-appsbd-ui/libraries/abVeeRules";
17
9
  import { defineRule } from "vee-validate";
18
10
 
19
- // Register all custom library rules manually if needed
20
11
  Object.keys(abAllRules).forEach(rule => {
21
12
  defineRule(rule, abAllRules[rule]);
22
13
  });
@@ -26,7 +17,7 @@ Object.keys(abAllRules).forEach(rule => {
26
17
 
27
18
  ### `abAllRules` Object
28
19
 
29
- An object containing validation functions conforming to VeeValidate's custom rule signature `(value, params, field)`.
20
+ Validation functions conforming to VeeValidate's custom rule signature `(value, params, field)`.
30
21
 
31
22
  Included rules:
32
23
  - `required`: Returns translated `%{fld_name} is required`.