@operato/form 10.29.30 → 10.29.37
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/CHANGELOG.md +17 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +266 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +19174 -0
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -11
- package/dist/src/components/ox-file-uploader.d.ts +0 -13
- package/dist/src/components/ox-file-uploader.js +0 -167
- package/dist/src/components/ox-file-uploader.js.map +0 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/form",
|
|
3
3
|
"description": "WebApplication form supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.37",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"./styles/search-form-styles.js": "./dist/src/styles/search-form-styles.js",
|
|
14
14
|
"./styles/single-column-form-styles.js": "./dist/src/styles/single-column-form-styles.js",
|
|
15
15
|
"./ox-filters-form-base.js": "./dist/src/filters/ox-filters-form-base.js",
|
|
16
|
-
"./ox-search-form.js": "./dist/src/components/ox-search-form.js"
|
|
17
|
-
"./ox-file-uploader.js": "./dist/src/components/ox-file-uploader.js"
|
|
16
|
+
"./ox-search-form.js": "./dist/src/components/ox-search-form.js"
|
|
18
17
|
},
|
|
19
18
|
"typesVersions": {
|
|
20
19
|
"*": {
|
|
@@ -32,9 +31,6 @@
|
|
|
32
31
|
],
|
|
33
32
|
"ox-search-form.js": [
|
|
34
33
|
"dist/src/components/ox-search-form.d.ts"
|
|
35
|
-
],
|
|
36
|
-
"ox-file-uploader.js": [
|
|
37
|
-
"dist/src/components/ox-file-uploader.d.ts"
|
|
38
34
|
]
|
|
39
35
|
}
|
|
40
36
|
},
|
|
@@ -63,12 +59,12 @@
|
|
|
63
59
|
},
|
|
64
60
|
"dependencies": {
|
|
65
61
|
"@material/web": "^2.0.0",
|
|
66
|
-
"@operato/graphql": "^10.29.
|
|
67
|
-
"@operato/input": "^10.29.
|
|
68
|
-
"@operato/p13n": "^10.29.
|
|
62
|
+
"@operato/graphql": "^10.29.37",
|
|
63
|
+
"@operato/input": "^10.29.37",
|
|
64
|
+
"@operato/p13n": "^10.29.37",
|
|
69
65
|
"@operato/styles": "^10.29.30",
|
|
70
66
|
"@operato/time-calculator": "^10.29.1",
|
|
71
|
-
"@operato/utils": "^10.29.
|
|
67
|
+
"@operato/utils": "^10.29.37",
|
|
72
68
|
"lit": "^3.1.2"
|
|
73
69
|
},
|
|
74
70
|
"devDependencies": {
|
|
@@ -104,5 +100,5 @@
|
|
|
104
100
|
"prettier --write"
|
|
105
101
|
]
|
|
106
102
|
},
|
|
107
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "38361a65226ee9f23814747b4f0520edf42c3184"
|
|
108
104
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class FileUploader extends LitElement {
|
|
3
|
-
static styles: import("lit").CSSResult[];
|
|
4
|
-
multiple: boolean;
|
|
5
|
-
accept: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
_files: File[];
|
|
8
|
-
fileInput: HTMLInputElement;
|
|
9
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
-
firstUpdated(): void;
|
|
11
|
-
get files(): File[];
|
|
12
|
-
reset(): void;
|
|
13
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, css, html } from 'lit';
|
|
3
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
|
-
import { FileDropHelper } from '@operato/utils';
|
|
5
|
-
let FileUploader = class FileUploader extends LitElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.multiple = false;
|
|
9
|
-
this.accept = '*/*';
|
|
10
|
-
this._files = [];
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
var _a;
|
|
14
|
-
return html `
|
|
15
|
-
<md-icon>post_add</md-icon>
|
|
16
|
-
<span>add file or drop files here!</span>
|
|
17
|
-
<input
|
|
18
|
-
id="input-file"
|
|
19
|
-
type="file"
|
|
20
|
-
accept=${this.accept}
|
|
21
|
-
?multiple=${this.multiple}
|
|
22
|
-
hidden
|
|
23
|
-
@change=${(e) => {
|
|
24
|
-
const fileInput = e.currentTarget;
|
|
25
|
-
const files = fileInput.files;
|
|
26
|
-
//// Temporary Validation preventing file size more than 10mb to be uploaded
|
|
27
|
-
for (let index = 0; index < files.length; index++) {
|
|
28
|
-
if (files[index].size > 9999999) {
|
|
29
|
-
document.dispatchEvent(new CustomEvent('notify', {
|
|
30
|
-
detail: {
|
|
31
|
-
type: 'error',
|
|
32
|
-
message: 'File size must be less than 10 MB.'
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
throw new Error('File size must be less than 10 MB.');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
this._files = [...this._files, ...Array.from(files)];
|
|
39
|
-
this.dispatchEvent(new CustomEvent('files-change', {
|
|
40
|
-
bubbles: true,
|
|
41
|
-
composed: true,
|
|
42
|
-
detail: {
|
|
43
|
-
files: files
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
fileInput.value = '';
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
<label for="input-file">${this.label || 'select file'}</label>
|
|
50
|
-
|
|
51
|
-
${((_a = this._files) === null || _a === void 0 ? void 0 : _a.length)
|
|
52
|
-
? html ` <ul>
|
|
53
|
-
${this._files.map(file => html `
|
|
54
|
-
<li>
|
|
55
|
-
- ${file.name}
|
|
56
|
-
<md-icon
|
|
57
|
-
@click=${(e) => {
|
|
58
|
-
this._files.splice(this._files.indexOf(file), 1);
|
|
59
|
-
this.requestUpdate();
|
|
60
|
-
}}
|
|
61
|
-
>delete_outline</md-icon
|
|
62
|
-
>
|
|
63
|
-
</li>
|
|
64
|
-
`)}
|
|
65
|
-
</ul>`
|
|
66
|
-
: ''}
|
|
67
|
-
`;
|
|
68
|
-
}
|
|
69
|
-
firstUpdated() {
|
|
70
|
-
FileDropHelper.set(this);
|
|
71
|
-
this.addEventListener('file-drop', (e) => {
|
|
72
|
-
const de = e;
|
|
73
|
-
this._files = this.multiple ? de.detail : de.detail[0] ? [de.detail[0]] : [];
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
get files() {
|
|
77
|
-
return this._files;
|
|
78
|
-
}
|
|
79
|
-
reset() {
|
|
80
|
-
this.fileInput.value = '';
|
|
81
|
-
this._files = [];
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
FileUploader.styles = [
|
|
85
|
-
css `
|
|
86
|
-
:host {
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
border-radius: var(--border-radius);
|
|
90
|
-
text-align: center;
|
|
91
|
-
padding-bottom: 5px !important;
|
|
92
|
-
text-transform: capitalize;
|
|
93
|
-
|
|
94
|
-
border: var(--file-uploader-border);
|
|
95
|
-
background-color: var(--md-sys-color-background);
|
|
96
|
-
font: var(--file-uploader-font) !important;
|
|
97
|
-
color: var(--file-uploader-color);
|
|
98
|
-
}
|
|
99
|
-
:host > md-icon {
|
|
100
|
-
color: var(--file-uploader-icon-color);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
:host(.candrop) {
|
|
104
|
-
background-color: var(--file-uploader-candrop-background-color);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
#input-file {
|
|
108
|
-
display: none;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
label {
|
|
112
|
-
position: relative;
|
|
113
|
-
width: auto;
|
|
114
|
-
border: none;
|
|
115
|
-
text-transform: capitalize;
|
|
116
|
-
|
|
117
|
-
padding: var(--file-uploader-label-padding);
|
|
118
|
-
border-radius: var(--file-uploader-label-border-radius);
|
|
119
|
-
background-color: var(--file-uploader-label-background-color);
|
|
120
|
-
color: var(--file-uploader-label-color);
|
|
121
|
-
font: var(--file-uploader-label-font) !important;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
ul {
|
|
125
|
-
max-width: 500px;
|
|
126
|
-
list-style: none;
|
|
127
|
-
padding: 0;
|
|
128
|
-
}
|
|
129
|
-
li {
|
|
130
|
-
text-align: left;
|
|
131
|
-
|
|
132
|
-
padding: var(--file-uploader-li-padding);
|
|
133
|
-
border-bottom: var(--file-uploader-li-border-bottom);
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
}
|
|
137
|
-
li md-icon {
|
|
138
|
-
cursor: pointer;
|
|
139
|
-
font: var(--file-uploader-li-icon-font);
|
|
140
|
-
margin-left: auto;
|
|
141
|
-
}
|
|
142
|
-
li md-icon:hover,
|
|
143
|
-
li md-icon:active {
|
|
144
|
-
color: var(--file-uploader-li-icon-focus-color);
|
|
145
|
-
}
|
|
146
|
-
`
|
|
147
|
-
];
|
|
148
|
-
__decorate([
|
|
149
|
-
property({ type: Boolean })
|
|
150
|
-
], FileUploader.prototype, "multiple", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
property({ type: String })
|
|
153
|
-
], FileUploader.prototype, "accept", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
property({ type: String })
|
|
156
|
-
], FileUploader.prototype, "label", void 0);
|
|
157
|
-
__decorate([
|
|
158
|
-
property({ type: Array })
|
|
159
|
-
], FileUploader.prototype, "_files", void 0);
|
|
160
|
-
__decorate([
|
|
161
|
-
query('#input-file')
|
|
162
|
-
], FileUploader.prototype, "fileInput", void 0);
|
|
163
|
-
FileUploader = __decorate([
|
|
164
|
-
customElement('ox-file-uploader')
|
|
165
|
-
], FileUploader);
|
|
166
|
-
export { FileUploader };
|
|
167
|
-
//# sourceMappingURL=ox-file-uploader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-file-uploader.js","sourceRoot":"","sources":["../../../src/components/ox-file-uploader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGxC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAkEwB,aAAQ,GAAY,KAAK,CAAA;QAC1B,WAAM,GAAW,KAAK,CAAA;QAGvB,WAAM,GAAW,EAAE,CAAA;IAuFhD,CAAC;IAnFC,MAAM;;QACJ,OAAO,IAAI,CAAA;;;;;;iBAME,IAAI,CAAC,MAAM;oBACR,IAAI,CAAC,QAAQ;;kBAEf,CAAC,CAAQ,EAAE,EAAE;YACrB,MAAM,SAAS,GAAG,CAAC,CAAC,aAAiC,CAAA;YACrD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAiB,CAAA;YACzC,4EAA4E;YAC5E,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;gBAClD,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,OAAO,EAAE,CAAC;oBAChC,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;wBACxB,MAA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AC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;IAClB,CAAC;;AA3JM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6DF;CACF,AA/DY,CA+DZ;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAA0B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAe;AAEf;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAoB;AAExB;IAArB,KAAK,CAAC,aAAa,CAAC;+CAA6B;AAxEvC,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CA6JxB","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { FileDropHelper } from '@operato/utils'\n\n@customElement('ox-file-uploader')\nexport class FileUploader extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n border-radius: var(--border-radius);\n text-align: center;\n padding-bottom: 5px !important;\n text-transform: capitalize;\n\n border: var(--file-uploader-border);\n background-color: var(--md-sys-color-background);\n font: var(--file-uploader-font) !important;\n color: var(--file-uploader-color);\n }\n :host > md-icon {\n color: var(--file-uploader-icon-color);\n }\n\n :host(.candrop) {\n background-color: var(--file-uploader-candrop-background-color);\n }\n\n #input-file {\n display: none;\n }\n\n label {\n position: relative;\n width: auto;\n border: none;\n text-transform: capitalize;\n\n padding: var(--file-uploader-label-padding);\n border-radius: var(--file-uploader-label-border-radius);\n background-color: var(--file-uploader-label-background-color);\n color: var(--file-uploader-label-color);\n font: var(--file-uploader-label-font) !important;\n }\n\n ul {\n max-width: 500px;\n list-style: none;\n padding: 0;\n }\n li {\n text-align: left;\n\n padding: var(--file-uploader-li-padding);\n border-bottom: var(--file-uploader-li-border-bottom);\n display: flex;\n align-items: center;\n }\n li md-icon {\n cursor: pointer;\n font: var(--file-uploader-li-icon-font);\n margin-left: auto;\n }\n li md-icon:hover,\n li md-icon:active {\n color: var(--file-uploader-li-icon-focus-color);\n }\n `\n ]\n\n @property({ type: Boolean }) multiple: boolean = false\n @property({ type: String }) accept: string = '*/*'\n @property({ type: String }) label?: string\n\n @property({ type: Array }) _files: File[] = []\n\n @query('#input-file') fileInput!: HTMLInputElement\n\n render() {\n return html`\n <md-icon>post_add</md-icon>\n <span>add file or drop files here!</span>\n <input\n id=\"input-file\"\n type=\"file\"\n accept=${this.accept}\n ?multiple=${this.multiple}\n hidden\n @change=${(e: Event) => {\n const fileInput = e.currentTarget as HTMLInputElement\n const files = fileInput.files as FileList\n //// Temporary Validation preventing file size more than 10mb to be uploaded\n for (let index = 0; index < files.length; index++) {\n if (files[index].size > 9999999) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n type: 'error',\n message: 'File size must be less than 10 MB.'\n }\n })\n )\n throw new Error('File size must be less than 10 MB.')\n }\n }\n\n this._files = [...this._files, ...Array.from(files)]\n\n this.dispatchEvent(\n new CustomEvent('files-change', {\n bubbles: true,\n composed: true,\n detail: {\n files: files\n }\n })\n )\n\n fileInput.value = ''\n }}\n />\n <label for=\"input-file\">${this.label || 'select file'}</label>\n\n ${this._files?.length\n ? html` <ul>\n ${this._files.map(\n file => html`\n <li>\n - ${file.name}\n <md-icon\n @click=${(e: Event) => {\n this._files.splice(this._files.indexOf(file), 1)\n this.requestUpdate()\n }}\n >delete_outline</md-icon\n >\n </li>\n `\n )}\n </ul>`\n : ''}\n `\n }\n\n firstUpdated() {\n FileDropHelper.set(this)\n\n this.addEventListener('file-drop', (e: Event) => {\n const de = e as any\n this._files = this.multiple ? de.detail : de.detail[0] ? [de.detail[0]] : []\n })\n }\n\n get files() {\n return this._files\n }\n\n reset() {\n this.fileInput.value = ''\n this._files = []\n }\n}\n"]}
|