@stsdti/approvable-vue 0.1.0 → 0.1.6
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/README.md +16 -2
- package/dist/approvable-vue.mjs +490 -472
- package/dist/approvable-vue.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/approvable/ApprovableButtons.vue +2 -14
- package/src/components/approvable/ApprovableIcon.vue +31 -0
- package/src/components/approvable/ApprovableStep.vue +3 -3
- package/src/index.js +21 -0
package/README.md
CHANGED
|
@@ -94,13 +94,27 @@ The renderer receives `button`, `step`, `approvable`, `resource` and a
|
|
|
94
94
|
|
|
95
95
|
## Configuration
|
|
96
96
|
|
|
97
|
+
The HTTP client is optional: with no configuration the components use `fetch`
|
|
98
|
+
and echo the `XSRF-TOKEN` cookie back as `X-XSRF-TOKEN`, so Laravel's CSRF check
|
|
99
|
+
passes. Configure it when you want your own axios instance — its `baseURL`,
|
|
100
|
+
interceptors and auth:
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import { configureApprovableClient } from '@stsdti/approvable-vue'
|
|
104
|
+
|
|
105
|
+
configureApprovableClient({ axios }) // your axios instance
|
|
106
|
+
configureApprovableClient({ fetch: myFetch }) // a custom fetch
|
|
107
|
+
configureApprovableClient({ baseURL: '/admin-api' }) // default transport, other prefix
|
|
108
|
+
configureApprovableClient({ adapter: myAdapter }) // anything else
|
|
109
|
+
```
|
|
110
|
+
|
|
97
111
|
Notifications and date formatting are configured on the core package:
|
|
98
112
|
|
|
99
113
|
```js
|
|
100
|
-
import { setApprovableNotifier,
|
|
114
|
+
import { setApprovableNotifier, setApprovableDateFormatter } from '@stsdti/approvable-core'
|
|
101
115
|
|
|
102
116
|
setApprovableNotifier({ success: toast.success, error: toast.error })
|
|
103
|
-
|
|
117
|
+
setApprovableDateFormatter((value) => dayjs(value).format('LLL'))
|
|
104
118
|
```
|
|
105
119
|
|
|
106
120
|
## License
|