@leavittsoftware/web 4.21.0 → 4.22.0

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.
@@ -35,7 +35,7 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
35
35
  hidePopover(): void;
36
36
  showPopover(): void;
37
37
  showPopover(): void;
38
- togglePopover(force?: boolean): boolean;
38
+ togglePopover(options?: boolean): boolean;
39
39
  togglePopover(force: boolean): void;
40
40
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
41
41
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -44,7 +44,8 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
44
44
  floatingLabelFoundation?: import("@material/floating-label/foundation").MDCFloatingLabelFoundation;
45
45
  lineRippleFoundation?: import("@material/line-ripple/foundation").MDCLineRippleFoundation;
46
46
  readonly attributes: NamedNodeMap;
47
- readonly classList: DOMTokenList;
47
+ get classList(): DOMTokenList;
48
+ set classList(value: string);
48
49
  className: string;
49
50
  readonly clientHeight: number;
50
51
  readonly clientLeft: number;
@@ -59,7 +60,8 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
59
60
  onfullscreenerror: ((this: Element, ev: Event) => any) | null;
60
61
  outerHTML: string;
61
62
  readonly ownerDocument: Document;
62
- readonly part: DOMTokenList;
63
+ get part(): DOMTokenList;
64
+ set part(value: string);
63
65
  readonly prefix: string | null;
64
66
  readonly scrollHeight: number;
65
67
  scrollLeft: number;
@@ -136,7 +138,7 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
136
138
  readonly previousSibling: ChildNode | null;
137
139
  textContent: string | null;
138
140
  appendChild<T extends Node>(node: T): T;
139
- cloneNode(deep?: boolean): Node;
141
+ cloneNode(subtree?: boolean): Node;
140
142
  compareDocumentPosition(other: Node): number;
141
143
  contains(other: Node | null): boolean;
142
144
  getRootNode(options?: GetRootNodeOptions): Node;
@@ -198,6 +200,7 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
198
200
  ariaPosInSet: string | null;
199
201
  ariaPressed: string | null;
200
202
  ariaReadOnly: string | null;
203
+ ariaRelevant: string | null;
201
204
  ariaRequired: string | null;
202
205
  ariaRoleDescription: string | null;
203
206
  ariaRowCount: string | null;
@@ -239,7 +242,8 @@ export declare const LoadWhile: <C extends Constructor<HTMLElement>>(base: C) =>
239
242
  replaceChildren(...nodes: (Node | string)[]): void;
240
243
  readonly assignedSlot: HTMLSlotElement | null;
241
244
  readonly attributeStyleMap: StylePropertyMap;
242
- readonly style: CSSStyleDeclaration;
245
+ get style(): CSSStyleDeclaration;
246
+ set style(cssText: string);
243
247
  contentEditable: string;
244
248
  enterKeyHint: string;
245
249
  inputMode: string;
