@dev-crew-berlin/enter-js-utils 0.4.2 → 0.5.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.
- package/README.md +63 -2
- package/dist/lib/class-names.d.ts +1 -0
- package/dist/lib/class-names.js +13 -0
- package/dist/lib/class-names.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/theme.js +1 -1
- package/dist/models/field-group.d.ts +161 -481
- package/dist/models/field-group.js +1 -1
- package/dist/models/field-group.js.map +1 -1
- package/dist/models/field.d.ts +116 -348
- package/dist/models/field.js +5 -5
- package/dist/models/field.js.map +1 -1
- package/dist/ui/button.d.ts +7 -0
- package/dist/ui/button.js +32 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/button.stories.d.ts +18 -0
- package/dist/ui/button.stories.js +38 -0
- package/dist/ui/button.stories.js.map +1 -0
- package/dist/ui/checkin-count-indicator.d.ts +0 -1
- package/dist/ui/checkin-count-indicator.stories.js +1 -1
- package/dist/ui/checkin-count-indicator.stories.js.map +1 -1
- package/dist/ui/companion-info.d.ts +15 -0
- package/dist/ui/companion-info.js +17 -0
- package/dist/ui/companion-info.js.map +1 -0
- package/dist/ui/companion-info.stories.d.ts +44 -0
- package/dist/ui/companion-info.stories.js +61 -0
- package/dist/ui/companion-info.stories.js.map +1 -0
- package/dist/ui/guest-card.d.ts +16 -0
- package/dist/ui/guest-card.js +36 -0
- package/dist/ui/guest-card.js.map +1 -0
- package/dist/ui/guest-card.stories.d.ts +92 -0
- package/dist/ui/guest-card.stories.js +125 -0
- package/dist/ui/guest-card.stories.js.map +1 -0
- package/dist/ui/tag.d.ts +7 -0
- package/dist/ui/tag.js +10 -0
- package/dist/ui/tag.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,72 @@
|
|
|
1
1
|
# js utils
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @dev-crew-berlin/enter-js-utils
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## packages
|
|
10
|
+
|
|
11
|
+
### lib
|
|
4
12
|
|
|
5
13
|
Some common helper functions and types.
|
|
6
14
|
This also contains the dcb colors.
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
### ui
|
|
9
17
|
|
|
10
18
|
react ui components for enter and dcb apps.
|
|
11
19
|
see: https://js-utils-main.mrdcb.vercel.app
|
|
20
|
+
|
|
21
|
+
### api-client
|
|
22
|
+
|
|
23
|
+
typed js client for the enter api.
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import EnterAPIClient from '@dev-crew-berlin/enter-js-utils/api-client'
|
|
27
|
+
|
|
28
|
+
const url = 'https://enter.events/api/v1'
|
|
29
|
+
|
|
30
|
+
async function apiExample() {
|
|
31
|
+
// fetch access Token
|
|
32
|
+
const accessToken = await EnterAPIClient.fetchAccessToken({
|
|
33
|
+
url: url,
|
|
34
|
+
user: 'me',
|
|
35
|
+
password: 'xxx',
|
|
36
|
+
deviceName: 'my-device',
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const credentials = {
|
|
40
|
+
accessToken: accessToken,
|
|
41
|
+
url: url,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// create api instance
|
|
45
|
+
const api = new EnterAPIClient({
|
|
46
|
+
credentials: credentials,
|
|
47
|
+
onLogout: (reason?: string) => {
|
|
48
|
+
deleteCredetials()
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const instances = await api.getInstanceList()
|
|
53
|
+
const attendees = await api.getAttendeeList({ instanceId: instances[0].id })
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## models
|
|
58
|
+
|
|
59
|
+
The models retured from the api-client.
|
|
60
|
+
|
|
61
|
+
## publish
|
|
62
|
+
|
|
63
|
+
This package is automatically published to npm for each new tag starting with `v*`.
|
|
64
|
+
So you can run:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm version patch # one of major | minor | patch or just write the version like v1.0.0
|
|
68
|
+
git push --follow-tags
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You could also create the tag manually.
|
|
72
|
+
If the version in the git tag and `package.json` differ the git tag is used.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function classNames(classNames: Record<string, boolean | undefined | null>): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function classNames(classNames) {
|
|
2
|
+
return Object.entries(classNames)
|
|
3
|
+
.filter(function (_a) {
|
|
4
|
+
var isActive = _a[1];
|
|
5
|
+
return isActive === true;
|
|
6
|
+
})
|
|
7
|
+
.map(function (_a) {
|
|
8
|
+
var className = _a[0];
|
|
9
|
+
return className;
|
|
10
|
+
})
|
|
11
|
+
.join(' ');
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=class-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-names.js","sourceRoot":"","sources":["../../src/lib/class-names.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CACxB,UAAsD;IAEtD,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SAC9B,MAAM,CAAC,UAAC,EAAY;YAAT,QAAQ,QAAA;QAAM,OAAA,QAAQ,KAAK,IAAI;IAAjB,CAAiB,CAAC;SAC3C,GAAG,CAAC,UAAC,EAAW;YAAV,SAAS,QAAA;QAAM,OAAA,SAAS;IAAT,CAAS,CAAC;SAC/B,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.js
CHANGED
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|