@aquera/nile-elements 1.0.1-beta-1.4 → 1.0.1-beta-1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/demo/index.html +8 -15
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +689 -620
- package/dist/internal/resizable-table-helper.cjs.js +1 -1
- package/dist/internal/resizable-table-helper.cjs.js.map +1 -1
- package/dist/internal/resizable-table-helper.esm.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +5 -5
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +203 -184
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -3
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +66 -77
- package/dist/nile-file-preview/types/nile-file-preview.enums.cjs.js +1 -1
- package/dist/nile-file-preview/types/nile-file-preview.enums.cjs.js.map +1 -1
- package/dist/nile-file-preview/types/nile-file-preview.enums.esm.js +1 -1
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/index.cjs.js +1 -1
- package/dist/nile-file-upload/index.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +142 -89
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +3 -3
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +50 -108
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +2 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +0 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +3 -3
- package/dist/nile-option-group/index.cjs.js +2 -0
- package/dist/nile-option-group/index.cjs.js.map +1 -0
- package/dist/nile-option-group/index.esm.js +1 -0
- package/dist/nile-option-group/nile-option-group.cjs.js +2 -0
- package/dist/nile-option-group/nile-option-group.cjs.js.map +1 -0
- package/dist/nile-option-group/nile-option-group.css.cjs.js +2 -0
- package/dist/nile-option-group/nile-option-group.css.cjs.js.map +1 -0
- package/dist/nile-option-group/nile-option-group.css.esm.js +46 -0
- package/dist/nile-option-group/nile-option-group.esm.js +14 -0
- package/dist/nile-option-group/nile-option-group.interface.cjs.js +2 -0
- package/dist/nile-option-group/nile-option-group.interface.cjs.js.map +1 -0
- package/dist/nile-option-group/nile-option-group.interface.esm.js +1 -0
- package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.esm.js +9 -2
- package/dist/nile-pagination/nile-pagination.esm.js +3 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- package/dist/nile-select/nile-select.interface.cjs.js +2 -0
- package/dist/nile-select/nile-select.interface.cjs.js.map +1 -0
- package/dist/nile-select/nile-select.interface.esm.js +1 -0
- package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.esm.js +2 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.esm.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.esm.js +2 -2
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
- package/dist/nile-virtual-select/renderer.esm.js +13 -12
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/resizable-table-helper.d.ts +5 -0
- package/dist/src/internal/resizable-table-helper.js +27 -4
- package/dist/src/internal/resizable-table-helper.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +5 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +44 -7
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +15 -0
- package/dist/src/nile-code-editor/theme.js +17 -2
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.css.js +201 -182
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +6 -2
- package/dist/src/nile-file-preview/nile-file-preview.js +49 -20
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +3 -2
- package/dist/src/nile-file-preview/nile-file-preview.template.js +58 -62
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/types/nile-file-preview.enums.d.ts +4 -3
- package/dist/src/nile-file-preview/types/nile-file-preview.enums.js +3 -2
- package/dist/src/nile-file-preview/types/nile-file-preview.enums.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +4 -0
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +25 -0
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +140 -87
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +30 -20
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.d.ts +7 -5
- package/dist/src/nile-file-upload/nile-file-upload.template.js +69 -115
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +11 -4
- package/dist/src/nile-file-upload/types/file-upload.enums.js +8 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -4
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +18 -21
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.d.ts +3 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +82 -32
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +0 -1
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +1 -0
- package/dist/src/nile-option/nile-option.js +6 -1
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-option-group/index.d.ts +1 -0
- package/dist/src/nile-option-group/index.js +2 -0
- package/dist/src/nile-option-group/index.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.css.d.ts +12 -0
- package/dist/src/nile-option-group/nile-option-group.css.js +58 -0
- package/dist/src/nile-option-group/nile-option-group.css.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.d.ts +23 -0
- package/dist/src/nile-option-group/nile-option-group.interface.d.ts +22 -0
- package/dist/src/nile-option-group/nile-option-group.interface.js +2 -0
- package/dist/src/nile-option-group/nile-option-group.interface.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.js +76 -0
- package/dist/src/nile-option-group/nile-option-group.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.css.js +7 -0
- package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.js +3 -1
- package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +6 -0
- package/dist/src/nile-select/nile-select.interface.d.ts +5 -0
- package/dist/src/nile-select/nile-select.interface.js +2 -0
- package/dist/src/nile-select/nile-select.interface.js.map +1 -0
- package/dist/src/nile-select/nile-select.js +59 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-table-body/nile-table-body.d.ts +1 -0
- package/dist/src/nile-table-body/nile-table-body.js +4 -0
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.d.ts +2 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.js +12 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +2 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.js +12 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
- package/dist/src/nile-virtual-select/renderer.js +3 -0
- package/dist/src/nile-virtual-select/renderer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -1
- package/src/internal/resizable-table-helper.ts +31 -8
- package/src/nile-code-editor/nile-code-editor.ts +49 -9
- package/src/nile-code-editor/theme.ts +19 -3
- package/src/nile-file-preview/nile-file-preview.css.ts +202 -183
- package/src/nile-file-preview/nile-file-preview.template.ts +66 -63
- package/src/nile-file-preview/nile-file-preview.ts +54 -22
- package/src/nile-file-preview/types/nile-file-preview.enums.ts +4 -3
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +25 -0
- package/src/nile-file-upload/nile-file-upload.css.ts +141 -88
- package/src/nile-file-upload/nile-file-upload.template.ts +133 -121
- package/src/nile-file-upload/nile-file-upload.ts +30 -18
- package/src/nile-file-upload/types/file-upload.enums.ts +9 -2
- package/src/nile-file-upload/utils/drag-drop.util.ts +25 -25
- package/src/nile-file-upload/utils/file-validation.util.ts +98 -45
- package/src/nile-input/nile-input.css.ts +0 -1
- package/src/nile-option/nile-option.ts +4 -1
- package/src/nile-option-group/index.ts +1 -0
- package/src/nile-option-group/nile-option-group.css.ts +60 -0
- package/src/nile-option-group/nile-option-group.interface.ts +25 -0
- package/src/nile-option-group/nile-option-group.ts +84 -0
- package/src/nile-pagination/nile-pagination.css.ts +7 -0
- package/src/nile-pagination/nile-pagination.ts +3 -1
- package/src/nile-select/nile-select.interface.ts +5 -0
- package/src/nile-select/nile-select.ts +74 -2
- package/src/nile-table-body/nile-table-body.ts +2 -0
- package/src/nile-table-cell-item/nile-table-cell-item.ts +15 -1
- package/src/nile-table-header-item/nile-table-header-item.ts +15 -1
- package/src/nile-virtual-select/renderer.ts +3 -0
- package/vscode-html-custom-data.json +49 -13
@@ -1,10 +1,10 @@
|
|
1
|
-
System.register(["lit","./nile-file-upload.css.cjs.js","../lit-html-9b3af046.cjs.js"],function(_export,_context){"use strict";var i,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,
|
1
|
+
System.register(["lit","./nile-file-upload.css.cjs.js","../lit-html-9b3af046.cjs.js","./types/file-upload.enums.cjs.js","./utils/file-validation.util.cjs.js"],function(_export,_context){"use strict";var i,e,t,s,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,l,a,o,r,c,d,v,p,u,h,$,m,b;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n){function n(){return _n.apply(this,arguments);}n.toString=function(){return _n.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_lit){i=_lit.html;},function(_nileFileUploadCssCjsJs){},function(_litHtml002CjsJs){e=_litHtml002CjsJs.T;},function(_typesFileUploadEnumsCjsJs){t=_typesFileUploadEnumsCjsJs.c;s=_typesFileUploadEnumsCjsJs.F;},function(_utilsFileValidationUtilCjsJs){n=_utilsFileValidationUtilCjsJs.t;}],execute:function execute(){/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2017 Google LLC
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
-
*/
|
5
|
+
*/l=1;a=/*#__PURE__*/function(){function a(i){_classCallCheck(this,a);}return _createClass(a,[{key:"_$AU",get:function get(){return this._$AM._$AU;}},{key:"_$AT",value:function _$AT(i,e,t){this._$Ct=i,this._$AM=e,this._$Ci=t;}},{key:"_$AS",value:function _$AS(i,e){return this.update(i,e);}},{key:"update",value:function update(i,e){return this.render.apply(this,_toConsumableArray(e));}}]);}();/**
|
6
6
|
* @license
|
7
7
|
* Copyright 2018 Google LLC
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
-
*/
|
9
|
+
*/o=function(i){return function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key];}return{_$litDirective$:i,values:e};};}(/*#__PURE__*/function(_a){function _class(i){var _i$strings;var _this;_classCallCheck(this,_class);if(_this=_callSuper(this,_class,[i]),i.type!==l||"class"!==i.name||((_i$strings=i.strings)===null||_i$strings===void 0?void 0:_i$strings.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return _this;}_inherits(_class,_a);return _createClass(_class,[{key:"render",value:function render(i){return" "+Object.keys(i).filter(function(e){return i[e];}).join(" ")+" ";}},{key:"update",value:function update(i,_ref){var _ref2=_slicedToArray(_ref,1),t=_ref2[0];if(void 0===this.st){this.st=new Set(),void 0!==i.strings&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(function(i){return""!==i;})));for(var _i in t){var _this$nt;t[_i]&&!((_this$nt=this.nt)!==null&&_this$nt!==void 0&&_this$nt.has(_i))&&this.st.add(_i);}return this.render(t);}var s=i.element.classList;var _iterator=_createForOfIteratorHelper(this.st),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i3=_step.value;_i3 in t||(s.remove(_i3),this.st["delete"](_i3));}}catch(err){_iterator.e(err);}finally{_iterator.f();}for(var _i2 in t){var _this$nt2;var _e=!!t[_i2];_e===this.st.has(_i2)||((_this$nt2=this.nt)===null||_this$nt2===void 0?void 0:_this$nt2.has(_i2))||(_e?(s.add(_i2),this.st.add(_i2)):(s.remove(_i2),this.st["delete"](_i2)));}return e;}}]);}(a)),r=function r(e,l,a,_r,c,d,v,p,u){return n(u),i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"wrapper\" part=\"horizontal-wrapper\">\n <div part=\"horizontal-div\" class=",">\n <div part=\"inner-div\" class=\"inner-div\">\n <slot class=\"upload-icon-slot\" name=\"upload-icon\">\n <nile-icon name=\"upload\" size=\"24\"></nile-icon>\n </slot>\n <div part=\"content\" class=\"content\">\n <div class=\"title\">","</div>\n <div class=\"subtitle\">","</div>\n </div>\n </div>\n <input\n type=\"file\"\n ?disabled=","\n @change=","\n multiple\n accept=","\n />\n <slot class=\"browse-file-button\" @click="," name=\"browse-file-button\">\n <nile-button variant=\"tertiary\" ?disabled=",">\n Browse File\n </nile-button>\n </slot>\n </div>\n ","\n </div>\n "])),o({"hover-border":"hover"===d,"horizontal-div":!0,disable:_r}),l,a,_r,function(i){c.handleFiles(i);},p.join(","),_r?void 0:e,_r,v||u.state===s.ERROR?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<div class=\"upload-error\">\n <nile-icon name=\"warning\" size=\"12\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n ","\n </div>"])),u.isStringTruncated?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-tooltip content=",">\n <span>","</span>\n </nile-tooltip>"])),v||t.CUSTOM_ERROR,v||t.CUSTOM_ERROR):i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<span>","</span>"])),v||t.CUSTOM_ERROR)):i(_templateObject5||(_templateObject5=_taggedTemplateLiteral([""]))));},_export("g",c=function c(i,e,t,s,n,l,a,o){return r(i,e,t,!1,s,n,l,a,o);}),_export("c",d=function d(i,e,t,s,n,l,a,o){return r(i,e,t,!0,s,n,l,a,o);}),_export("a",v=function v(i,e,t,s,n,l,a,o){return r(i,e,t,!1,s,n,l,a,o);}),_export("b",p=function p(){return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <div part=\"horizontal-drag-state\" class=\"horizontal-div dragging\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"general\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"image\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>","</p>\n </div>\n"])),t.DRAG_STATE_DEFAULT);}),u=function u(e,l,a,o,r,c,d,v){return n(v),i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <div part=\"vertical-wrapper\" class=\"wrapper\">\n <div part=\"vertical-default\" class=\"vertical-default vertical-div ","\">\n <slot name=\"upload-icon\">\n <nile-icon name=\"upload\" size=\"24\"></nile-icon>\n </slot>\n <div part=\"vertical-content-container\" class=\"content-container\">\n <div class=\"title\">","</div>\n <div class=\"subtitle\">","</div>\n </div>\n <input\n type=\"file\"\n ?disabled=","\n @change=","\n multiple\n accept=","\n />\n <slot @click="," name=\"browse-file-button\">\n <nile-button variant=\"tertiary\" ?disabled=",">\n Browse File\n </nile-button>\n </slot>\n </div>\n ","\n </div>\n "])),o?"disable":"",l,a,o,function(i){return r.handleFiles(i);},d.join(","),o?void 0:e,o,c||v.state===s.ERROR?i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<div class=\"vertical-upload-error\">\n <nile-icon name=\"warning\" size=\"12\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n ","\n </div>"])),v.isStringTruncated?i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-tooltip content=",">\n <span>","</span>\n </nile-tooltip>"])),c||t.CUSTOM_ERROR,c||t.CUSTOM_ERROR):i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<span>","</span>"])),c||t.CUSTOM_ERROR)):i(_templateObject11||(_templateObject11=_taggedTemplateLiteral([""]))));},_export("d",h=function h(i,e,t,s,n,l,a){return u(i,e,t,!1,s,n,l,a);}),_export("h",$=function $(i,e,t,s,n,l,a){return u(i,e,t,!0,s,n,l,a);}),_export("e",m=function m(i,e,t,s,n,l,a){return u(i,e,t,!1,s,n,l,a);}),_export("f",b=function b(){return i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"vertical-drag-state\" class=\"vertical-div vertical-drag\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"general\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"image\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>","</p>\n </div>\n"])),t.DRAG_STATE_DEFAULT);});}};});
|
10
10
|
//# sourceMappingURL=nile-file-upload.template.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-file-upload.template.cjs.js","sources":["../../../../node_modules/lit-html/directive.js","../../../../node_modules/lit-html/directives/class-map.js","../../../src/nile-file-upload/nile-file-upload.template.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import { html, TemplateResult } from 'lit';\nimport './nile-file-upload.css';\nimport { DragHandler } from './utils/drag-drop.util';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { FileUploadState } from './types/file-upload.enums';\n\nlet dragHandlerInstance: DragHandler;\nexport const getDragHandler = (dragHandler: DragHandler): void => {\n dragHandlerInstance = dragHandler;\n}\n\nexport const getHorizontalDefaultState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n errorMessage: string,\n state: FileUploadState\n): TemplateResult => html`\n <div>\n <div class=${classMap({ 'hover-border': state === \"hover\", 'horizontal-div': true })}>\n <div class=\"inner-div\">\n <slot name=\"uploadIcon\">\n <nile-icon name=\"var(--nile-icon-upload, var(--ng-icon-upload-01))\" size=\"24\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n <div class=\"content\">\n <slot name=\"title\">\n <h4>${title}</h4>\n </slot>\n <slot name=\"subtitle\">\n <p>${subtitle}</p>\n </slot>\n </div>\n </div>\n <input\n type=\"file\"\n @change=${(e: Event | DragEvent) => dragHandlerInstance.handleFiles(e)}\n multiple\n />\n <slot @click=${browseFiles} name=\"browseFileButton\">\n <nile-button variant=\"tertiary\">\n Browse File\n </nile-button>\n </slot>\n </div>\n ${errorMessage ?\n html`<div class=\"upload-error\">\n <nile-icon name=\"var(--nile-icon-warning, var(--ng-icon-alert-circle))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" size=\"12\" color=\"red\"></nile-icon>\n <span>${errorMessage}</span>\n </div>` :\n html``\n }\n </div>\n`;\n\nexport const getHorizontalDisabledtState = (\n browseFiles: Function,\n title: string,\n subtitle: string\n): TemplateResult => html`\n <div\n class=\"horizontal-div disable\"\n >\n <div class=\"inner-div\">\n <slot name=\"uploadIcon\">\n <nile-icon name=\"var(--nile-icon-upload, var(--ng-icon-upload-01))\" size=\"24\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n <div class=\"content\">\n <slot name=\"title\">\n <h4>${title}</h4>\n </slot>\n <slot name=\"subtitle\">\n <p>${subtitle}</p>\n </slot>\n </div>\n </div>\n <input\n type=\"file\"\n @change=${(e: Event | DragEvent) => dragHandlerInstance.handleFiles(e)}\n multiple\n />\n <slot @click=${browseFiles} name=\"browseFileButton\">\n <nile-button variant=\"tertiary\">\n Browse File\n </nile-button>\n </slot>\n </div>\n`;\n\nexport const getHorizontalDragState = (): TemplateResult => html`\n <div class=\"horizontal-div dragging\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"var(--nile-icon-general, var(--ng-icon-file-06))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"var(--nile-icon-image, var(--ng-icon-image-03))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>Drop files here to upload</p>\n </div>\n`;\n\n// Vertical States\nexport const getVerticalDefaultState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n errorMessage: string,\n state: FileUploadState\n): TemplateResult => html`\n <div>\n <div class=${classMap({ 'hover-border': state === \"hover\", 'vertical-div': true })}>\n <slot name=\"uploadIcon\">\n <nile-icon name=\"var(--nile-icon-upload, var(--ng-icon-upload-01))\" size=\"24\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n <div class=\"content-container\">\n <slot name=\"title\">\n <h4>${title}</h4>\n </slot>\n <slot name=\"subtitle\">\n <p>${subtitle}</p>\n </slot>\n </div>\n <input\n type=\"file\"\n @change=${(e: Event | DragEvent) => dragHandlerInstance.handleFiles(e)}\n multiple\n />\n <slot @click=${browseFiles} name=\"browseFileButton\">\n <nile-button variant=\"tertiary\">\n Browse File\n </nile-button>\n </slot>\n </div>\n ${errorMessage ?\n html`<div class=\"upload-error\">\n <nile-icon name=\"var(--nile-icon-warning, var(--ng-icon-alert-circle))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" size=\"12\" color=\"red\"></nile-icon>\n <span>${errorMessage}</span>\n </div>` :\n html``\n }\n </div>\n`;\n\nexport const getVerticalDisabledState = (\n browseFiles: Function,\n title: string,\n subtitle: string\n): TemplateResult => html`\n <div\n class=\"vertical-deafult vertical-div disable\"\n >\n <slot name=\"uploadIcon\">\n <nile-icon name=\"var(--nile-icon-upload, var(--ng-icon-upload-01))\" size=\"24\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n <div class=\"content-container\">\n <slot name=\"title\">\n <h4>${title}</h4>\n </slot>\n <slot name=\"title\">\n <p>${subtitle}</p>\n </slot>\n </div>\n <input\n type=\"file\"\n @change=${(e: Event | DragEvent) => dragHandlerInstance.handleFiles(e)}\n multiple\n />\n <slot @click=${browseFiles} name=\"browseFileButton\">\n <nile-button variant=\"tertiary\">\n Browse File\n </nile-button>\n </slot>\n </div>\n`;\n\nexport const getVerticalDragState = (): TemplateResult => html`\n <div class=\"vertical-div vertical-drag\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"var(--nile-icon-general, var(--ng-icon-file-06))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"var(--nile-icon-image, var(--ng-icon-image-03))\"\n method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>Drop files here to upload</p>\n </div>\n`;"],"names":["t","i","o","_createClass","key","get","_$AU","this","_$AM","value","_$AT","e","_$Ct","_$Ci","_$AS","update","render","_len","arguments","length","Array","_key","_$litDirective$","values","s","_class","_i$strings","_this","_classCallCheck","super","type","r","name","strings","Error","_inherits","_o","Object","keys","filter","join","_ref2","_slicedToArray","_ref","st","Set","nt","split","has","add","element","classList","_iterator","_createForOfIteratorHelper","_step","n","done","remove","err","f","_this$nt2","delete","_export","getDragHandler","dragHandler","dragHandlerInstance","getHorizontalDefaultState","browseFiles","title","subtitle","errorMessage","state","html","_templateObject","_taggedTemplateLiteral","classMap","handleFiles","_templateObject2","_templateObject3","getHorizontalDisabledtState","_templateObject4","getHorizontalDragState","_templateObject5","getVerticalDefaultState","_templateObject6","_templateObject7","_templateObject8","getVerticalDisabledState","_templateObject9","getVerticalDragState","_templateObject10"],"mappings":";;;;GAKMA,CAAAA,CAAa,EAA8GC,CAAAA,yBAAE,SAAAC,EAAYF,CAAAA,CAAAA,CAAAA,eAAAA,MAAAA,CAAAA,EAAI,CAAA,OAAAG,YAAA,CAAAD,CAAA,GAAAE,GAAA,QAAAC,GAAA,UAAAA,IAAA,CAAIC,CAAO,MAAOC,KAAKC,CAAAA,IAAAA,CAAKF,IAAI,EAAC,GAAAF,GAAA,QAAAK,KAAA,UAAAC,IAAAA,CAAKV,CAAEW,CAAAA,CAAAA,CAAEV,CAAGM,CAAAA,CAAAA,IAAAA,CAAKK,IAAKZ,CAAAA,CAAAA,CAAEO,KAAKC,IAAKG,CAAAA,CAAAA,CAAEJ,KAAKM,IAAKZ,CAAAA,CAAC,EAAC,GAAAG,GAAA,QAAAK,KAAA,UAAAK,IAAAA,CAAKd,CAAEW,CAAAA,CAAAA,CAAAA,CAAG,MAAOJ,KAAAA,CAAKQ,OAAOf,CAAEW,CAAAA,CAAAA,CAAE,EAAC,GAAAP,GAAA,UAAAK,KAAA,UAAAM,MAAAA,CAAOf,EAAEW,CAAG,CAAA,CAAA,MAAOJ,KAAKS,CAAAA,MAAAA,CAAAA,KAAAA,CAALT,IAAKS,CAAAA,kBAAAA,CAAUL,CAAE,EAAA,EAAA;;;;ACAvS,GAAMA,EDA2E,SAAAV,CAAA,QAAA,oBAAAgB,IAAA,CAAAC,SAAA,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AAA,CAAAA,CAAAA,QAA6CjB,CAAAA,CAAI,CAAAkB,iBAAA,GAAAA,iBAAA,CAAAhB,sBAAA","x_google_ignoreList":[0,1]}
|
1
|
+
{"version":3,"file":"nile-file-upload.template.cjs.js","sources":["../../../../node_modules/lit-html/directive.js","../../../../node_modules/lit-html/directives/class-map.js","../../../src/nile-file-upload/nile-file-upload.template.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import { html, TemplateResult } from 'lit';\nimport './nile-file-upload.css';\nimport { DragHandler } from './utils/drag-drop.util';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { FileUploadDefaults, FileUploadState } from './types/file-upload.enums';\nimport { truncateString } from './utils/file-validation.util';\nimport { NileFileUpload } from './nile-file-upload';\n\nconst baseHorizontalState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n disabled: boolean,\n dragHandler: DragHandler,\n state: FileUploadState,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => {\n truncateString(nileFileUpload);\n return html`\n <div class=\"wrapper\" part=\"horizontal-wrapper\">\n <div part=\"horizontal-div\" class=${classMap({ 'hover-border': state === \"hover\", 'horizontal-div': true, 'disable': disabled })}>\n <div part=\"inner-div\" class=\"inner-div\">\n <slot class=\"upload-icon-slot\" name=\"upload-icon\">\n <nile-icon name=\"upload\" size=\"24\"></nile-icon>\n </slot>\n <div part=\"content\" class=\"content\">\n <div class=\"title\">${title}</div>\n <div class=\"subtitle\">${subtitle}</div>\n </div>\n </div>\n <input\n type=\"file\"\n ?disabled=${disabled}\n @change=${(e: Event | DragEvent) => { dragHandler.handleFiles(e) }}\n multiple\n accept=${allowedTypes.join(',')}\n />\n <slot class=\"browse-file-button\" @click=${disabled ? undefined : browseFiles} name=\"browse-file-button\">\n <nile-button variant=\"tertiary\" ?disabled=${disabled}>\n Browse File\n </nile-button>\n </slot>\n </div>\n ${errorMessage || nileFileUpload.state === FileUploadState.ERROR ?\n html`<div class=\"upload-error\">\n <nile-icon name=\"warning\" size=\"12\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n ${\n nileFileUpload.isStringTruncated\n ? html`<nile-tooltip content=${errorMessage || FileUploadDefaults.CUSTOM_ERROR}>\n <span>${errorMessage || FileUploadDefaults.CUSTOM_ERROR}</span>\n </nile-tooltip>`\n : html`<span>${errorMessage || FileUploadDefaults.CUSTOM_ERROR}</span>`\n }\n </div>` :\n html``\n }\n </div>\n `;\n}\n\nexport const getHorizontalDefaultState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n state: FileUploadState,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseHorizontalState(browseFiles, title, subtitle, false, dragHandler, state, errorMessage, allowedTypes, nileFileUpload);\n\nexport const getHorizontalDisabledState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n state: FileUploadState,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseHorizontalState(browseFiles, title, subtitle, true, dragHandler, state, errorMessage, allowedTypes, nileFileUpload);\n\nexport const getHorizontalErrorState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n state: FileUploadState,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseHorizontalState(browseFiles, title, subtitle, false, dragHandler, state, errorMessage, allowedTypes, nileFileUpload);\n\nexport const getHorizontalDragState = (): TemplateResult => html`\n <div part=\"horizontal-drag-state\" class=\"horizontal-div dragging\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"general\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"image\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>${FileUploadDefaults.DRAG_STATE_DEFAULT}</p>\n </div>\n`;\n\n// Vertical States\nconst baseVerticalState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n disabled: boolean,\n dragHandler: DragHandler,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => {\n truncateString(nileFileUpload);\n return html`\n <div part=\"vertical-wrapper\" class=\"wrapper\">\n <div part=\"vertical-default\" class=\"vertical-default vertical-div ${disabled ? 'disable' : ''}\">\n <slot name=\"upload-icon\">\n <nile-icon name=\"upload\" size=\"24\"></nile-icon>\n </slot>\n <div part=\"vertical-content-container\" class=\"content-container\">\n <div class=\"title\">${title}</div>\n <div class=\"subtitle\">${subtitle}</div>\n </div>\n <input\n type=\"file\"\n ?disabled=${disabled}\n @change=${(e: Event | DragEvent) => dragHandler.handleFiles(e)}\n multiple\n accept=${allowedTypes.join(',')}\n />\n <slot @click=${disabled ? undefined : browseFiles} name=\"browse-file-button\">\n <nile-button variant=\"tertiary\" ?disabled=${disabled}>\n Browse File\n </nile-button>\n </slot>\n </div>\n ${errorMessage || nileFileUpload.state === FileUploadState.ERROR ?\n html`<div class=\"vertical-upload-error\">\n <nile-icon name=\"warning\" size=\"12\" color=\"var(--nile-colors-red-700)\"></nile-icon>\n ${\n nileFileUpload.isStringTruncated\n ? html`<nile-tooltip content=${errorMessage || FileUploadDefaults.CUSTOM_ERROR}>\n <span>${errorMessage || FileUploadDefaults.CUSTOM_ERROR}</span>\n </nile-tooltip>`\n : html`<span>${errorMessage || FileUploadDefaults.CUSTOM_ERROR}</span>`\n }\n </div>` :\n html``\n }\n </div>\n `;\n}\n\nexport const getVerticalDefaultState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseVerticalState(browseFiles, title, subtitle, false, dragHandler, errorMessage, allowedTypes, nileFileUpload);\n\nexport const getVerticalDisabledState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseVerticalState(browseFiles, title, subtitle, true, dragHandler, errorMessage, allowedTypes, nileFileUpload);\n\nexport const getVerticalErrorState = (\n browseFiles: Function,\n title: string,\n subtitle: string,\n dragHandler: DragHandler,\n errorMessage: string,\n allowedTypes: string[],\n nileFileUpload: NileFileUpload\n): TemplateResult => baseVerticalState(browseFiles, title, subtitle, false, dragHandler, errorMessage, allowedTypes, nileFileUpload);\n\n\nexport const getVerticalDragState = (): TemplateResult => html`\n <div part=\"vertical-drag-state\" class=\"vertical-div vertical-drag\">\n <div class=\"icons-container\">\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"general\"\n size=\"20\"\n class=\"general-icon\"\n ></nile-icon>\n <nile-icon\n color=\"var(--nile-colors-blue-500)\"\n name=\"image\"\n size=\"24\"\n class=\"image-icon\"\n ></nile-icon>\n </div>\n <p>${FileUploadDefaults.DRAG_STATE_DEFAULT}</p>\n </div>\n`;"],"names":["t","i","a","_createClass","key","get","_$AU","this","_$AM","value","_$AT","e","_$Ct","_$Ci","_$AS","update","render","_len","arguments","length","Array","_key","_$litDirective$","values","s","_class","_i$strings","_this","_classCallCheck","super","type","r","name","strings","Error","_inherits","_a","Object","keys","filter","join","st","Set","nt","split","has","add","element","classList","_iterator","_createForOfIteratorHelper","_step","n","done","remove","err","f","_this$nt2","delete","baseHorizontalState","browseFiles","title","subtitle","disabled","dragHandler","state","errorMessage","allowedTypes","nileFileUpload","truncateString","html","_templateObject","_taggedTemplateLiteral","classMap","disable","handleFiles","undefined","FileUploadState","ERROR","_templateObject2","isStringTruncated","_templateObject3","FileUploadDefaults","CUSTOM_ERROR","_templateObject4","_templateObject5","getHorizontalDefaultState","getHorizontalDisabledState","getHorizontalErrorState","getHorizontalDragState","_templateObject6","DRAG_STATE_DEFAULT","baseVerticalState","u","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","getVerticalDefaultState","h","getVerticalDisabledState","$","getVerticalErrorState","getVerticalDragState","b","_templateObject12"],"mappings":";;;;GAKMA,CAAAA,CAAa,EAA8GC,CAAAA,yBAAE,SAAAC,EAAYF,CAAAA,CAAAA,CAAAA,eAAAA,MAAAA,CAAAA,EAAI,CAAA,OAAAG,YAAA,CAAAD,CAAA,GAAAE,GAAA,QAAAC,GAAA,UAAAA,IAAA,CAAIC,CAAO,MAAOC,KAAKC,CAAAA,IAAAA,CAAKF,IAAI,EAAC,GA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AAAA,CACX3C,CAAAA,CACAC,CACAC,CAAAA,CAAAA,CACAE,CACAE,CAAAA,CAAAA,CACAC,EACAC,CACmBwB,QAAAA,CAAAA,CAAAA,CAAkBhC,CAAaC,CAAAA,CAAAA,CAAOC,CAAU,CAAA,CAAA,CAAA,CAAOE,CAAaE,CAAAA,CAAAA,CAAcC,CAAcC,CAAAA,CAAAA,CAAAA,IAAAA,OAAAA,KAGxGoC,CAAuB,CAAA,QAAvBA,CAAAA,CAAuBC,CAAA,QAAsBnC,CAAAA,CAAI,CAAAoC,iBAAA,GAAAA,iBAAA,CAAAlC,sBAAA,seAgBrDU,CAAmBS,CAAAA,kBAAAA","x_google_ignoreList":[0,1]}
|
@@ -1,167 +1,109 @@
|
|
1
|
-
import{html as i}from"lit";import"./nile-file-upload.css.esm.js";import{T as e}from"../lit-html-39a6718c.esm.js";
|
1
|
+
import{html as i}from"lit";import"./nile-file-upload.css.esm.js";import{T as e}from"../lit-html-39a6718c.esm.js";import{c as t,F as s}from"./types/file-upload.enums.esm.js";import{t as n}from"./utils/file-validation.util.esm.js";
|
2
2
|
/**
|
3
3
|
* @license
|
4
4
|
* Copyright 2017 Google LLC
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
-
*/const
|
6
|
+
*/const l=1;class a{constructor(i){}get _$AU(){return this._$AM._$AU}_$AT(i,e,t){this._$Ct=i,this._$AM=e,this._$Ci=t}_$AS(i,e){return this.update(i,e)}update(i,e){return this.render(...e)}}
|
7
7
|
/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2018 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/const
|
12
|
-
<div>
|
13
|
-
<div class=${
|
14
|
-
<div class="inner-div">
|
15
|
-
<slot name="
|
16
|
-
<nile-icon name="
|
11
|
+
*/const o=(i=>(...e)=>({_$litDirective$:i,values:e}))(class extends a{constructor(i){if(super(i),i.type!==l||"class"!==i.name||i.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((e=>i[e])).join(" ")+" "}update(i,[t]){if(void 0===this.st){this.st=new Set,void 0!==i.strings&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((i=>""!==i))));for(const i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}const s=i.element.classList;for(const i of this.st)i in t||(s.remove(i),this.st.delete(i));for(const i in t){const e=!!t[i];e===this.st.has(i)||this.nt?.has(i)||(e?(s.add(i),this.st.add(i)):(s.remove(i),this.st.delete(i)))}return e}}),r=(e,l,a,r,c,d,v,p,u)=>(n(u),i`
|
12
|
+
<div class="wrapper" part="horizontal-wrapper">
|
13
|
+
<div part="horizontal-div" class=${o({"hover-border":"hover"===d,"horizontal-div":!0,disable:r})}>
|
14
|
+
<div part="inner-div" class="inner-div">
|
15
|
+
<slot class="upload-icon-slot" name="upload-icon">
|
16
|
+
<nile-icon name="upload" size="24"></nile-icon>
|
17
17
|
</slot>
|
18
|
-
<div class="content">
|
19
|
-
<
|
20
|
-
|
21
|
-
</slot>
|
22
|
-
<slot name="subtitle">
|
23
|
-
<p>${o}</p>
|
24
|
-
</slot>
|
18
|
+
<div part="content" class="content">
|
19
|
+
<div class="title">${l}</div>
|
20
|
+
<div class="subtitle">${a}</div>
|
25
21
|
</div>
|
26
22
|
</div>
|
27
23
|
<input
|
28
24
|
type="file"
|
29
|
-
|
25
|
+
?disabled=${r}
|
26
|
+
@change=${i=>{c.handleFiles(i)}}
|
30
27
|
multiple
|
28
|
+
accept=${p.join(",")}
|
31
29
|
/>
|
32
|
-
<slot @click=${e} name="
|
33
|
-
<nile-button variant="tertiary">
|
30
|
+
<slot class="browse-file-button" @click=${r?void 0:e} name="browse-file-button">
|
31
|
+
<nile-button variant="tertiary" ?disabled=${r}>
|
34
32
|
Browse File
|
35
33
|
</nile-button>
|
36
34
|
</slot>
|
37
35
|
</div>
|
38
|
-
${s?i`<div class="upload-error">
|
39
|
-
<nile-icon name="
|
40
|
-
|
36
|
+
${v||u.state===s.ERROR?i`<div class="upload-error">
|
37
|
+
<nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
|
38
|
+
${u.isStringTruncated?i`<nile-tooltip content=${v||t.CUSTOM_ERROR}>
|
39
|
+
<span>${v||t.CUSTOM_ERROR}</span>
|
40
|
+
</nile-tooltip>`:i`<span>${v||t.CUSTOM_ERROR}</span>`}
|
41
41
|
</div>`:i``}
|
42
42
|
</div>
|
43
|
-
|
44
|
-
<div
|
45
|
-
class="horizontal-div disable"
|
46
|
-
>
|
47
|
-
<div class="inner-div">
|
48
|
-
<slot name="uploadIcon">
|
49
|
-
<nile-icon name="var(--nile-icon-upload, var(--ng-icon-upload-01))" size="24" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"></nile-icon>
|
50
|
-
</slot>
|
51
|
-
<div class="content">
|
52
|
-
<slot name="title">
|
53
|
-
<h4>${n}</h4>
|
54
|
-
</slot>
|
55
|
-
<slot name="subtitle">
|
56
|
-
<p>${o}</p>
|
57
|
-
</slot>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
<input
|
61
|
-
type="file"
|
62
|
-
@change=${i=>l.handleFiles(i)}
|
63
|
-
multiple
|
64
|
-
/>
|
65
|
-
<slot @click=${e} name="browseFileButton">
|
66
|
-
<nile-button variant="tertiary">
|
67
|
-
Browse File
|
68
|
-
</nile-button>
|
69
|
-
</slot>
|
70
|
-
</div>
|
71
|
-
`,c=()=>i`
|
72
|
-
<div class="horizontal-div dragging">
|
43
|
+
`),c=(i,e,t,s,n,l,a,o)=>r(i,e,t,!1,s,n,l,a,o),d=(i,e,t,s,n,l,a,o)=>r(i,e,t,!0,s,n,l,a,o),v=(i,e,t,s,n,l,a,o)=>r(i,e,t,!1,s,n,l,a,o),p=()=>i`
|
44
|
+
<div part="horizontal-drag-state" class="horizontal-div dragging">
|
73
45
|
<div class="icons-container">
|
74
46
|
<nile-icon
|
75
47
|
color="var(--nile-colors-blue-500)"
|
76
|
-
name="
|
77
|
-
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
48
|
+
name="general"
|
78
49
|
size="20"
|
79
50
|
class="general-icon"
|
80
51
|
></nile-icon>
|
81
52
|
<nile-icon
|
82
53
|
color="var(--nile-colors-blue-500)"
|
83
|
-
name="
|
84
|
-
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
54
|
+
name="image"
|
85
55
|
size="24"
|
86
56
|
class="image-icon"
|
87
57
|
></nile-icon>
|
88
58
|
</div>
|
89
|
-
<p
|
59
|
+
<p>${t.DRAG_STATE_DEFAULT}</p>
|
90
60
|
</div>
|
91
|
-
`,
|
92
|
-
<div>
|
93
|
-
<div
|
94
|
-
<slot name="
|
95
|
-
<nile-icon name="
|
61
|
+
`,u=(e,l,a,o,r,c,d,v)=>(n(v),i`
|
62
|
+
<div part="vertical-wrapper" class="wrapper">
|
63
|
+
<div part="vertical-default" class="vertical-default vertical-div ${o?"disable":""}">
|
64
|
+
<slot name="upload-icon">
|
65
|
+
<nile-icon name="upload" size="24"></nile-icon>
|
96
66
|
</slot>
|
97
|
-
<div class="content-container">
|
98
|
-
<
|
99
|
-
|
100
|
-
</slot>
|
101
|
-
<slot name="subtitle">
|
102
|
-
<p>${o}</p>
|
103
|
-
</slot>
|
67
|
+
<div part="vertical-content-container" class="content-container">
|
68
|
+
<div class="title">${l}</div>
|
69
|
+
<div class="subtitle">${a}</div>
|
104
70
|
</div>
|
105
71
|
<input
|
106
72
|
type="file"
|
107
|
-
|
73
|
+
?disabled=${o}
|
74
|
+
@change=${i=>r.handleFiles(i)}
|
108
75
|
multiple
|
76
|
+
accept=${d.join(",")}
|
109
77
|
/>
|
110
|
-
<slot @click=${e} name="
|
111
|
-
<nile-button variant="tertiary">
|
78
|
+
<slot @click=${o?void 0:e} name="browse-file-button">
|
79
|
+
<nile-button variant="tertiary" ?disabled=${o}>
|
112
80
|
Browse File
|
113
81
|
</nile-button>
|
114
82
|
</slot>
|
115
83
|
</div>
|
116
|
-
${s?i`<div class="upload-error">
|
117
|
-
<nile-icon name="
|
118
|
-
|
84
|
+
${c||v.state===s.ERROR?i`<div class="vertical-upload-error">
|
85
|
+
<nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
|
86
|
+
${v.isStringTruncated?i`<nile-tooltip content=${c||t.CUSTOM_ERROR}>
|
87
|
+
<span>${c||t.CUSTOM_ERROR}</span>
|
88
|
+
</nile-tooltip>`:i`<span>${c||t.CUSTOM_ERROR}</span>`}
|
119
89
|
</div>`:i``}
|
120
90
|
</div>
|
121
|
-
|
122
|
-
<div
|
123
|
-
class="vertical-deafult vertical-div disable"
|
124
|
-
>
|
125
|
-
<slot name="uploadIcon">
|
126
|
-
<nile-icon name="var(--nile-icon-upload, var(--ng-icon-upload-01))" size="24" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"></nile-icon>
|
127
|
-
</slot>
|
128
|
-
<div class="content-container">
|
129
|
-
<slot name="title">
|
130
|
-
<h4>${n}</h4>
|
131
|
-
</slot>
|
132
|
-
<slot name="title">
|
133
|
-
<p>${o}</p>
|
134
|
-
</slot>
|
135
|
-
</div>
|
136
|
-
<input
|
137
|
-
type="file"
|
138
|
-
@change=${i=>l.handleFiles(i)}
|
139
|
-
multiple
|
140
|
-
/>
|
141
|
-
<slot @click=${e} name="browseFileButton">
|
142
|
-
<nile-button variant="tertiary">
|
143
|
-
Browse File
|
144
|
-
</nile-button>
|
145
|
-
</slot>
|
146
|
-
</div>
|
147
|
-
`,m=()=>i`
|
148
|
-
<div class="vertical-div vertical-drag">
|
91
|
+
`),m=(i,e,t,s,n,l,a)=>u(i,e,t,!1,s,n,l,a),h=(i,e,t,s,n,l,a)=>u(i,e,t,!0,s,n,l,a),$=(i,e,t,s,n,l,a)=>u(i,e,t,!1,s,n,l,a),b=()=>i`
|
92
|
+
<div part="vertical-drag-state" class="vertical-div vertical-drag">
|
149
93
|
<div class="icons-container">
|
150
94
|
<nile-icon
|
151
95
|
color="var(--nile-colors-blue-500)"
|
152
|
-
name="
|
153
|
-
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
96
|
+
name="general"
|
154
97
|
size="20"
|
155
98
|
class="general-icon"
|
156
99
|
></nile-icon>
|
157
100
|
<nile-icon
|
158
101
|
color="var(--nile-colors-blue-500)"
|
159
|
-
name="
|
160
|
-
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
102
|
+
name="image"
|
161
103
|
size="24"
|
162
104
|
class="image-icon"
|
163
105
|
></nile-icon>
|
164
106
|
</div>
|
165
|
-
<p
|
107
|
+
<p>${t.DRAG_STATE_DEFAULT}</p>
|
166
108
|
</div>
|
167
|
-
`;export{a,
|
109
|
+
`;export{v as a,p as b,d as c,m as d,$ as e,b as f,c as g,h};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-3bfb4490.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-file-upload.cjs.js","tslib","./nile-file-upload.css.cjs.js","../internal/nile-element.cjs.js","./utils/drag-drop.util.cjs.js","./types/file-upload.enums.cjs.js","./nile-file-upload.template.cjs.js","../lit-html-9b3af046.cjs.js","lit/decorators.js","./utils/file-validation.util.cjs.js"],function(_export,_context){"use strict";var t,i,e,l,_templateObject,_templateObject2;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){t=_fixture003CjsJs.f;i=_fixture003CjsJs.a;e=_fixture003CjsJs.h;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileFileUploadCjsJs){},function(_tslib){},function(_nileFileUploadCssCjsJs){},function(_internalNileElementCjsJs){},function(_utilsDragDropUtilCjsJs){},function(_typesFileUploadEnumsCjsJs){},function(_nileFileUploadTemplateCjsJs){},function(_litHtml002CjsJs){},function(_litDecoratorsJs){},function(_utilsFileValidationUtilCjsJs){}],execute:function execute(){describe("<nile-file-upload>",function(){var s;beforeEach(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-file-upload></nile-file-upload>"]))));case 2:s=_context2.sent;case 3:case"end":return _context2.stop();}},_callee);}))),it("passes accessibility test",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(s).to.be.accessible();case 2:case"end":return _context3.stop();}},_callee2);}))),it("renders with the correct tag name",function(){i(s.tagName.toLowerCase()).to.equal("nile-file-upload");}),it("renders with slot content when provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _r$0$textContent;var o,a,r;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:o="Test Content";_context4.next=3;return t(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-file-upload>","</nile-file-upload>"])),o));case 3:s=_context4.sent;a=s.shadowRoot.querySelector("slot");e.exists(a,"Slot should exist");r=a.assignedNodes({flatten:!0});i(r.length).to.be.greaterThan(0),i((_r$0$textContent=r[0].textContent)===null||_r$0$textContent===void 0?void 0:_r$0$textContent.trim()).to.equal(o);case 8:case"end":return _context4.stop();}},_callee3);})));});}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-3bfb4490.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-file-upload.cjs.js","tslib","./nile-file-upload.css.cjs.js","../internal/nile-element.cjs.js","./utils/drag-drop.util.cjs.js","./utils/file-validation.util.cjs.js","./types/file-upload.enums.cjs.js","lit/decorators.js","./nile-file-upload.template.cjs.js","../lit-html-9b3af046.cjs.js"],function(_export,_context){"use strict";var t,i,e,l,_templateObject,_templateObject2;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){t=_fixture003CjsJs.f;i=_fixture003CjsJs.a;e=_fixture003CjsJs.h;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileFileUploadCjsJs){},function(_tslib){},function(_nileFileUploadCssCjsJs){},function(_internalNileElementCjsJs){},function(_utilsDragDropUtilCjsJs){},function(_utilsFileValidationUtilCjsJs){},function(_typesFileUploadEnumsCjsJs){},function(_litDecoratorsJs){},function(_nileFileUploadTemplateCjsJs){},function(_litHtml002CjsJs){}],execute:function execute(){describe("<nile-file-upload>",function(){var s;beforeEach(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-file-upload></nile-file-upload>"]))));case 2:s=_context2.sent;case 3:case"end":return _context2.stop();}},_callee);}))),it("passes accessibility test",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(s).to.be.accessible();case 2:case"end":return _context3.stop();}},_callee2);}))),it("renders with the correct tag name",function(){i(s.tagName.toLowerCase()).to.equal("nile-file-upload");}),it("renders with slot content when provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _r$0$textContent;var o,a,r;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:o="Test Content";_context4.next=3;return t(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-file-upload>","</nile-file-upload>"])),o));case 3:s=_context4.sent;a=s.shadowRoot.querySelector("slot");e.exists(a,"Slot should exist");r=a.assignedNodes({flatten:!0});i(r.length).to.be.greaterThan(0),i((_r$0$textContent=r[0].textContent)===null||_r$0$textContent===void 0?void 0:_r$0$textContent.trim()).to.equal(o);case 8:case"end":return _context4.stop();}},_callee3);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-file-upload.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
import{f as t,a as i,h as e}from"../fixture-8edec91c.esm.js";import{html as l}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-file-upload.esm.js";import"tslib";import"./nile-file-upload.css.esm.js";import"../internal/nile-element.esm.js";import"./utils/drag-drop.util.esm.js";import"./
|
1
|
+
import{f as t,a as i,h as e}from"../fixture-8edec91c.esm.js";import{html as l}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-file-upload.esm.js";import"tslib";import"./nile-file-upload.css.esm.js";import"../internal/nile-element.esm.js";import"./utils/drag-drop.util.esm.js";import"./utils/file-validation.util.esm.js";import"./types/file-upload.enums.esm.js";import"lit/decorators.js";import"./nile-file-upload.template.esm.js";import"../lit-html-39a6718c.esm.js";describe("<nile-file-upload>",(()=>{let s;beforeEach((async()=>{s=await t(l`<nile-file-upload></nile-file-upload>`)})),it("passes accessibility test",(async()=>{await i(s).to.be.accessible()})),it("renders with the correct tag name",(()=>{i(s.tagName.toLowerCase()).to.equal("nile-file-upload")})),it("renders with slot content when provided",(async()=>{const o="Test Content";s=await t(l`<nile-file-upload>${o}</nile-file-upload>`);const a=s.shadowRoot.querySelector("slot");e.exists(a,"Slot should exist");const r=a.assignedNodes({flatten:!0});i(r.length).to.be.greaterThan(0),i(r[0].textContent?.trim()).to.equal(o)}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var e,l,i,a
|
1
|
+
System.register([],function(_export,_context){"use strict";var e,l,r,i,a;_export({F:void 0,d:void 0,a:void 0,b:void 0,c:void 0});return{setters:[],execute:function execute(){!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error";}(e||_export("F",e={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical";}(l||_export("d",l={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later.";}(r||_export("a",r={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.NILE_DRAG="nile-drag",e.NILE_CHANGE="nile-change",e.NILE_UPLOADING="nile-uploading",e.NILE_UPLOAD_PROGRESS="nile-upload-progress",e.NILE_UPLOAD_SUCCESS="nile-upload-success",e.NILE_UPLOAD_CANCELLED="nile-upload-cancelled",e.NILE_SIZE_EXCEED_FILES="nile-size-exceed-files",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_NETWORK_ERROR="nile-network-error",e.SERVER_SIDE_ERROR="nile-server-error",e.NILE_DESTROY="nile-destroy";}(i||_export("b",i={})),function(e){e.TITLE="Drag and drop to upload",e.SUBTITLE="PNG, JPG or SVG (upto 1MB) | 1:1 ratio",e.ERROR_MESSAGE="Invalid File Format.",e.DRAG_STATE_DEFAULT="Drop files here to upload",e.CUSTOM_ERROR="Error Occured!";}(a||_export("c",a={}));}};});
|
2
2
|
//# sourceMappingURL=file-upload.enums.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file-upload.enums.cjs.js","sources":["../../../../src/nile-file-upload/types/file-upload.enums.ts"],"sourcesContent":["export enum FileUploadState {\n DEFAULT = 'default',\n DISABLED = 'disabled',\n HOVER = 'hover',\n DRAG = 'drag'\n}\n\nexport enum FileUploadVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical'\n}\n\nexport enum FileUploadError {\n INVALID_FORMAT = \"Invalid file format! Upload valid file.\",\n
|
1
|
+
{"version":3,"file":"file-upload.enums.cjs.js","sources":["../../../../src/nile-file-upload/types/file-upload.enums.ts"],"sourcesContent":["export enum FileUploadState {\n DEFAULT = 'default',\n DISABLED = 'disabled',\n HOVER = 'hover',\n DRAG = 'drag',\n ERROR = 'error'\n}\n\nexport enum FileUploadVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical'\n}\n\nexport enum FileUploadError {\n INVALID_FORMAT = \"Invalid file format! Upload valid file.\",\n SIZE_LIMIT_EXCEEDED = \"File exceeds size limit! Upload smaller file.\",\n MULTIPLE_NOT_ALLOWED = \"Please Upload Single File!\",\n DUPLICATES_NOT_ALLOWED = \"Duplicate Files Are Not Allowed!\",\n UPLOAD_URL_REQUIRED = \"Upload URL is required!\",\n SERVER_SIDE_ERROR = \"Error from server! Please try again later.\",\n NETWORK_ERROR = \"Network error! Please try again later.\"\n}\n\nexport enum FileUploadEvent {\n NILE_INIT = \"nile-init\",\n NILE_BROWSE = \"nile-browse\",\n NILE_DRAG = \"nile-drag\",\n NILE_CHANGE = \"nile-change\",\n NILE_UPLOADING = \"nile-uploading\",\n NILE_UPLOAD_PROGRESS = \"nile-upload-progress\",\n NILE_UPLOAD_SUCCESS = \"nile-upload-success\",\n NILE_UPLOAD_CANCELLED = \"nile-upload-cancelled\",\n NILE_SIZE_EXCEED_FILES = \"nile-size-exceed-files\",\n NILE_CANCEL_UPLOAD = \"nile-cancel-upload\",\n NILE_NETWORK_ERROR = \"nile-network-error\",\n SERVER_SIDE_ERROR = \"nile-server-error\",\n NILE_DESTROY = \"nile-destroy\"\n}\n\nexport enum FileUploadDefaults {\n TITLE = 'Drag and drop to upload',\n SUBTITLE = 'PNG, JPG or SVG (upto 1MB) | 1:1 ratio',\n ERROR_MESSAGE = 'Invalid File Format.',\n DRAG_STATE_DEFAULT = 'Drop files here to upload',\n CUSTOM_ERROR = 'Error Occured!'\n};"],"names":["FileUploadState","DEFAULT","DISABLED","HOVER","DRAG","ERROR","FileUploadVariant","HORIZONTAL","VERTICAL","FileUploadError","INVALID_FORMAT","SIZE_LIMIT_EXCEEDED","MULTIPLE_NOT_ALLOWED","DUPLICATES_NOT_ALLOWED","UPLOAD_URL_REQUIRED","SERVER_SIDE_ERROR","NETWORK_ERROR","FileUploadEvent","NILE_INIT","NILE_BROWSE","NILE_DRAG","NILE_CHANGE","NILE_UPLOADING","NILE_UPLOAD_PROGRESS","NILE_UPLOAD_SUCCESS","NILE_UPLOAD_CANCELLED","NILE_SIZE_EXCEED_FILES","NILE_CANCEL_UPLOAD","NILE_NETWORK_ERROR","NILE_DESTROY","FileUploadDefaults","TITLE","SUBTITLE","ERROR_MESSAGE","DRAG_STATE_DEFAULT","CUSTOM_ERROR"],"mappings":"+KAAA,SAAYA,CAAAA,CAAAA,CACVA,C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,mBAAA,CACAE,CAAA,CAAAY,YAAA,CAAA,cACD,EAdD,CAAYZ,CAAAA,EAAAA,OAAAA,KAAAA,EAcX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYa,CAAAA,CAAAA,CACVA,CAAA,CAAAC,KAAA,CAAA,yBACAD,CAAAA,CAAAA,CAAAE,SAAA,wCACAF,CAAAA,CAAAA,CAAAG,aAAA,CAAA,sBAAA,CACAH,CAAA,CAAAI,kBAAA,CAAA,2BACAJ,CAAAA,CAAAA,CAAAK,aAAA,gBACD,EAND,CAAYL,CAAAA,EAAAA,OAAAA,KAAAA,EAMX,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
var e,l,i,a
|
1
|
+
var e,l,r,i,a;!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error"}(e||(e={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(l||(l={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later."}(r||(r={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.NILE_DRAG="nile-drag",e.NILE_CHANGE="nile-change",e.NILE_UPLOADING="nile-uploading",e.NILE_UPLOAD_PROGRESS="nile-upload-progress",e.NILE_UPLOAD_SUCCESS="nile-upload-success",e.NILE_UPLOAD_CANCELLED="nile-upload-cancelled",e.NILE_SIZE_EXCEED_FILES="nile-size-exceed-files",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_NETWORK_ERROR="nile-network-error",e.SERVER_SIDE_ERROR="nile-server-error",e.NILE_DESTROY="nile-destroy"}(i||(i={})),function(e){e.TITLE="Drag and drop to upload",e.SUBTITLE="PNG, JPG or SVG (upto 1MB) | 1:1 ratio",e.ERROR_MESSAGE="Invalid File Format.",e.DRAG_STATE_DEFAULT="Drop files here to upload",e.CUSTOM_ERROR="Error Occured!"}(a||(a={}));export{e as F,r as a,i as b,a as c,l as d};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../types/file-upload.enums.cjs.js"],function(_export,_context){"use strict";var t,s;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(
|
1
|
+
System.register(["./file-validation.util.cjs.js","../types/file-upload.enums.cjs.js"],function(_export,_context){"use strict";var t,s,e;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_fileValidationUtilCjsJs){t=_fileValidationUtilCjsJs.p;},function(_typesFileUploadEnumsCjsJs){s=_typesFileUploadEnumsCjsJs.F;}],execute:function execute(){_export("D",e=/*#__PURE__*/function(){function e(){_classCallCheck(this,e);this.currentState=s.DEFAULT;}return _createClass(e,[{key:"setErrorMessage",value:function setErrorMessage(t){this.errorMessageCallback=t;}},{key:"setValuesInDragHandler",value:function setValuesInDragHandler(t){this.currentState=t;}},{key:"onFileDrop",value:function onFileDrop(t){this.fileDropCallback=t;}},{key:"onStateChange",value:function onStateChange(t){this.stateChangeCallback=t;}},{key:"setState",value:function setState(t){var _this$stateChangeCall;this.currentState!==s.DISABLED&&(this.currentState=t,(_this$stateChangeCall=this.stateChangeCallback)===null||_this$stateChangeCall===void 0?void 0:_this$stateChangeCall.call(this,t));}},{key:"dragEnter",value:function dragEnter(_e){var _this$errorMessageCal;t(_e),this.currentState!==s.DISABLED&&((_this$errorMessageCal=this.errorMessageCallback)!==null&&_this$errorMessageCal!==void 0&&_this$errorMessageCal.call(this,""),this.setState(s.DRAG));}},{key:"dragLeave",value:function dragLeave(_e2){t(_e2),this.currentState!==s.DISABLED&&this.setState(s.DEFAULT);}},{key:"dragOver",value:function dragOver(_e3){t(_e3),this.currentState,s.DISABLED;}},{key:"drop",value:function drop(_e4){t(_e4),this.currentState!==s.DISABLED&&(this.setState(s.DEFAULT),this.handleFiles(_e4));}},{key:"handleDocumentDrop",value:function handleDocumentDrop(_e5){this.currentState!==s.DISABLED&&(t(_e5),this.setState(s.DEFAULT));}},{key:"preventDragOver",value:function preventDragOver(s){t(s);}},{key:"preventDrop",value:function preventDrop(s){t(s);}},{key:"handleFiles",value:function handleFiles(_e6){if(t(_e6),this.currentState===s.DISABLED)return;var i=null;if("dataTransfer"in _e6&&_e6.dataTransfer&&(i=_e6.dataTransfer.files),!i&&_e6.target instanceof HTMLInputElement&&(i=_e6.target.files),i&&i.length>0){var _this$fileDropCallbac;var _t=Array.from(i);(_this$fileDropCallbac=this.fileDropCallback)===null||_this$fileDropCallbac===void 0||_this$fileDropCallbac.call(this,_t);}_e6.target instanceof HTMLInputElement&&(_e6.target.value="");}}]);}());}};});
|
2
2
|
//# sourceMappingURL=drag-drop.util.cjs.js.map
|