@iankibetsh/shframework 1.9.4 → 1.9.6

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,38 @@ 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
  }
205
- Toast.mixin({
206
- position: position
207
- });
207
+ console.log(mixinConfig);
208
+ const Toast = Swal__default["default"].mixin(mixinConfig);
209
+ // Toast.mixin({
210
+ // position: 'top'
211
+ // })
208
212
  Toast.fire({
209
213
  icon: toastType,
210
- title: message
214
+ title: message,
215
+ postion: 'bottom'
211
216
  });
212
217
  }
213
218
 
@@ -5756,7 +5761,7 @@ const loadPopupComponent = ()=>{
5756
5761
  const component = route.query.comp || '';
5757
5762
  PopupComponent.value = vue.defineAsyncComponent({
5758
5763
  // 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`),
5764
+ loader: () => (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`../../../views/popups/${component}Popup.vue`),
5760
5765
 
5761
5766
  // A component to use while the async component is loading
5762
5767
  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,38 @@ 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
  }
175
- Toast.mixin({
176
- position: position
177
- });
177
+ console.log(mixinConfig);
178
+ const Toast = Swal.mixin(mixinConfig);
179
+ // Toast.mixin({
180
+ // position: 'top'
181
+ // })
178
182
  Toast.fire({
179
183
  icon: toastType,
180
- title: message
184
+ title: message,
185
+ postion: 'bottom'
181
186
  });
182
187
  }
183
188
 
@@ -5726,7 +5731,7 @@ const loadPopupComponent = ()=>{
5726
5731
  const component = route.query.comp || '';
5727
5732
  PopupComponent.value = defineAsyncComponent({
5728
5733
  // the loader function
5729
- loader: () => import(/* @vite-ignore */ `/src/views/popups/${component}Popup.vue`),
5734
+ loader: () => import(`../../../views/popups/${component}Popup.vue`),
5730
5735
 
5731
5736
  // A component to use while the async component is loading
5732
5737
  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.6",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",