@paperless/core 2.22.0-alpha.27 → 2.22.0-alpha.29
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/build/index.esm.js +1 -1
- package/dist/{paperless/p-84c43a3d.entry.js → build/p-1c17ee9b.entry.js} +1 -1
- package/dist/build/p-25961586.entry.js +1 -0
- package/dist/{paperless/p-9f51b9dc.entry.js → build/p-260a97c9.entry.js} +1 -1
- package/dist/build/{p-44da0b12.entry.js → p-2a37b400.entry.js} +1 -1
- package/dist/build/{p-fff6fa7a.entry.js → p-31399606.entry.js} +1 -1
- package/dist/build/{p-fa519af0.js → p-5f422b65.js} +1 -1
- package/dist/build/p-60923e39.entry.js +1 -0
- package/dist/{paperless/p-d24f045f.entry.js → build/p-6aa93bf9.entry.js} +1 -1
- package/dist/build/{p-e51c1cd6.entry.js → p-70974f53.entry.js} +1 -1
- package/dist/build/p-75ba802e.entry.js +3 -0
- package/dist/build/{p-b781e8db.entry.js → p-8c1bf7ea.entry.js} +1 -1
- package/dist/{paperless/p-7d018d4d.entry.js → build/p-9e06356b.entry.js} +1 -1
- package/dist/build/p-B_lDCj8j.js +1 -0
- package/dist/build/p-CeBIrPPx.js +1 -0
- package/dist/build/{p-78b15121.entry.js → p-a6369294.entry.js} +1 -1
- package/dist/build/p-a9c0aab3.entry.js +1 -0
- package/dist/build/p-b85ee4b7.entry.js +1 -0
- package/dist/build/{p-76f83633.entry.js → p-ba7ccf80.entry.js} +1 -1
- package/dist/build/{p-524eb1cb.entry.js → p-c16870f5.entry.js} +1 -1
- package/dist/build/{p-17e598ac.entry.js → p-cf436a7d.entry.js} +1 -1
- package/dist/build/{p-0d6f3aa3.entry.js → p-cfbd02e6.entry.js} +1 -1
- package/dist/build/{p-cbeb58ba.entry.js → p-e907c9d3.entry.js} +1 -1
- package/dist/build/{p-d9b3ace4.entry.js → p-ee7858e4.entry.js} +1 -1
- package/dist/build/{p-23cc6b6b.entry.js → p-f1c6f25b.entry.js} +1 -1
- package/dist/{paperless/p-5abcc8d2.entry.js → build/p-f5be155f.entry.js} +1 -1
- package/dist/build/p-xs4N_Y-0.js +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/{cn-BGmLaIp8.js → cn-Cd68UVBT.js} +30 -274
- package/dist/cjs/{floating-ui.dom-33QlkSyu.js → floating-ui.dom-DEq7yeQK.js} +91 -50
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/locale-BIZDGOk_.js +75117 -0
- package/dist/cjs/p-accordion.cjs.entry.js +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +1 -1
- package/dist/cjs/p-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +6 -6
- package/dist/cjs/p-calendar.cjs.entry.js +75 -302
- package/dist/cjs/p-card-container.cjs.entry.js +1 -1
- package/dist/cjs/p-checkbox_3.cjs.entry.js +2 -2
- package/dist/cjs/p-content-slider.cjs.entry.js +1 -1
- package/dist/cjs/p-cropper.cjs.entry.js +88 -32
- package/dist/cjs/p-datepicker.cjs.entry.js +41 -2891
- package/dist/cjs/p-divider.cjs.entry.js +1 -1
- package/dist/cjs/p-dropdown-menu-item_2.cjs.entry.js +1 -1
- package/dist/cjs/p-empty-state_8.cjs.entry.js +12 -18
- package/dist/cjs/p-field_3.cjs.entry.js +1 -1
- package/dist/cjs/p-illustration.cjs.entry.js +1 -1
- package/dist/cjs/p-label.cjs.entry.js +1 -1
- package/dist/cjs/p-listing.cjs.entry.js +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/p-pagination_3.cjs.entry.js +2 -2
- package/dist/cjs/p-select.cjs.entry.js +1 -1
- package/dist/cjs/p-table.cjs.entry.js +1 -1
- package/dist/cjs/p-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/atoms/loader/loader.component.js +1 -1
- package/dist/collection/components/molecules/button/button.component.js +8 -7
- package/dist/collection/components/molecules/calendar/calendar.component.js +1 -2
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +2 -2
- package/dist/collection/components/molecules/pagination/pages/pagination-pages.component.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BtuWYjfq.js → p--JDhF4GL.js} +1 -1
- package/dist/components/{p-DW-MndqD.js → p-0y7dmBHx.js} +1 -1
- package/dist/components/{p-DxmwiGc9.js → p-B4tCVctO.js} +1 -1
- package/dist/components/{p-LfH4pSix.js → p-BA1QFuzs.js} +1 -1
- package/dist/components/{p-Bno5n2sV.js → p-BBmuctek.js} +1 -1
- package/dist/components/p-BE2DRulM.js +1 -0
- package/dist/components/{p-Dbt4VuQm.js → p-BPP8ZYwN.js} +1 -1
- package/dist/components/{p-BeiMfpUZ.js → p-BV-h5ALt.js} +1 -1
- package/dist/components/{p-C_dax2wr.js → p-BX8yg_1a.js} +1 -1
- package/dist/components/{p-CjI4hMLv.js → p-BaXKEl7X.js} +1 -1
- package/dist/components/{p-BfJQbKrn.js → p-CCvROjOe.js} +1 -1
- package/dist/components/p-CHydrUrt.js +1 -0
- package/dist/components/{p-Bi6PK1YV.js → p-CccN0jY7.js} +1 -1
- package/dist/components/p-CeBIrPPx.js +1 -0
- package/dist/components/{p-BMb-TnTI.js → p-Coxruux_.js} +1 -1
- package/dist/components/{p-B9n8mzrj.js → p-DAuzJ_qL.js} +1 -1
- package/dist/components/{p-BAIZ48ms.js → p-DZjr9R4d.js} +1 -1
- package/dist/components/{p-BBNOzE00.js → p-Djf2rBRX.js} +1 -1
- package/dist/components/p-Dl4hxOHI.js +1 -0
- package/dist/components/{p-BIQLsxW1.js → p-DuYGcgJi.js} +1 -1
- package/dist/components/{p-CFu8cH3m.js → p-DxNTB_Qq.js} +1 -1
- package/dist/components/{p-CgOKCXab.js → p-JhZXmipA.js} +1 -1
- package/dist/components/{p-ChfXIxTQ.js → p-KuL1SNit.js} +1 -1
- package/dist/components/p-accordion.js +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-button.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-card-container.js +1 -1
- package/dist/components/p-card-header.js +1 -1
- package/dist/components/p-content-slider.js +1 -1
- package/dist/components/p-cropper.js +2 -2
- package/dist/components/p-datepicker.js +1 -1
- package/dist/components/p-divider.js +1 -1
- package/dist/components/p-drawer-header.js +1 -1
- package/dist/components/p-drawer.js +1 -1
- package/dist/components/p-dropdown-menu-item.js +1 -1
- package/dist/components/p-dropdown.js +1 -1
- package/dist/components/p-empty-state.js +1 -1
- package/dist/components/p-field-container.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-floating-menu-container.js +1 -1
- package/dist/components/p-helper.js +1 -1
- package/dist/components/p-illustration.js +1 -1
- package/dist/components/p-label.js +1 -1
- package/dist/components/p-listing.js +1 -1
- package/dist/components/p-modal-footer.js +1 -1
- package/dist/components/p-modal-header.js +1 -1
- package/dist/components/p-modal.js +1 -1
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-navigation-item.js +1 -1
- package/dist/components/p-pagination-pages.js +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/{p-PFAC3Kay.js → p-prb4IQlb.js} +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-segment-item.js +1 -1
- package/dist/components/p-select.js +1 -1
- package/dist/components/{p-CCOwunss.js → p-swqKzLDH.js} +1 -1
- package/dist/components/p-tab-container.js +1 -1
- package/dist/components/p-table-cell.js +1 -1
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table-row-actions-container.js +1 -1
- package/dist/components/p-table-row.js +1 -1
- package/dist/components/p-table.js +1 -1
- package/dist/components/p-tooltip.js +1 -1
- package/dist/components/p-xs4N_Y-0.js +1 -0
- package/dist/esm/{cn-BniKgfyU.js → cn-CsNqHcjL.js} +30 -274
- package/dist/esm/{floating-ui.dom-DGLCmOXW.js → floating-ui.dom-CeBIrPPx.js} +91 -50
- package/dist/esm/index.js +1 -1
- package/dist/esm/locale-B_lDCj8j.js +75114 -0
- package/dist/esm/p-accordion.entry.js +1 -1
- package/dist/esm/p-attachment.entry.js +1 -1
- package/dist/esm/p-badge_3.entry.js +1 -1
- package/dist/esm/p-button_3.entry.js +6 -6
- package/dist/esm/p-calendar.entry.js +63 -290
- package/dist/esm/p-card-container.entry.js +1 -1
- package/dist/esm/p-checkbox_3.entry.js +2 -2
- package/dist/esm/p-content-slider.entry.js +1 -1
- package/dist/esm/p-cropper.entry.js +88 -32
- package/dist/esm/p-datepicker.entry.js +37 -2887
- package/dist/esm/p-divider.entry.js +1 -1
- package/dist/esm/p-dropdown-menu-item_2.entry.js +1 -1
- package/dist/esm/p-empty-state_8.entry.js +12 -18
- package/dist/esm/p-field_3.entry.js +1 -1
- package/dist/esm/p-illustration.entry.js +1 -1
- package/dist/esm/p-label.entry.js +1 -1
- package/dist/esm/p-listing.entry.js +1 -1
- package/dist/esm/p-navigation-item.entry.js +1 -1
- package/dist/esm/p-pagination_3.entry.js +2 -2
- package/dist/esm/p-select.entry.js +1 -1
- package/dist/esm/p-table.entry.js +1 -1
- package/dist/esm/p-tooltip.entry.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/{build/p-84c43a3d.entry.js → paperless/p-1c17ee9b.entry.js} +1 -1
- package/dist/paperless/p-25961586.entry.js +1 -0
- package/dist/{build/p-9f51b9dc.entry.js → paperless/p-260a97c9.entry.js} +1 -1
- package/dist/paperless/{p-44da0b12.entry.js → p-2a37b400.entry.js} +1 -1
- package/dist/paperless/{p-fff6fa7a.entry.js → p-31399606.entry.js} +1 -1
- package/dist/paperless/p-60923e39.entry.js +1 -0
- package/dist/{build/p-d24f045f.entry.js → paperless/p-6aa93bf9.entry.js} +1 -1
- package/dist/paperless/{p-e51c1cd6.entry.js → p-70974f53.entry.js} +1 -1
- package/dist/paperless/p-75ba802e.entry.js +3 -0
- package/dist/paperless/{p-b781e8db.entry.js → p-8c1bf7ea.entry.js} +1 -1
- package/dist/{build/p-7d018d4d.entry.js → paperless/p-9e06356b.entry.js} +1 -1
- package/dist/paperless/p-B_lDCj8j.js +1 -0
- package/dist/paperless/p-CeBIrPPx.js +1 -0
- package/dist/paperless/{p-78b15121.entry.js → p-a6369294.entry.js} +1 -1
- package/dist/paperless/p-a9c0aab3.entry.js +1 -0
- package/dist/paperless/p-b85ee4b7.entry.js +1 -0
- package/dist/paperless/{p-76f83633.entry.js → p-ba7ccf80.entry.js} +1 -1
- package/dist/paperless/{p-524eb1cb.entry.js → p-c16870f5.entry.js} +1 -1
- package/dist/paperless/{p-17e598ac.entry.js → p-cf436a7d.entry.js} +1 -1
- package/dist/paperless/{p-0d6f3aa3.entry.js → p-cfbd02e6.entry.js} +1 -1
- package/dist/paperless/{p-cbeb58ba.entry.js → p-e907c9d3.entry.js} +1 -1
- package/dist/paperless/{p-d9b3ace4.entry.js → p-ee7858e4.entry.js} +1 -1
- package/dist/paperless/{p-23cc6b6b.entry.js → p-f1c6f25b.entry.js} +1 -1
- package/dist/{build/p-5abcc8d2.entry.js → paperless/p-f5be155f.entry.js} +1 -1
- package/dist/paperless/p-xs4N_Y-0.js +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/molecules/button/button.component.d.ts +1 -1
- package/dist/types/components.d.ts +3 -1
- package/dist/workbox-d13932f0.js +1 -1
- package/dist/workbox-d13932f0.js.map +1 -1
- package/hydrate/index.js +75313 -6268
- package/hydrate/index.mjs +75313 -6268
- package/package.json +10 -11
- package/dist/build/p-1f7ab568.entry.js +0 -1
- package/dist/build/p-20077155.entry.js +0 -1
- package/dist/build/p-3452b2f5.entry.js +0 -3
- package/dist/build/p-CT54OXR2.js +0 -1
- package/dist/build/p-DGLCmOXW.js +0 -1
- package/dist/build/p-KEbntKvf.js +0 -1
- package/dist/build/p-b090e928.entry.js +0 -1
- package/dist/build/p-bafe9297.entry.js +0 -1
- package/dist/cjs/index-DG6V15XP.js +0 -2871
- package/dist/components/p-CPpl-J0y.js +0 -1
- package/dist/components/p-CT54OXR2.js +0 -1
- package/dist/components/p-D4bALv5t.js +0 -1
- package/dist/components/p-DGLCmOXW.js +0 -1
- package/dist/components/p-DeSgaQxj.js +0 -1
- package/dist/esm/index-KEbntKvf.js +0 -2839
- package/dist/paperless/p-1f7ab568.entry.js +0 -1
- package/dist/paperless/p-20077155.entry.js +0 -1
- package/dist/paperless/p-3452b2f5.entry.js +0 -3
- package/dist/paperless/p-CT54OXR2.js +0 -1
- package/dist/paperless/p-DGLCmOXW.js +0 -1
- package/dist/paperless/p-KEbntKvf.js +0 -1
- package/dist/paperless/p-b090e928.entry.js +0 -1
- package/dist/paperless/p-bafe9297.entry.js +0 -1
|
@@ -204,6 +204,20 @@ const defaultEventOptions = {
|
|
|
204
204
|
function emit(target, type, detail, options) {
|
|
205
205
|
return target.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign(Object.assign({}, defaultEventOptions), { detail }), options)));
|
|
206
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Get the real event target by checking composed path.
|
|
209
|
+
* This is useful when dealing with events that can cross shadow DOM boundaries.
|
|
210
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath}
|
|
211
|
+
* @param {Event} event The event object.
|
|
212
|
+
* @returns {EventTarget | null} The first element in the composed path, or the original event target.
|
|
213
|
+
*/
|
|
214
|
+
function getComposedPathTarget(event) {
|
|
215
|
+
if (typeof event.composedPath === 'function') {
|
|
216
|
+
const path = event.composedPath();
|
|
217
|
+
return path.find(isElement) || event.target;
|
|
218
|
+
}
|
|
219
|
+
return event.target;
|
|
220
|
+
}
|
|
207
221
|
const resolvedPromise = Promise.resolve();
|
|
208
222
|
/**
|
|
209
223
|
* Defers the callback to be executed after the next DOM update cycle.
|
|
@@ -216,6 +230,23 @@ function nextTick(context, callback) {
|
|
|
216
230
|
? resolvedPromise.then(context ? callback.bind(context) : callback)
|
|
217
231
|
: resolvedPromise;
|
|
218
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Get the root document node.
|
|
235
|
+
* @param {Element} element The target element.
|
|
236
|
+
* @returns {Document|DocumentFragment|null} The document node.
|
|
237
|
+
*/
|
|
238
|
+
function getRootDocument(element) {
|
|
239
|
+
const rootNode = element.getRootNode();
|
|
240
|
+
switch (rootNode.nodeType) {
|
|
241
|
+
case 1:
|
|
242
|
+
return rootNode.ownerDocument;
|
|
243
|
+
case 9:
|
|
244
|
+
return rootNode;
|
|
245
|
+
case 11:
|
|
246
|
+
return rootNode;
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
219
250
|
/**
|
|
220
251
|
* Get the offset base on the document.
|
|
221
252
|
* @param {Element} element The target element.
|
|
@@ -432,12 +463,10 @@ class CropperElement extends HTMLElement {
|
|
|
432
463
|
},
|
|
433
464
|
});
|
|
434
465
|
});
|
|
435
|
-
const shadow = this.attachShadow({
|
|
466
|
+
const shadow = this.shadowRoot || this.attachShadow({
|
|
436
467
|
mode: this.shadowRootMode || DEFAULT_SHADOW_ROOT_MODE,
|
|
437
468
|
});
|
|
438
|
-
|
|
439
|
-
shadowRoots.set(this, shadow);
|
|
440
|
-
}
|
|
469
|
+
shadowRoots.set(this, shadow);
|
|
441
470
|
styleSheets.set(this, this.$addStyles(this.$sharedStyle));
|
|
442
471
|
if (this.$style) {
|
|
443
472
|
this.$addStyles(this.$style);
|
|
@@ -545,7 +574,7 @@ class CropperElement extends HTMLElement {
|
|
|
545
574
|
}
|
|
546
575
|
}
|
|
547
576
|
}
|
|
548
|
-
CropperElement.$version = '2.
|
|
577
|
+
CropperElement.$version = '2.1.0';
|
|
549
578
|
|
|
550
579
|
var style$7 = `:host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}`;
|
|
551
580
|
|
|
@@ -990,7 +1019,7 @@ class CropperCanvas extends CropperElement {
|
|
|
990
1019
|
}
|
|
991
1020
|
}
|
|
992
1021
|
CropperCanvas.$name = CROPPER_CANVAS;
|
|
993
|
-
CropperCanvas.$version = '2.
|
|
1022
|
+
CropperCanvas.$version = '2.1.0';
|
|
994
1023
|
|
|
995
1024
|
var style$6 = `:host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}`;
|
|
996
1025
|
|
|
@@ -999,7 +1028,8 @@ const NATIVE_ATTRIBUTES = [
|
|
|
999
1028
|
'alt',
|
|
1000
1029
|
'crossorigin',
|
|
1001
1030
|
'decoding',
|
|
1002
|
-
'
|
|
1031
|
+
'elementtiming',
|
|
1032
|
+
'fetchpriority',
|
|
1003
1033
|
'loading',
|
|
1004
1034
|
'referrerpolicy',
|
|
1005
1035
|
'sizes',
|
|
@@ -1023,6 +1053,17 @@ class CropperImage extends CropperElement {
|
|
|
1023
1053
|
this.skewable = false;
|
|
1024
1054
|
this.slottable = false;
|
|
1025
1055
|
this.translatable = false;
|
|
1056
|
+
// Native attributes
|
|
1057
|
+
this.alt = '';
|
|
1058
|
+
this.crossorigin = '';
|
|
1059
|
+
this.decoding = '';
|
|
1060
|
+
this.elementtiming = '';
|
|
1061
|
+
this.fetchpriority = '';
|
|
1062
|
+
this.loading = '';
|
|
1063
|
+
this.referrerpolicy = '';
|
|
1064
|
+
this.sizes = '';
|
|
1065
|
+
this.src = '';
|
|
1066
|
+
this.srcset = '';
|
|
1026
1067
|
}
|
|
1027
1068
|
set $canvas(element) {
|
|
1028
1069
|
canvasCache$3.set(this, element);
|
|
@@ -1258,7 +1299,10 @@ class CropperImage extends CropperElement {
|
|
|
1258
1299
|
const onLoad = () => {
|
|
1259
1300
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1260
1301
|
off($image, EVENT_ERROR, onError);
|
|
1261
|
-
|
|
1302
|
+
// Ensure the image is fully rendered.
|
|
1303
|
+
setTimeout(() => {
|
|
1304
|
+
resolve($image);
|
|
1305
|
+
});
|
|
1262
1306
|
};
|
|
1263
1307
|
const onError = () => {
|
|
1264
1308
|
off($image, EVENT_LOAD, onLoad);
|
|
@@ -1537,7 +1581,7 @@ class CropperImage extends CropperElement {
|
|
|
1537
1581
|
}
|
|
1538
1582
|
}
|
|
1539
1583
|
CropperImage.$name = CROPPER_IMAGE;
|
|
1540
|
-
CropperImage.$version = '2.
|
|
1584
|
+
CropperImage.$version = '2.1.0';
|
|
1541
1585
|
|
|
1542
1586
|
var style$5 = `:host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}`;
|
|
1543
1587
|
|
|
@@ -1545,9 +1589,9 @@ const canvasCache$2 = new WeakMap();
|
|
|
1545
1589
|
class CropperShade extends CropperElement {
|
|
1546
1590
|
constructor() {
|
|
1547
1591
|
super(...arguments);
|
|
1548
|
-
this.$onCanvasChange = null;
|
|
1549
1592
|
this.$onCanvasActionEnd = null;
|
|
1550
1593
|
this.$onCanvasActionStart = null;
|
|
1594
|
+
this.$onSelectionChange = null;
|
|
1551
1595
|
this.$style = style$5;
|
|
1552
1596
|
this.x = 0;
|
|
1553
1597
|
this.y = 0;
|
|
@@ -1588,8 +1632,8 @@ class CropperShade extends CropperElement {
|
|
|
1588
1632
|
this.hidden = true;
|
|
1589
1633
|
}
|
|
1590
1634
|
};
|
|
1591
|
-
this.$
|
|
1592
|
-
const { x, y, width, height, } = event.detail;
|
|
1635
|
+
this.$onSelectionChange = (event) => {
|
|
1636
|
+
const { x, y, width, height, } = event.defaultPrevented ? $selection : event.detail;
|
|
1593
1637
|
this.$change(x, y, width, height);
|
|
1594
1638
|
if ($selection.hidden || (x === 0 && y === 0 && width === 0 && height === 0)) {
|
|
1595
1639
|
this.hidden = true;
|
|
@@ -1597,7 +1641,7 @@ class CropperShade extends CropperElement {
|
|
|
1597
1641
|
};
|
|
1598
1642
|
on($canvas, EVENT_ACTION_START, this.$onCanvasActionStart);
|
|
1599
1643
|
on($canvas, EVENT_ACTION_END, this.$onCanvasActionEnd);
|
|
1600
|
-
on($canvas, EVENT_CHANGE, this.$
|
|
1644
|
+
on($canvas, EVENT_CHANGE, this.$onSelectionChange);
|
|
1601
1645
|
}
|
|
1602
1646
|
}
|
|
1603
1647
|
this.$render();
|
|
@@ -1613,9 +1657,9 @@ class CropperShade extends CropperElement {
|
|
|
1613
1657
|
off($canvas, EVENT_ACTION_END, this.$onCanvasActionEnd);
|
|
1614
1658
|
this.$onCanvasActionEnd = null;
|
|
1615
1659
|
}
|
|
1616
|
-
if (this.$
|
|
1617
|
-
off($canvas, EVENT_CHANGE, this.$
|
|
1618
|
-
this.$
|
|
1660
|
+
if (this.$onSelectionChange) {
|
|
1661
|
+
off($canvas, EVENT_CHANGE, this.$onSelectionChange);
|
|
1662
|
+
this.$onSelectionChange = null;
|
|
1619
1663
|
}
|
|
1620
1664
|
}
|
|
1621
1665
|
super.disconnectedCallback();
|
|
@@ -1666,7 +1710,7 @@ class CropperShade extends CropperElement {
|
|
|
1666
1710
|
}
|
|
1667
1711
|
}
|
|
1668
1712
|
CropperShade.$name = CROPPER_SHADE;
|
|
1669
|
-
CropperShade.$version = '2.
|
|
1713
|
+
CropperShade.$version = '2.1.0';
|
|
1670
1714
|
|
|
1671
1715
|
var style$4 = `:host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}`;
|
|
1672
1716
|
|
|
@@ -1689,7 +1733,7 @@ class CropperHandle extends CropperElement {
|
|
|
1689
1733
|
}
|
|
1690
1734
|
}
|
|
1691
1735
|
CropperHandle.$name = CROPPER_HANDLE;
|
|
1692
|
-
CropperHandle.$version = '2.
|
|
1736
|
+
CropperHandle.$version = '2.1.0';
|
|
1693
1737
|
|
|
1694
1738
|
var style$3 = `:host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}`;
|
|
1695
1739
|
|
|
@@ -1975,10 +2019,13 @@ class CropperSelection extends CropperElement {
|
|
|
1975
2019
|
}
|
|
1976
2020
|
const { relatedEvent } = detail;
|
|
1977
2021
|
let { action } = detail;
|
|
2022
|
+
const relatedTarget = relatedEvent
|
|
2023
|
+
? getComposedPathTarget(relatedEvent)
|
|
2024
|
+
: null;
|
|
1978
2025
|
// Switching to another selection
|
|
1979
2026
|
if (!action && this.multiple) {
|
|
1980
2027
|
// Get the `action` property from the focusing in selection
|
|
1981
|
-
action = this.$action || (
|
|
2028
|
+
action = this.$action || (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.action);
|
|
1982
2029
|
this.$action = action;
|
|
1983
2030
|
}
|
|
1984
2031
|
if (!action
|
|
@@ -1986,9 +2033,9 @@ class CropperSelection extends CropperElement {
|
|
|
1986
2033
|
|| (this.multiple && !this.active && action !== ACTION_SCALE)) {
|
|
1987
2034
|
return;
|
|
1988
2035
|
}
|
|
1989
|
-
const moveX = detail.endX - detail.startX;
|
|
1990
|
-
const moveY = detail.endY - detail.startY;
|
|
1991
2036
|
const { width, height } = this;
|
|
2037
|
+
let moveX = detail.endX - detail.startX;
|
|
2038
|
+
let moveY = detail.endY - detail.startY;
|
|
1992
2039
|
let { aspectRatio } = this;
|
|
1993
2040
|
// Locking aspect ratio by holding shift key
|
|
1994
2041
|
if (!isPositiveNumber(aspectRatio) && relatedEvent.shiftKey) {
|
|
@@ -1996,7 +2043,14 @@ class CropperSelection extends CropperElement {
|
|
|
1996
2043
|
}
|
|
1997
2044
|
switch (action) {
|
|
1998
2045
|
case ACTION_SELECT:
|
|
1999
|
-
if (moveX !== 0
|
|
2046
|
+
if (moveX !== 0 || moveY !== 0) {
|
|
2047
|
+
// Force to create a square selection for better user experience
|
|
2048
|
+
if (moveX === 0) {
|
|
2049
|
+
moveX = moveY;
|
|
2050
|
+
}
|
|
2051
|
+
else if (moveY === 0) {
|
|
2052
|
+
moveY = moveX;
|
|
2053
|
+
}
|
|
2000
2054
|
const { $canvas } = this;
|
|
2001
2055
|
const offset = getOffset(currentTarget);
|
|
2002
2056
|
(this.multiple && !this.hidden ? this.$createSelection() : this).$change(detail.startX - offset.left, detail.startY - offset.top, Math.abs(moveX), Math.abs(moveY), aspectRatio);
|
|
@@ -2521,7 +2575,7 @@ class CropperSelection extends CropperElement {
|
|
|
2521
2575
|
}
|
|
2522
2576
|
}
|
|
2523
2577
|
CropperSelection.$name = CROPPER_SELECTION;
|
|
2524
|
-
CropperSelection.$version = '2.
|
|
2578
|
+
CropperSelection.$version = '2.1.0';
|
|
2525
2579
|
|
|
2526
2580
|
var style$2 = `:host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}`;
|
|
2527
2581
|
|
|
@@ -2579,7 +2633,7 @@ class CropperGrid extends CropperElement {
|
|
|
2579
2633
|
}
|
|
2580
2634
|
}
|
|
2581
2635
|
CropperGrid.$name = CROPPER_GIRD;
|
|
2582
|
-
CropperGrid.$version = '2.
|
|
2636
|
+
CropperGrid.$version = '2.1.0';
|
|
2583
2637
|
|
|
2584
2638
|
var style$1 = `:host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}`;
|
|
2585
2639
|
|
|
@@ -2598,7 +2652,7 @@ class CropperCrosshair extends CropperElement {
|
|
|
2598
2652
|
}
|
|
2599
2653
|
}
|
|
2600
2654
|
CropperCrosshair.$name = CROPPER_CROSSHAIR;
|
|
2601
|
-
CropperCrosshair.$version = '2.
|
|
2655
|
+
CropperCrosshair.$version = '2.1.0';
|
|
2602
2656
|
|
|
2603
2657
|
var style = `:host{display:block;height:100%;overflow:hidden;position:relative;width:100%}`;
|
|
2604
2658
|
|
|
@@ -2653,10 +2707,11 @@ class CropperViewer extends CropperElement {
|
|
|
2653
2707
|
]);
|
|
2654
2708
|
}
|
|
2655
2709
|
connectedCallback() {
|
|
2710
|
+
var _a, _b;
|
|
2656
2711
|
super.connectedCallback();
|
|
2657
2712
|
let $selection = null;
|
|
2658
2713
|
if (this.selection) {
|
|
2659
|
-
$selection = this.
|
|
2714
|
+
$selection = (_b = (_a = getRootDocument(this)) === null || _a === void 0 ? void 0 : _a.querySelector(this.selection)) !== null && _b !== void 0 ? _b : null;
|
|
2660
2715
|
}
|
|
2661
2716
|
else {
|
|
2662
2717
|
$selection = this.closest(this.$getTagNameOf(CROPPER_SELECTION));
|
|
@@ -2699,7 +2754,7 @@ class CropperViewer extends CropperElement {
|
|
|
2699
2754
|
super.disconnectedCallback();
|
|
2700
2755
|
}
|
|
2701
2756
|
$handleSelectionChange(event) {
|
|
2702
|
-
this.$render(event.detail);
|
|
2757
|
+
this.$render(event.defaultPrevented ? this.$selection : event.detail);
|
|
2703
2758
|
}
|
|
2704
2759
|
$handleSourceImageLoad() {
|
|
2705
2760
|
const { $image, $sourceImage } = this;
|
|
@@ -2708,9 +2763,7 @@ class CropperViewer extends CropperElement {
|
|
|
2708
2763
|
if (newSrc && newSrc !== oldSrc) {
|
|
2709
2764
|
$image.setAttribute('src', newSrc);
|
|
2710
2765
|
$image.$ready(() => {
|
|
2711
|
-
|
|
2712
|
-
this.$render();
|
|
2713
|
-
}, 50);
|
|
2766
|
+
this.$render();
|
|
2714
2767
|
});
|
|
2715
2768
|
}
|
|
2716
2769
|
}
|
|
@@ -2769,7 +2822,10 @@ class CropperViewer extends CropperElement {
|
|
|
2769
2822
|
this.$scale = scale;
|
|
2770
2823
|
this.$setStyles(styles);
|
|
2771
2824
|
if (this.$sourceImage) {
|
|
2772
|
-
|
|
2825
|
+
// Transform the image by the selection offset after the next DOM update cycle
|
|
2826
|
+
setTimeout(() => {
|
|
2827
|
+
this.$transformImageByOffset(matrix !== null && matrix !== void 0 ? matrix : this.$sourceImage.$getTransform(), -x, -y);
|
|
2828
|
+
});
|
|
2773
2829
|
}
|
|
2774
2830
|
}
|
|
2775
2831
|
$transformImageByOffset(matrix, x, y) {
|
|
@@ -2791,7 +2847,7 @@ class CropperViewer extends CropperElement {
|
|
|
2791
2847
|
}
|
|
2792
2848
|
}
|
|
2793
2849
|
CropperViewer.$name = CROPPER_VIEWER;
|
|
2794
|
-
CropperViewer.$version = '2.
|
|
2850
|
+
CropperViewer.$version = '2.1.0';
|
|
2795
2851
|
|
|
2796
2852
|
/*! Cropper.js v2.0.0 | (c) 2015-present Chen Fengyuan | MIT */
|
|
2797
2853
|
CropperCanvas.$define();
|