adminforth 2.45.0-next.2 → 2.45.0-next.4

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.
@@ -135,6 +135,7 @@
135
135
  <component
136
136
  v-for="c in coreStore?.config?.globalInjections?.everyPageBottom || []"
137
137
  :is="getCustomComponent(c)"
138
+ :adminUser="coreStore.adminUser || null"
138
139
  :meta="c.meta"
139
140
  />
140
141
  </div>
@@ -118,11 +118,12 @@ class FrontendAPI implements FrontendAPIInterface {
118
118
 
119
119
  confirm(params: Parameters<FrontendAPIInterface['confirm']>[0]): ReturnType<FrontendAPIInterface['confirm']> {
120
120
  return new Promise((resolve, reject) => {
121
- this.modalStore.setModalContent({
122
- content: params.message,
121
+ this.modalStore.setModalContent({
122
+ title: params.title,
123
+ content: params.message,
123
124
  contentHTML: params.messageHtml,
124
125
  acceptText: params.yes || 'Yes',
125
- cancelText: params.no || 'Cancel'
126
+ cancelText: params.no || 'Cancel'
126
127
  })
127
128
  this.modalStore.onAcceptFunction = resolve
128
129
  this.modalStore.onCancelFunction = reject
@@ -22,8 +22,8 @@
22
22
  </div>
23
23
  </div>
24
24
 
25
- <h3 class="mb-4 text-2xl font-bold text-gray-900 dark:text-white">
26
- There are unsaved changes.
25
+ <h3 v-if="modalStore?.modalContent?.title" class="mb-4 text-2xl font-bold text-gray-900 dark:text-white">
26
+ {{ modalStore.modalContent.title }}
27
27
  </h3>
28
28
 
29
29
  <div class="mb-2 text-[15px] text-gray-600 dark:text-gray-300">
@@ -35,7 +35,7 @@
35
35
 
36
36
  <div class="flex justify-center gap-4 w-full">
37
37
  <button @click="()=>{modalStore.onAcceptFunction(false);modalStore.togleModal()}" type="button" class="flex-1 py-2.5 px-4 text-sm font-medium text-gray-700 bg-white rounded-lg border border-gray-200 hover:bg-gray-50 focus:ring-4 focus:ring-gray-100 transition-all dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700">
38
- Stay and continue
38
+ {{ modalStore?.modalContent?.cancelText }}
39
39
  </button>
40
40
 
41
41
  <button
@@ -47,7 +47,7 @@
47
47
  border border-red-700 dark:border-red-600
48
48
  rounded-lg shadow-sm focus:z-10 focus:ring-4
49
49
  focus:ring-red-100 dark:focus:ring-red-900 gap-1">
50
- Leave without saving
50
+ {{ modalStore?.modalContent?.acceptText }}
51
51
  </button>
52
52
  </div>
53
53
 
@@ -32,7 +32,7 @@ export const useModalStore = defineStore('modal', () => {
32
32
  }
33
33
  function setModalContent(content: ModalContentType) {
34
34
  modalContent.value = {
35
- title: content.title || 'title',
35
+ title: content.title || '',
36
36
  content: content.content || '',
37
37
  contentHTML: content.contentHTML || '',
38
38
  acceptText: content.acceptText || 'acceptText',
@@ -160,6 +160,10 @@ export interface FrontendAPIInterface {
160
160
  }
161
161
 
162
162
  export type ConfirmParams = {
163
+ /**
164
+ * The title to display in the dialog
165
+ */
166
+ title?: string;
163
167
  /**
164
168
  * The message to display in the dialog
165
169
  */
@@ -781,9 +781,10 @@ export async function onBeforeRouteLeaveCreateEditViewGuard(initialValues: any,
781
781
  generateMessageHtmlForRecordChange(changedFields, t);
782
782
 
783
783
  const answer = await confirm({
784
+ title: t('There are unsaved changes'),
784
785
  messageHtml,
785
- yes: t('Yes'),
786
- no: t('No'),
786
+ yes: t('Leave without saving'),
787
+ no: t('Stay and continue'),
787
788
  });
788
789
 
789
790
  return answer;
@@ -164,6 +164,10 @@ export interface FrontendAPIInterface {
164
164
  }>): void;
165
165
  }
166
166
  export type ConfirmParams = {
167
+ /**
168
+ * The title to display in the dialog
169
+ */
170
+ title?: string;
167
171
  /**
168
172
  * The message to display in the dialog
169
173
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FrontendAPI.d.ts","sourceRoot":"","sources":["../../types/FrontendAPI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IAEjC;;;;;;;;;;;;;;;;;;;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CAAC;IAEnD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE;QAAC,KAAK,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;CAE3C,CAAA;AAID,oBAAY,YAAY;IACpB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"FrontendAPI.js","sourceRoot":"","sources":["../../types/FrontendAPI.ts"],"names":[],"mappings":"AAoNA,MAAM,CAAN,IAAY,YAKT;AALH,WAAY,YAAY;IACpB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;AACf,CAAC,EALS,YAAY,KAAZ,YAAY,QAKrB"}
1
+ {"version":3,"file":"FrontendAPI.js","sourceRoot":"","sources":["../../types/FrontendAPI.ts"],"names":[],"mappings":"AAwNA,MAAM,CAAN,IAAY,YAKT;AALH,WAAY,YAAY;IACpB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;AACf,CAAC,EALS,YAAY,KAAZ,YAAY,QAKrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.45.0-next.2",
3
+ "version": "2.45.0-next.4",
4
4
  "description": "OpenSource Agent-Native forth-generation admin panel",
5
5
  "keywords": [
6
6
  "adminforth",