@live-change/balance-frontend 0.8.64 → 0.8.66

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.
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <CurrencyDisplay
3
+ value="value"
4
+ :currency="currency"
5
+ :denomination="denomination"
6
+ :i18nConfig="i18nConfig"
7
+ :i18nDefaultConfig="i18nDefaultConfig" />
8
+ </template>
9
+
10
+ <script setup>
11
+ import { defineProps, toRefs, computed, inject } from 'vue'
12
+ import DefaultCurrencyDisplay from './CurrencyDisplay.vue'
13
+
14
+ import { injectComponent } from '@live-change/vue3-ssr'
15
+ const CurrencyDisplay = injectComponent({
16
+ name: 'CurrencyDisplay',
17
+ type: 'currency'
18
+ }, DefaultCurrencyDisplay)
19
+
20
+ const props = defineProps({
21
+ ownerType: {
22
+ type: String,
23
+ required: true
24
+ },
25
+ owner: {
26
+ type: String,
27
+ required: true
28
+ },
29
+ currency: {
30
+ type: String,
31
+ default: null
32
+ },
33
+ denomination: {
34
+ type: String,
35
+ default: null
36
+ },
37
+ i18nConfig: {
38
+ type: Object,
39
+ default: undefined
40
+ },
41
+ i18nDefaultConfig: {
42
+ type: Object,
43
+ default: () => {}
44
+ },
45
+ available: {
46
+ type: Boolean,
47
+ default: true
48
+ }
49
+ })
50
+
51
+ const { ownerType, owner, currency, denomination, i18nConfig, i18nDefaultConfig, available } = toRefs(props)
52
+
53
+ import { usePath, live, useClient, useActions, reverseRange, useTimeSynchronization } from '@live-change/vue3-ssr'
54
+ const path = usePath()
55
+
56
+ const balancePath = computed(() => path.balance.ownerOwnedBalance({
57
+ ownerType: ownerType.value,
58
+ owner: owner.value
59
+ }))
60
+
61
+ const [balance] = await Promise.all([
62
+ live(balancePath)
63
+ ])
64
+
65
+ const value = computed(() => available.value
66
+ ? balance.value?.available ?? 0
67
+ : balance.value?.amount ?? 0
68
+ )
69
+
70
+ </script>
71
+
72
+ <style scoped>
73
+
74
+ </style>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ {{ formatted }}
3
+ </template>
4
+
5
+ <script setup>
6
+
7
+ import { defineProps, toRefs, computed, inject } from 'vue'
8
+
9
+ const props = defineProps({
10
+ value: {
11
+ type: Number,
12
+ required: true
13
+ },
14
+ currency: {
15
+ type: String,
16
+ default: null
17
+ },
18
+ denomination: {
19
+ type: String,
20
+ default: null
21
+ },
22
+ i18nConfig: {
23
+ type: Object,
24
+ default: undefined
25
+ },
26
+ i18nDefaultConfig: {
27
+ type: Object,
28
+ default: () => {}
29
+ }
30
+ })
31
+ const { value, currency, denomination, i18nConfig, i18nDefaultConfig } = toRefs(props)
32
+
33
+ import { n } from 'vue-i18n'
34
+
35
+ const currencyConfig = inject('currencyI18nConfig:'+currency, null)
36
+ const defaultConfig = inject('currencyI18nConfig', null)
37
+
38
+ const config = computed(() => i18nConfig ?? currencyConfig ?? defaultConfig ?? i18nDefaultConfig)
39
+
40
+ const formatted = computed(() => {
41
+ return n(
42
+ value.value / (denomination.value ?? config.value.denomination ?? 100),
43
+ currency.value ?? config.value.currency ?? 'USD',
44
+ config.value
45
+ )
46
+ })
47
+
48
+ </script>
49
+
50
+ <style scoped>
51
+
52
+ </style>
@@ -1,15 +1,11 @@
1
- <script lang="ts">
2
- import { defineComponent } from 'vue'
3
-
4
- export default defineComponent({
5
- name: 'OperationsList'
6
- })
7
- </script>
8
-
9
1
  <template>
10
2
 
11
3
  </template>
12
4
 
5
+ <script setup>
6
+
7
+ </script>
8
+
13
9
  <style scoped>
14
10
 
15
11
  </style>
