@dnncommunity/dnn-elements 0.27.4 → 0.27.5
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/cjs/dnn-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/dnn-button.cjs.entry.js +1 -1
- package/dist/cjs/dnn-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/dnn-chevron.cjs.entry.js +1 -1
- package/dist/cjs/dnn-collapsible.cjs.entry.js +1 -1
- package/dist/cjs/dnn-color-input.cjs.entry.js +1 -1
- package/dist/cjs/dnn-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/dnn-dropzone.cjs.entry.js +1 -1
- package/dist/cjs/dnn-fieldset.cjs.entry.js +1 -1
- package/dist/cjs/dnn-image-cropper.cjs.entry.js +1 -1
- package/dist/cjs/dnn-input.cjs.entry.js +1 -1
- package/dist/cjs/dnn-modal.cjs.entry.js +1 -1
- package/dist/cjs/dnn-monaco-editor.cjs.entry.js +1 -1
- package/dist/cjs/dnn-permissions-grid.cjs.entry.js +1 -1
- package/dist/cjs/dnn-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dnn-richtext.cjs.entry.js +1 -1
- package/dist/cjs/dnn-searchbox.cjs.entry.js +1 -1
- package/dist/cjs/dnn-select.cjs.entry.js +1 -1
- package/dist/cjs/dnn-sort-icon.cjs.entry.js +1 -1
- package/dist/cjs/dnn-tab_2.cjs.entry.js +1 -1
- package/dist/cjs/dnn-textarea.cjs.entry.js +1 -1
- package/dist/cjs/dnn-toggle.cjs.entry.js +1 -1
- package/dist/cjs/dnn-treeview-item.cjs.entry.js +1 -1
- package/dist/cjs/dnn-vertical-overflow-menu.cjs.entry.js +1 -1
- package/dist/cjs/dnn-vertical-splitview.cjs.entry.js +1 -1
- package/dist/cjs/dnn.cjs.js +2 -2
- package/dist/cjs/dnn.cjs.js.map +1 -1
- package/dist/cjs/{index-K23KQE7g.js → index-BzSsiRML.js} +3 -3
- package/dist/cjs/{index-K23KQE7g.js.map → index-BzSsiRML.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/dnn/dnn.esm.js +1 -1
- package/dist/dnn/dnn.esm.js.map +1 -1
- package/dist/dnn/{p-772efdc9.entry.js → p-00b0e3d0.entry.js} +2 -2
- package/dist/dnn/{p-0d2e6bec.entry.js → p-0d99c2b8.entry.js} +2 -2
- package/dist/dnn/{p-87c5a3e1.entry.js → p-1d262137.entry.js} +2 -2
- package/dist/dnn/{p-45a86dce.entry.js → p-3b0899a5.entry.js} +2 -2
- package/dist/dnn/{p-fbcbff0c.entry.js → p-4590b154.entry.js} +2 -2
- package/dist/dnn/{p-4dcaf4b8.entry.js → p-4986fe41.entry.js} +2 -2
- package/dist/dnn/{p-f5e55951.entry.js → p-4ac36eed.entry.js} +2 -2
- package/dist/dnn/{p-339fd231.entry.js → p-5874cffe.entry.js} +2 -2
- package/dist/dnn/{p-3debecb2.entry.js → p-5d0daad5.entry.js} +2 -2
- package/dist/dnn/{p-f6248aff.entry.js → p-7870677a.entry.js} +2 -2
- package/dist/dnn/{p-e9230fb6.entry.js → p-7a7d02d5.entry.js} +2 -2
- package/dist/dnn/{p-c2af08af.entry.js → p-8a5225c9.entry.js} +2 -2
- package/dist/dnn/{p-2669f569.entry.js → p-8f3fa786.entry.js} +2 -2
- package/dist/dnn/{p-jUj9nGA3.js → p-DF1WoBK0.js} +1 -1
- package/dist/dnn/{p-jUj9nGA3.js.map → p-DF1WoBK0.js.map} +1 -1
- package/dist/dnn/{p-8cf49dba.entry.js → p-a4714e37.entry.js} +2 -2
- package/dist/dnn/{p-246e9d22.entry.js → p-a9b12047.entry.js} +2 -2
- package/dist/dnn/{p-7529ec9c.entry.js → p-b693f031.entry.js} +2 -2
- package/dist/dnn/{p-7c143bf2.entry.js → p-c0c459af.entry.js} +2 -2
- package/dist/dnn/{p-fec2ad79.entry.js → p-c62166d5.entry.js} +2 -2
- package/dist/dnn/{p-27bea35c.entry.js → p-c94f23b7.entry.js} +2 -2
- package/dist/dnn/{p-5d2634a6.entry.js → p-cb110d7a.entry.js} +2 -2
- package/dist/dnn/{p-3f1c1037.entry.js → p-d35b5b70.entry.js} +2 -2
- package/dist/dnn/{p-1c0ed7f8.entry.js → p-ddeb8569.entry.js} +2 -2
- package/dist/dnn/{p-005f113b.entry.js → p-e8f9b0bd.entry.js} +2 -2
- package/dist/dnn/{p-c26d7825.entry.js → p-eef24ba4.entry.js} +2 -2
- package/dist/dnn/{p-0a610d48.entry.js → p-ef391dd8.entry.js} +2 -2
- package/dist/esm/dnn-autocomplete.entry.js +1 -1
- package/dist/esm/dnn-button.entry.js +1 -1
- package/dist/esm/dnn-checkbox.entry.js +1 -1
- package/dist/esm/dnn-chevron.entry.js +1 -1
- package/dist/esm/dnn-collapsible.entry.js +1 -1
- package/dist/esm/dnn-color-input.entry.js +1 -1
- package/dist/esm/dnn-color-picker.entry.js +1 -1
- package/dist/esm/dnn-dropzone.entry.js +1 -1
- package/dist/esm/dnn-fieldset.entry.js +1 -1
- package/dist/esm/dnn-image-cropper.entry.js +1 -1
- package/dist/esm/dnn-input.entry.js +1 -1
- package/dist/esm/dnn-modal.entry.js +1 -1
- package/dist/esm/dnn-monaco-editor.entry.js +1 -1
- package/dist/esm/dnn-permissions-grid.entry.js +1 -1
- package/dist/esm/dnn-progress-bar.entry.js +1 -1
- package/dist/esm/dnn-richtext.entry.js +1 -1
- package/dist/esm/dnn-searchbox.entry.js +1 -1
- package/dist/esm/dnn-select.entry.js +1 -1
- package/dist/esm/dnn-sort-icon.entry.js +1 -1
- package/dist/esm/dnn-tab_2.entry.js +1 -1
- package/dist/esm/dnn-textarea.entry.js +1 -1
- package/dist/esm/dnn-toggle.entry.js +1 -1
- package/dist/esm/dnn-treeview-item.entry.js +1 -1
- package/dist/esm/dnn-vertical-overflow-menu.entry.js +1 -1
- package/dist/esm/dnn-vertical-splitview.entry.js +1 -1
- package/dist/esm/dnn.js +3 -3
- package/dist/esm/dnn.js.map +1 -1
- package/dist/esm/{index-jUj9nGA3.js → index-DF1WoBK0.js} +3 -3
- package/dist/esm/{index-jUj9nGA3.js.map → index-DF1WoBK0.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/types/stencil-public-runtime.d.ts +19 -0
- package/package.json +6 -2
- /package/dist/dnn/{p-772efdc9.entry.js.map → p-00b0e3d0.entry.js.map} +0 -0
- /package/dist/dnn/{p-0d2e6bec.entry.js.map → p-0d99c2b8.entry.js.map} +0 -0
- /package/dist/dnn/{p-87c5a3e1.entry.js.map → p-1d262137.entry.js.map} +0 -0
- /package/dist/dnn/{p-45a86dce.entry.js.map → p-3b0899a5.entry.js.map} +0 -0
- /package/dist/dnn/{p-fbcbff0c.entry.js.map → p-4590b154.entry.js.map} +0 -0
- /package/dist/dnn/{p-4dcaf4b8.entry.js.map → p-4986fe41.entry.js.map} +0 -0
- /package/dist/dnn/{p-f5e55951.entry.js.map → p-4ac36eed.entry.js.map} +0 -0
- /package/dist/dnn/{p-339fd231.entry.js.map → p-5874cffe.entry.js.map} +0 -0
- /package/dist/dnn/{p-3debecb2.entry.js.map → p-5d0daad5.entry.js.map} +0 -0
- /package/dist/dnn/{p-f6248aff.entry.js.map → p-7870677a.entry.js.map} +0 -0
- /package/dist/dnn/{p-e9230fb6.entry.js.map → p-7a7d02d5.entry.js.map} +0 -0
- /package/dist/dnn/{p-c2af08af.entry.js.map → p-8a5225c9.entry.js.map} +0 -0
- /package/dist/dnn/{p-2669f569.entry.js.map → p-8f3fa786.entry.js.map} +0 -0
- /package/dist/dnn/{p-8cf49dba.entry.js.map → p-a4714e37.entry.js.map} +0 -0
- /package/dist/dnn/{p-246e9d22.entry.js.map → p-a9b12047.entry.js.map} +0 -0
- /package/dist/dnn/{p-7529ec9c.entry.js.map → p-b693f031.entry.js.map} +0 -0
- /package/dist/dnn/{p-7c143bf2.entry.js.map → p-c0c459af.entry.js.map} +0 -0
- /package/dist/dnn/{p-fec2ad79.entry.js.map → p-c62166d5.entry.js.map} +0 -0
- /package/dist/dnn/{p-27bea35c.entry.js.map → p-c94f23b7.entry.js.map} +0 -0
- /package/dist/dnn/{p-5d2634a6.entry.js.map → p-cb110d7a.entry.js.map} +0 -0
- /package/dist/dnn/{p-3f1c1037.entry.js.map → p-d35b5b70.entry.js.map} +0 -0
- /package/dist/dnn/{p-1c0ed7f8.entry.js.map → p-ddeb8569.entry.js.map} +0 -0
- /package/dist/dnn/{p-005f113b.entry.js.map → p-e8f9b0bd.entry.js.map} +0 -0
- /package/dist/dnn/{p-c26d7825.entry.js.map → p-eef24ba4.entry.js.map} +0 -0
- /package/dist/dnn/{p-0a610d48.entry.js.map → p-ef391dd8.entry.js.map} +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
package/dist/dnn/dnn.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as l}from"./p-
|
|
1
|
+
import{p as e,b as l}from"./p-DF1WoBK0.js";export{s as setNonce}from"./p-DF1WoBK0.js";import{g as a}from"./p-DQuL1Twl.js";var t=()=>{const l=import.meta.url;const a={};if(l!==""){a.resourcesUrl=new URL(".",l).href}return e(a)};t().then((async e=>{await a();return l([["p-e8f9b0bd",[[65,"dnn-color-input",{color:[1025],contrastColor:[1025,"contrast-color"],lightColor:[1025,"light-color"],darkColor:[1025,"dark-color"],label:[1],readonly:[4],localization:[16],name:[1],helpText:[1,"help-text"],useContrastColor:[4,"use-contrast-color"],useLightColor:[4,"use-light-color"],useDarkColor:[4,"use-dark-color"],currentColor:[32],focused:[32]},null,{currentColor:["currentColorChanged"]}]]],["p-00b0e3d0",[[65,"dnn-image-cropper",{width:[2],height:[2],resx:[16],quality:[2],preventUndersized:[4,"prevent-undersized"],name:[1],view:[32],localResx:[32],fileName:[32],focused:[32],clear:[64]},null,{resx:["resxChanged"]}]]],["p-3b0899a5",[[65,"dnn-autocomplete",{label:[1],name:[1],helpText:[1,"help-text"],value:[1537],required:[4],disabled:[4],suggestions:[16],renderSuggestion:[16,"render-suggestion"],totalSuggestions:[2,"total-suggestions"],preloadThresholdPixels:[2,"preload-threshold-pixels"],autocomplete:[1],focused:[32],valid:[32],customValidityMessage:[32],selectedIndex:[32],positionInitialized:[32],lastScrollTop:[32],displayValue:[32],checkValidity:[64],setCustomValidity:[64]},[[4,"click","handleClick"]],{value:["handleValueChange"]}]]],["p-a9b12047",[[65,"dnn-input",{type:[1025],label:[1],name:[1],value:[1544],helpText:[1,"help-text"],required:[4],disabled:[4],autocomplete:[1],min:[8],max:[8],minlength:[2],maxlength:[2],multiple:[4],pattern:[1],readonly:[4],step:[8],disableValidityReporting:[4,"disable-validity-reporting"],allowShowPassword:[4,"allow-show-password"],inputmode:[1],focused:[32],valid:[32],checkValidity:[64],setCustomValidity:[64]}]]],["p-7870677a",[[65,"dnn-select",{label:[1],name:[1],required:[4],helpText:[1,"help-text"],disabled:[4],autocomplete:[1],value:[1537],focused:[32],valid:[32],customValidityMessage:[32],checkValidity:[64]}]]],["p-8a5225c9",[[65,"dnn-textarea",{resizable:[1],value:[1025],label:[1],name:[1],helpText:[1,"help-text"],required:[4],disabled:[4],autocomplete:[1],minlength:[2],maxlength:[2],readonly:[4],rows:[2],focused:[32],valid:[32],customValidityMessage:[32],checkValidity:[64],setCustomValidity:[64]}]]],["p-4590b154",[[1,"dnn-treeview-item",{expanded:[1540],hasChildren:[32],focused:[32]},null,{expanded:["watchExpanded"]}]]],["p-8f3fa786",[[1,"dnn-chevron",{expandText:[1,"expand-text"],collapseText:[1,"collapse-text"],expanded:[1540],focused:[32]},null,{expanded:["handleExpandedChanged"]}]]],["p-c62166d5",[[66,"dnn-monaco-editor",{language:[1],value:[1025],name:[1],focused:[32]},null,{language:["languageChanged"],value:["valueChanged"]}]]],["p-cb110d7a",[[1,"dnn-progress-bar",{value:[2],max:[2],useGradient:[4,"use-gradient"]}]]],["p-5d0daad5",[[64,"dnn-richtext",{options:[16],value:[1],name:[1],plugins:[16],customizeOptions:[16,"customize-options"],focused:[32]},null,{value:["watchValueChanged"]}]]],["p-4986fe41",[[1,"dnn-sort-icon",{sortDirection:[1025,"sort-direction"],focused:[32]}]]],["p-b693f031",[[65,"dnn-toggle",{checked:[1028],disabled:[4],name:[1],value:[1],focused:[32]},[[2,"click","handleClick"]],{checked:["checkedChanged"]}]]],["p-4ac36eed",[[1,"dnn-vertical-overflow-menu",{showDropdownButton:[32],showDropdownMenu:[32]}]]],["p-ef391dd8",[[1,"dnn-vertical-splitview",{splitterWidth:[2,"splitter-width"],splitWidthPercentage:[1026,"split-width-percentage"],leftWidth:[32],rightWidth:[32],setSplitWidthPercentage:[64],getSplitWidthPercentage:[64]}]]],["p-c0c459af",[[65,"dnn-checkbox",{checked:[1025],useIntermediate:[4,"use-intermediate"],value:[1],name:[1],required:[4],nextStateHandler:[16,"next-state-handler"],requiredMessage:[1,"required-message"],focused:[32],valid:[32],checkValidity:[64]},[[2,"click","handleClick"]],{checked:["handleCheckedChange"]}]]],["p-a4714e37",[[1,"dnn-color-picker",{color:[1],colorBoxHeight:[1,"color-box-height"],currentColor:[32],rgbDisplay:[32],hslDisplay:[32],hexDisplay:[32],focused:[32]},null,{currentColor:["handeCurrentColorChanged"]}]]],["p-5874cffe",[[65,"dnn-dropzone",{resx:[16],allowedExtensions:[16,"allowed-extensions"],allowCameraMode:[4,"allow-camera-mode"],captureQuality:[2,"capture-quality"],maxFileSize:[2,"max-file-size"],name:[1],canTakeSnapshots:[32],takingPicture:[32],fileTooLarge:[32],invalidExtension:[32],localResx:[32],focused:[32]},null,{resx:["resxChanged"]}]]],["p-1d262137",[[1,"dnn-searchbox",{placeholder:[1],debounceTime:[2,"debounce-time"],query:[1025],focused:[32]},null,{query:["handleQueryChanged"]}]]],["p-eef24ba4",[[1,"dnn-tab",{tabTitle:[1,"tab-title"],visible:[32],show:[64],hide:[64]}],[1,"dnn-tabs",{tabTitles:[32],selectedTabTitle:[32]}]]],["p-ddeb8569",[[1,"dnn-collapsible",{expanded:[516],transitionDuration:[2,"transition-duration"],updateSize:[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]],{expanded:["handledExpandedChanged"]}]]],["p-0d99c2b8",[[1,"dnn-modal",{backdropDismiss:[4,"backdrop-dismiss"],preventBackdropDismiss:[1540,"prevent-backdrop-dismiss"],closeText:[1,"close-text"],resizable:[4],showCloseButton:[4,"show-close-button"],hideCloseButton:[1540,"hide-close-button"],visible:[1540],show:[64],hide:[64]}]]],["p-7a7d02d5",[[65,"dnn-button",{appearance:[1],type:[1],formButtonType:[1,"form-button-type"],reversed:[4],size:[1],confirm:[4],confirmYesText:[1,"confirm-yes-text"],confirmNoText:[1,"confirm-no-text"],confirmMessage:[1,"confirm-message"],disabled:[4],focused:[32],modalVisible:[32]}]]],["p-c94f23b7",[[1,"dnn-permissions-grid",{permissions:[1040],roleGroups:[16,"role-groups"],roles:[16],resx:[16],foundUsers:[16,"found-users"],selectedRoleGroupId:[32],userQuery:[32],pickedUser:[32],localResx:[32],focused:[32]},null,{foundUsers:["handleFoundUsersChanged"],resx:["resxChanged"]}]]],["p-d35b5b70",[[1,"dnn-fieldset",{focused:[1540],disabled:[1540],invalid:[1540],label:[1],floatLabel:[1540,"float-label"],helpText:[1,"help-text"],resizable:[1],customValidityMessage:[32],setFocused:[64],setBlurred:[64],disable:[64],enable:[64],pinLabel:[64],unpinLabel:[64],setValidity:[64]}]]]],e)}));
|
|
2
2
|
//# sourceMappingURL=dnn.esm.js.map
|
package/dist/dnn/dnn.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dnn.esm.js","sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.
|
|
1
|
+
{"version":3,"file":"dnn.esm.js","sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.31.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, H, promiseResolve, win } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG;AACpC,EAAE,MAAM,IAAI,GAAiE,EAAE;AAC/E,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI;AACrD;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAM,aAAa,EAAE;AACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D,CAAC,CAAC","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,g as o}from"./p-jUj9nGA3.js";import{g as h}from"./p-DMm7UhBf.js";var a;(function(e){e[e["nw"]=0]="nw";e[e["ne"]=1]="ne";e[e["se"]=2]="se";e[e["sw"]=3]="sw"})(a||(a={}));var r=a;function c(e,t){let i=e.split(",");let s=i[0].match(/:(.*?);/)[1];let o=atob(i[1]);let h=o.length;let a=new Uint8Array(h);while(h>0){h--;a[h]=o.charCodeAt(h)}let r=new Blob([a],{type:s});return new File([r],t,{type:s})}const n=":host{display:block}canvas{display:none}.view{visibility:hidden;opacity:0;height:0;overflow:hidden;transition:all 300ms ease-in-out}.view.visible{visibility:visible;opacity:1;height:initial;overflow:visible}.view .cropper{position:relative;width:100%}.view .cropper img{width:100%;display:block;margin:0 auto}.view .cropper .backdrop{backdrop-filter:saturate(0.5);backdrop-filter:brightness(0.5);position:absolute;left:0;top:0;width:100%;height:100%}.view .cropper .crop{position:absolute;top:0;left:0;width:100%;height:100%;outline:2px dashed white;box-shadow:black 0 0 0px 2px;backdrop-filter:saturate(2);backdrop-filter:brightness(2);cursor:move}.view .cropper .crop>div{width:20px;height:20px;background-color:white;border:2px solid rgba(0, 0, 0, 0.5);position:absolute}.view .cropper .crop>div.nw,.view .cropper .crop>div.ne{top:-17px}.view .cropper .crop>div.ne,.view .cropper .crop>div.se{right:-17px}.view .cropper .crop>div.se,.view .cropper .crop>div.sw{bottom:-17px}.view .cropper .crop>div.sw,.view .cropper .crop>div.nw{left:-17px}.view .cropper .crop>div.nw,.view .cropper .crop>div.se{cursor:nwse-resize}.view .cropper .crop>div.ne,.view .cropper .crop>div.sw{cursor:nesw-resize}dnn-modal{--max-width:512px}";const d=class{constructor(i){e(this,i);this.imageCropChanged=t(this,"imageCropChanged",7);this.imageFileCropChanged=t(this,"imageFileCropChanged",7);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.quality=.8;this.preventUndersized=false;this.focused=false;this.defaultResx={capture:"Capture",dragAndDropFile:"Drag and drop an image",or:"or",takePicture:"Take a picture",uploadFile:"Upload an image",imageTooSmall:"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.",modalCloseText:"Close"};this.initializeCropBox=()=>{const e=this.image.getBoundingClientRect();const t=this.width==undefined||this.height==undefined?NaN:this.width/this.height;let i,s;if(e.width/e.height>t){s=e.height;i=s*t}else{i=e.width;s=i/t}const o=(e.height-s)/2;const h=(e.width-i)/2;this.crop.style.top=`${Math.round(o)}px`;this.crop.style.left=`${Math.round(h)}px`;this.crop.style.width=`${Math.round(i)}px`;this.crop.style.height=`${Math.round(s)}px`};this.handleCropMouseDown=e=>{e.stopPropagation();e.preventDefault();const t=e.target;const i=t.classList[0];document.addEventListener("mouseup",this.handleImageCropFinished,false);document.addEventListener("touchend",this.handleImageCropFinished,false);switch(i){case"crop":document.addEventListener("mousemove",this.handleCropDrag,false);document.addEventListener("touchmove",this.handleCropDrag,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleCropDrag)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleCropDrag)));break;case"nw":document.addEventListener("mousemove",this.handleNwMouseMove,false);document.addEventListener("touchmove",this.handleNwMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleNwMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleNwMouseMove)));break;case"ne":document.addEventListener("mousemove",this.handleNeMouseMove,false);document.addEventListener("touchmove",this.handleNeMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleNeMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleNeMouseMove)));break;case"se":document.addEventListener("mousemove",this.handleSeMouseMove,false);document.addEventListener("touchmove",this.handleSeMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleSeMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleSeMouseMove)));break;case"sw":document.addEventListener("mousemove",this.handleSwMouseMove,false);document.addEventListener("touchmove",this.handleSwMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleSwMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleSwMouseMove)));break}};this.handleImageCropFinished=e=>{this.emitImage();document.removeEventListener("mouseup",this.handleImageCropFinished);this.previousTouch=undefined};this.handleNwMouseMove=e=>{this.handleCornerDrag(e,r.nw)};this.handleNeMouseMove=e=>{this.handleCornerDrag(e,r.ne)};this.handleSeMouseMove=e=>{this.handleCornerDrag(e,r.se)};this.handleSwMouseMove=e=>{this.handleCornerDrag(e,r.sw)};this.handleCornerDrag=(e,t)=>{const i=this.width==undefined||this.height==undefined?NaN:this.width/this.height;const s=this.crop.getBoundingClientRect();const o=this.image.getBoundingClientRect();let{movementX:a,movementY:c}=h(e,this.previousTouch);let n,d;switch(t){case r.nw:n=s.width-a;d=s.height-c;break;case r.ne:n=s.width+a;d=s.height-c;break;case r.se:n=s.width+a;d=s.height+c;break;case r.sw:n=s.width-a;d=s.height+c}let u,p;if(!isNaN(i)){switch(t){case r.nw:d=n/i;u=s.bottom-d;break;case r.se:n=d*i;break;case r.ne:d=n/i;u=s.bottom-d;break;case r.sw:n=d*i;p=s.right-n;break}}switch(t){case r.nw:u=this.crop.offsetTop+(s.height-d);p=this.crop.offsetLeft+(s.width-n);break;case r.ne:u=this.crop.offsetTop+(s.height-d);p=this.crop.offsetLeft;break;case r.se:u=this.crop.offsetTop;p=this.crop.offsetLeft;break;case r.sw:u=this.crop.offsetTop;p=this.crop.offsetLeft+(s.width-n);break}if(p<0){n+=p;p=0}if(u<0){d+=u;u=0}if(p+n>o.width){n=o.width-p}if(u+d>o.height){d=o.height-u}if(!isNaN(i)){switch(t){case r.se:case r.sw:n=d*i;if(p+n>o.width){n=o.width-p;d=n/i}break}}if(this.preventUndersized){const e=this.image.width/this.image.naturalWidth;if(n/e<(this.width||NaN)||d/e<(this.height||NaN)){return}}this.crop.style.top=`${u}px`;this.crop.style.left=`${p}px`;this.crop.style.width=`${n}px`;this.crop.style.height=`${d}px`};this.handleCropDrag=e=>{if(!this.isMouseStillInTarget(e)){return}let{movementX:t,movementY:i}=h(e,this.previousTouch);let s=this.crop.offsetLeft+t;let o=this.crop.offsetTop+i;var a=this.image.getBoundingClientRect();var r=this.crop.getBoundingClientRect();if(s<0){s=0}if(o<0){o=0}if(s+r.width>a.width){s=this.crop.offsetLeft}if(o+r.height>a.height){o=this.crop.offsetTop}this.crop.style.left=s+"px";this.crop.style.top=o+"px"}}async clear(){this.setView("noPictureView")}componentWillLoad(){this.mergeResx()}componentDidLoad(){requestAnimationFrame((()=>{this.setView("noPictureView")}))}resxChanged(){this.mergeResx()}formResetCallback(){this.clear();this.internals.setValidity({});this.internals.setFormValue("")}mergeResx(){this.localResx=Object.assign(Object.assign({},this.defaultResx),this.resx)}setView(e){const t=this.host.shadowRoot.querySelectorAll(".view");t.forEach((e=>e.classList.remove("visible")));switch(e){case"noPictureView":this.noPictureView.classList.add("visible");break;case"hasPictureView":this.hasPictureView.classList.add("visible");break}this.view=e}initCrop(){this.crop.style.top="0px";this.crop.style.left="0px";this.crop.style.width="100%";this.crop.style.height="100%";if(this.width==null||this.height==null){return}const e=this.width/this.height;const t=this.image.getBoundingClientRect();const i=t.width/t.height;if(e>i){const i=t.width/e;const s=t.height-i;this.crop.style.top=`${Math.round(s/2)}px`;this.crop.style.height=`${Math.round(i)}px`}else{const i=t.height*e;const s=t.width-i;this.crop.style.left=`${Math.round(s/2)}px`;this.crop.style.width=`${Math.round(i)}px`}}setImage(){this.image.addEventListener("load",(()=>{this.initCrop();this.emitImage()}));this.image.src=this.canvas.toDataURL()}handleNewFile(e){if(e.type.split("/")[0]!="image"){return}this.fileName=e.name;var t=new FileReader;t.onload=e=>{var t=new Image;t.onload=()=>{this.canvas.width=t.width;this.canvas.height=t.height;if(this.preventUndersized&&this.width!=undefined&&this.height!=undefined&&(t.width<this.width||t.height<this.height)){this.imageTooSmallModal.show();return}var e=this.canvas.getContext("2d");e.drawImage(t,0,0);requestAnimationFrame((()=>{this.setView("hasPictureView")}));requestAnimationFrame((()=>{this.setImage()}));requestAnimationFrame((()=>{this.initializeCropBox()}))};t.src=e.target.result.toString()};t.readAsDataURL(e)}emitImage(){var e,t;var i=this.crop.offsetLeft/this.image.width*this.image.naturalWidth;var s=this.crop.offsetTop/this.image.height*this.image.naturalHeight;var o=this.crop.getBoundingClientRect();var h=o.width/this.image.width*this.image.naturalWidth;var a=o.height/this.image.height*this.image.naturalHeight;if(i<0)i=0;if(i>this.image.naturalWidth)i=this.image.naturalWidth;if(s<0)s=0;if(s>this.image.naturalWidth)s=this.image.naturalWidth;if(h>this.image.naturalWidth)h=this.image.naturalWidth;if(a>this.image.naturalHeight)a=this.image.naturalHeight;var r=this.generateCroppedImage(i,s,h,a,(e=this.width)!==null&&e!==void 0?e:h,(t=this.height)!==null&&t!==void 0?t:a);this.imageCropChanged.emit(r);var n=c(r,this.fileName);this.imageFileCropChanged.emit(n);if(this.name!=undefined){var d=new FormData;d.append(this.name,n);this.internals.setFormValue(d)}}generateCroppedImage(e,t,i,s,o,h){this.canvas.width=o;this.canvas.height=h;const a=this.canvas.getContext("2d");a.clearRect(0,0,o,h);a.drawImage(this.image,e,t,i,s,0,0,o,h);return this.canvas.toDataURL("image/jpeg",this.quality)}isMouseStillInTarget(e){var t=false;let i=0;let s=0;const o=this.image.getBoundingClientRect();if(e instanceof MouseEvent){i=e.clientX;s=e.clientY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var h=e.touches[0];i=h.clientX;s=h.clientY}}if(i>=o.x&&s>=o.y&&i<=o.left+o.width&&s<=o.top+o.height){t=true}var a=this.crop.querySelectorAll("div");a.forEach((e=>{var o=e.getBoundingClientRect();if(i>=o.x&&s>=o.y&&i<=o.left+o.width&&s<=o.top+o.height){t=true}}));return t}render(){var e,t;return i(s,{key:"af6c2df1c0df146d783f4616fec7da29468eaa04",tabIndex:this.focused?-1:0,onFocus:()=>this.inputField.focus(),onBlur:()=>this.inputField.blur()},i("canvas",{key:"7af554950d5b58e3efaee38c624ed24939407937",ref:e=>this.canvas=e}),i("div",{key:"7a09006b6790eb3934e881ebe109a9b3dd2750f9",class:"view",ref:e=>this.hasPictureView=e},i("div",{key:"5c116796354c0e2bd3dd6d69593fc40898a78fc9",class:"cropper"},i("img",{key:"87f72f7b69e01337d71e4291055a9ffbca5f4c96",ref:e=>this.image=e,alt:this.fileName}),i("div",{key:"c24a87d142bfab627f8ed0d9647a2b73efe76954",class:"backdrop"}),i("div",{key:"066f4e30840fea38819be154bb0833703467205a",class:"crop",ref:e=>this.crop=e,onMouseDown:this.handleCropMouseDown,onTouchStart:this.handleCropMouseDown},i("div",{key:"bc8cdcee09201ca61ead012f58e91df58dc1bb10",class:"nw"}),i("div",{key:"dacc389bbdb9a54439400af6eb6fd285fd5d4de2",class:"ne"}),i("div",{key:"a2b7edb579cd3a9cfe2f44557a8dd7447ca45fd0",class:"se"}),i("div",{key:"e1381b9569a19d70450f8e344ffffc3fa7c6ec39",class:"sw"})))),i("div",{key:"0a1e8be2893e8c09bff591169122a46754c2a12a",class:"view",ref:e=>this.noPictureView=e},i("dnn-dropzone",{key:"fb134de05e5fcff750f7444f903ee9f542f4ee4b",allowCameraMode:true,onFilesSelected:e=>this.handleNewFile(e.detail[0]),allowedExtensions:["jpg","jpeg","gif","png","svg","webp","bmp"],resx:{capture:this.localResx.capture,dragAndDropFile:this.localResx.dragAndDropFile,or:this.localResx.or,takePicture:this.localResx.takePicture,uploadFile:this.localResx.uploadFile,uploadSizeTooLarge:"The file you tried to upload is too large.",fileSizeLimit:"The maximum size is"},ref:e=>this.inputField=e,onFocus:()=>this.focused=true,onBlur:()=>this.focused=false})),i("dnn-modal",{key:"c9b9f9820d574c0272224fbd7dc2ba7ef178b1b7",ref:e=>this.imageTooSmallModal=e,"close-text":this.localResx.modalCloseText},i("p",{key:"f9bb9c355af33f26d295f76067c60194b2f4532e"},this.localResx.imageTooSmall.replace("{width}",((e=this.width)===null||e===void 0?void 0:e.toString())||"").replace("{height}",((t=this.height)===null||t===void 0?void 0:t.toString())||""))))}static get formAssociated(){return true}get host(){return o(this)}static get watchers(){return{resx:["resxChanged"]}}};d.style=n;export{d as dnn_image_cropper};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as i,H as s,g as o}from"./p-DF1WoBK0.js";import{g as h}from"./p-DMm7UhBf.js";var a;(function(e){e[e["nw"]=0]="nw";e[e["ne"]=1]="ne";e[e["se"]=2]="se";e[e["sw"]=3]="sw"})(a||(a={}));var r=a;function c(e,t){let i=e.split(",");let s=i[0].match(/:(.*?);/)[1];let o=atob(i[1]);let h=o.length;let a=new Uint8Array(h);while(h>0){h--;a[h]=o.charCodeAt(h)}let r=new Blob([a],{type:s});return new File([r],t,{type:s})}const n=":host{display:block}canvas{display:none}.view{visibility:hidden;opacity:0;height:0;overflow:hidden;transition:all 300ms ease-in-out}.view.visible{visibility:visible;opacity:1;height:initial;overflow:visible}.view .cropper{position:relative;width:100%}.view .cropper img{width:100%;display:block;margin:0 auto}.view .cropper .backdrop{backdrop-filter:saturate(0.5);backdrop-filter:brightness(0.5);position:absolute;left:0;top:0;width:100%;height:100%}.view .cropper .crop{position:absolute;top:0;left:0;width:100%;height:100%;outline:2px dashed white;box-shadow:black 0 0 0px 2px;backdrop-filter:saturate(2);backdrop-filter:brightness(2);cursor:move}.view .cropper .crop>div{width:20px;height:20px;background-color:white;border:2px solid rgba(0, 0, 0, 0.5);position:absolute}.view .cropper .crop>div.nw,.view .cropper .crop>div.ne{top:-17px}.view .cropper .crop>div.ne,.view .cropper .crop>div.se{right:-17px}.view .cropper .crop>div.se,.view .cropper .crop>div.sw{bottom:-17px}.view .cropper .crop>div.sw,.view .cropper .crop>div.nw{left:-17px}.view .cropper .crop>div.nw,.view .cropper .crop>div.se{cursor:nwse-resize}.view .cropper .crop>div.ne,.view .cropper .crop>div.sw{cursor:nesw-resize}dnn-modal{--max-width:512px}";const d=class{constructor(i){e(this,i);this.imageCropChanged=t(this,"imageCropChanged",7);this.imageFileCropChanged=t(this,"imageFileCropChanged",7);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.quality=.8;this.preventUndersized=false;this.focused=false;this.defaultResx={capture:"Capture",dragAndDropFile:"Drag and drop an image",or:"or",takePicture:"Take a picture",uploadFile:"Upload an image",imageTooSmall:"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.",modalCloseText:"Close"};this.initializeCropBox=()=>{const e=this.image.getBoundingClientRect();const t=this.width==undefined||this.height==undefined?NaN:this.width/this.height;let i,s;if(e.width/e.height>t){s=e.height;i=s*t}else{i=e.width;s=i/t}const o=(e.height-s)/2;const h=(e.width-i)/2;this.crop.style.top=`${Math.round(o)}px`;this.crop.style.left=`${Math.round(h)}px`;this.crop.style.width=`${Math.round(i)}px`;this.crop.style.height=`${Math.round(s)}px`};this.handleCropMouseDown=e=>{e.stopPropagation();e.preventDefault();const t=e.target;const i=t.classList[0];document.addEventListener("mouseup",this.handleImageCropFinished,false);document.addEventListener("touchend",this.handleImageCropFinished,false);switch(i){case"crop":document.addEventListener("mousemove",this.handleCropDrag,false);document.addEventListener("touchmove",this.handleCropDrag,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleCropDrag)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleCropDrag)));break;case"nw":document.addEventListener("mousemove",this.handleNwMouseMove,false);document.addEventListener("touchmove",this.handleNwMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleNwMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleNwMouseMove)));break;case"ne":document.addEventListener("mousemove",this.handleNeMouseMove,false);document.addEventListener("touchmove",this.handleNeMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleNeMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleNeMouseMove)));break;case"se":document.addEventListener("mousemove",this.handleSeMouseMove,false);document.addEventListener("touchmove",this.handleSeMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleSeMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleSeMouseMove)));break;case"sw":document.addEventListener("mousemove",this.handleSwMouseMove,false);document.addEventListener("touchmove",this.handleSwMouseMove,false);document.addEventListener("mouseup",(()=>document.removeEventListener("mousemove",this.handleSwMouseMove)));document.addEventListener("touchend",(()=>document.removeEventListener("touchmove",this.handleSwMouseMove)));break}};this.handleImageCropFinished=e=>{this.emitImage();document.removeEventListener("mouseup",this.handleImageCropFinished);this.previousTouch=undefined};this.handleNwMouseMove=e=>{this.handleCornerDrag(e,r.nw)};this.handleNeMouseMove=e=>{this.handleCornerDrag(e,r.ne)};this.handleSeMouseMove=e=>{this.handleCornerDrag(e,r.se)};this.handleSwMouseMove=e=>{this.handleCornerDrag(e,r.sw)};this.handleCornerDrag=(e,t)=>{const i=this.width==undefined||this.height==undefined?NaN:this.width/this.height;const s=this.crop.getBoundingClientRect();const o=this.image.getBoundingClientRect();let{movementX:a,movementY:c}=h(e,this.previousTouch);let n,d;switch(t){case r.nw:n=s.width-a;d=s.height-c;break;case r.ne:n=s.width+a;d=s.height-c;break;case r.se:n=s.width+a;d=s.height+c;break;case r.sw:n=s.width-a;d=s.height+c}let u,p;if(!isNaN(i)){switch(t){case r.nw:d=n/i;u=s.bottom-d;break;case r.se:n=d*i;break;case r.ne:d=n/i;u=s.bottom-d;break;case r.sw:n=d*i;p=s.right-n;break}}switch(t){case r.nw:u=this.crop.offsetTop+(s.height-d);p=this.crop.offsetLeft+(s.width-n);break;case r.ne:u=this.crop.offsetTop+(s.height-d);p=this.crop.offsetLeft;break;case r.se:u=this.crop.offsetTop;p=this.crop.offsetLeft;break;case r.sw:u=this.crop.offsetTop;p=this.crop.offsetLeft+(s.width-n);break}if(p<0){n+=p;p=0}if(u<0){d+=u;u=0}if(p+n>o.width){n=o.width-p}if(u+d>o.height){d=o.height-u}if(!isNaN(i)){switch(t){case r.se:case r.sw:n=d*i;if(p+n>o.width){n=o.width-p;d=n/i}break}}if(this.preventUndersized){const e=this.image.width/this.image.naturalWidth;if(n/e<(this.width||NaN)||d/e<(this.height||NaN)){return}}this.crop.style.top=`${u}px`;this.crop.style.left=`${p}px`;this.crop.style.width=`${n}px`;this.crop.style.height=`${d}px`};this.handleCropDrag=e=>{if(!this.isMouseStillInTarget(e)){return}let{movementX:t,movementY:i}=h(e,this.previousTouch);let s=this.crop.offsetLeft+t;let o=this.crop.offsetTop+i;var a=this.image.getBoundingClientRect();var r=this.crop.getBoundingClientRect();if(s<0){s=0}if(o<0){o=0}if(s+r.width>a.width){s=this.crop.offsetLeft}if(o+r.height>a.height){o=this.crop.offsetTop}this.crop.style.left=s+"px";this.crop.style.top=o+"px"}}async clear(){this.setView("noPictureView")}componentWillLoad(){this.mergeResx()}componentDidLoad(){requestAnimationFrame((()=>{this.setView("noPictureView")}))}resxChanged(){this.mergeResx()}formResetCallback(){this.clear();this.internals.setValidity({});this.internals.setFormValue("")}mergeResx(){this.localResx=Object.assign(Object.assign({},this.defaultResx),this.resx)}setView(e){const t=this.host.shadowRoot.querySelectorAll(".view");t.forEach((e=>e.classList.remove("visible")));switch(e){case"noPictureView":this.noPictureView.classList.add("visible");break;case"hasPictureView":this.hasPictureView.classList.add("visible");break}this.view=e}initCrop(){this.crop.style.top="0px";this.crop.style.left="0px";this.crop.style.width="100%";this.crop.style.height="100%";if(this.width==null||this.height==null){return}const e=this.width/this.height;const t=this.image.getBoundingClientRect();const i=t.width/t.height;if(e>i){const i=t.width/e;const s=t.height-i;this.crop.style.top=`${Math.round(s/2)}px`;this.crop.style.height=`${Math.round(i)}px`}else{const i=t.height*e;const s=t.width-i;this.crop.style.left=`${Math.round(s/2)}px`;this.crop.style.width=`${Math.round(i)}px`}}setImage(){this.image.addEventListener("load",(()=>{this.initCrop();this.emitImage()}));this.image.src=this.canvas.toDataURL()}handleNewFile(e){if(e.type.split("/")[0]!="image"){return}this.fileName=e.name;var t=new FileReader;t.onload=e=>{var t=new Image;t.onload=()=>{this.canvas.width=t.width;this.canvas.height=t.height;if(this.preventUndersized&&this.width!=undefined&&this.height!=undefined&&(t.width<this.width||t.height<this.height)){this.imageTooSmallModal.show();return}var e=this.canvas.getContext("2d");e.drawImage(t,0,0);requestAnimationFrame((()=>{this.setView("hasPictureView")}));requestAnimationFrame((()=>{this.setImage()}));requestAnimationFrame((()=>{this.initializeCropBox()}))};t.src=e.target.result.toString()};t.readAsDataURL(e)}emitImage(){var e,t;var i=this.crop.offsetLeft/this.image.width*this.image.naturalWidth;var s=this.crop.offsetTop/this.image.height*this.image.naturalHeight;var o=this.crop.getBoundingClientRect();var h=o.width/this.image.width*this.image.naturalWidth;var a=o.height/this.image.height*this.image.naturalHeight;if(i<0)i=0;if(i>this.image.naturalWidth)i=this.image.naturalWidth;if(s<0)s=0;if(s>this.image.naturalWidth)s=this.image.naturalWidth;if(h>this.image.naturalWidth)h=this.image.naturalWidth;if(a>this.image.naturalHeight)a=this.image.naturalHeight;var r=this.generateCroppedImage(i,s,h,a,(e=this.width)!==null&&e!==void 0?e:h,(t=this.height)!==null&&t!==void 0?t:a);this.imageCropChanged.emit(r);var n=c(r,this.fileName);this.imageFileCropChanged.emit(n);if(this.name!=undefined){var d=new FormData;d.append(this.name,n);this.internals.setFormValue(d)}}generateCroppedImage(e,t,i,s,o,h){this.canvas.width=o;this.canvas.height=h;const a=this.canvas.getContext("2d");a.clearRect(0,0,o,h);a.drawImage(this.image,e,t,i,s,0,0,o,h);return this.canvas.toDataURL("image/jpeg",this.quality)}isMouseStillInTarget(e){var t=false;let i=0;let s=0;const o=this.image.getBoundingClientRect();if(e instanceof MouseEvent){i=e.clientX;s=e.clientY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var h=e.touches[0];i=h.clientX;s=h.clientY}}if(i>=o.x&&s>=o.y&&i<=o.left+o.width&&s<=o.top+o.height){t=true}var a=this.crop.querySelectorAll("div");a.forEach((e=>{var o=e.getBoundingClientRect();if(i>=o.x&&s>=o.y&&i<=o.left+o.width&&s<=o.top+o.height){t=true}}));return t}render(){var e,t;return i(s,{key:"af6c2df1c0df146d783f4616fec7da29468eaa04",tabIndex:this.focused?-1:0,onFocus:()=>this.inputField.focus(),onBlur:()=>this.inputField.blur()},i("canvas",{key:"7af554950d5b58e3efaee38c624ed24939407937",ref:e=>this.canvas=e}),i("div",{key:"7a09006b6790eb3934e881ebe109a9b3dd2750f9",class:"view",ref:e=>this.hasPictureView=e},i("div",{key:"5c116796354c0e2bd3dd6d69593fc40898a78fc9",class:"cropper"},i("img",{key:"87f72f7b69e01337d71e4291055a9ffbca5f4c96",ref:e=>this.image=e,alt:this.fileName}),i("div",{key:"c24a87d142bfab627f8ed0d9647a2b73efe76954",class:"backdrop"}),i("div",{key:"066f4e30840fea38819be154bb0833703467205a",class:"crop",ref:e=>this.crop=e,onMouseDown:this.handleCropMouseDown,onTouchStart:this.handleCropMouseDown},i("div",{key:"bc8cdcee09201ca61ead012f58e91df58dc1bb10",class:"nw"}),i("div",{key:"dacc389bbdb9a54439400af6eb6fd285fd5d4de2",class:"ne"}),i("div",{key:"a2b7edb579cd3a9cfe2f44557a8dd7447ca45fd0",class:"se"}),i("div",{key:"e1381b9569a19d70450f8e344ffffc3fa7c6ec39",class:"sw"})))),i("div",{key:"0a1e8be2893e8c09bff591169122a46754c2a12a",class:"view",ref:e=>this.noPictureView=e},i("dnn-dropzone",{key:"fb134de05e5fcff750f7444f903ee9f542f4ee4b",allowCameraMode:true,onFilesSelected:e=>this.handleNewFile(e.detail[0]),allowedExtensions:["jpg","jpeg","gif","png","svg","webp","bmp"],resx:{capture:this.localResx.capture,dragAndDropFile:this.localResx.dragAndDropFile,or:this.localResx.or,takePicture:this.localResx.takePicture,uploadFile:this.localResx.uploadFile,uploadSizeTooLarge:"The file you tried to upload is too large.",fileSizeLimit:"The maximum size is"},ref:e=>this.inputField=e,onFocus:()=>this.focused=true,onBlur:()=>this.focused=false})),i("dnn-modal",{key:"c9b9f9820d574c0272224fbd7dc2ba7ef178b1b7",ref:e=>this.imageTooSmallModal=e,"close-text":this.localResx.modalCloseText},i("p",{key:"f9bb9c355af33f26d295f76067c60194b2f4532e"},this.localResx.imageTooSmall.replace("{width}",((e=this.width)===null||e===void 0?void 0:e.toString())||"").replace("{height}",((t=this.height)===null||t===void 0?void 0:t.toString())||""))))}static get formAssociated(){return true}get host(){return o(this)}static get watchers(){return{resx:["resxChanged"]}}};d.style=n;export{d as dnn_image_cropper};
|
|
2
|
+
//# sourceMappingURL=p-00b0e3d0.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,c as e,h as i,H as t,g as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,c as e,h as i,H as t,g as o}from"./p-DF1WoBK0.js";const a=":host{display:block}:host .overlay{background-color:rgba(0, 0, 0, 0.5);position:fixed;top:0;left:0;width:100%;height:100%;z-index:1002;display:flex;justify-content:center;align-items:center;backdrop-filter:blur(2px);transition:all 300ms ease-in-out;visibility:hidden;opacity:0}:host .overlay .modal{max-width:var(--max-width, 1200px);background-color:white;padding:30px;transform:scale(2);transition:transform 300ms ease-in-out;z-index:2;position:relative;max-height:80%;border-radius:var(--dnn-controls-radius, 5px);box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);display:block}:host .overlay .modal .content{max-width:80vw;max-height:80vh;overflow:auto}:host .overlay .modal .se{position:absolute;height:10px;width:10px;bottom:-5px;right:-5px;cursor:se-resize}:host .overlay .modal .close{position:absolute;background-color:white;border:2px solid white;border-radius:50%;padding:0;margin:0;top:-12px;right:-12px;outline:none;display:flex;justify-content:center;align-items:center}:host .overlay .modal .close:focus-visible,:host .overlay .modal .close:hover{box-shadow:0 0 2px 2px var(--dnn-color-primary, blue)}:host .overlay .modal .close svg{width:24px;height:24px;color:grey}:host .overlay.visible{visibility:visible;opacity:1}:host .overlay.visible .modal{transform:scale(1);box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);display:block}";const d=class{constructor(i){s(this,i);this.dismissed=e(this,"dismissed",7);this.preventBackdropDismiss=false;this.closeText="Close modal";this.resizable=false;this.hideCloseButton=false;this.visible=false;this.mouseX=0;this.mouseY=0;this.w=0;this.h=0;this.handleResizeMouseMove=s=>{const e=(s.clientX-this.mouseX)*2;const i=(s.clientY-this.mouseY)*2;this.modal.style.width=`${this.w+e}px`;this.modal.style.height=`${this.h+i}px`};this.handleResizeMouseDown=s=>{addEventListener("mousemove",this.handleResizeMouseMove);this.mouseX=s.clientX;this.mouseY=s.clientY;const e=getComputedStyle(this.modal);this.w=parseInt(e.width,10);this.h=parseInt(e.height,10)};this.handleResizeMouseUp=()=>{removeEventListener("mousemove",this.handleResizeMouseMove)}}async show(){this.visible=true}async hide(){this.visible=false}componentWillLoad(){if(this.backdropDismiss!=undefined){console.warn("The 'backdropDismiss' prop is deprecated. Use 'preventBackdropDismiss' instead.");this.preventBackdropDismiss=!this.backdropDismiss}if(this.showCloseButton!=undefined){console.warn("The 'showCloseButton' prop is deprecated. Use 'hideCloseButton' instead.");this.hideCloseButton=!this.showCloseButton}}componentDidLoad(){var s;(s=this.seDrag)===null||s===void 0?void 0:s.addEventListener("mousedown",this.handleResizeMouseDown);addEventListener("mouseup",this.handleResizeMouseUp)}disconnectedCallback(){var s;(s=this.seDrag)===null||s===void 0?void 0:s.removeEventListener("mousedown",this.handleResizeMouseDown);removeEventListener("mouseup",this.handleResizeMouseUp)}handleDismiss(){this.visible=false;this.dismissed.emit()}handleBackdropClick(s){const e=s.target;if(e.id==="backdrop"&&!this.preventBackdropDismiss){this.handleDismiss()}}render(){return i(t,{key:"1b553793159147c3bcbefe3feb0040dca184f279"},i("div",{key:"83d338885e97f2f5aae58826a503f0ef9acc129e",id:"backdrop",class:this.visible?"overlay visible":"overlay",onClick:s=>this.handleBackdropClick(s)},i("div",{key:"22b9240c98a27046d7f1a1105c11c97f8f22a3c7",class:"modal",ref:s=>this.modal=s},!this.hideCloseButton&&i("button",{key:"291c1da4d7a6036fdc74160e9542f6c88ec91cdd",class:"close","aria-label":this.closeText,onClick:()=>this.handleDismiss()},i("svg",{key:"6b42864cda915b5b2f9c0c3b31a12916f1329bdc",xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},i("path",{key:"8647863fb4e6eecfe0fde4b869fdf2f19613c34d",d:"M0 0h24v24H0z",fill:"none"}),i("path",{key:"ba4210c8aec3728f25e71e173d14935ac2687343",d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))),i("div",{key:"6111d4069b7975f9b752c3640d357e933a444332",class:"content"},i("slot",{key:"82288c865bacb35b26a696f0d4e1e85c925e0aed"})),this.resizable&&i("div",{key:"bf144ef24308dfadd8a11182f080759c0ef1c860",class:"se",ref:s=>this.seDrag=s}))))}get el(){return o(this)}};d.style=a;export{d as dnn_modal};
|
|
2
|
+
//# sourceMappingURL=p-0d99c2b8.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,c as t,h as r,H as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,c as t,h as r,H as s}from"./p-DF1WoBK0.js";const e=":host{position:relative;display:flex;justify-content:space-between;--background-color:transparent;--color:#333;--border-size:1px;--border-color:grey;--border-active-color:black;--border-radius:var(--dnn-controls-radius, 5px);--padding:var(--dnn-controls-padding, 5px);--focus-color:var(--dnn-color-primary, blue)}:host input{width:100%;border:var(--border-size) solid var(--border-color);outline:none;border-radius:var(--border-radius);padding:var(--padding);padding-right:32px;transition:all 300ms ease-in-out}:host input:focus-visible,:host input:hover{outline:none;box-shadow:0 0 2px 2px var(--focus-color)}:host svg{position:absolute;top:0;right:0;height:100%;transform:scale(0.7);fill:var(--color);outline:var(--color);color:var(--color);transition:all 300ms ease-in-out}:host button{background:transparent;border:0;margin:0;padding:0}:host button:focus-visible svg,:host button:hover svg{fill:var(--focus-color);outline:var(--focus-color);color:var(--focus-color)}";const i=class{constructor(r){o(this,r);this.queryChanged=t(this,"queryChanged",7);this.placeholder="";this.debounceTime=500;this.query="";this.debounceTimer=null}handleQueryChanged(){clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout((()=>{this.queryChanged.emit(this.query)}),this.debounceTime)}render(){return r(s,{key:"da1b9bf51836e46a71c6646dfbef2f12a775bca0",tabIndex:this.focused?-1:0,onFocus:()=>this.inputField.focus(),onBlur:()=>this.inputField.blur()},r("input",{key:"dfaebc0e8371c6a93bd4a6e7bf5876d3bdc7c44e",ref:o=>this.inputField=o,type:"text",value:this.query,placeholder:this.placeholder,onInput:o=>this.query=o.target.value,onFocus:()=>this.focused=true,onBlur:()=>this.focused=false}),this.query!==""?r("button",{class:"svg clear",onClick:()=>this.query=""},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))):r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))}static get watchers(){return{query:["handleQueryChanged"]}}};i.style=e;export{i as dnn_searchbox};
|
|
2
|
+
//# sourceMappingURL=p-1d262137.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as n}from"./p-jUj9nGA3.js";import{D as r}from"./p-DI6iaKDl.js";const o=":host{display:inline-block;--foreground-color:var(--dnn-color-foreground, #000);--background-color:var(--dnn-color-background, #fff);--focus-color:var(--dnn-color-primary, #3792ED);--danger-color:var(--dnn-color-danger, #900);--control-radius:var(--dnn-controls-radius, 3px)}dnn-fieldset{width:100%}@keyframes shift{0%{background-position:0% 0}50%{background-position:100% 0}100%{background-position:200% 0}}.inner-container{display:flex;justify-content:space-between;position:relative;width:100%}.inner-container input{border:none;outline:none;background-color:transparent;color:var(--foreground-color);text-align:var(--input-text-align);width:100%}.inner-container svg.chevron-down{height:1rem;width:auto;transform:scale(1.2);fill:var(--foreground-color);cursor:pointer}.inner-container ul{position:absolute;border:1px solid lightgray;margin:0;padding:var(--dnn-controls-radius, 3px) 0;overflow-y:auto;width:100%;box-shadow:2px 2px 6px 1px rgba(0, 0, 0, 0.3);background-color:var(--dnn-color-background, white);border-radius:var(--dnn-controls-radius, 3px);z-index:2;display:none;scroll-behavior:smooth}.inner-container ul.show{display:block}.inner-container ul li{display:block;list-style-type:none;cursor:pointer;padding:0 0.5rem}.inner-container ul li.selected{background-color:lightgray}.inner-container ul li:hover{background-color:lightgray}.inner-container ul .loading{width:100%;height:0.5rem;border-radius:0.5rem;background:linear-gradient(to right, var(--background-color) 0%, var(--foreground-color) 50%, var(--background-color) 100%);background-size:200% 100%;animation:shift 2s linear infinite;width:75%;margin:0 auto;opacity:0.5}dnn-fieldset{--fieldset-foreground-color:var(--foreground-color);--fieldset-background-color:var(--background-color);--fieldset-focus-color:var(--focus-color);--fieldset-danger-color:var(--danger-color);--fieldset-control-radius:var(--control-radius)}svg.error{fill:red;width:1em;height:1em;transform:scale(1.5);margin-right:0.5em}";var h=undefined&&undefined.__decorate||function(t,i,e,s){var n=arguments.length,r=n<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(t,i,e,s);else for(var h=t.length-1;h>=0;h--)if(o=t[h])r=(n<3?o(r):n>3?o(i,e,r):o(i,e))||r;return n>3&&r&&Object.defineProperty(i,e,r),r};const a=class{constructor(e){t(this,e);this.valueChange=i(this,"valueChange",7);this.valueInput=i(this,"valueInput",7);this.needMoreItems=i(this,"needMoreItems",7);this.searchQueryChanged=i(this,"searchQueryChanged",7);this.itemSelected=i(this,"itemSelected",7);if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}this.value="";this.suggestions=[];this.preloadThresholdPixels=1e3;this.autocomplete="off";this.focused=false;this.valid=true;this.positionInitialized=false;this.lastScrollTop=0;this.displayValue="";this.adjustDropdownPosition=()=>{var t=this.findAverageSuggestionHeight();requestAnimationFrame((()=>{this.positionInitialized=true}));var i=window.innerHeight-this.inputField.getBoundingClientRect().bottom;const e=parseFloat(getComputedStyle(document.documentElement).fontSize);const s=i>3*t+3*e;if(s){this.suggestionsContainer.style.top="1.2rem"}else{this.suggestionsContainer.style.bottom="1.2rem"}if(s){this.suggestionsContainer.style.maxHeight=`${i-3*e}px`}else{this.suggestionsContainer.style.maxHeight=`${this.inputField.getBoundingClientRect().top-3*e}px`}this.checkIfMoreItemsNeeded()}}async checkValidity(){var t=this.inputField.checkValidity();if(!t){this.fieldset.setValidity(false,this.inputField.validationMessage)}this.fieldset.setValidity(true,"");this.valid=t;this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage);return this.inputField.validity}async setCustomValidity(t){if(t==undefined||t==""){this.inputField.setCustomValidity("");this.valid=true;this.fieldset.setValidity(true);return}this.inputField.setCustomValidity(t);this.valid=false;this.fieldset.setValidity(false,t)}handleValueChange(t){this.displayValue=t;this.selectedIndex=this.suggestions.findIndex((i=>i.value===t))}handleClick(t){const i=t.composedPath();if(!i.includes(this.element)){this.focused=false}}componentDidRender(){if(this.focused&&this.suggestions.length>0&&!this.positionInitialized){this.adjustDropdownPosition()}}formResetCallback(){this.inputField.setCustomValidity("");this.valid=true;this.value="";this.internals.setValidity({});this.internals.setFormValue("")}handleInput(t){const i=t.target.value;this.displayValue=i;this.value=i;var e=this.inputField.checkValidity();this.valid=e;this.valueInput.emit(i);this.handleSearchQueryChanged(i)}handleSearchQueryChanged(t){this.searchQueryChanged.emit(t)}handleInvalid(){this.valid=false;if(this.customValidityMessage==undefined){this.customValidityMessage=this.inputField.validationMessage}this.fieldset.setValidity(false,this.inputField.validationMessage);this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage)}handleChange(){this.valueChange.emit(this.value);if(this.name!=undefined){var t=new FormData;t.append(this.name,this.value);this.internals.setFormValue(t)}}shouldLabelFloat(){if(this.focused){return false}if(this.value!=""){return false}return true}findAverageSuggestionHeight(){const t=this.suggestionsContainer.querySelectorAll("li");var i=0;for(let e=0;e<t.length;e++){i+=t[e].clientHeight}return i/t.length}handleKeyDown(t){var i;if(t.key==="ArrowDown"){t.preventDefault();if(this.selectedIndex==undefined){this.selectedIndex=0}else{this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)}}if(t.key==="ArrowUp"){t.preventDefault();if(this.selectedIndex==undefined){this.selectedIndex=this.suggestions.length-1}else{this.selectedIndex=Math.max(this.selectedIndex-1,0)}}this.value=this.selectedIndex==undefined?this.value:(i=this.suggestions[this.selectedIndex])===null||i===void 0?void 0:i.value;if(t.key==="Enter"){if(this.selectedIndex!=undefined){var e=this.suggestions[this.selectedIndex];this.value=e.value;this.inputField.value=e.label;this.itemSelected.emit(e.value);this.focused=false}}if(t.key==="Tab"){this.focused=false}}selectItem(t,i){t.preventDefault();t.stopPropagation();this.selectedIndex=i;this.value=this.suggestions[this.selectedIndex].value;this.displayValue=this.suggestions[this.selectedIndex].label;this.inputField.value=this.displayValue;this.checkValidity();this.focused=false;this.itemSelected.emit(this.suggestions[this.selectedIndex].value)}getVirtualScrollHeight(){const t=this.findAverageSuggestionHeight();const i=(this.totalSuggestions||NaN)-this.suggestions.length;return t*i}handleDropdownClick(){this.handleSearchQueryChanged(this.value)}handleSuggestionsScroll(){const t=this.suggestionsContainer;const i=t.scrollTop;if(i>this.lastScrollTop){const e=t.querySelector(".loading");if(e==undefined){this.lastScrollTop=i;return}const s=e.offsetTop;const n=e.offsetHeight;const r=s+n;const o=i+t.clientHeight;if(o>r){t.scrollTop=r-t.clientHeight}this.checkIfMoreItemsNeeded()}this.lastScrollTop=i}checkIfMoreItemsNeeded(){const t=this.suggestionsContainer;const i=t.querySelector(".loading");if(i==undefined)return;const e=t.scrollTop+t.clientHeight;const s=i.offsetTop;if(s-e<this.preloadThresholdPixels){const t={searchTerm:this.inputField.value};this.needMoreItems.emit(t)}}handleBlur(){var t=this.inputField.checkValidity();this.valid=t;this.fieldset.setValidity(t,this.inputField.validationMessage);this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage)}render(){var t;return e(s,{key:"1e292d089aaa274d1aa4b9898bd0d9d15b7d6d70",tabIndex:this.focused?-1:0,onFocus:()=>this.inputField.focus(),onBlur:()=>this.inputField.blur()},e("dnn-fieldset",{key:"d70181acb451533a2ecb842b16bb9a1f4786d5e5",ref:t=>this.fieldset=t,invalid:!this.valid,focused:this.focused,label:`${(t=this.label)!==null&&t!==void 0?t:""}${this.required?" *":""}`,helpText:this.helpText,id:this.labelId,disabled:this.disabled,floatLabel:this.shouldLabelFloat()},e("div",{key:"b91badc6ea15ecaeeb7b8f24383b8dbc7eeb1ceb",class:"inner-container"},e("input",{key:"e2dd5f4e2179dc5d61e6e5faf5f62bfac8e96ae1",ref:t=>this.inputField=t,name:this.name,type:"search",role:"combobox","aria-haspopup":"listbox","aria-expanded":this.focused.toString(),"aria-activedescendant":this.selectedIndex!==undefined?`option-${this.selectedIndex}`:undefined,disabled:this.disabled,required:this.required,autoComplete:this.autocomplete,value:this.displayValue,onFocus:()=>{this.searchQueryChanged.emit(this.value);this.focused=true},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onInvalid:()=>this.handleInvalid(),onChange:()=>this.handleChange(),"aria-labelledby":this.labelId,onKeyDown:t=>this.handleKeyDown(t)}),!this.valid&&e("svg",{key:"c5678ec6aebde3e12654d23996f5e7800a44011d",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",class:"error"},e("path",{key:"e3d61322deab9289f34f64f03dbda93721334f3b",d:"M479.982-280q14.018 0 23.518-9.482 9.5-9.483 9.5-23.5 0-14.018-9.482-23.518-9.483-9.5-23.5-9.5-14.018 0-23.518 9.482-9.5 9.483-9.5 23.5 0 14.018 9.482 23.518 9.483 9.5 23.5 9.5ZM453-433h60v-253h-60v253Zm27.266 353q-82.734 0-155.5-31.5t-127.266-86q-54.5-54.5-86-127.341Q80-397.681 80-480.5q0-82.819 31.5-155.659Q143-709 197.5-763t127.341-85.5Q397.681-880 480.5-880q82.819 0 155.659 31.5Q709-817 763-763t85.5 127Q880-563 880-480.266q0 82.734-31.5 155.5T763-197.684q-54 54.316-127 86Q563-80 480.266-80Zm.234-60Q622-140 721-239.5t99-241Q820-622 721.188-721 622.375-820 480-820q-141 0-240.5 98.812Q140-622.375 140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z"})),e("ul",{key:"46bf9ea05343a94b1bef9fabbed0e4f31536952d",class:this.focused&&this.suggestions.length>0?"show":"",role:"listbox",ref:t=>this.suggestionsContainer=t,onScroll:()=>this.handleSuggestionsScroll()},this.suggestions.map(((t,i)=>e("li",{id:`option-${i}`,role:"option","aria-selected":this.selectedIndex==i,class:this.selectedIndex==i?"selected":"",onClick:t=>this.selectItem(t,i)},this.renderSuggestion!=undefined?this.renderSuggestion(t):t.label))),this.totalSuggestions!=undefined&&this.totalSuggestions>this.suggestions.length&&e("div",{key:"6a0e9fc2f6dbbb0e7333631d60e131aa3e24ed05",class:"loading"}),this.totalSuggestions!=undefined&&this.totalSuggestions>this.suggestions.length&&this.positionInitialized&&e("div",{key:"5b5195357e3f0f257837485dd08e487f3302830e",style:{height:`${this.getVirtualScrollHeight()}px`}})),e("svg",{key:"6add57764f3df4fde8d95fc049e1e1f9a03afb96",onClick:()=>this.handleDropdownClick(),class:"chevron-down",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},e("path",{key:"2f25891e79ba26598884234386e6b57612741c48",d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})))))}static get formAssociated(){return true}get element(){return n(this)}static get watchers(){return{value:["handleValueChange"]}}};h([r(300)],a.prototype,"handleSearchQueryChanged",null);h([r(100)],a.prototype,"handleSuggestionsScroll",null);h([r()],a.prototype,"checkIfMoreItemsNeeded",null);a.style=o;export{a as dnn_autocomplete};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as n}from"./p-DF1WoBK0.js";import{D as r}from"./p-DI6iaKDl.js";const o=":host{display:inline-block;--foreground-color:var(--dnn-color-foreground, #000);--background-color:var(--dnn-color-background, #fff);--focus-color:var(--dnn-color-primary, #3792ED);--danger-color:var(--dnn-color-danger, #900);--control-radius:var(--dnn-controls-radius, 3px)}dnn-fieldset{width:100%}@keyframes shift{0%{background-position:0% 0}50%{background-position:100% 0}100%{background-position:200% 0}}.inner-container{display:flex;justify-content:space-between;position:relative;width:100%}.inner-container input{border:none;outline:none;background-color:transparent;color:var(--foreground-color);text-align:var(--input-text-align);width:100%}.inner-container svg.chevron-down{height:1rem;width:auto;transform:scale(1.2);fill:var(--foreground-color);cursor:pointer}.inner-container ul{position:absolute;border:1px solid lightgray;margin:0;padding:var(--dnn-controls-radius, 3px) 0;overflow-y:auto;width:100%;box-shadow:2px 2px 6px 1px rgba(0, 0, 0, 0.3);background-color:var(--dnn-color-background, white);border-radius:var(--dnn-controls-radius, 3px);z-index:2;display:none;scroll-behavior:smooth}.inner-container ul.show{display:block}.inner-container ul li{display:block;list-style-type:none;cursor:pointer;padding:0 0.5rem}.inner-container ul li.selected{background-color:lightgray}.inner-container ul li:hover{background-color:lightgray}.inner-container ul .loading{width:100%;height:0.5rem;border-radius:0.5rem;background:linear-gradient(to right, var(--background-color) 0%, var(--foreground-color) 50%, var(--background-color) 100%);background-size:200% 100%;animation:shift 2s linear infinite;width:75%;margin:0 auto;opacity:0.5}dnn-fieldset{--fieldset-foreground-color:var(--foreground-color);--fieldset-background-color:var(--background-color);--fieldset-focus-color:var(--focus-color);--fieldset-danger-color:var(--danger-color);--fieldset-control-radius:var(--control-radius)}svg.error{fill:red;width:1em;height:1em;transform:scale(1.5);margin-right:0.5em}";var h=undefined&&undefined.__decorate||function(t,i,e,s){var n=arguments.length,r=n<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(t,i,e,s);else for(var h=t.length-1;h>=0;h--)if(o=t[h])r=(n<3?o(r):n>3?o(i,e,r):o(i,e))||r;return n>3&&r&&Object.defineProperty(i,e,r),r};const a=class{constructor(e){t(this,e);this.valueChange=i(this,"valueChange",7);this.valueInput=i(this,"valueInput",7);this.needMoreItems=i(this,"needMoreItems",7);this.searchQueryChanged=i(this,"searchQueryChanged",7);this.itemSelected=i(this,"itemSelected",7);if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}this.value="";this.suggestions=[];this.preloadThresholdPixels=1e3;this.autocomplete="off";this.focused=false;this.valid=true;this.positionInitialized=false;this.lastScrollTop=0;this.displayValue="";this.adjustDropdownPosition=()=>{var t=this.findAverageSuggestionHeight();requestAnimationFrame((()=>{this.positionInitialized=true}));var i=window.innerHeight-this.inputField.getBoundingClientRect().bottom;const e=parseFloat(getComputedStyle(document.documentElement).fontSize);const s=i>3*t+3*e;if(s){this.suggestionsContainer.style.top="1.2rem"}else{this.suggestionsContainer.style.bottom="1.2rem"}if(s){this.suggestionsContainer.style.maxHeight=`${i-3*e}px`}else{this.suggestionsContainer.style.maxHeight=`${this.inputField.getBoundingClientRect().top-3*e}px`}this.checkIfMoreItemsNeeded()}}async checkValidity(){var t=this.inputField.checkValidity();if(!t){this.fieldset.setValidity(false,this.inputField.validationMessage)}this.fieldset.setValidity(true,"");this.valid=t;this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage);return this.inputField.validity}async setCustomValidity(t){if(t==undefined||t==""){this.inputField.setCustomValidity("");this.valid=true;this.fieldset.setValidity(true);return}this.inputField.setCustomValidity(t);this.valid=false;this.fieldset.setValidity(false,t)}handleValueChange(t){this.displayValue=t;this.selectedIndex=this.suggestions.findIndex((i=>i.value===t))}handleClick(t){const i=t.composedPath();if(!i.includes(this.element)){this.focused=false}}componentDidRender(){if(this.focused&&this.suggestions.length>0&&!this.positionInitialized){this.adjustDropdownPosition()}}formResetCallback(){this.inputField.setCustomValidity("");this.valid=true;this.value="";this.internals.setValidity({});this.internals.setFormValue("")}handleInput(t){const i=t.target.value;this.displayValue=i;this.value=i;var e=this.inputField.checkValidity();this.valid=e;this.valueInput.emit(i);this.handleSearchQueryChanged(i)}handleSearchQueryChanged(t){this.searchQueryChanged.emit(t)}handleInvalid(){this.valid=false;if(this.customValidityMessage==undefined){this.customValidityMessage=this.inputField.validationMessage}this.fieldset.setValidity(false,this.inputField.validationMessage);this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage)}handleChange(){this.valueChange.emit(this.value);if(this.name!=undefined){var t=new FormData;t.append(this.name,this.value);this.internals.setFormValue(t)}}shouldLabelFloat(){if(this.focused){return false}if(this.value!=""){return false}return true}findAverageSuggestionHeight(){const t=this.suggestionsContainer.querySelectorAll("li");var i=0;for(let e=0;e<t.length;e++){i+=t[e].clientHeight}return i/t.length}handleKeyDown(t){var i;if(t.key==="ArrowDown"){t.preventDefault();if(this.selectedIndex==undefined){this.selectedIndex=0}else{this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)}}if(t.key==="ArrowUp"){t.preventDefault();if(this.selectedIndex==undefined){this.selectedIndex=this.suggestions.length-1}else{this.selectedIndex=Math.max(this.selectedIndex-1,0)}}this.value=this.selectedIndex==undefined?this.value:(i=this.suggestions[this.selectedIndex])===null||i===void 0?void 0:i.value;if(t.key==="Enter"){if(this.selectedIndex!=undefined){var e=this.suggestions[this.selectedIndex];this.value=e.value;this.inputField.value=e.label;this.itemSelected.emit(e.value);this.focused=false}}if(t.key==="Tab"){this.focused=false}}selectItem(t,i){t.preventDefault();t.stopPropagation();this.selectedIndex=i;this.value=this.suggestions[this.selectedIndex].value;this.displayValue=this.suggestions[this.selectedIndex].label;this.inputField.value=this.displayValue;this.checkValidity();this.focused=false;this.itemSelected.emit(this.suggestions[this.selectedIndex].value)}getVirtualScrollHeight(){const t=this.findAverageSuggestionHeight();const i=(this.totalSuggestions||NaN)-this.suggestions.length;return t*i}handleDropdownClick(){this.handleSearchQueryChanged(this.value)}handleSuggestionsScroll(){const t=this.suggestionsContainer;const i=t.scrollTop;if(i>this.lastScrollTop){const e=t.querySelector(".loading");if(e==undefined){this.lastScrollTop=i;return}const s=e.offsetTop;const n=e.offsetHeight;const r=s+n;const o=i+t.clientHeight;if(o>r){t.scrollTop=r-t.clientHeight}this.checkIfMoreItemsNeeded()}this.lastScrollTop=i}checkIfMoreItemsNeeded(){const t=this.suggestionsContainer;const i=t.querySelector(".loading");if(i==undefined)return;const e=t.scrollTop+t.clientHeight;const s=i.offsetTop;if(s-e<this.preloadThresholdPixels){const t={searchTerm:this.inputField.value};this.needMoreItems.emit(t)}}handleBlur(){var t=this.inputField.checkValidity();this.valid=t;this.fieldset.setValidity(t,this.inputField.validationMessage);this.internals.setValidity(this.inputField.validity,this.inputField.validationMessage)}render(){var t;return e(s,{key:"1e292d089aaa274d1aa4b9898bd0d9d15b7d6d70",tabIndex:this.focused?-1:0,onFocus:()=>this.inputField.focus(),onBlur:()=>this.inputField.blur()},e("dnn-fieldset",{key:"d70181acb451533a2ecb842b16bb9a1f4786d5e5",ref:t=>this.fieldset=t,invalid:!this.valid,focused:this.focused,label:`${(t=this.label)!==null&&t!==void 0?t:""}${this.required?" *":""}`,helpText:this.helpText,id:this.labelId,disabled:this.disabled,floatLabel:this.shouldLabelFloat()},e("div",{key:"b91badc6ea15ecaeeb7b8f24383b8dbc7eeb1ceb",class:"inner-container"},e("input",{key:"e2dd5f4e2179dc5d61e6e5faf5f62bfac8e96ae1",ref:t=>this.inputField=t,name:this.name,type:"search",role:"combobox","aria-haspopup":"listbox","aria-expanded":this.focused.toString(),"aria-activedescendant":this.selectedIndex!==undefined?`option-${this.selectedIndex}`:undefined,disabled:this.disabled,required:this.required,autoComplete:this.autocomplete,value:this.displayValue,onFocus:()=>{this.searchQueryChanged.emit(this.value);this.focused=true},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onInvalid:()=>this.handleInvalid(),onChange:()=>this.handleChange(),"aria-labelledby":this.labelId,onKeyDown:t=>this.handleKeyDown(t)}),!this.valid&&e("svg",{key:"c5678ec6aebde3e12654d23996f5e7800a44011d",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",class:"error"},e("path",{key:"e3d61322deab9289f34f64f03dbda93721334f3b",d:"M479.982-280q14.018 0 23.518-9.482 9.5-9.483 9.5-23.5 0-14.018-9.482-23.518-9.483-9.5-23.5-9.5-14.018 0-23.518 9.482-9.5 9.483-9.5 23.5 0 14.018 9.482 23.518 9.483 9.5 23.5 9.5ZM453-433h60v-253h-60v253Zm27.266 353q-82.734 0-155.5-31.5t-127.266-86q-54.5-54.5-86-127.341Q80-397.681 80-480.5q0-82.819 31.5-155.659Q143-709 197.5-763t127.341-85.5Q397.681-880 480.5-880q82.819 0 155.659 31.5Q709-817 763-763t85.5 127Q880-563 880-480.266q0 82.734-31.5 155.5T763-197.684q-54 54.316-127 86Q563-80 480.266-80Zm.234-60Q622-140 721-239.5t99-241Q820-622 721.188-721 622.375-820 480-820q-141 0-240.5 98.812Q140-622.375 140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z"})),e("ul",{key:"46bf9ea05343a94b1bef9fabbed0e4f31536952d",class:this.focused&&this.suggestions.length>0?"show":"",role:"listbox",ref:t=>this.suggestionsContainer=t,onScroll:()=>this.handleSuggestionsScroll()},this.suggestions.map(((t,i)=>e("li",{id:`option-${i}`,role:"option","aria-selected":this.selectedIndex==i,class:this.selectedIndex==i?"selected":"",onClick:t=>this.selectItem(t,i)},this.renderSuggestion!=undefined?this.renderSuggestion(t):t.label))),this.totalSuggestions!=undefined&&this.totalSuggestions>this.suggestions.length&&e("div",{key:"6a0e9fc2f6dbbb0e7333631d60e131aa3e24ed05",class:"loading"}),this.totalSuggestions!=undefined&&this.totalSuggestions>this.suggestions.length&&this.positionInitialized&&e("div",{key:"5b5195357e3f0f257837485dd08e487f3302830e",style:{height:`${this.getVirtualScrollHeight()}px`}})),e("svg",{key:"6add57764f3df4fde8d95fc049e1e1f9a03afb96",onClick:()=>this.handleDropdownClick(),class:"chevron-down",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},e("path",{key:"2f25891e79ba26598884234386e6b57612741c48",d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})))))}static get formAssociated(){return true}get element(){return n(this)}static get watchers(){return{value:["handleValueChange"]}}};h([r(300)],a.prototype,"handleSearchQueryChanged",null);h([r(100)],a.prototype,"handleSuggestionsScroll",null);h([r()],a.prototype,"checkIfMoreItemsNeeded",null);a.style=o;export{a as dnn_autocomplete};
|
|
2
|
+
//# sourceMappingURL=p-3b0899a5.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,g as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as i,H as s,g as a}from"./p-DF1WoBK0.js";const d=":host{display:flex;overflow:visible}.expander{width:24px;height:24px}.expander button{transition:all 150ms ease-in-out;background-color:transparent;border:none;padding:0;margin:0;height:1em;display:flex;justify-content:center;align-items:center;cursor:pointer;position:relative;top:2px}.expander button svg :first-child{transition:all 150ms ease-in-out;fill:white;stroke:black}.expander.expanded button{transform:rotate(45deg)}.expander.expanded button svg :first-child{fill:black;stroke:black}div.item .item-slot{display:flex;align-items:center;gap:0.25em;min-height:24px}div.item div.children{overflow:hidden;height:0;transition:all 150ms ease-in-out}";const n=class{constructor(i){e(this,i);this.userExpanded=t(this,"userExpanded",3);this.userCollapsed=t(this,"userCollapsed",3);this.expanded=false;this.hasChildren=false;this.focused=false}watchExpanded(e){if(e){this.expander.classList.add("expanded");this.collapsible.expanded=true;return}this.expander.classList.remove("expanded");this.collapsible.expanded=false}componentDidLoad(){requestAnimationFrame((()=>{const e=this.childElement.children[0];const t=e.assignedElements().length;if(t>0){this.hasChildren=true}if(this.expanded){this.expander.classList.add("expanded");this.collapsible.expanded=false;setTimeout((()=>{this.collapsible.expanded=true}),300)}}))}toggleCollapse(){this.expanded=!this.expanded;if(this.expanded){this.expander.classList.add("expanded");this.userExpanded.emit();return}this.expander.classList.remove("expanded");this.userCollapsed.emit()}getTabIndex(){if(!this.hasChildren){return-1}return this.focused?-1:0}render(){return i(s,{key:"9239fbebdd6994b6df4fe0e07cb8ad2a9162cdf3",tabIndex:this.getTabIndex(),onFocus:()=>{var e;return(e=this.button)===null||e===void 0?void 0:e.focus()},onBlur:()=>{var e;return(e=this.button)===null||e===void 0?void 0:e.blur()}},i("div",{key:"823ca5c4685cda9e917620eb875b84deccadcbc7",class:"expander",ref:e=>this.expander=e},this.hasChildren&&i("button",{key:"195827a4a30353e8ada07e672715462f67dfbf36",ref:e=>this.button=e,onClick:()=>this.toggleCollapse(),onFocus:()=>this.focused=true,onBlur:()=>this.focused=false},i("svg",{key:"61d9696936d4ed74058d5c324333661844ff1b00",xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},i("path",{key:"52e1f643b8e5119111b244e84f68e9b2b0fd5c64",d:"M10 17l5-5-5-5v10z"}),i("path",{key:"afac6879313e031dac1e5949ebe00d639decf4c4",d:"M0 24V0h24v24H0z",fill:"none"})))),i("div",{key:"0b27c152b7a34a8723c81d35b568644c46799bc9",class:"item"},i("div",{key:"ebfa06a7283da2513d547b4ef88716f04022d6cb",class:"item-slot"},i("slot",{key:"334db821df034666b9ba801abd7d5a9b45b013cf"})),i("dnn-collapsible",{key:"3b935ccb97e28b0d782740540a57c1658db2d0ea",ref:e=>this.collapsible=e,expanded:this.expanded},i("div",{key:"2eec927ff0cbbb3c71df32ed98b02a0d480d5283",ref:e=>this.childElement=e},i("slot",{key:"768790449686500938e3ae5ed41aea0d438e903c",name:"children"})))))}get el(){return a(this)}static get watchers(){return{expanded:["watchExpanded"]}}};n.style=d;export{n as dnn_treeview_item};
|
|
2
|
+
//# sourceMappingURL=p-4590b154.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as o,h as s,H as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as o,h as s,H as t}from"./p-DF1WoBK0.js";const a=":host{--color:#888;--color-sorted:var(--dnn-color-primary, rgb(2,139,255));--color-hover:var(--dnn-color-primary-light, #36a1ff);display:inline-block}button{cursor:pointer;outline:none;border:none;margin:0;padding:0;background-color:transparent;outline:none;display:inline-block;line-height:1em;position:relative;top:0.25em}button svg{height:1.5em;width:auto;fill:var(--color)}button.active svg{fill:var(--color-sorted)}button:hover svg,button:focus-visible svg{fill:var(--color-hover)}";const c=class{constructor(s){e(this,s);this.sortChanged=o(this,"sortChanged",7);this.sortDirection="none";this.focused=false}changeSort(){switch(this.sortDirection){case"asc":this.sortDirection="desc";break;case"desc":this.sortDirection="asc";break;case"none":this.sortDirection="asc";break}this.sortChanged.emit(this.sortDirection)}render(){return s(t,{key:"1f289964833f7c735887de5a8fd65091c91f9403",tabIndex:this.focused?-1:0,onFocus:()=>this.button.focus(),onBlur:()=>this.button.blur()},s("button",{key:"aa3c23fcfc03535a3fdcccc01e2b6142f71ac0f5",ref:e=>this.button=e,class:{active:this.sortDirection!="none"},onClick:()=>this.changeSort(),onFocus:()=>this.focused=true,onBlur:()=>this.focused=false},this.sortDirection=="none"&&s("svg",{key:"3eae289f7f69d8e3d2da7c58053c2ab94d3d4222",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},s("path",{key:"90d60e5ac32d13f90949d74e36af3ffe2d9884ec",d:"M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z"})),this.sortDirection=="asc"&&s("svg",{key:"d3a5d9a62b844888963f9c795451255bb44f9056",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},s("path",{key:"c622ace2ea7177ea4480e9983cdb8e3ad425ea66",d:"M 0 7 H 12 L 6 0 Z"})),this.sortDirection=="desc"&&s("svg",{key:"ceaef3f24f367870fb934890bfbd10b5ee71426f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},s("path",{key:"db246c5f5b28c0f0606219cde513490e540a6073",d:"M 0 9 H 12 L 6 16 Z"}))))}};c.style=a;export{c as dnn_sort_icon};
|
|
2
|
+
//# sourceMappingURL=p-4986fe41.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,H as o,g as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,H as o,g as s}from"./p-DF1WoBK0.js";const i=":host{--background-color:var(--dnn-color-primary-contrast, white);--foreground-color:var(--dnn-color-primary, #3792ED);display:block}.menu-container{display:flex;justify-content:flex-start;align-items:center;background-color:var(--background-color)}.menu-container .menu{margin:0.5em;display:flex;gap:1em;justify-content:flex-start;align-items:center;white-space:nowrap;width:100%}.menu-container .overflow{margin-left:auto;position:relative}.menu-container .overflow button{cursor:pointer;padding:0;margin:0;background-color:transparent;border:none}.menu-container .overflow button svg{fill:var(--foreground-color)}.menu-container .overflow .dropdown{position:absolute;display:flex;flex-direction:column;white-space:nowrap;right:0;transition:100ms ease-in-out;height:0;overflow:hidden}.menu-container .overflow .dropdown.visible{padding:1em;gap:0.5em;background-color:var(--background-color);box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7)}";const a=class{constructor(t){e(this,t);this.showDropdownButton=false;this.showDropdownMenu=false;this.previousMenuWidth=0}componentDidRender(){requestAnimationFrame((()=>{this.moveItemsToDropDownIfNecessery();this.resizeObserver=new ResizeObserver((e=>{for(let t of e){if(t.contentRect.width<this.previousMenuWidth){this.moveItemsToDropDownIfNecessery()}if(this.previousMenuWidth>0&&t.contentRect.width>this.previousMenuWidth){this.moveItemsToMenuIfPossible()}this.previousMenuWidth=t.contentRect.width}}));this.resizeObserver.observe(this.element)}))}moveItemsToDropDownIfNecessery(){const e=Array.from(this.menu.querySelector("slot").assignedElements());const t=this.menu.getBoundingClientRect().width;let o=parseFloat(getComputedStyle(this.element).fontSize)*2;e.forEach((e=>o+=this.getFullWidth(e)));o+=(e.length-1)*parseFloat(getComputedStyle(this.element).fontSize);if(o>t){this.showDropdownButton=true;var s=e[e.length-1];if(this.dropdown==undefined){return}s.slot="dropdown";this.moveItemsToDropDownIfNecessery()}}moveItemsToMenuIfPossible(){if(this.dropdown==undefined||!this.dropdown.hasChildNodes()){return}const e=Array.from(this.menu.querySelector("slot").assignedElements());const t=this.menu.getBoundingClientRect().width;let o=parseFloat(getComputedStyle(this.element).fontSize)*2;o+=(e.length-1)*parseFloat(getComputedStyle(this.element).fontSize);e.forEach((e=>o+=this.getFullWidth(e)));const s=this.dropdown.querySelector("slot").assignedElements()[0];if(s!=undefined){o+=this.getFullWidth(s)}if(o<t){if(s!=undefined){s.slot=""}if(s==undefined){this.dropdown.classList.remove("visible");this.showDropdownMenu=false;this.showDropdownButton=false}}}getFullWidth(e){var t=e.getBoundingClientRect().width;var o=getComputedStyle(e);t+=parseFloat(o.marginLeft);t+=parseFloat(o.marginRight);t+=parseFloat(o.paddingLeft);t+=parseFloat(o.paddingRight);return t}toggleOverflowMenu(){this.showDropdownMenu=!this.showDropdownMenu;if(this.showDropdownMenu){this.dropdown.classList.add("visible");let e=0;const t=Array.from(this.dropdown.querySelector("slot").assignedElements());t.forEach((t=>e+=t.getBoundingClientRect().height));const o=parseFloat(getComputedStyle(this.dropdown).fontSize);const s=o*(this.dropdown.children.length-1)/2;e+=s;const i=o*2;e+=i;this.dropdown.style.height=`${e}px`;const a=e=>{const t=this.button.getBoundingClientRect();if(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom){this.toggleOverflowMenu()}document.removeEventListener("click",a)};setTimeout((()=>{document.addEventListener("click",a,false)}),100)}else{this.dropdown.classList.remove("visible");this.dropdown.style.height="0px"}}render(){return t(o,{key:"f5d038ff61404f3e15eef0deb44051d0967c7e88"},t("div",{key:"2277fdfd939c4d06f8dc275b9dfb92a688dc4910",class:"menu-container"},t("div",{key:"07686f1acc098a389e3a2766e6a0e01f7370b0e3",class:"menu",ref:e=>this.menu=e},t("slot",{key:"f03bade0de2c0c35f4db272ab30a8afde7ac04de"})),this.showDropdownButton&&t("div",{key:"8baa54e82d810f6b10625129642cf7f30bc3ef1f",class:"overflow"},t("button",{key:"e4571ea364927f89f2efcd8b6184c07865a7f7e9",ref:e=>this.button=e,class:"icon",onClick:()=>this.toggleOverflowMenu()},t("svg",{key:"e4dc876383112fbaec7d1aff22082eddaa5c9a44",xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},t("path",{key:"0d4455483051a0600e690ea893ecaaf61b523af9",d:"M0 0h24v24H0z",fill:"none"}),t("path",{key:"189db323452d7d49d37d2e6dbc0f42f256403d28",d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),t("div",{key:"04aff4de4c423a37abb464eabfd950d8e280cfcb",class:"dropdown",ref:e=>this.dropdown=e},t("slot",{key:"0fb6aad3f798f42403cd6ee0fa4f324190ec610e",name:"dropdown"})))))}get element(){return s(this)}};a.style=i;export{a as dnn_vertical_overflow_menu};
|
|
2
|
+
//# sourceMappingURL=p-4ac36eed.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as i,h as t,H as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as i,h as t,H as a}from"./p-DF1WoBK0.js";import{a as s}from"./p-D7CP7b6z.js";const r=":host{--border-color:var(--dnn-color-foreground-light, lightgray);--border-radius:var(--dnn-controls-radius, 5px);--drop-background-color:var(--dnn-color-neutral, #b2b2b2);display:flex;flex-direction:column;gap:1rem;text-align:center;border:2px dashed var(--border-color);border-radius:var(--border-radius);padding:1rem;transition:all 300ms ease-in-out}:host(.dropping){background-color:var(--drop-background-color)}p{margin:0;padding:0}button{display:flex;justify-content:center;align-items:center;border:0px;margin:0;padding:0;background-color:transparent}button:hover{cursor:pointer}button svg{margin-right:0.5rem}label.upload-file{display:flex;justify-content:center;align-items:center;cursor:pointer}label.upload-file input{display:none}.video-preview{display:flex;flex-direction:column;align-items:center}.video-preview button{margin:1rem}.error{color:red}";const d=class{constructor(t){e(this,t);this.filesSelected=i(this,"filesSelected",7);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.allowCameraMode=false;this.captureQuality=.8;this.canTakeSnapshots=false;this.takingPicture=false;this.fileTooLarge=false;this.invalidExtension=false;this.focused=false;this.defaultResx={dragAndDropFile:"Drag and drop a file",capture:"Capture",or:"or",takePicture:"Take a picture",uploadFile:"Upload a file",uploadSizeTooLarge:"The file you tried to upload is too large.",fileSizeLimit:"The maximum size is {0}",invalidExtension:"The file you tried to upload has an invalid extension.",allowedFileExtensions:"Allowed file extensions: {0}"};this.handleDragOver=e=>{e.stopPropagation();e.preventDefault();if(e.dataTransfer!=null){e.dataTransfer.dropEffect="copy"}this.dropzone.classList.add("dropping")};this.handleDrop=e=>{this.invalidExtension=false;this.fileTooLarge=false;e.stopPropagation();e.preventDefault();const i=e.dataTransfer.files;if(this.hasInvalidExtensions(Array.from(i))){this.invalidExtension=true;return}if(this.isAnyFileLargerThanAllowed(Array.from(i))){this.fileTooLarge=true;return}var t=this.getFilesFromFileList(i);this.filesSelected.emit(t)}}componentWillLoad(){this.mergeResx()}componentDidLoad(){if(this.allowCameraMode){this.checkIfBrowserCanTakeSnapshots().then((e=>this.canTakeSnapshots=e))}if(this.allowedExtensions!=undefined&&this.allowedExtensions.length>0){var e=this.allowedExtensions.map((e=>`.${e}`));var i=e.join(",");this.fileInput.accept=i}}resxChanged(){this.mergeResx()}formResetCallback(){this.internals.setValidity({});this.fileInput.value="";this.internals.setFormValue("")}mergeResx(){this.localResx=Object.assign(Object.assign({},this.defaultResx),this.resx)}checkIfBrowserCanTakeSnapshots(){return new Promise((e=>{const i=navigator.mediaDevices;if(i==undefined||i.enumerateDevices==undefined){e(false)}i.enumerateDevices().then((i=>{var t=i.some((e=>e.kind=="videoinput"));e(t)}))}))}getFilesFromFileList(e){var i=[];if(e==undefined){return i}for(let t=0;t<e.length;t++){const a=e[t];i.push(a)}return i}isAnyFileLargerThanAllowed(e){if(this.maxFileSize==undefined||this.maxFileSize<=0){return false}if(this.maxFileSize!=undefined&&e.some((e=>e.size>this.maxFileSize))){return true}return false}handleUploadKeyDown(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();this.fileInput.click()}}handleUploadButton(e){this.fileTooLarge=false;this.invalidExtension=false;let i=this.getFilesFromFileList(e.files);if(this.isAnyFileLargerThanAllowed(i)){this.fileTooLarge=true;return}if(this.hasInvalidExtensions(i)){this.invalidExtension=true;return}this.filesSelected.emit(i);if(this.name!=undefined&&this.name.length>0){var t=new FormData;i.forEach((e=>{t.append(this.name||"",e)}));this.internals.setFormValue(t)}}hasInvalidExtensions(e){var i,t;var a=false;for(let d=0;d<e.length;d++){const n=e[d];var s=/(?:\.([^.]+))?$/;const o=(i=s.exec(n.name)[1])===null||i===void 0?void 0:i.toLowerCase();if(o==undefined){a=true}var r=(t=this.allowedExtensions)===null||t===void 0?void 0:t.map((e=>e.toLowerCase()));if(this.allowedExtensions!=undefined&&!(r===null||r===void 0?void 0:r.includes(o))){a=true}return a}return false}takeSnapshot(){this.takingPicture=true;navigator.mediaDevices.getUserMedia({video:true,audio:false}).then((e=>{this.videoPreview.srcObject=e;this.videoPreview.play().then((()=>{this.videoSettings=e.getVideoTracks()[0].getSettings()}))})).catch((e=>alert(e)))}applySnapshot(){var e=document.createElement("canvas");const i=e.getContext("2d");e.width=this.videoSettings.width;e.height=this.videoSettings.height;i.drawImage(this.videoPreview,0,0);e.toBlob((e=>{var i=new File([e],"image.jpeg",{type:"image/jpeg"});this.takingPicture=false;var t=[i];this.filesSelected.emit(t)}),"image/jpeg",this.captureQuality)}getInvalidExtensionsMessage(){var e=this.localResx.allowedFileExtensions;var e=e.replace("{0}",this.allowedExtensions.join(", "));return e}render(){var e,i,r,d,n,o;return t(a,{key:"9bf5683b9676b9f12bfdd3d7cb0c83256f8c0203",ref:e=>this.dropzone=e,class:"dropzone",onDragOver:e=>this.handleDragOver(e),onDrop:e=>this.handleDrop(e),onDragLeave:()=>this.dropzone.classList.remove("dropping"),tabIndex:this.focused?-1:0,onFocus:()=>this.uploadLabel.focus(),onBlur:()=>this.uploadLabel.blur()},!this.takingPicture&&[t("p",{key:"1f20574a079f352ce1689d49e8a1dd24a9c99273"},(e=this.localResx)===null||e===void 0?void 0:e.dragAndDropFile),t("p",{key:"f10c10c4ff5aac3f49ee79879c2b01f06ad9c217"},"- ",(i=this.localResx)===null||i===void 0?void 0:i.or," -"),t("label",{key:"dfabce2f1514f4c64b348a68429e4a4a164fdf65",class:"upload-file",tabIndex:0,onKeyDown:e=>this.handleUploadKeyDown(e),ref:e=>this.uploadLabel=e,onFocus:()=>this.focused=true,onBlur:()=>this.focused=false},t("input",{key:"fdb1cbf34bafaee686cfda2c8e2e1f4d1d7557d8",type:"file",ref:e=>this.fileInput=e,onChange:e=>this.handleUploadButton(e.target)}),t("span",{key:"003231306c4a995678f8c41bbcb0d0667f5312d4"},t("svg",{key:"8f7f50f075dff8a690cc7f6b43dcedb2d68c2802",xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},t("g",{key:"bc713b2e80a36383680654fcf944b4447808f8e4"},t("rect",{key:"a0a8812fc7ac49f95cd3b885232e393d6da40628",fill:"none",height:"24",width:"24"})),t("g",{key:"c38ff3ab4708733194c4d98f2f725387ac1da991"},t("path",{key:"35034aedf3fc0dec87e950fc296cb442bfabaae5",d:"M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"}))))," ",(r=this.localResx)===null||r===void 0?void 0:r.uploadFile),this.canTakeSnapshots&&[t("p",{key:"93f0444250ea6e18e8e5bd9af758ebf38a44d97a"},"- ",(d=this.localResx)===null||d===void 0?void 0:d.or," -"),t("button",{key:"5e78937c6ba6eaea45bbe12ffe43583a909c64be",onClick:()=>this.takeSnapshot()},t("svg",{key:"a3f342027510b4bc4d5c1a17c8c4582f59e8c901",xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},t("path",{key:"5d598483b5944434a674d97249981c3227e7100d",d:"M0 0h24v24H0z",fill:"none"}),t("circle",{key:"f42859aaf900907f711dcc91dce9845fc6ad20ed",cx:"12",cy:"12",r:"3.2"}),t("path",{key:"cb210b970f117a381172a767556b80d8f05158ab",d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})),(n=this.localResx)===null||n===void 0?void 0:n.takePicture)]],this.takingPicture&&t("div",{key:"7a96086948279dba16838d4f78324f38ef679a45",class:"video-preview"},t("video",{key:"c22a04d71071bd1267946cc9de99b2e602be832e",ref:e=>this.videoPreview=e}),t("button",{key:"5d0d4c8f918fe2f7e14a19853fce505dd5cc0f79",onClick:()=>this.applySnapshot()},t("svg",{key:"fb4b54a29b90e12c7587fa2a2bdb521cb5f2291b",xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},t("path",{key:"62fe7540d09aa2d84a1b0ba7bd8a796c885a6ff0",d:"M0 0h24v24H0z",fill:"none"}),t("circle",{key:"e26d2dd296c55809b2a80f4e089e4fc6e6ab9281",cx:"12",cy:"12",r:"3.2"}),t("path",{key:"a4c67d37680f7852831e1fd8bd1a737f89c30633",d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}))," ",(o=this.localResx)===null||o===void 0?void 0:o.capture)),this.fileTooLarge&&t("div",{key:"29a3f6ecf6bade110ac9dc6d5fdf71d6b0a0afe6",class:"error"},t("p",{key:"04fb742f8c8ae23e263cb6e0d84154a82be5b0b1"},this.localResx.uploadSizeTooLarge,t("br",{key:"98deac095ecdc88db09ee4db0020ae1965dcf855"}),this.localResx.fileSizeLimit.replace("{0}",s(this.maxFileSize)))),this.invalidExtension&&t("div",{key:"14cc9810bc03af3aa52c4c320e351aef1d313b2c",class:"error"},t("p",{key:"017fc0253778bb478602f27cbd80e18f4d63ab19"},this.localResx.invalidExtension,t("br",{key:"50c241772f10bb66fb97075afa6967e63536c3a1"}),this.getInvalidExtensionsMessage())))}static get formAssociated(){return true}static get watchers(){return{resx:["resxChanged"]}}};d.style=r;export{d as dnn_dropzone};
|
|
2
|
+
//# sourceMappingURL=p-5874cffe.entry.js.map
|