bootstrap-vue-wrapper 1.11.2 → 2.0.0

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 (35) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +2 -45
  3. package/dist/bootstrap-vue-wrapper.mjs +7403 -0
  4. package/dist/bootstrap-vue-wrapper.umd.js +25 -0
  5. package/dist/components/bs-breadcrumb/BsBreadcrumb.vue.d.ts +33 -0
  6. package/dist/components/bs-checkbox/BsCheckbox.vue.d.ts +141 -0
  7. package/dist/components/bs-form/BsForm.vue.d.ts +13 -0
  8. package/dist/components/bs-input/BsInput.vue.d.ts +106 -0
  9. package/dist/components/bs-modal/BsModal.vue.d.ts +71 -0
  10. package/dist/components/bs-offcanvas/BsOffcanvas.vue.d.ts +34 -0
  11. package/dist/components/bs-paginator/BsPaginator.vue.d.ts +157 -0
  12. package/dist/components/bs-radio/BsRadio.vue.d.ts +139 -0
  13. package/dist/components/bs-select/BsSelect.vue.d.ts +139 -0
  14. package/dist/components/bs-table/BsTable.vue.d.ts +150 -0
  15. package/dist/components/bs-textarea/BsTextarea.vue.d.ts +106 -0
  16. package/dist/components/bs-toast/BsToast.vue.d.ts +18 -0
  17. package/dist/components/validator/Validator.d.ts +6 -0
  18. package/dist/index.d.ts +13 -0
  19. package/dist/style.css +1 -0
  20. package/package.json +53 -26
  21. package/src/.DS_Store +0 -0
  22. package/src/components/bs-breadcrumb/BsBreadcrumb.vue +0 -45
  23. package/src/components/bs-checkbox/BsCheckbox.vue +0 -148
  24. package/src/components/bs-form/BsForm.vue +0 -37
  25. package/src/components/bs-input/BsInput.vue +0 -92
  26. package/src/components/bs-modal/BsModal.vue +0 -90
  27. package/src/components/bs-offcanvas/BsOffcanvas.vue +0 -67
  28. package/src/components/bs-paginator/BsPaginator.vue +0 -215
  29. package/src/components/bs-radio/BsRadio.vue +0 -118
  30. package/src/components/bs-select/BsSelect.vue +0 -122
  31. package/src/components/bs-table/BsTable.vue +0 -202
  32. package/src/components/bs-textarea/BsTextarea.vue +0 -92
  33. package/src/components/bs-toast/BsToast.vue +0 -23
  34. package/src/index.js +0 -29
  35. package/src/mixins/validator.js +0 -107
package/CHANGELOG.md ADDED
@@ -0,0 +1,83 @@
1
+ # Changelog
2
+
3
+ ## [2.0.0] - 2024-02-01
4
+
5
+ Version 2.0 Changelog
6
+ Major Changes:
7
+ - Codebase Rewrite: The entire codebase has been rewritten in TypeScript, providing stronger type guarantees, improved maintainability, and enhanced developer experience.
8
+ - `BsTable` template `item` property renamed to `value`
9
+ - `hideValidationMessage` property has been removed. Instead, use the `validatorEnabled` property to disable validation.
10
+
11
+ New Features:
12
+ - Development Support Enhancements: Introduced a dedicated examples directory within the development (dev) folder, offering a comprehensive suite of examples to assist developers in understanding and utilizing the library's capabilities more effectively.
13
+
14
+ Improvements:
15
+ - Validator Component Overhaul: Rethought and redesigned the validator component. It is no longer implemented as a mixin. Instead, it is now a standalone component utilizing the Composition API, aligning with modern Vue.js best practices and improving its reusability and composability in applications.
16
+
17
+ Fixes:
18
+ - Bug Fixes: Addressed various bugs and issues identified in the previous versions, enhancing the stability and reliability of the library.
19
+
20
+ Migrate from 1.x to 2.x:
21
+
22
+ If you want to display the validation message elsewhere, not directly below the input, this could previously be achieved as follows:
23
+ ```
24
+ <div class="input-group">
25
+ <bs-input
26
+ id="customerNameInput"
27
+ ref="customerNameInputRef"
28
+ v-model="customerName"
29
+ type="text"
30
+ :hide-validation-message="true"
31
+ minlength="3"
32
+ @invalid="onCustomerNameInvalid"
33
+ />
34
+ <button
35
+ class="btn btn-primary rounded-end"
36
+ type="submit"
37
+ >
38
+ Search
39
+ </button>
40
+ <div v-if="customerNameInvalidMessage !== null" class="invalid-feedback">
41
+ {{ customerNameInvalidMessage }}
42
+ </div>
43
+ </div>
44
+
45
+ ...
46
+
47
+ /**
48
+ * @param invalidMessage
49
+ */
50
+ onCustomerNameInvalid(invalidMessage) {
51
+ this.customerNameInvalidMessage = invalidMessage
52
+ },
53
+ ```
54
+
55
+ In version 2.x, it can be done like this:
56
+ ```
57
+ <div class="input-group">
58
+ <bs-input
59
+ id="customerNameInput"
60
+ ref="customerNameInputRef"
61
+ v-model="customerName"
62
+ type="text"
63
+ minlength="3"
64
+ :validator-enabled="false"
65
+ @invalid="customerNameValidator.onInvalid"
66
+ />
67
+ <button
68
+ class="btn btn-primary rounded-end"
69
+ type="submit"
70
+ >
71
+ Search
72
+ </button>
73
+ <div v-if="customerNameValidator.getInvalidMessage() !== null" class="invalid-feedback">
74
+ {{ customerNameValidator.getInvalidMessage() }}
75
+ </div>
76
+ </div>
77
+
78
+ ...
79
+
80
+ setup() {
81
+ const customerNameValidator = useValidator(customerNameInputRef)
82
+ }
83
+ ```
package/README.md CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/bootstrap-vue-wrapper.svg)](https://www.npmjs.com/package/bootstrap-vue-wrapper)
4
4
 
5
-
6
5
  ## Requirements:
7
- - bootstrap 5
8
- - bootstrap icons
6
+ - Bootstrap 5
7
+ - Bootstrap icons
9
8
  - Vue i18n (for custom validation messages)
10
9
  - Vue router (for `<router-link>`)
11
10
  - Vue 3
@@ -15,45 +14,3 @@
15
14
  ```bash
16
15
  npm install bootstrap-vue-wrapper
17
16
  ```
18
- ## Examples:
19
-
20
-
21
- ### Table:
22
-
23
- ```html
24
- <bs-table
25
- class="table-striped table-hover"
26
- :fields="fields"
27
- :items="items"
28
- :order-by="orderBy"
29
- :is-loading="isLoading"
30
- @orderChanged="onOrderChanged"
31
- />
32
-
33
- ...
34
-
35
- <script>
36
- import { BsTable } from 'bootstrap-vue-wrapper'
37
- </script>
38
- ```
39
-
40
- ### Custom validation message:
41
-
42
- ```html
43
- <bs-input
44
- id="emailInput"
45
- ref="emailInputRef"
46
- v-model="email"
47
- type="email"
48
- label="Email"
49
- required
50
- />
51
-
52
- ...
53
-
54
- <script>
55
- errorFromServer() {
56
- this.$refs.emailInputRef.setCustomError('Email is already taken.')
57
- }
58
- </script>
59
- ```