@@ -16,7 +16,7 @@ import { catchAllPagesRoute, contentEditRoutes, pagesSitemap } from "@live-chang
16
16
  export function balanceRoutes(config = {}) {
17
17
  const { prefix = '/', route = (r) => r } = config
18
18
  return [
19
- ...userRoutes({ ...config, prefix: prefix + 'user/' }),
19
+
20
20
 
21
21
 
22
22
 
@@ -41,6 +41,8 @@ export function createRouter(app, config) {
41
41
  // import.meta.env.SSR is injected by Vite.
42
42
  history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
43
43
  routes: [
44
+ ...userRoutes({ ...config, prefix: prefix + 'user/' }),
45
+
44
46
  ...balanceRoutes(config),
45
47
 
46
48
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/balance-frontend",
3
- "version": "0.8.64",
3
+ "version": "0.8.66",
4
4
  "scripts": {
5
5
  "memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
@@ -35,41 +35,41 @@
35
35
  "@codemirror/language": "6.10.1",
36
36
  "@dotenvx/dotenvx": "0.27.0",
37
37
  "@fortawesome/fontawesome-free": "^6.5.2",
38
- "@live-change/access-control-frontend": "^0.8.64",
39
- "@live-change/access-control-service": "^0.8.64",
40
- "@live-change/backup-service": "^0.8.64",
41
- "@live-change/blog-frontend": "^0.8.64",
42
- "@live-change/blog-service": "^0.8.64",
43
- "@live-change/cli": "^0.8.64",
44
- "@live-change/content-frontend": "^0.8.64",
45
- "@live-change/content-service": "^0.8.64",
46
- "@live-change/dao": "^0.8.64",
47
- "@live-change/dao-vue3": "^0.8.64",
48
- "@live-change/dao-websocket": "^0.8.64",
49
- "@live-change/db-client": "^0.8.64",
50
- "@live-change/email-service": "^0.8.64",
51
- "@live-change/framework": "^0.8.64",
52
- "@live-change/frontend-auto-form": "^0.8.64",
53
- "@live-change/frontend-base": "^0.8.64",
54
- "@live-change/geoip-service": "^0.8.64",
55
- "@live-change/image-frontend": "^0.8.64",
56
- "@live-change/locale-settings-service": "^0.8.64",
57
- "@live-change/password-authentication-service": "^0.8.64",
58
- "@live-change/prosemirror-service": "^0.8.64",
59
- "@live-change/secret-code-service": "^0.8.64",
60
- "@live-change/secret-link-service": "^0.8.64",
61
- "@live-change/session-service": "^0.8.64",
62
- "@live-change/task-service": "^0.8.64",
63
- "@live-change/upload-frontend": "^0.8.64",
64
- "@live-change/url-frontend": "^0.8.64",
65
- "@live-change/url-service": "^0.8.64",
66
- "@live-change/user-frontend": "^0.8.64",
67
- "@live-change/user-identification-service": "^0.8.64",
68
- "@live-change/user-service": "^0.8.64",
69
- "@live-change/vote-service": "^0.8.64",
70
- "@live-change/vue3-components": "^0.8.64",
71
- "@live-change/vue3-ssr": "^0.8.64",
72
- "@live-change/wysiwyg-frontend": "^0.8.64",
38
+ "@live-change/access-control-frontend": "^0.8.66",
39
+ "@live-change/access-control-service": "^0.8.66",
40
+ "@live-change/backup-service": "^0.8.66",
41
+ "@live-change/blog-frontend": "^0.8.66",
42
+ "@live-change/blog-service": "^0.8.66",
43
+ "@live-change/cli": "^0.8.66",
44
+ "@live-change/content-frontend": "^0.8.66",
45
+ "@live-change/content-service": "^0.8.66",
46
+ "@live-change/dao": "^0.8.66",
47
+ "@live-change/dao-vue3": "^0.8.66",
48
+ "@live-change/dao-websocket": "^0.8.66",
49
+ "@live-change/db-client": "^0.8.66",
50
+ "@live-change/email-service": "^0.8.66",
51
+ "@live-change/framework": "^0.8.66",
52
+ "@live-change/frontend-auto-form": "^0.8.66",
53
+ "@live-change/frontend-base": "^0.8.66",
54
+ "@live-change/geoip-service": "^0.8.66",
55
+ "@live-change/image-frontend": "^0.8.66",
56
+ "@live-change/locale-settings-service": "^0.8.66",
57
+ "@live-change/password-authentication-service": "^0.8.66",
58
+ "@live-change/prosemirror-service": "^0.8.66",
59
+ "@live-change/secret-code-service": "^0.8.66",
60
+ "@live-change/secret-link-service": "^0.8.66",
61
+ "@live-change/session-service": "^0.8.66",
62
+ "@live-change/task-service": "^0.8.66",
63
+ "@live-change/upload-frontend": "^0.8.66",
64
+ "@live-change/url-frontend": "^0.8.66",
65
+ "@live-change/url-service": "^0.8.66",
66
+ "@live-change/user-frontend": "^0.8.66",
67
+ "@live-change/user-identification-service": "^0.8.66",
68
+ "@live-change/user-service": "^0.8.66",
69
+ "@live-change/vote-service": "^0.8.66",
70
+ "@live-change/vue3-components": "^0.8.66",
71
+ "@live-change/vue3-ssr": "^0.8.66",
72
+ "@live-change/wysiwyg-frontend": "^0.8.66",
73
73
  "@vueuse/core": "^10.11.0",
74
74
  "codeceptjs-assert": "^0.0.5",
75
75
  "compression": "^1.7.4",
@@ -91,7 +91,7 @@
91
91
  "vue3-scroll-border": "0.1.6"
92
92
  },
93
93
  "devDependencies": {
94
- "@live-change/codeceptjs-helper": "^0.8.64",
94
+ "@live-change/codeceptjs-helper": "^0.8.66",
95
95
  "codeceptjs": "^3.6.5",
96
96
  "generate-password": "1.7.1",
97
97
  "playwright": "^1.41.2",
@@ -102,5 +102,5 @@
102
102
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
103
103
  "license": "ISC",
104
104
  "description": "",
105
- "gitHead": "cf14b283170cd39b80a57865e9b5eb9cf2073f39"
105
+ "gitHead": "33fa71ec087690903b109e2c0a2cf1de886449f7"
106
106
  }
@@ -1,13 +0,0 @@
1
- <template>
2
- <div class="w-full">
3
- dupa
4
- </div>
5
- </template>
6
-
7
- <script setup>
8
-
9
- </script>
10
-
11
- <style scoped>
12
-
13
- </style>