@iankibetsh/shframework 1.9.4 → 1.9.5

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/dist/library.js CHANGED
@@ -172,21 +172,7 @@ const signOutUser = ()=>{
172
172
  };
173
173
 
174
174
 
175
- const Toast = Swal__default["default"].mixin({
176
- toast: true,
177
- position: 'top-end',
178
- showConfirmButton: false,
179
- customClass: {
180
- popup: 'colored-toast'
181
- },
182
- iconColor: 'white',
183
- timer: 2000,
184
- timerProgressBar: true,
185
- didOpen: (toast) => {
186
- toast.addEventListener('mouseenter', Swal__default["default"].stopTimer);
187
- toast.addEventListener('mouseleave', Swal__default["default"].resumeTimer);
188
- }
189
- });
175
+
190
176
  function getShConfig(key = null,def = '') {
191
177
 
192
178
  const config = ShStorage.getItem('ShConfig') ?? {};
@@ -195,19 +181,37 @@ function getShConfig(key = null,def = '') {
195
181
  }
196
182
  return config
197
183
  }
198
- function showToast (message, toastType, position) {
184
+ function showToast (message, toastType, config) {
185
+ const mixinConfig = {
186
+ toast: true,
187
+ position: 'top-end',
188
+ showConfirmButton: false,
189
+ customClass: {
190
+ popup: 'colored-toast'
191
+ },
192
+ iconColor: 'white',
193
+ timer: 2000,
194
+ timerProgressBar: true,
195
+ didOpen: (toast) => {
196
+ toast.addEventListener('mouseenter', Swal__default["default"].stopTimer);
197
+ toast.addEventListener('mouseleave', Swal__default["default"].resumeTimer);
198
+ }
199
+ };
199
200
  if (!toastType) {
200
201
  toastType = 'success';
201
202
  }
202
- if(!position){
203
- position = window.swalPosition;
203
+ if(config){
204
+ // alert(config.position)
205
+ Object.keys(config).map(key=>mixinConfig[key] = config.key);
204
206
  }
207
+ const Toast = Swal__default["default"].mixin(mixinConfig);
205
208
  Toast.mixin({
206
- position: position
209
+ position: 'top'
207
210
  });
208
211
  Toast.fire({
209
212
  icon: toastType,
210
- title: message
213
+ title: message,
214
+ postion: 'bottom'
211
215
  });
212
216
  }
213
217
 
@@ -5756,7 +5760,7 @@ const loadPopupComponent = ()=>{
5756
5760
  const component = route.query.comp || '';
5757
5761
  PopupComponent.value = vue.defineAsyncComponent({
5758
5762
  // the loader function
5759
- loader: () => (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(/* @vite-ignore */ `/src/views/popups/${component}Popup.vue`),
5763
+ loader: () => (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`../../../views/popups/${component}Popup.vue`),
5760
5764
 
5761
5765
  // A component to use while the async component is loading
5762
5766
  loadingComponent: script$6,
package/dist/library.mjs CHANGED
@@ -142,21 +142,7 @@ const signOutUser = ()=>{
142
142
  };
143
143
 
144
144
 
145
- const Toast = Swal.mixin({
146
- toast: true,
147
- position: 'top-end',
148
- showConfirmButton: false,
149
- customClass: {
150
- popup: 'colored-toast'
151
- },
152
- iconColor: 'white',
153
- timer: 2000,
154
- timerProgressBar: true,
155
- didOpen: (toast) => {
156
- toast.addEventListener('mouseenter', Swal.stopTimer);
157
- toast.addEventListener('mouseleave', Swal.resumeTimer);
158
- }
159
- });
145
+
160
146
  function getShConfig(key = null,def = '') {
161
147
 
162
148
  const config = ShStorage.getItem('ShConfig') ?? {};
@@ -165,19 +151,37 @@ function getShConfig(key = null,def = '') {
165
151
  }
166
152
  return config
167
153
  }
168
- function showToast (message, toastType, position) {
154
+ function showToast (message, toastType, config) {
155
+ const mixinConfig = {
156
+ toast: true,
157
+ position: 'top-end',
158
+ showConfirmButton: false,
159
+ customClass: {
160
+ popup: 'colored-toast'
161
+ },
162
+ iconColor: 'white',
163
+ timer: 2000,
164
+ timerProgressBar: true,
165
+ didOpen: (toast) => {
166
+ toast.addEventListener('mouseenter', Swal.stopTimer);
167
+ toast.addEventListener('mouseleave', Swal.resumeTimer);
168
+ }
169
+ };
169
170
  if (!toastType) {
170
171
  toastType = 'success';
171
172
  }
172
- if(!position){
173
- position = window.swalPosition;
173
+ if(config){
174
+ // alert(config.position)
175
+ Object.keys(config).map(key=>mixinConfig[key] = config.key);
174
176
  }
177
+ const Toast = Swal.mixin(mixinConfig);
175
178
  Toast.mixin({
176
- position: position
179
+ position: 'top'
177
180
  });
178
181
  Toast.fire({
179
182
  icon: toastType,
180
- title: message
183
+ title: message,
184
+ postion: 'bottom'
181
185
  });
182
186
  }
183
187
 
@@ -5726,7 +5730,7 @@ const loadPopupComponent = ()=>{
5726
5730
  const component = route.query.comp || '';
5727
5731
  PopupComponent.value = defineAsyncComponent({
5728
5732
  // the loader function
5729
- loader: () => import(/* @vite-ignore */ `/src/views/popups/${component}Popup.vue`),
5733
+ loader: () => import(`../../../views/popups/${component}Popup.vue`),
5730
5734
 
5731
5735
  // A component to use while the async component is loading
5732
5736
  loadingComponent: script$6,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",