@humandialog/forms.svelte 0.5.10 → 0.5.11

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.
@@ -130,11 +130,18 @@
130
130
  if(config.customOperations && Array.isArray(config.customOperations) && config.customOperations.length > 0)
131
131
  {
132
132
  config.customOperations.forEach( o => {
133
- options.push({
134
- caption: o.caption,
135
- icon: o.icon,
136
- action: o.action
137
- })
133
+ let add = true;
134
+ if(o.condition)
135
+ add = o.condition();
136
+
137
+ if(add)
138
+ {
139
+ options.push({
140
+ caption: o.caption,
141
+ icon: o.icon,
142
+ action: o.action
143
+ })
144
+ }
138
145
  })
139
146
  }
140
147
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "type": "module",
28
28
  "dependencies": {
29
- "@humandialog/auth.svelte": "^1.4.0",
29
+ "@humandialog/auth.svelte": "^1.5.0",
30
30
  "flowbite-svelte": "^0.29.13",
31
31
  "svelte-icons": "^2.1.0",
32
32
  "svelte-spa-router": "^3.3.0"
@@ -442,9 +442,9 @@
442
442
 
443
443
  <ListComboProperty name='Privileges' a='auth_group' onSelect={on_change_privileges}>
444
444
  <ComboItem name='None' key={0} />
445
- <ComboItem name='Can See' key={1} />
446
- <ComboItem name='Can Invite' key={3} />
447
- <ComboItem name='Maintainer' key={7} />
445
+ <ComboItem name='Can see' key={1} />
446
+ <ComboItem name='Can invite' key={3} />
447
+ <ComboItem name='Can fully manage' key={7} />
448
448
  </ListComboProperty>
449
449
 
450
450
  {#if showFiles}
@@ -98,11 +98,18 @@
98
98
  if(config.customOperations && Array.isArray(config.customOperations) && config.customOperations.length > 0)
99
99
  {
100
100
  config.customOperations.forEach( o => {
101
- options.push({
102
- caption: o.caption,
103
- icon: o.icon,
104
- action: o.action
105
- })
101
+ let add = true;
102
+ if(o.condition)
103
+ add = o.condition();
104
+
105
+ if(add)
106
+ {
107
+ options.push({
108
+ caption: o.caption,
109
+ icon: o.icon,
110
+ action: o.action
111
+ })
112
+ }
106
113
  })
107
114
  }
108
115