@@ -39,7 +39,7 @@ declare const TitaniumSingleSelectBase_base: {
39
39
  hidePopover(): void;
40
40
  showPopover(): void;
41
41
  showPopover(): void;
42
- togglePopover(force?: boolean): boolean;
42
+ togglePopover(options?: boolean): boolean;
43
43
  togglePopover(force: boolean): void;
44
44
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
45
45
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -48,7 +48,8 @@ declare const TitaniumSingleSelectBase_base: {
48
48
  floatingLabelFoundation?: import("@material/floating-label/foundation").MDCFloatingLabelFoundation;
49
49
  lineRippleFoundation?: import("@material/line-ripple/foundation").MDCLineRippleFoundation;
50
50
  readonly attributes: NamedNodeMap;
51
- readonly classList: DOMTokenList;
51
+ get classList(): DOMTokenList;
52
+ set classList(value: string);
52
53
  className: string;
53
54
  readonly clientHeight: number;
54
55
  readonly clientLeft: number;
@@ -63,7 +64,8 @@ declare const TitaniumSingleSelectBase_base: {
63
64
  onfullscreenerror: ((this: Element, ev: Event) => any) | null;
64
65
  outerHTML: string;
65
66
  readonly ownerDocument: Document;
66
- readonly part: DOMTokenList;
67
+ get part(): DOMTokenList;
68
+ set part(value: string);
67
69
  readonly prefix: string | null;
68
70
  readonly scrollHeight: number;
69
71
  scrollLeft: number;
@@ -140,7 +142,7 @@ declare const TitaniumSingleSelectBase_base: {
140
142
  readonly previousSibling: ChildNode | null;
141
143
  textContent: string | null;
142
144
  appendChild<T_1 extends Node>(node: T_1): T_1;
143
- cloneNode(deep?: boolean): Node;
145
+ cloneNode(subtree?: boolean): Node;
144
146
  compareDocumentPosition(other: Node): number;
145
147
  contains(other: Node | null): boolean;
146
148
  getRootNode(options?: GetRootNodeOptions): Node;
@@ -202,6 +204,7 @@ declare const TitaniumSingleSelectBase_base: {
202
204
  ariaPosInSet: string | null;
203
205
  ariaPressed: string | null;
204
206
  ariaReadOnly: string | null;
207
+ ariaRelevant: string | null;
205
208
  ariaRequired: string | null;
206
209
  ariaRoleDescription: string | null;
207
210
  ariaRowCount: string | null;
@@ -243,7 +246,8 @@ declare const TitaniumSingleSelectBase_base: {
243
246
  replaceChildren(...nodes: (Node | string)[]): void;
244
247
  readonly assignedSlot: HTMLSlotElement | null;
245
248
  readonly attributeStyleMap: StylePropertyMap;
246
- readonly style: CSSStyleDeclaration;
249
+ get style(): CSSStyleDeclaration;
250
+ set style(cssText: string);
247
251
  contentEditable: string;
248
252
  enterKeyHint: string;
249
253
  inputMode: string;
@@ -2,12 +2,16 @@ import '@material/web/dialog/dialog';
2
2
  import '@material/web/icon/icon';
3
3
  import '@material/web/button/text-button';
4
4
  import '@material/web/iconbutton/icon-button';
5
- export declare type CropperOptions = Cropper.Options & {
6
- shape?: 'square' | 'circle';
7
- };
5
+ import 'cropperjs';
8
6
  import { LitElement } from 'lit';
9
- import Cropper from 'cropperjs';
7
+ import { CropperCanvas, CropperImage, CropperSelection } from 'cropperjs';
10
8
  import { MdDialog } from '@material/web/dialog/dialog';
9
+ export declare type CropperOptions = {
10
+ shape?: 'square' | 'circle';
11
+ canvasHideBackground?: boolean;
12
+ selectionHideGrid?: boolean;
13
+ selectionAspectRatio?: number | null | undefined;
14
+ };
11
15
  declare const CropAndSaveImageDialog_base: {
12
16
  new (...args: any[]): {
13
17
  "__#4@#promiseCount": number;
@@ -39,7 +43,7 @@ declare const CropAndSaveImageDialog_base: {
39
43
  hidePopover(): void;
40
44
  showPopover(): void;
41
45
  showPopover(): void;
42
- togglePopover(force?: boolean): boolean;
46
+ togglePopover(options?: boolean): boolean;
43
47
  togglePopover(force: boolean): void;
44
48
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
45
49
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -48,7 +52,8 @@ declare const CropAndSaveImageDialog_base: {
48
52
  floatingLabelFoundation?: import("@material/floating-label/foundation").MDCFloatingLabelFoundation;
49
53
  lineRippleFoundation?: import("@material/line-ripple/foundation").MDCLineRippleFoundation;
50
54
  readonly attributes: NamedNodeMap;
51
- readonly classList: DOMTokenList;
55
+ get classList(): DOMTokenList;
56
+ set classList(value: string);
52
57
  className: string;
53
58
  readonly clientHeight: number;
54
59
  readonly clientLeft: number;
@@ -63,7 +68,8 @@ declare const CropAndSaveImageDialog_base: {
63
68
  onfullscreenerror: ((this: Element, ev: Event) => any) | null;
64
69
  outerHTML: string;
65
70
  readonly ownerDocument: Document;
66
- readonly part: DOMTokenList;
71
+ get part(): DOMTokenList;
72
+ set part(value: string);
67
73
  readonly prefix: string | null;
68
74
  readonly scrollHeight: number;
69
75
  scrollLeft: number;
@@ -140,7 +146,7 @@ declare const CropAndSaveImageDialog_base: {
140
146
  readonly previousSibling: ChildNode | null;
141
147
  textContent: string | null;
142
148
  appendChild<T extends Node>(node: T): T;
143
- cloneNode(deep?: boolean): Node;
149
+ cloneNode(subtree?: boolean): Node;
144
150
  compareDocumentPosition(other: Node): number;
145
151
  contains(other: Node | null): boolean;
146
152
  getRootNode(options?: GetRootNodeOptions): Node;
@@ -202,6 +208,7 @@ declare const CropAndSaveImageDialog_base: {
202
208
  ariaPosInSet: string | null;
203
209
  ariaPressed: string | null;
204
210
  ariaReadOnly: string | null;
211
+ ariaRelevant: string | null;
205
212
  ariaRequired: string | null;
206
213
  ariaRoleDescription: string | null;
207
214
  ariaRowCount: string | null;
@@ -243,7 +250,8 @@ declare const CropAndSaveImageDialog_base: {
243
250
  replaceChildren(...nodes: (Node | string)[]): void;
244
251
  readonly assignedSlot: HTMLSlotElement | null;
245
252
  readonly attributeStyleMap: StylePropertyMap;
246
- readonly style: CSSStyleDeclaration;
253
+ get style(): CSSStyleDeclaration;
254
+ set style(cssText: string);
247
255
  contentEditable: string;
248
256
  enterKeyHint: string;
249
257
  inputMode: string;
@@ -368,21 +376,22 @@ declare const CropAndSaveImageDialog_base: {
368
376
  export declare class CropAndSaveImageDialog extends CropAndSaveImageDialog_base {
369
377
  #private;
370
378
  accessor dialog: MdDialog;
371
- accessor img: HTMLImageElement;
372
- /**
373
- * Configurable CropperJs options.
374
- */
375
- accessor options: CropperOptions;
379
+ accessor main: HTMLElement;
380
+ accessor cropperCanvas: CropperCanvas;
381
+ accessor cropperSelection: CropperSelection;
382
+ accessor cropperImage: CropperImage;
376
383
  /**
377
384
  * Forces cropper to output PNG's
378
385
  */
379
386
  accessor forcePNGOutput: boolean;
387
+ accessor options: CropperOptions;
380
388
  protected accessor fileName: string;
389
+ protected accessor src: string;
381
390
  firstUpdated(): void;
382
- static styles: import("lit").CSSResult[];
383
391
  open(url: string, filename: string, saveCroppedImageFunc?: (file: File, previewDataUrl: string) => Promise<void>): Promise<"cancel" | "cropped">;
384
392
  reset(): void;
385
393
  blobToFile(blob: Blob, fileName: string): File;
394
+ static styles: import("lit").CSSResult[];
386
395
  render(): import("lit-html").TemplateResult<1>;
387
396
  }
388
397
  export {};
@@ -3,13 +3,14 @@ import '@material/web/dialog/dialog';
3
3
  import '@material/web/icon/icon';
4
4
  import '@material/web/button/text-button';
5
5
  import '@material/web/iconbutton/icon-button';
6
+ import 'cropperjs';
6
7
  import { dialogZIndexHack } from '../../titanium/hacks/dialog-zindex-hack';
7
8
  import { css, html, LitElement } from 'lit';
8
9
  import { property, customElement, query, state } from 'lit/decorators.js';
9
- import Cropper from 'cropperjs';
10
10
  import { cropperCSS } from './cropper-styles';
11
11
  import { h1, p } from '../../titanium/styles/styles';
12
12
  import { LoadWhile } from '../../titanium/helpers/load-while';
13
+ import { ifDefined } from 'lit/directives/if-defined.js';
13
14
  import Bowser from 'bowser';
14
15
  const LoaderGif = new URL('./images/duck-loader.gif', import.meta.url).href;
15
16
  /**
@@ -22,144 +23,84 @@ let CropAndSaveImageDialog = class CropAndSaveImageDialog extends LoadWhile(LitE
22
23
  #dialog_accessor_storage;
23
24
  get dialog() { return this.#dialog_accessor_storage; }
24
25
  set dialog(value) { this.#dialog_accessor_storage = value; }
25
- #img_accessor_storage;
26
- get img() { return this.#img_accessor_storage; }
27
- set img(value) { this.#img_accessor_storage = value; }
28
- #options_accessor_storage = {};
29
- /**
30
- * Configurable CropperJs options.
31
- */
32
- get options() { return this.#options_accessor_storage; }
33
- set options(value) { this.#options_accessor_storage = value; }
26
+ #main_accessor_storage;
27
+ get main() { return this.#main_accessor_storage; }
28
+ set main(value) { this.#main_accessor_storage = value; }
29
+ #cropperCanvas_accessor_storage;
30
+ get cropperCanvas() { return this.#cropperCanvas_accessor_storage; }
31
+ set cropperCanvas(value) { this.#cropperCanvas_accessor_storage = value; }
32
+ #cropperSelection_accessor_storage;
33
+ get cropperSelection() { return this.#cropperSelection_accessor_storage; }
34
+ set cropperSelection(value) { this.#cropperSelection_accessor_storage = value; }
35
+ #cropperImage_accessor_storage;
36
+ get cropperImage() { return this.#cropperImage_accessor_storage; }
37
+ set cropperImage(value) { this.#cropperImage_accessor_storage = value; }
34
38
  #forcePNGOutput_accessor_storage;
35
39
  /**
36
40
  * Forces cropper to output PNG's
37
41
  */
38
42
  get forcePNGOutput() { return this.#forcePNGOutput_accessor_storage; }
39
43
  set forcePNGOutput(value) { this.#forcePNGOutput_accessor_storage = value; }
44
+ #options_accessor_storage;
45
+ get options() { return this.#options_accessor_storage; }
46
+ set options(value) { this.#options_accessor_storage = value; }
40
47
  #fileName_accessor_storage = '';
41
48
  get fileName() { return this.#fileName_accessor_storage; }
42
49
  set fileName(value) { this.#fileName_accessor_storage = value; }
43
- #cropper;
50
+ #src_accessor_storage = '';
51
+ get src() { return this.#src_accessor_storage; }
52
+ set src(value) { this.#src_accessor_storage = value; }
44
53
  #mimeType = '';
45
54
  #extension = '';
55
+ #isReady = false;
46
56
  firstUpdated() {
47
57
  const bowser = Bowser.getParser(window.navigator.userAgent);
48
58
  const os = bowser?.getOS?.()?.name ?? '';
49
59
  this.#mimeType = os === 'iOS' || os === 'macOS' || this.forcePNGOutput ? 'image/png' : 'image/webp';
50
60
  this.#extension = os === 'iOS' || os === 'macOS' || this.forcePNGOutput ? 'png' : 'webp';
61
+ this.#setUpResizeObserver();
62
+ }
63
+ #resizeObserver;
64
+ #setUpResizeObserver() {
65
+ this.#resizeObserver = new ResizeObserver(() => {
66
+ if (this.#isReady) {
67
+ this.cropperImage.$center('cover');
68
+ }
69
+ });
70
+ this.#resizeObserver.observe(this.main);
51
71
  }
52
- static { this.styles = [
53
- h1,
54
- p,
55
- cropperCSS,
56
- css `
57
- :host {
58
- display: block;
59
- }
60
-
61
- md-dialog {
62
- max-width: calc(100vw - 24px);
63
- max-height: calc(100vh - 24px);
64
- }
65
-
66
- main {
67
- display: flex;
68
- position: relative;
69
- align-self: center;
70
- }
71
-
72
- loading-animation {
73
- display: flex;
74
- flex-direction: column;
75
- place-content: center;
76
- place-items: center;
77
- width: 100%;
78
- }
79
-
80
- loading-animation img {
81
- height: 300px;
82
- }
83
-
84
- section[crop] {
85
- display: grid;
86
- width: 100%;
87
- grid: 'cropper buttons' / 1fr 58px;
88
- }
89
-
90
- cropper-container {
91
- grid-area: cropper;
92
-
93
- display: block;
94
- max-width: 800px;
95
- max-height: 600px;
96
- overflow: hidden;
97
- }
98
-
99
- cropper-container img {
100
- display: block;
101
- /* This rule is very important, please don't ignore this */
102
- max-width: 100%;
103
- }
104
-
105
- crop-buttons {
106
- grid-area: buttons;
107
-
108
- display: grid;
109
- align-content: start;
110
- grid-auto-flow: row;
111
-
112
- padding: 0 8px;
113
- gap: 8px;
114
- }
115
-
116
- @media (max-width: 600px) {
117
- section[crop] {
118
- grid:
119
- 'cropper'
120
- 'buttons';
121
- }
122
-
123
- crop-buttons {
124
- justify-content: end;
125
- grid-auto-flow: column;
126
- padding: 8px 0;
127
- }
128
- }
129
-
130
- [hidden] {
131
- display: none !important;
132
- }
133
- `,
134
- ]; }
135
72
  #saveCroppedImageFunc;
136
73
  #resolve;
137
74
  async open(url, filename, saveCroppedImageFunc) {
75
+ this.#isReady = false;
138
76
  this.#saveCroppedImageFunc = saveCroppedImageFunc;
139
77
  this.dialog.returnValue = '';
140
78
  this.reset();
141
79
  this.fileName = filename;
142
- this.#setCropperImage(url);
80
+ this.src = url;
81
+ await this.updateComplete;
143
82
  this.dialog.show();
83
+ this.cropperImage.$ready(async (image) => {
84
+ this.cropperCanvas.style.width = `${image.naturalWidth}px`;
85
+ this.cropperCanvas.style.aspectRatio = `${image.naturalWidth} / ${image.naturalHeight}`;
86
+ const rect = this.cropperCanvas.getBoundingClientRect();
87
+ this.cropperSelection.width = rect.width / 2;
88
+ this.cropperSelection.height = rect.height / 2;
89
+ this.cropperImage.$center('cover');
90
+ this.#isReady = true;
91
+ await this.updateComplete;
92
+ this.cropperSelection.$center();
93
+ });
144
94
  return await new Promise((resolve) => {
145
95
  this.#resolve = resolve;
146
96
  });
147
97
  }
148
98
  reset() {
149
- this.img.src = '';
150
- this.#cropper?.destroy();
99
+ this.cropperImage.$resetTransform();
151
100
  }
152
101
  blobToFile(blob, fileName) {
153
102
  return new File([blob], fileName, { lastModified: new Date().getTime() });
154
103
  }
155
- #setCropperImage(url) {
156
- this.img.src = url;
157
- this.#cropper = new Cropper(this.img, {
158
- viewMode: 2,
159
- aspectRatio: this.options.shape === 'circle' ? 1 : this.options.aspectRatio,
160
- ...this.options,
161
- });
162
- }
163
104
  #changeFileExtension(fileName, ext) {
164
105
  return fileName.slice(0, fileName.lastIndexOf('.')) + `.${ext}`;
165
106
  }
@@ -196,6 +137,66 @@ let CropAndSaveImageDialog = class CropAndSaveImageDialog extends LoadWhile(LitE
196
137
  image.src = dataUrl;
197
138
  return await imagePromise;
198
139
  }
140
+ static { this.styles = [
141
+ h1,
142
+ p,
143
+ cropperCSS,
144
+ css `
145
+ :host {
146
+ display: block;
147
+ }
148
+
149
+ md-dialog {
150
+ max-width: calc(100vw - 24px);
151
+ max-height: calc(100vh - 24px);
152
+ }
153
+
154
+ main {
155
+ display: flex;
156
+ position: relative;
157
+ align-self: center;
158
+
159
+ padding: 18px 24px 0px 24px;
160
+ }
161
+
162
+ loading-animation {
163
+ display: flex;
164
+ flex-direction: column;
165
+ place-content: center;
166
+ place-items: center;
167
+ width: 100%;
168
+ }
169
+
170
+ loading-animation img {
171
+ height: 300px;
172
+ }
173
+
174
+ cropper-container {
175
+ display: grid;
176
+ grid-template-areas:
177
+ 'cropper'
178
+ 'buttons';
179
+ gap: 8px 0;
180
+ }
181
+
182
+ cropper-canvas {
183
+ max-width: min(800px, calc(100vw - 115px));
184
+ max-height: calc(100vh - 250px);
185
+ }
186
+
187
+ crop-buttons {
188
+ grid-area: buttons;
189
+ display: flex;
190
+ flex-direction: row;
191
+ justify-content: end;
192
+ gap: 8px;
193
+ }
194
+
195
+ [hidden] {
196
+ display: none !important;
197
+ }
198
+ `,
199
+ ]; }
199
200
  render() {
200
201
  return html `
201
202
  <md-dialog
@@ -207,25 +208,40 @@ let CropAndSaveImageDialog = class CropAndSaveImageDialog extends LoadWhile(LitE
207
208
  e.preventDefault();
208
209
  }}
209
210
  >
210
- <div slot="headline">Crop and save image</div>
211
+ <div slot="headline">Crop image</div>
211
212
  <main slot="content">
212
213
  <loading-animation ?hidden=${!this.isLoading}>
213
214
  <img src=${LoaderGif} />
214
215
  <p>Uploading image...</p>
215
216
  </loading-animation>
216
- <section crop ?hidden=${this.isLoading}>
217
- <cropper-container ?circle=${this.options.shape === 'circle'}>
218
- <img />
219
- </cropper-container>
217
+ <cropper-container ?hidden=${this.isLoading}>
218
+ <cropper-canvas ?background=${!this.options?.canvasHideBackground}>
219
+ <cropper-image initial-center-size="cover" .src=${this.src} alt="Picture" rotatable scalable skewable translatable></cropper-image>
220
+ <cropper-shade hidden></cropper-shade>
221
+ <cropper-handle action="select" plain></cropper-handle>
222
+ <cropper-selection movable resizable aspect-ratio=${this.options?.shape === 'circle' ? 1 : ifDefined(this.options?.selectionAspectRatio)}>
223
+ <cropper-grid role="grid" covered ?hidden=${this.options?.selectionHideGrid}></cropper-grid>
224
+ <cropper-crosshair centered></cropper-crosshair>
225
+ <cropper-handle theme-color="rgba(255, 255, 255, 0.35)" action="move"></cropper-handle>
226
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="n-resize"></cropper-handle>
227
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="e-resize"></cropper-handle>
228
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="s-resize"></cropper-handle>
229
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="w-resize"></cropper-handle>
230
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="ne-resize"></cropper-handle>
231
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="nw-resize"></cropper-handle>
232
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="se-resize"></cropper-handle>
233
+ <cropper-handle theme-color="var(--md-sys-color-primary)" action="sw-resize"></cropper-handle>
234
+ </cropper-selection>
235
+ </cropper-canvas>
220
236
  <crop-buttons>
221
- <md-icon-button label="Rotate right" title="Rotate right" @click=${() => this.#cropper?.rotate(90)}
222
- ><md-icon>rotate_right</md-icon></md-icon-button
223
- >
224
- <md-icon-button label="Rotate left" title="Rotate left" @click=${() => this.#cropper?.rotate(-90)}>
237
+ <md-icon-button label="Rotate right" title="Rotate right" @click=${() => this.cropperImage?.$rotate('90deg')}>
238
+ <md-icon>rotate_right</md-icon>
239
+ </md-icon-button>
240
+ <md-icon-button label="Rotate left" title="Rotate left" @click=${() => this.cropperImage.$rotate('-90deg')}>
225
241
  <md-icon>rotate_left</md-icon>
226
242
  </md-icon-button>
227
243
  </crop-buttons>
228
- </section>
244
+ </cropper-container>
229
245
  </main>
230
246
  <div slot="actions">
231
247
  <md-text-button
@@ -241,13 +257,11 @@ let CropAndSaveImageDialog = class CropAndSaveImageDialog extends LoadWhile(LitE
241
257
  @click=${async () => {
242
258
  this.isLoading = true;
243
259
  await this.updateComplete;
244
- //WORKAROUND: The first call to this func can result in a corrupt image, esp seen in Android when picture comes from camera
245
- this.#cropper?.getCroppedCanvas();
246
- const canvas = this.#cropper?.getCroppedCanvas();
260
+ const canvas = await this.cropperSelection?.$toCanvas();
247
261
  if (!canvas) {
248
262
  return;
249
263
  }
250
- const previewDataUrl = this.options.shape === 'circle' ? await this.#applyCircleMask(canvas.toDataURL(this.#mimeType)) : canvas.toDataURL(this.#mimeType);
264
+ const previewDataUrl = this.options?.shape === 'circle' ? await this.#applyCircleMask(canvas.toDataURL(this.#mimeType)) : canvas.toDataURL(this.#mimeType);
251
265
  const response = await fetch(previewDataUrl);
252
266
  const file = this.blobToFile(await response.blob(), this.#changeFileExtension(this.fileName, this.#extension));
253
267
  const save = this.#saveCroppedImageFunc?.(file, previewDataUrl) || Promise.resolve();
@@ -267,17 +281,29 @@ __decorate([
267
281
  query('md-dialog')
268
282
  ], CropAndSaveImageDialog.prototype, "dialog", null);
269
283
  __decorate([
270
- query('cropper-container > img')
271
- ], CropAndSaveImageDialog.prototype, "img", null);
284
+ query('main')
285
+ ], CropAndSaveImageDialog.prototype, "main", null);
272
286
  __decorate([
273
- property({ type: Object })
274
- ], CropAndSaveImageDialog.prototype, "options", null);
287
+ query('cropper-canvas')
288
+ ], CropAndSaveImageDialog.prototype, "cropperCanvas", null);
289
+ __decorate([
290
+ query('cropper-selection')
291
+ ], CropAndSaveImageDialog.prototype, "cropperSelection", null);
292
+ __decorate([
293
+ query('cropper-image')
294
+ ], CropAndSaveImageDialog.prototype, "cropperImage", null);
275
295
  __decorate([
276
296
  property({ type: Boolean, reflect: true, attribute: 'force-png' })
277
297
  ], CropAndSaveImageDialog.prototype, "forcePNGOutput", null);
298
+ __decorate([
299
+ property({ type: Object })
300
+ ], CropAndSaveImageDialog.prototype, "options", null);
278
301
  __decorate([
279
302
  state()
280
303
  ], CropAndSaveImageDialog.prototype, "fileName", null);
304
+ __decorate([
305
+ state()
306
+ ], CropAndSaveImageDialog.prototype, "src", null);
281
307
  CropAndSaveImageDialog = __decorate([
282
308
  customElement('crop-and-save-image-dialog')
283
309
  ], CropAndSaveImageDialog);
@@ -1 +1 @@
1
- {"version":3,"file":"crop-and-save-image-dialog.js","sourceRoot":"","sources":["crop-and-save-image-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,yBAAyB,CAAC;AACjC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAK3E,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,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AAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAkC;AAEjC;IAA3B,KAAK,EAAE;sDAA0C;AACtB;IAA3B,KAAK,EAAE;iDAAqC;AAflC,sBAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CA4QlC"}
@@ -11,9 +11,7 @@ import { CropAndSaveImageDialog, CropperOptions } from './crop-and-save-image-di
11
11
  import { SmartAttachment } from './type/smart-attachment';
12
12
  import { ImagePreviewDialog } from './image-preview-dialog';
13
13
  import { IDatabaseAttachment } from '@leavittsoftware/lg-core-typescript/lg.net.system';
14
- export type TitaniumSmartInputOptions = Cropper.Options & {
15
- shape?: 'square' | 'circle';
16
- };
14
+ export type TitaniumSmartInputOptions = CropperOptions;
17
15
  /**
18
16
  * Material outline image input with cropper
19
17
  *
@@ -116,7 +116,7 @@ let TitaniumSmartAttachmentInput = class TitaniumSmartAttachmentInput extends Li
116
116
  */
117
117
  get noItemsText() { return this.#noItemsText_accessor_storage; }
118
118
  set noItemsText(value) { this.#noItemsText_accessor_storage = value; }
119
- #options_accessor_storage = {};
119
+ #options_accessor_storage;
120
120
  /**
121
121
  * Configurable CropperJs options.
122
122
  */