@ldmjs/ui 1.0.74 → 1.0.75

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
@@ -130,6 +130,7 @@ const vuetify = createVuetify({
130
130
  - fileToArrayBuffer
131
131
  - fileToBase64
132
132
  - base64ToUint8Array
133
+ - base64ToBlob
133
134
  - uint8ArrayToHex
134
135
  - hexToArrayBuffer
135
136
  - uint8ArrayToBase64
package/dist/index.d.ts CHANGED
@@ -65,6 +65,8 @@ export declare function fileToArrayBuffer(value: File | Blob): Promise<ArrayBuff
65
65
  export declare function fileToBase64(value: File | Blob): Promise<string>;
66
66
  /* convert Base64 string to Uint8Array */
67
67
  export declare function base64ToUint8Array(base64: string): Uint8Array;
68
+ /* convert Base64 string to Blob */
69
+ export declare function base64ToBlob(base64: string): Blob;
68
70
  /* convert Uint8Array to Hexadecimal system */
69
71
  export declare function uint8ArrayToHex(bytes: Uint8Array): string;
70
72
  /* convert a hex string to an ArrayBuffer */
package/dist/index.js CHANGED
@@ -255,6 +255,7 @@ __webpack_require__.d(__webpack_exports__, {
255
255
  alphaRule: () => (/* reexport */ validators_js_.alphaRule),
256
256
  awaiting: () => (/* reexport */ awaiting),
257
257
  base64: () => (/* reexport */ base64),
258
+ base64ToBlob: () => (/* reexport */ base64ToBlob),
258
259
  base64ToUint8Array: () => (/* reexport */ base64ToUint8Array),
259
260
  betweenRule: () => (/* reexport */ validators_js_.betweenRule),
260
261
  cookie: () => (/* reexport */ cookie),
@@ -296,6 +297,7 @@ __webpack_require__.r(utils_namespaceObject);
296
297
  __webpack_require__.d(utils_namespaceObject, {
297
298
  awaiting: () => (awaiting),
298
299
  base64: () => (base64),
300
+ base64ToBlob: () => (base64ToBlob),
299
301
  base64ToUint8Array: () => (base64ToUint8Array),
300
302
  cookie: () => (cookie),
301
303
  deepValueGetter: () => (deepValueGetter),
@@ -7267,6 +7269,25 @@ function base64ToUint8Array(base64) {
7267
7269
  }
7268
7270
  return arr;
7269
7271
  }
7272
+ /**
7273
+ * Конвертирование из base64 в Blob
7274
+ * @param b64Data
7275
+ * @param sliceSize
7276
+ */
7277
+ function base64ToBlob(data, sliceSize = 512) {
7278
+ const byteCharacters = window.atob(data);
7279
+ const byteArrays = [];
7280
+ for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
7281
+ const slice = byteCharacters.slice(offset, offset + sliceSize);
7282
+ const byteNumbers = new Array(slice.length);
7283
+ for (let i = 0; i < slice.length; i++) {
7284
+ byteNumbers[i] = slice.charCodeAt(i);
7285
+ }
7286
+ const byteArray = new Uint8Array(byteNumbers);
7287
+ byteArrays.push(byteArray);
7288
+ }
7289
+ return new Blob(byteArrays);
7290
+ }
7270
7291
  function uint8ArrayToHex(bytes) {
7271
7292
  const hex = [];
7272
7293
  /* eslint-disable-next-line @typescript-eslint/prefer-for-of */
@@ -7556,7 +7577,7 @@ class DialogManager {
7556
7577
  }
7557
7578
  }
7558
7579
  finally {
7559
- //
7580
+ DialogManager._id = '';
7560
7581
  }
7561
7582
  }
7562
7583
  activate(info) {
@@ -8457,11 +8478,11 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
8457
8478
  break;
8458
8479
  }
8459
8480
  modal.show = false;
8481
+ let okResult = this.modalResult;
8460
8482
  if (modal.type !== ModalType.Select && modal.type !== ModalType.CreateEdit) {
8461
- const okResult = this.$utils.isDefined(modal.okResult) ? modal.okResult : true;
8462
- return modal.resolveFunction(okResult);
8483
+ okResult = this.$utils.isDefined(modal.okResult) ? modal.okResult : okResult;
8463
8484
  }
8464
- modal.resolveFunction(this.modalResult);
8485
+ modal.resolveFunction(okResult ?? true);
8465
8486
  this.modalResult = null;
8466
8487
  }
8467
8488
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {