@bexis2/bexis2-core-ui 0.2.20 → 0.2.22

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 CHANGED
@@ -1,4 +1,7 @@
1
1
  # bexis-core-ui
2
+ ## 0.2.22
3
+ - Page title update on breadcrumb
4
+
2
5
  ## v0.2.19
3
6
  - fix multiselect bug from prev version
4
7
 
@@ -4,8 +4,8 @@
4
4
  export default class DropdownKvP extends SvelteComponentTyped<{
5
5
  target: any;
6
6
  id: any;
7
- source: any;
8
7
  title: any;
8
+ source: any;
9
9
  required?: boolean | undefined;
10
10
  invalid?: boolean | undefined;
11
11
  valid?: boolean | undefined;
@@ -27,8 +27,8 @@ declare const __propDef: {
27
27
  props: {
28
28
  target: any;
29
29
  id: any;
30
- source: any;
31
30
  title: any;
31
+ source: any;
32
32
  required?: boolean | undefined;
33
33
  invalid?: boolean | undefined;
34
34
  valid?: boolean | undefined;
@@ -4,8 +4,8 @@
4
4
  export default class MultiSelect extends SvelteComponentTyped<{
5
5
  target: any;
6
6
  id: any;
7
- source: any;
8
7
  title: any;
8
+ source: any;
9
9
  required?: boolean | undefined;
10
10
  invalid?: boolean | undefined;
11
11
  feedback?: string[] | undefined;
@@ -41,8 +41,8 @@ declare const __propDef: {
41
41
  props: {
42
42
  target: any;
43
43
  id: any;
44
- source: any;
45
44
  title: any;
45
+ source: any;
46
46
  required?: boolean | undefined;
47
47
  invalid?: boolean | undefined;
48
48
  feedback?: string[] | undefined;
@@ -38,7 +38,7 @@ onMount(async () => {
38
38
  {/if}
39
39
 
40
40
  <div class="grid grid-cols-2">
41
- <Breadcrumb {title} />
41
+ <Breadcrumb bind:title={title} />
42
42
  <Docs {links} {note} />
43
43
  </div>
44
44
  </svelte:fragment>
@@ -1,5 +1,10 @@
1
1
  <script>import { breadcrumbStore } from "../../../stores/pageStores";
2
2
  export let title;
3
+ $:
4
+ update(title);
5
+ function update(t) {
6
+ breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
7
+ }
3
8
  let list = [];
4
9
  $:
5
10
  list;
@@ -22,6 +22,7 @@ export declare const breadcrumbStore: {
22
22
  set: (this: void, value: BreadcrumbModel) => void;
23
23
  update: (this: void, updater: import("svelte/store").Updater<BreadcrumbModel>) => void;
24
24
  addItem: (item: breadcrumbItemType) => void;
25
+ updateItem: (item: breadcrumbItemType) => void;
25
26
  clean: () => void;
26
27
  };
27
28
  export declare const notificationStore: {
@@ -91,13 +91,24 @@ function createBreadcrumbStore() {
91
91
  });
92
92
  update((s) => (s = b));
93
93
  },
94
- clean: () => {
94
+ updateItem: (item) => {
95
95
  let b;
96
96
  breadcrumbStore.subscribe((value) => {
97
- value = new BreadcrumbModel();
97
+ value = value === undefined ? new BreadcrumbModel() : value;
98
+ let v = value.items.find((i) => i.link === item.link);
99
+ console.log(value.items, v);
100
+ if (v) {
101
+ const i = value.items.indexOf(v);
102
+ value.items[i] = item;
103
+ v = item;
104
+ }
98
105
  b = value;
99
106
  });
100
107
  update((s) => (s = b));
108
+ },
109
+ clean: () => {
110
+ breadcrumbStore.set(new BreadcrumbModel());
111
+ //update((s) => (s = b));
101
112
  }
102
113
  };
103
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bexis2/bexis2-core-ui",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -4,6 +4,14 @@
4
4
 
5
5
  export let title;
6
6
 
7
+ $:update(title)
8
+
9
+
10
+ function update(t)
11
+ {
12
+ breadcrumbStore.updateItem({ label: t, link: window.location.pathname });
13
+ }
14
+
7
15
  let list: breadcrumbItemType[] = [];
8
16
  $: list;
9
17
 
@@ -111,14 +111,32 @@ function createBreadcrumbStore() {
111
111
  update((s) => (s = b));
112
112
  },
113
113
 
114
- clean: () => {
114
+ updateItem: (item: breadcrumbItemType) => {
115
+
115
116
  let b: BreadcrumbModel;
116
117
  breadcrumbStore.subscribe((value) => {
117
- value = new BreadcrumbModel();
118
+ value = value === undefined ? new BreadcrumbModel() : value;
119
+
120
+ let v = value.items.find((i) => i.link === item.link)
121
+ console.log(value.items,v);
122
+
123
+ if (v) {
124
+ const i = value.items.indexOf(v);
125
+ value.items[i]=item
126
+ v = item;
127
+ }
128
+
118
129
  b = value;
119
130
  });
120
131
 
121
132
  update((s) => (s = b));
133
+ },
134
+
135
+ clean: () => {
136
+
137
+ breadcrumbStore.set(new BreadcrumbModel());
138
+
139
+ //update((s) => (s = b));
122
140
  }
123
141
  };
124
142
  }