@social-mail/social-mail-client 1.8.380 → 1.8.381

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.8.380",
3
+ "version": "1.8.381",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  import XNode from "@web-atoms/core/dist/core/XNode";
2
2
  import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
3
3
  import ExpressionParser from "@web-atoms/core/dist/core/ExpressionParser";
4
- import { AddIconTextButton, DeleteIconButton } from "../buttons/IconButton";
4
+ import { AddIconTextButton, DeleteIconButton, EditIconButton } from "../buttons/IconButton";
5
5
  import PageNavigator from "@web-atoms/web-controls/dist/PageNavigator";
6
6
  import Bind from "@web-atoms/core/dist/core/Bind";
7
7
  import EntityService from "../../../services/EntityService";
@@ -141,6 +141,13 @@ export default class CollectionEditorEx<T = any, TR = any> extends AtomControl {
141
141
  }
142
142
  const na = node.attributes ??= {};
143
143
  na["data-margin"] = "default";
144
+ if (this.editPage) {
145
+ node.children.push(<span>
146
+ <EditIconButton
147
+ data-click-event="edit-collection-item"
148
+ />
149
+ </span>);
150
+ }
144
151
  node.children.push(<span><DeleteIconButton
145
152
  data-click-event="delete-collection-item"
146
153
  /></span>);
@@ -183,6 +190,21 @@ export default class CollectionEditorEx<T = any, TR = any> extends AtomControl {
183
190
  items.remove(item);
184
191
  }
185
192
 
193
+ @Action({ onEvent: "edit-collection-item"})
194
+ async editItem(item) {
195
+ const { editPage } = this;
196
+ const edited = await PageNavigator.pushPageForResult(editPage, { ... item }) as any;
197
+ if (!edited) {
198
+ return;
199
+ }
200
+ for (const key in edited) {
201
+ if (Object.prototype.hasOwnProperty.call(edited, key)) {
202
+ const element = edited[key];
203
+ item[key] = element;
204
+ }
205
+ }
206
+ }
207
+
186
208
  @Action({})
187
209
  async onAddItem() {
188
210
  const {
@@ -53,6 +53,7 @@ export default class MailboxDetailPage extends ContentPage {
53
53
  model={this.model}
54
54
  field={(x) => x.syncTargets}
55
55
  addPage={EditSyncTargetPage}
56
+ editPage={EditSyncTargetPage}
56
57
  addItemDefaults={({
57
58
  username,
58
59
  host