@paperless/core 2.22.0-alpha.27 → 2.22.0-alpha.28
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, d as getElement, h, e as Host } from './index-BDccsg1s.js';
|
|
2
|
-
import { c as cn } from './cn-
|
|
2
|
+
import { c as cn } from './cn-CsNqHcjL.js';
|
|
3
3
|
import './clsx-ChV9xqsO.js';
|
|
4
4
|
|
|
5
5
|
const contentSliderComponentCss = () => `.absolute{position:absolute}.relative{position:relative}.z-10{z-index:10}.-mx-16{margin-left:-4rem;margin-right:-4rem}.-my-4{margin-bottom:-1rem;margin-top:-1rem}.mt-3{margin-top:.75rem}.box-content{box-sizing:content-box}.flex{display:flex}.w-0{width:0}.w-full{width:100%}.translate-x-0{--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.px-1{padding-left:.25rem;padding-right:.25rem}.px-16{padding-left:4rem;padding-right:4rem}*{box-sizing:border-box}:host{display:flex;flex-direction:column;margin:-1rem -4rem;overflow:hidden;padding:1rem 4rem}:host .slider{box-sizing:content-box;overflow:visible;position:relative}:host .slider.draggable{cursor:grab}@media (min-width:64rem){:host .slider.draggable{cursor:auto}}:host .slider.draggable.dragging{cursor:grabbing}@media (min-width:64rem){:host .slider.draggable.dragging{cursor:auto}}:host .slider.draggable.dragging .inner-slider{transition-property:none}:host .slider .inner-slider{--tw-translate-x:0px;align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;will-change:transform}@media (min-width:64rem){:host .slider .inner-slider{flex-wrap:wrap;gap:1rem}}:host .slider .inner-slider>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .slider .inner-slider>::slotted(*){width:calc(50% - .5rem)}}@media (min-width:64rem){:host .slider .inner-slider>::slotted(*){flex:1 1 0%;width:0}}:host .indicator{align-items:center;display:flex;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}:host .indicator .item{margin-top:.75rem;padding-left:.25rem;padding-right:.25rem;padding-top:.25rem}@media (min-width:64rem){.desktop-xs\\:hidden{display:none}.desktop-xs\\:flex-wrap{flex-wrap:wrap}}.visible{visibility:visible}.static{position:static}.block{display:block}.hidden{display:none}.h-2{height:.5rem}.w-2{width:.5rem}.cursor-pointer{cursor:pointer}.resize{resize:both}.rounded-full{border-radius:9999px}.bg-indigo-300{--tw-bg-opacity:1;background-color:rgb(187 209 253/var(--tw-bg-opacity,1))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}`;
|
|
@@ -202,6 +202,20 @@ const defaultEventOptions = {
|
|
|
202
202
|
function emit(target, type, detail, options) {
|
|
203
203
|
return target.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign(Object.assign({}, defaultEventOptions), { detail }), options)));
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Get the real event target by checking composed path.
|
|
207
|
+
* This is useful when dealing with events that can cross shadow DOM boundaries.
|
|
208
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath}
|
|
209
|
+
* @param {Event} event The event object.
|
|
210
|
+
* @returns {EventTarget | null} The first element in the composed path, or the original event target.
|
|
211
|
+
*/
|
|
212
|
+
function getComposedPathTarget(event) {
|
|
213
|
+
if (typeof event.composedPath === 'function') {
|
|
214
|
+
const path = event.composedPath();
|
|
215
|
+
return path.find(isElement) || event.target;
|
|
216
|
+
}
|
|
217
|
+
return event.target;
|
|
218
|
+
}
|
|
205
219
|
const resolvedPromise = Promise.resolve();
|
|
206
220
|
/**
|
|
207
221
|
* Defers the callback to be executed after the next DOM update cycle.
|
|
@@ -214,6 +228,23 @@ function nextTick(context, callback) {
|
|
|
214
228
|
? resolvedPromise.then(context ? callback.bind(context) : callback)
|
|
215
229
|
: resolvedPromise;
|
|
216
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Get the root document node.
|
|
233
|
+
* @param {Element} element The target element.
|
|
234
|
+
* @returns {Document|DocumentFragment|null} The document node.
|
|
235
|
+
*/
|
|
236
|
+
function getRootDocument(element) {
|
|
237
|
+
const rootNode = element.getRootNode();
|
|
238
|
+
switch (rootNode.nodeType) {
|
|
239
|
+
case 1:
|
|
240
|
+
return rootNode.ownerDocument;
|
|
241
|
+
case 9:
|
|
242
|
+
return rootNode;
|
|
243
|
+
case 11:
|
|
244
|
+
return rootNode;
|
|
245
|
+
}
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
217
248
|
/**
|
|
218
249
|
* Get the offset base on the document.
|
|
219
250
|
* @param {Element} element The target element.
|
|
@@ -430,12 +461,10 @@ class CropperElement extends HTMLElement {
|
|
|
430
461
|
},
|
|
431
462
|
});
|
|
432
463
|
});
|
|
433
|
-
const shadow = this.attachShadow({
|
|
464
|
+
const shadow = this.shadowRoot || this.attachShadow({
|
|
434
465
|
mode: this.shadowRootMode || DEFAULT_SHADOW_ROOT_MODE,
|
|
435
466
|
});
|
|
436
|
-
|
|
437
|
-
shadowRoots.set(this, shadow);
|
|
438
|
-
}
|
|
467
|
+
shadowRoots.set(this, shadow);
|
|
439
468
|
styleSheets.set(this, this.$addStyles(this.$sharedStyle));
|
|
440
469
|
if (this.$style) {
|
|
441
470
|
this.$addStyles(this.$style);
|
|
@@ -543,7 +572,7 @@ class CropperElement extends HTMLElement {
|
|
|
543
572
|
}
|
|
544
573
|
}
|
|
545
574
|
}
|
|
546
|
-
CropperElement.$version = '2.
|
|
575
|
+
CropperElement.$version = '2.1.0';
|
|
547
576
|
|
|
548
577
|
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}`;
|
|
549
578
|
|
|
@@ -988,7 +1017,7 @@ class CropperCanvas extends CropperElement {
|
|
|
988
1017
|
}
|
|
989
1018
|
}
|
|
990
1019
|
CropperCanvas.$name = CROPPER_CANVAS;
|
|
991
|
-
CropperCanvas.$version = '2.
|
|
1020
|
+
CropperCanvas.$version = '2.1.0';
|
|
992
1021
|
|
|
993
1022
|
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%}`;
|
|
994
1023
|
|
|
@@ -997,7 +1026,8 @@ const NATIVE_ATTRIBUTES = [
|
|
|
997
1026
|
'alt',
|
|
998
1027
|
'crossorigin',
|
|
999
1028
|
'decoding',
|
|
1000
|
-
'
|
|
1029
|
+
'elementtiming',
|
|
1030
|
+
'fetchpriority',
|
|
1001
1031
|
'loading',
|
|
1002
1032
|
'referrerpolicy',
|
|
1003
1033
|
'sizes',
|
|
@@ -1021,6 +1051,17 @@ class CropperImage extends CropperElement {
|
|
|
1021
1051
|
this.skewable = false;
|
|
1022
1052
|
this.slottable = false;
|
|
1023
1053
|
this.translatable = false;
|
|
1054
|
+
// Native attributes
|
|
1055
|
+
this.alt = '';
|
|
1056
|
+
this.crossorigin = '';
|
|
1057
|
+
this.decoding = '';
|
|
1058
|
+
this.elementtiming = '';
|
|
1059
|
+
this.fetchpriority = '';
|
|
1060
|
+
this.loading = '';
|
|
1061
|
+
this.referrerpolicy = '';
|
|
1062
|
+
this.sizes = '';
|
|
1063
|
+
this.src = '';
|
|
1064
|
+
this.srcset = '';
|
|
1024
1065
|
}
|
|
1025
1066
|
set $canvas(element) {
|
|
1026
1067
|
canvasCache$3.set(this, element);
|
|
@@ -1256,7 +1297,10 @@ class CropperImage extends CropperElement {
|
|
|
1256
1297
|
const onLoad = () => {
|
|
1257
1298
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1258
1299
|
off($image, EVENT_ERROR, onError);
|
|
1259
|
-
|
|
1300
|
+
// Ensure the image is fully rendered.
|
|
1301
|
+
setTimeout(() => {
|
|
1302
|
+
resolve($image);
|
|
1303
|
+
});
|
|
1260
1304
|
};
|
|
1261
1305
|
const onError = () => {
|
|
1262
1306
|
off($image, EVENT_LOAD, onLoad);
|
|
@@ -1535,7 +1579,7 @@ class CropperImage extends CropperElement {
|
|
|
1535
1579
|
}
|
|
1536
1580
|
}
|
|
1537
1581
|
CropperImage.$name = CROPPER_IMAGE;
|
|
1538
|
-
CropperImage.$version = '2.
|
|
1582
|
+
CropperImage.$version = '2.1.0';
|
|
1539
1583
|
|
|
1540
1584
|
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}`;
|
|
1541
1585
|
|
|
@@ -1543,9 +1587,9 @@ const canvasCache$2 = new WeakMap();
|
|
|
1543
1587
|
class CropperShade extends CropperElement {
|
|
1544
1588
|
constructor() {
|
|
1545
1589
|
super(...arguments);
|
|
1546
|
-
this.$onCanvasChange = null;
|
|
1547
1590
|
this.$onCanvasActionEnd = null;
|
|
1548
1591
|
this.$onCanvasActionStart = null;
|
|
1592
|
+
this.$onSelectionChange = null;
|
|
1549
1593
|
this.$style = style$5;
|
|
1550
1594
|
this.x = 0;
|
|
1551
1595
|
this.y = 0;
|
|
@@ -1586,8 +1630,8 @@ class CropperShade extends CropperElement {
|
|
|
1586
1630
|
this.hidden = true;
|
|
1587
1631
|
}
|
|
1588
1632
|
};
|
|
1589
|
-
this.$
|
|
1590
|
-
const { x, y, width, height, } = event.detail;
|
|
1633
|
+
this.$onSelectionChange = (event) => {
|
|
1634
|
+
const { x, y, width, height, } = event.defaultPrevented ? $selection : event.detail;
|
|
1591
1635
|
this.$change(x, y, width, height);
|
|
1592
1636
|
if ($selection.hidden || (x === 0 && y === 0 && width === 0 && height === 0)) {
|
|
1593
1637
|
this.hidden = true;
|
|
@@ -1595,7 +1639,7 @@ class CropperShade extends CropperElement {
|
|
|
1595
1639
|
};
|
|
1596
1640
|
on($canvas, EVENT_ACTION_START, this.$onCanvasActionStart);
|
|
1597
1641
|
on($canvas, EVENT_ACTION_END, this.$onCanvasActionEnd);
|
|
1598
|
-
on($canvas, EVENT_CHANGE, this.$
|
|
1642
|
+
on($canvas, EVENT_CHANGE, this.$onSelectionChange);
|
|
1599
1643
|
}
|
|
1600
1644
|
}
|
|
1601
1645
|
this.$render();
|
|
@@ -1611,9 +1655,9 @@ class CropperShade extends CropperElement {
|
|
|
1611
1655
|
off($canvas, EVENT_ACTION_END, this.$onCanvasActionEnd);
|
|
1612
1656
|
this.$onCanvasActionEnd = null;
|
|
1613
1657
|
}
|
|
1614
|
-
if (this.$
|
|
1615
|
-
off($canvas, EVENT_CHANGE, this.$
|
|
1616
|
-
this.$
|
|
1658
|
+
if (this.$onSelectionChange) {
|
|
1659
|
+
off($canvas, EVENT_CHANGE, this.$onSelectionChange);
|
|
1660
|
+
this.$onSelectionChange = null;
|
|
1617
1661
|
}
|
|
1618
1662
|
}
|
|
1619
1663
|
super.disconnectedCallback();
|
|
@@ -1664,7 +1708,7 @@ class CropperShade extends CropperElement {
|
|
|
1664
1708
|
}
|
|
1665
1709
|
}
|
|
1666
1710
|
CropperShade.$name = CROPPER_SHADE;
|
|
1667
|
-
CropperShade.$version = '2.
|
|
1711
|
+
CropperShade.$version = '2.1.0';
|
|
1668
1712
|
|
|
1669
1713
|
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}`;
|
|
1670
1714
|
|
|
@@ -1687,7 +1731,7 @@ class CropperHandle extends CropperElement {
|
|
|
1687
1731
|
}
|
|
1688
1732
|
}
|
|
1689
1733
|
CropperHandle.$name = CROPPER_HANDLE;
|
|
1690
|
-
CropperHandle.$version = '2.
|
|
1734
|
+
CropperHandle.$version = '2.1.0';
|
|
1691
1735
|
|
|
1692
1736
|
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}`;
|
|
1693
1737
|
|
|
@@ -1973,10 +2017,13 @@ class CropperSelection extends CropperElement {
|
|
|
1973
2017
|
}
|
|
1974
2018
|
const { relatedEvent } = detail;
|
|
1975
2019
|
let { action } = detail;
|
|
2020
|
+
const relatedTarget = relatedEvent
|
|
2021
|
+
? getComposedPathTarget(relatedEvent)
|
|
2022
|
+
: null;
|
|
1976
2023
|
// Switching to another selection
|
|
1977
2024
|
if (!action && this.multiple) {
|
|
1978
2025
|
// Get the `action` property from the focusing in selection
|
|
1979
|
-
action = this.$action || (
|
|
2026
|
+
action = this.$action || (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.action);
|
|
1980
2027
|
this.$action = action;
|
|
1981
2028
|
}
|
|
1982
2029
|
if (!action
|
|
@@ -1984,9 +2031,9 @@ class CropperSelection extends CropperElement {
|
|
|
1984
2031
|
|| (this.multiple && !this.active && action !== ACTION_SCALE)) {
|
|
1985
2032
|
return;
|
|
1986
2033
|
}
|
|
1987
|
-
const moveX = detail.endX - detail.startX;
|
|
1988
|
-
const moveY = detail.endY - detail.startY;
|
|
1989
2034
|
const { width, height } = this;
|
|
2035
|
+
let moveX = detail.endX - detail.startX;
|
|
2036
|
+
let moveY = detail.endY - detail.startY;
|
|
1990
2037
|
let { aspectRatio } = this;
|
|
1991
2038
|
// Locking aspect ratio by holding shift key
|
|
1992
2039
|
if (!isPositiveNumber(aspectRatio) && relatedEvent.shiftKey) {
|
|
@@ -1994,7 +2041,14 @@ class CropperSelection extends CropperElement {
|
|
|
1994
2041
|
}
|
|
1995
2042
|
switch (action) {
|
|
1996
2043
|
case ACTION_SELECT:
|
|
1997
|
-
if (moveX !== 0
|
|
2044
|
+
if (moveX !== 0 || moveY !== 0) {
|
|
2045
|
+
// Force to create a square selection for better user experience
|
|
2046
|
+
if (moveX === 0) {
|
|
2047
|
+
moveX = moveY;
|
|
2048
|
+
}
|
|
2049
|
+
else if (moveY === 0) {
|
|
2050
|
+
moveY = moveX;
|
|
2051
|
+
}
|
|
1998
2052
|
const { $canvas } = this;
|
|
1999
2053
|
const offset = getOffset(currentTarget);
|
|
2000
2054
|
(this.multiple && !this.hidden ? this.$createSelection() : this).$change(detail.startX - offset.left, detail.startY - offset.top, Math.abs(moveX), Math.abs(moveY), aspectRatio);
|
|
@@ -2519,7 +2573,7 @@ class CropperSelection extends CropperElement {
|
|
|
2519
2573
|
}
|
|
2520
2574
|
}
|
|
2521
2575
|
CropperSelection.$name = CROPPER_SELECTION;
|
|
2522
|
-
CropperSelection.$version = '2.
|
|
2576
|
+
CropperSelection.$version = '2.1.0';
|
|
2523
2577
|
|
|
2524
2578
|
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)}`;
|
|
2525
2579
|
|
|
@@ -2577,7 +2631,7 @@ class CropperGrid extends CropperElement {
|
|
|
2577
2631
|
}
|
|
2578
2632
|
}
|
|
2579
2633
|
CropperGrid.$name = CROPPER_GIRD;
|
|
2580
|
-
CropperGrid.$version = '2.
|
|
2634
|
+
CropperGrid.$version = '2.1.0';
|
|
2581
2635
|
|
|
2582
2636
|
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%)}`;
|
|
2583
2637
|
|
|
@@ -2596,7 +2650,7 @@ class CropperCrosshair extends CropperElement {
|
|
|
2596
2650
|
}
|
|
2597
2651
|
}
|
|
2598
2652
|
CropperCrosshair.$name = CROPPER_CROSSHAIR;
|
|
2599
|
-
CropperCrosshair.$version = '2.
|
|
2653
|
+
CropperCrosshair.$version = '2.1.0';
|
|
2600
2654
|
|
|
2601
2655
|
var style = `:host{display:block;height:100%;overflow:hidden;position:relative;width:100%}`;
|
|
2602
2656
|
|
|
@@ -2651,10 +2705,11 @@ class CropperViewer extends CropperElement {
|
|
|
2651
2705
|
]);
|
|
2652
2706
|
}
|
|
2653
2707
|
connectedCallback() {
|
|
2708
|
+
var _a, _b;
|
|
2654
2709
|
super.connectedCallback();
|
|
2655
2710
|
let $selection = null;
|
|
2656
2711
|
if (this.selection) {
|
|
2657
|
-
$selection = this.
|
|
2712
|
+
$selection = (_b = (_a = getRootDocument(this)) === null || _a === void 0 ? void 0 : _a.querySelector(this.selection)) !== null && _b !== void 0 ? _b : null;
|
|
2658
2713
|
}
|
|
2659
2714
|
else {
|
|
2660
2715
|
$selection = this.closest(this.$getTagNameOf(CROPPER_SELECTION));
|
|
@@ -2697,7 +2752,7 @@ class CropperViewer extends CropperElement {
|
|
|
2697
2752
|
super.disconnectedCallback();
|
|
2698
2753
|
}
|
|
2699
2754
|
$handleSelectionChange(event) {
|
|
2700
|
-
this.$render(event.detail);
|
|
2755
|
+
this.$render(event.defaultPrevented ? this.$selection : event.detail);
|
|
2701
2756
|
}
|
|
2702
2757
|
$handleSourceImageLoad() {
|
|
2703
2758
|
const { $image, $sourceImage } = this;
|
|
@@ -2706,9 +2761,7 @@ class CropperViewer extends CropperElement {
|
|
|
2706
2761
|
if (newSrc && newSrc !== oldSrc) {
|
|
2707
2762
|
$image.setAttribute('src', newSrc);
|
|
2708
2763
|
$image.$ready(() => {
|
|
2709
|
-
|
|
2710
|
-
this.$render();
|
|
2711
|
-
}, 50);
|
|
2764
|
+
this.$render();
|
|
2712
2765
|
});
|
|
2713
2766
|
}
|
|
2714
2767
|
}
|
|
@@ -2767,7 +2820,10 @@ class CropperViewer extends CropperElement {
|
|
|
2767
2820
|
this.$scale = scale;
|
|
2768
2821
|
this.$setStyles(styles);
|
|
2769
2822
|
if (this.$sourceImage) {
|
|
2770
|
-
|
|
2823
|
+
// Transform the image by the selection offset after the next DOM update cycle
|
|
2824
|
+
setTimeout(() => {
|
|
2825
|
+
this.$transformImageByOffset(matrix !== null && matrix !== void 0 ? matrix : this.$sourceImage.$getTransform(), -x, -y);
|
|
2826
|
+
});
|
|
2771
2827
|
}
|
|
2772
2828
|
}
|
|
2773
2829
|
$transformImageByOffset(matrix, x, y) {
|
|
@@ -2789,7 +2845,7 @@ class CropperViewer extends CropperElement {
|
|
|
2789
2845
|
}
|
|
2790
2846
|
}
|
|
2791
2847
|
CropperViewer.$name = CROPPER_VIEWER;
|
|
2792
|
-
CropperViewer.$version = '2.
|
|
2848
|
+
CropperViewer.$version = '2.1.0';
|
|
2793
2849
|
|
|
2794
2850
|
/*! Cropper.js v2.0.0 | (c) 2015-present Chen Fengyuan | MIT */
|
|
2795
2851
|
CropperCanvas.$define();
|