@aquera/nile-elements 1.4.8-beta-1.0 → 1.4.8-beta-1.2
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 +4 -0
- package/demo/index.html +133 -33
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +98 -71
- 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 +7 -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 +73 -64
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -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.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +10 -0
- package/dist/nile-option/nile-option.esm.js +10 -7
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.esm.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js.map +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.esm.js +4 -3
- package/dist/nile-side-bar-action/portal-manager.cjs.js +2 -0
- package/dist/nile-side-bar-action/portal-manager.cjs.js.map +1 -0
- package/dist/nile-side-bar-action/portal-manager.esm.js +1 -0
- package/dist/nile-side-bar-action/portal-utils.cjs.js +2 -0
- package/dist/nile-side-bar-action/portal-utils.cjs.js.map +1 -0
- package/dist/nile-side-bar-action/portal-utils.esm.js +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +7 -3
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.js +46 -37
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js +15 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +10 -0
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +1 -0
- package/dist/src/nile-option/nile-option.js +13 -5
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-side-bar-action/nile-side-bar-action.d.ts +8 -1
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js +66 -12
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js.map +1 -1
- package/dist/src/nile-side-bar-action/portal-manager.d.ts +43 -0
- package/dist/src/nile-side-bar-action/portal-manager.js +374 -0
- package/dist/src/nile-side-bar-action/portal-manager.js.map +1 -0
- package/dist/src/nile-side-bar-action/portal-utils.d.ts +32 -0
- package/dist/src/nile-side-bar-action/portal-utils.js +212 -0
- package/dist/src/nile-side-bar-action/portal-utils.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-file-preview/nile-file-preview.css.ts +7 -3
- package/src/nile-file-preview/nile-file-preview.template.ts +46 -37
- package/src/nile-lite-tooltip/nile-lite-tooltip.ts +15 -0
- package/src/nile-option/nile-option.css.ts +10 -0
- package/src/nile-option/nile-option.ts +11 -5
- package/src/nile-side-bar-action/nile-side-bar-action.ts +74 -15
- package/src/nile-side-bar-action/portal-manager.ts +489 -0
- package/src/nile-side-bar-action/portal-utils.ts +270 -0
- package/vscode-html-custom-data.json +22 -3
package/README.md
CHANGED
|
@@ -79,6 +79,10 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
|
79
79
|
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
|
81
81
|
|
|
82
|
+
#### Version 1.4.8
|
|
83
|
+
- Nile Option: Description property added (UIF-1078)
|
|
84
|
+
- Nile Lite Tooltip: Fixed the Empty Issue and Added Height and Width Property for Tooltip (UIF-1077)
|
|
85
|
+
|
|
82
86
|
#### Version 1.4.7
|
|
83
87
|
- Nile Tab: Font Weight Mismatch in Nile Tab Item (UIF-1072)
|
|
84
88
|
- Nile Sidebar: Collapsed state is not reflected correctly for the header, and the logo is not working properly in Safari and Firefox. (UIF-1075)
|
package/demo/index.html
CHANGED
|
@@ -1,50 +1,150 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en-GB">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<!-- <link rel="stylesheet" href="./theme/nxt/nxtgen.css" id="stylesheet" /> -->
|
|
7
|
+
<link rel="stylesheet" href="variables.css" id="stylesheet" />
|
|
8
|
+
<link rel="stylesheet" href="index.css" />
|
|
9
|
+
<script type="module" src="index.js"></script>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
* {
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html,
|
|
18
|
+
body {
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
gap: 10px;
|
|
31
|
+
width: 648px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#previews {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
justify-content: flex-start;
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
gap: 10px;
|
|
40
|
+
width: 248px;
|
|
41
|
+
height: 500px;
|
|
42
|
+
overflow-y: auto;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
45
|
+
</head>
|
|
46
|
+
|
|
47
|
+
<body>
|
|
48
|
+
<!-- <div style="background-color: var(--ng-color-base-black);">Demo Page</div> -->
|
|
49
|
+
|
|
50
|
+
<body>
|
|
51
|
+
<div class="container">
|
|
52
|
+
|
|
53
|
+
<nile-file-upload state="default" variant="horizontal"
|
|
54
|
+
fileUploadUrl="https://api.escuelajs.co/api/v1/files/upload"></nile-file-upload>
|
|
55
|
+
|
|
56
|
+
<div id="previews"></div>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
6
60
|
<script>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
61
|
+
const upload = document.querySelector('nile-file-upload');
|
|
62
|
+
const previewContainer = document.querySelector('#previews');
|
|
63
|
+
const uploadBtn = document.getElementById('uploadBtn');
|
|
64
|
+
|
|
65
|
+
let allFiles = [];
|
|
66
|
+
let deletedFiles = [];
|
|
67
|
+
let validTypes = ['image/svg+xml', 'image/png', 'image/webp', 'application/pdf', 'application/zip', 'image/jpeg'];
|
|
68
|
+
let imageUrls = [
|
|
69
|
+
'https://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg',
|
|
70
|
+
'https://cdn.pixabay.com/photo/2017/08/05/11/16/logo-2582748_1280.png',
|
|
71
|
+
'https://miro.medium.com/v2/resize:fit:4800/format:webp/1*xMuIOwjliGUPjkzukeWKfw.jpeg',
|
|
72
|
+
'https://upload.wikimedia.org/wikipedia/commons/9/96/Nature_celebrating_India.png',
|
|
73
|
+
'https://upload.wikimedia.org/wikipedia/commons/2/22/1_Nature_1.png',
|
|
74
|
+
'https://www.un.org/sites/un2.un.org/files/field/image/making-peace-with-nature.png',
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
upload.addEventListener('nile-change', (event) => {
|
|
78
|
+
let updatedFiles = event.detail.files
|
|
79
|
+
.filter(file => !deletedFiles.includes(file) && !allFiles.some(f => f.file === file))
|
|
80
|
+
.map(file => ({ file, progress: 0 }));
|
|
81
|
+
|
|
82
|
+
allFiles = [...allFiles, ...updatedFiles];
|
|
83
|
+
callFilePreview(allFiles);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
previewContainer.addEventListener('nile-remove', (event) => {
|
|
88
|
+
let { value, url } = event.detail;
|
|
89
|
+
// for image url's
|
|
90
|
+
// imageUrls = removeFile(url, imageUrls);
|
|
91
|
+
// callFilePreview(imageUrls);
|
|
92
|
+
// for files
|
|
93
|
+
allFiles = removeFile(value, allFiles);
|
|
94
|
+
callFilePreview(allFiles);
|
|
95
|
+
});
|
|
11
96
|
|
|
12
|
-
|
|
13
|
-
|
|
97
|
+
upload.addEventListener('nile-upload-progress', (e) => {
|
|
98
|
+
const { file, progress } = e.detail;
|
|
14
99
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<script type="module" src="index.js"></script>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
100
|
+
allFiles = allFiles.map(item =>
|
|
101
|
+
item.file === file ? { ...item, progress } : item
|
|
102
|
+
);
|
|
21
103
|
|
|
104
|
+
callFilePreview(allFiles);
|
|
105
|
+
});
|
|
22
106
|
|
|
23
|
-
|
|
24
107
|
|
|
25
|
-
|
|
108
|
+
previewContainer.addEventListener('nile-uploading', () => {
|
|
109
|
+
console.log('nile-uploading');
|
|
110
|
+
});
|
|
26
111
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
canSavePassword>
|
|
30
|
-
</nile-input>
|
|
31
|
-
-->
|
|
32
|
-
|
|
112
|
+
upload.addEventListener('nile-upload-cancelled', (e) => {
|
|
113
|
+
const cancelledFile = e.detail.file;
|
|
33
114
|
|
|
34
|
-
|
|
115
|
+
allFiles = allFiles.map(item =>
|
|
116
|
+
item.file === cancelledFile
|
|
117
|
+
? { file: cancelledFile, status: 'cancelled', errorMessage: 'File upload cancelled' }
|
|
118
|
+
: item
|
|
119
|
+
);
|
|
120
|
+
callFilePreview(allFiles);
|
|
121
|
+
});
|
|
35
122
|
|
|
123
|
+
const callFilePreview = (fileObjs) => {
|
|
124
|
+
previewContainer.innerHTML = "";
|
|
36
125
|
|
|
37
|
-
|
|
38
|
-
|
|
126
|
+
fileObjs.forEach(({ file, progress, status, errorMessage }) => {
|
|
127
|
+
const filePreview = document.createElement('nile-file-preview');
|
|
128
|
+
filePreview.inputFile = file;
|
|
129
|
+
filePreview.variant = "horizontal";
|
|
130
|
+
filePreview.allowedTypes = validTypes;
|
|
131
|
+
if (progress != null) filePreview.uploadStatus = progress;
|
|
132
|
+
if (status) filePreview.errorMessage = errorMessage;
|
|
133
|
+
previewContainer.appendChild(filePreview);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
39
136
|
|
|
137
|
+
// callFilePreview(imageUrls);
|
|
40
138
|
|
|
139
|
+
const removeFile = (removeFile, files) => {
|
|
140
|
+
return files.filter(file => {
|
|
141
|
+
if (file !== removeFile) return true;
|
|
142
|
+
deletedFiles.push(file);
|
|
143
|
+
return false;
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
</script>
|
|
41
147
|
</body>
|
|
148
|
+
</body>
|
|
42
149
|
|
|
43
|
-
<script>
|
|
44
|
-
const smallBtn5 = document.getElementById('small-btn1');
|
|
45
|
-
const smallTooltip5 = document.getElementById('small-tooltip1');
|
|
46
|
-
setTimeout(() => {
|
|
47
|
-
smallTooltip5.content = 'This is a small tooltip. 2';
|
|
48
|
-
}, 5000);
|
|
49
|
-
</script>
|
|
50
150
|
</html>
|