@nuraly/lumenui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nuralyui.bundle.js +23024 -17355
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/alert/alert.component.d.ts +8 -5
- package/dist/src/components/alert/alert.component.js +24 -20
- package/dist/src/components/alert/alert.style.d.ts +0 -7
- package/dist/src/components/alert/alert.style.js +48 -90
- package/dist/src/components/alert/bundle.js +82 -108
- package/dist/src/components/alert/bundle.js.gz +0 -0
- package/dist/src/components/badge/badge.component.d.ts +9 -8
- package/dist/src/components/badge/badge.component.js +17 -14
- package/dist/src/components/badge/badge.style.d.ts +0 -7
- package/dist/src/components/badge/badge.style.js +49 -107
- package/dist/src/components/badge/bundle.js +81 -119
- package/dist/src/components/badge/bundle.js.gz +0 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
- package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
- package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
- package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
- package/dist/src/components/breadcrumb/bundle.js +96 -93
- package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
- package/dist/src/components/button/bundle.js +221 -470
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.d.ts +2 -1
- package/dist/src/components/button/button.component.js +6 -6
- package/dist/src/components/button/button.style.d.ts +0 -7
- package/dist/src/components/button/button.style.js +167 -433
- package/dist/src/components/canvas/base-canvas.component.d.ts +2 -1
- package/dist/src/components/canvas/base-canvas.component.js +1 -0
- package/dist/src/components/canvas/bundle.js +16919 -9595
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
- package/dist/src/components/canvas/canvas.constants.js +1 -1
- package/dist/src/components/canvas/chatbot-panel.style.js +31 -31
- package/dist/src/components/canvas/index.d.ts +2 -0
- package/dist/src/components/canvas/index.js +3 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
- package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
- package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
- package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
- package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
- package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
- package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
- package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/workflow-canvas.component.js +24 -2
- package/dist/src/components/canvas/workflow-canvas.style.js +776 -648
- package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
- package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
- package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
- package/dist/src/components/canvas/workflow-node.component.js +5 -5
- package/dist/src/components/canvas/workflow-node.style.js +183 -181
- package/dist/src/components/card/bundle.js +43 -35
- package/dist/src/components/card/bundle.js.gz +0 -0
- package/dist/src/components/card/card.component.d.ts +6 -1
- package/dist/src/components/card/card.component.js +8 -2
- package/dist/src/components/card/card.style.js +26 -30
- package/dist/src/components/carousel/bundle.js +8 -8
- package/dist/src/components/carousel/bundle.js.gz +0 -0
- package/dist/src/components/carousel/carousel.component.d.ts +12 -0
- package/dist/src/components/carousel/carousel.component.js +16 -4
- package/dist/src/components/chatbot/bundle.js +422 -406
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot.component.d.ts +2 -1
- package/dist/src/components/chatbot/chatbot.component.js +1 -0
- package/dist/src/components/chatbot/chatbot.style.js +277 -277
- package/dist/src/components/checkbox/bundle.js +86 -245
- package/dist/src/components/checkbox/bundle.js.gz +0 -0
- package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
- package/dist/src/components/checkbox/checkbox.component.js +11 -13
- package/dist/src/components/checkbox/checkbox.style.js +56 -231
- package/dist/src/components/code-editor/bundle.js +151 -25
- package/dist/src/components/code-editor/bundle.js.gz +0 -0
- package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
- package/dist/src/components/code-editor/code-editor.component.js +141 -394
- package/dist/src/components/code-editor/code-editor.style.js +139 -15
- package/dist/src/components/collapse/bundle.js +97 -84
- package/dist/src/components/collapse/bundle.js.gz +0 -0
- package/dist/src/components/collapse/collapse.component.d.ts +7 -1
- package/dist/src/components/collapse/collapse.component.js +11 -2
- package/dist/src/components/collapse/collapse.style.js +60 -60
- package/dist/src/components/colorpicker/bundle.js +85 -48
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
- package/dist/src/components/colorpicker/color-holder.component.js +5 -6
- package/dist/src/components/colorpicker/color-holder.style.js +11 -11
- package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
- package/dist/src/components/colorpicker/color-picker.component.js +1 -0
- package/dist/src/components/colorpicker/color-picker.style.js +12 -12
- package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
- package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
- package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
- package/dist/src/components/container/bundle.js +24 -14
- package/dist/src/components/container/bundle.js.gz +0 -0
- package/dist/src/components/container/container.component.d.ts +4 -1
- package/dist/src/components/container/container.component.js +7 -5
- package/dist/src/components/container/container.style.js +9 -9
- package/dist/src/components/datepicker/bundle.js +193 -177
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
- package/dist/src/components/datepicker/datepicker.component.js +1 -0
- package/dist/src/components/datepicker/datepicker.style.js +65 -65
- package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
- package/dist/src/components/db-connection-select/bundle.js +7 -6
- package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +3 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
- package/dist/src/components/divider/bundle.js +61 -35
- package/dist/src/components/divider/bundle.js.gz +0 -0
- package/dist/src/components/divider/divider.component.d.ts +4 -6
- package/dist/src/components/divider/divider.component.js +10 -14
- package/dist/src/components/divider/divider.style.js +41 -31
- package/dist/src/components/document/bundle.js +50 -48
- package/dist/src/components/document/bundle.js.gz +0 -0
- package/dist/src/components/document/document.component.d.ts +12 -1
- package/dist/src/components/document/document.component.js +18 -6
- package/dist/src/components/document/document.style.js +21 -36
- package/dist/src/components/dropdown/bundle.js +117 -101
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
- package/dist/src/components/dropdown/dropdown.component.js +1 -0
- package/dist/src/components/dropdown/dropdown.style.js +68 -68
- package/dist/src/components/file-upload/bundle.js +82 -76
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
- package/dist/src/components/file-upload/file-upload.component.js +1 -0
- package/dist/src/components/file-upload/styles.js +59 -59
- package/dist/src/components/flex/bundle.js +18 -8
- package/dist/src/components/flex/bundle.js.gz +0 -0
- package/dist/src/components/flex/flex.component.d.ts +4 -1
- package/dist/src/components/flex/flex.component.js +7 -4
- package/dist/src/components/flex/flex.style.js +2 -2
- package/dist/src/components/form/bundle.js +22 -10
- package/dist/src/components/form/bundle.js.gz +0 -0
- package/dist/src/components/form/form.component.d.ts +4 -1
- package/dist/src/components/form/form.component.js +5 -1
- package/dist/src/components/form/form.style.js +2 -2
- package/dist/src/components/grid/bundle.js +26 -14
- package/dist/src/components/grid/bundle.js.gz +0 -0
- package/dist/src/components/grid/col.component.d.ts +4 -1
- package/dist/src/components/grid/col.component.js +4 -1
- package/dist/src/components/grid/col.style.js +2 -2
- package/dist/src/components/grid/row.component.d.ts +4 -1
- package/dist/src/components/grid/row.component.js +4 -1
- package/dist/src/components/grid/row.style.js +2 -2
- package/dist/src/components/icon/bundle.js +78 -252
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon-paths.d.ts +2 -0
- package/dist/src/components/icon/icon-paths.js +141 -0
- package/dist/src/components/icon/icon.component.d.ts +10 -12
- package/dist/src/components/icon/icon.component.js +42 -93
- package/dist/src/components/icon/icon.style.js +42 -130
- package/dist/src/components/icon/icon.variables.js +9 -9
- package/dist/src/components/iconpicker/bundle.js +859 -1511
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
- package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
- package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
- package/dist/src/components/image/bundle.js +43 -33
- package/dist/src/components/image/bundle.js.gz +0 -0
- package/dist/src/components/image/image.component.d.ts +10 -1
- package/dist/src/components/image/image.component.js +13 -3
- package/dist/src/components/image/image.style.js +19 -26
- package/dist/src/components/input/bundle.js +420 -644
- package/dist/src/components/input/bundle.js.gz +0 -0
- package/dist/src/components/input/input.component.d.ts +16 -3
- package/dist/src/components/input/input.component.js +43 -27
- package/dist/src/components/input/input.style.d.ts +1 -1
- package/dist/src/components/input/input.style.js +331 -634
- package/dist/src/components/kv-secret-select/bundle.js +2 -1
- package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
- package/dist/src/components/label/bundle.js +37 -60
- package/dist/src/components/label/bundle.js.gz +0 -0
- package/dist/src/components/label/label.component.d.ts +8 -4
- package/dist/src/components/label/label.component.js +9 -14
- package/dist/src/components/label/label.style.js +17 -25
- package/dist/src/components/label/label.style.variables.js +18 -18
- package/dist/src/components/layout/bundle.js +86 -70
- package/dist/src/components/layout/bundle.js.gz +0 -0
- package/dist/src/components/layout/content.component.d.ts +2 -1
- package/dist/src/components/layout/content.component.js +2 -1
- package/dist/src/components/layout/content.style.js +3 -3
- package/dist/src/components/layout/footer.component.d.ts +2 -1
- package/dist/src/components/layout/footer.component.js +3 -2
- package/dist/src/components/layout/footer.style.js +7 -7
- package/dist/src/components/layout/header.component.d.ts +2 -1
- package/dist/src/components/layout/header.component.js +3 -2
- package/dist/src/components/layout/header.style.js +7 -7
- package/dist/src/components/layout/layout.component.d.ts +4 -7
- package/dist/src/components/layout/layout.component.js +9 -22
- package/dist/src/components/layout/layout.style.js +1 -1
- package/dist/src/components/layout/sider.component.d.ts +3 -1
- package/dist/src/components/layout/sider.component.js +3 -1
- package/dist/src/components/layout/sider.style.js +29 -29
- package/dist/src/components/menu/bundle.js +135 -125
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/menu.component.d.ts +2 -1
- package/dist/src/components/menu/menu.component.js +1 -0
- package/dist/src/components/menu/menu.style.js +87 -87
- package/dist/src/components/modal/bundle.js +105 -96
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/modal.component.d.ts +2 -1
- package/dist/src/components/modal/modal.component.js +1 -0
- package/dist/src/components/modal/modal.style.js +69 -71
- package/dist/src/components/panel/bundle.js +190 -391
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/panel/panel.component.d.ts +2 -1
- package/dist/src/components/panel/panel.component.js +1 -0
- package/dist/src/components/panel/panel.style.js +65 -65
- package/dist/src/components/popconfirm/bundle.js +107 -93
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
- package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
- package/dist/src/components/radio/bundle.js +56 -86
- package/dist/src/components/radio/bundle.js.gz +0 -0
- package/dist/src/components/radio/radio.component.d.ts +8 -2
- package/dist/src/components/radio/radio.component.js +17 -9
- package/dist/src/components/radio/radio.style.js +30 -77
- package/dist/src/components/radio-group/bundle.js +125 -89
- package/dist/src/components/radio-group/bundle.js.gz +0 -0
- package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
- package/dist/src/components/radio-group/radio-group.component.js +18 -10
- package/dist/src/components/radio-group/radio-group.style.js +44 -44
- package/dist/src/components/select/bundle.js +260 -367
- package/dist/src/components/select/bundle.js.gz +0 -0
- package/dist/src/components/select/select.component.d.ts +12 -17
- package/dist/src/components/select/select.component.js +35 -35
- package/dist/src/components/select/select.style.js +184 -324
- package/dist/src/components/skeleton/bundle.js +82 -162
- package/dist/src/components/skeleton/bundle.js.gz +0 -0
- package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
- package/dist/src/components/skeleton/skeleton.component.js +20 -7
- package/dist/src/components/skeleton/skeleton.style.js +34 -133
- package/dist/src/components/slider-input/bundle.js +89 -88
- package/dist/src/components/slider-input/bundle.js.gz +0 -0
- package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
- package/dist/src/components/slider-input/slider-input.component.js +20 -8
- package/dist/src/components/slider-input/slider-input.style.js +47 -47
- package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
- package/dist/src/components/table/bundle.js +149 -128
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/table.component.d.ts +2 -1
- package/dist/src/components/table/table.component.js +1 -0
- package/dist/src/components/table/table.style.js +79 -79
- package/dist/src/components/tabs/bundle.js +462 -663
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/tabs/tabs.component.d.ts +6 -1
- package/dist/src/components/tabs/tabs.component.js +8 -1
- package/dist/src/components/tabs/tabs.style.js +200 -201
- package/dist/src/components/tag/bundle.js +44 -36
- package/dist/src/components/tag/bundle.js.gz +0 -0
- package/dist/src/components/tag/tag.component.d.ts +7 -6
- package/dist/src/components/tag/tag.component.js +10 -19
- package/dist/src/components/tag/tag.style.js +20 -24
- package/dist/src/components/textarea/bundle.js +131 -94
- package/dist/src/components/textarea/bundle.js.gz +0 -0
- package/dist/src/components/textarea/textarea.component.d.ts +7 -1
- package/dist/src/components/textarea/textarea.component.js +10 -3
- package/dist/src/components/textarea/textarea.style.d.ts +1 -13
- package/dist/src/components/textarea/textarea.style.js +79 -91
- package/dist/src/components/timeline/bundle.js +71 -134
- package/dist/src/components/timeline/bundle.js.gz +0 -0
- package/dist/src/components/timeline/timeline.component.d.ts +9 -6
- package/dist/src/components/timeline/timeline.component.js +16 -13
- package/dist/src/components/timeline/timeline.style.d.ts +0 -7
- package/dist/src/components/timeline/timeline.style.js +41 -122
- package/dist/src/components/timepicker/bundle.js +196 -166
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
- package/dist/src/components/timepicker/timepicker.component.js +1 -0
- package/dist/src/components/timepicker/timepicker.style.js +42 -42
- package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
- package/dist/src/components/toast/bundle.js +97 -81
- package/dist/src/components/toast/bundle.js.gz +0 -0
- package/dist/src/components/toast/toast.component.d.ts +2 -1
- package/dist/src/components/toast/toast.component.js +1 -0
- package/dist/src/components/toast/toast.style.js +62 -62
- package/dist/src/components/tooltips/bundle.js +10 -10
- package/dist/src/components/tooltips/bundle.js.gz +0 -0
- package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
- package/dist/src/components/tooltips/tooltips.component.js +9 -1
- package/dist/src/components/tooltips/tooltips.style.js +6 -6
- package/dist/src/components/video/bundle.js +47 -36
- package/dist/src/components/video/bundle.js.gz +0 -0
- package/dist/src/components/video/video.component.d.ts +12 -1
- package/dist/src/components/video/video.component.js +18 -6
- package/dist/src/components/video/video.style.js +18 -24
- package/package.json +25 -12
- package/packages/common/dist/VERSIONS.md +2 -2
- package/packages/common/dist/shared/base-mixin.d.ts +21 -19
- package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/base-mixin.js +102 -18
- package/packages/common/dist/shared/base-mixin.js.map +1 -1
- package/packages/common/dist/shared/index.d.ts +1 -0
- package/packages/common/dist/shared/index.d.ts.map +1 -1
- package/packages/common/dist/shared/index.js +2 -0
- package/packages/common/dist/shared/index.js.map +1 -1
- package/packages/common/dist/shared/style-injector.d.ts +11 -0
- package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
- package/packages/common/dist/shared/style-injector.js +53 -0
- package/packages/common/dist/shared/style-injector.js.map +1 -0
- package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
- package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/theme-mixin.js +5 -38
- package/packages/common/dist/shared/theme-mixin.js.map +1 -1
- package/packages/themes/dist/default.css +0 -10
- package/packages/themes/dist/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{css as e,
|
|
1
|
+
import{css as e,html as t,LitElement as i}from"lit";import{property as o,state as s,customElement as r}from"lit/decorators.js";const a=e`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
|
-
font-family:
|
|
4
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
5
5
|
}
|
|
6
6
|
.upload {
|
|
7
7
|
width: 100%;
|
|
8
8
|
}
|
|
9
9
|
.upload-dragger {
|
|
10
|
-
background-color:
|
|
11
|
-
border: 1px dashed
|
|
12
|
-
border-radius:
|
|
10
|
+
background-color: #f8f9fa;
|
|
11
|
+
border: 1px dashed #d9d9d9;
|
|
12
|
+
border-radius: 6px;
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 180px;
|
|
@@ -17,48 +17,48 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
position: relative;
|
|
19
19
|
overflow: hidden;
|
|
20
|
-
transition: border-color
|
|
20
|
+
transition: border-color 0.3s;
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
align-items: center;
|
|
25
25
|
}
|
|
26
26
|
.upload-dragger:hover {
|
|
27
|
-
border-color:
|
|
27
|
+
border-color: #409eff;
|
|
28
28
|
}
|
|
29
29
|
.upload-dragger.is-dragover {
|
|
30
|
-
background-color:
|
|
31
|
-
border-color:
|
|
30
|
+
background-color: rgba(64, 158, 255, 0.06);
|
|
31
|
+
border-color: #409eff;
|
|
32
32
|
}
|
|
33
33
|
.upload-icon {
|
|
34
34
|
font-size: 28px;
|
|
35
|
-
color:
|
|
35
|
+
color: #c0c4cc;
|
|
36
36
|
margin-bottom: 8px;
|
|
37
37
|
}
|
|
38
38
|
.upload-text {
|
|
39
|
-
color:
|
|
40
|
-
font-size:
|
|
39
|
+
color: #606266;
|
|
40
|
+
font-size: 14px;
|
|
41
41
|
text-align: center;
|
|
42
42
|
padding: 0 12px;
|
|
43
43
|
}
|
|
44
44
|
.upload-tip {
|
|
45
|
-
font-size:
|
|
46
|
-
color:
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
color: #909399;
|
|
47
47
|
margin-top: 7px;
|
|
48
48
|
padding: 0 12px;
|
|
49
49
|
}
|
|
50
50
|
.upload-button {
|
|
51
51
|
padding: 8px 16px;
|
|
52
|
-
background-color:
|
|
53
|
-
color:
|
|
52
|
+
background-color: #409eff;
|
|
53
|
+
color: white;
|
|
54
54
|
border: none;
|
|
55
|
-
border-radius:
|
|
55
|
+
border-radius: 4px;
|
|
56
56
|
cursor: pointer;
|
|
57
|
-
font-size:
|
|
58
|
-
transition: background-color
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
transition: background-color 0.3s;
|
|
59
59
|
}
|
|
60
60
|
.upload-button:hover {
|
|
61
|
-
background-color:
|
|
61
|
+
background-color: #66b1ff;
|
|
62
62
|
}
|
|
63
63
|
.file-list {
|
|
64
64
|
margin-top: 10px;
|
|
@@ -68,9 +68,9 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
68
68
|
display: flex;
|
|
69
69
|
align-items: center;
|
|
70
70
|
margin-bottom: 8px;
|
|
71
|
-
transition: all
|
|
71
|
+
transition: all 0.3s;
|
|
72
72
|
padding: 8px;
|
|
73
|
-
border-radius:
|
|
73
|
+
border-radius: 4px;
|
|
74
74
|
gap: 8px;
|
|
75
75
|
width: 100%;
|
|
76
76
|
box-sizing: border-box;
|
|
@@ -80,22 +80,22 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
80
80
|
max-width: 100%;
|
|
81
81
|
}
|
|
82
82
|
.file-item:hover {
|
|
83
|
-
background-color:
|
|
83
|
+
background-color: #f8f9fa;
|
|
84
84
|
}
|
|
85
85
|
.file-name {
|
|
86
86
|
flex: 1;
|
|
87
87
|
white-space: nowrap;
|
|
88
88
|
overflow: hidden;
|
|
89
89
|
text-overflow: ellipsis;
|
|
90
|
-
color:
|
|
90
|
+
color: #606266;
|
|
91
91
|
min-width: 0;
|
|
92
92
|
max-width: 100%;
|
|
93
93
|
word-break: break-all;
|
|
94
94
|
width: 0;
|
|
95
95
|
}
|
|
96
96
|
.file-size {
|
|
97
|
-
color:
|
|
98
|
-
font-size:
|
|
97
|
+
color: #909399;
|
|
98
|
+
font-size: 12px;
|
|
99
99
|
flex-shrink: 0;
|
|
100
100
|
margin-left: 8px;
|
|
101
101
|
white-space: nowrap;
|
|
@@ -115,10 +115,10 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
115
115
|
border: none;
|
|
116
116
|
padding: 4px;
|
|
117
117
|
cursor: pointer;
|
|
118
|
-
color:
|
|
118
|
+
color: #909399;
|
|
119
119
|
}
|
|
120
120
|
.file-actions button:hover {
|
|
121
|
-
color:
|
|
121
|
+
color: #409eff;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/* Dark theme support - using data-theme attribute */
|
|
@@ -127,80 +127,80 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
127
127
|
/* Upload dragger - dark theme */
|
|
128
128
|
:host-context([data-theme*="dark"]) .upload-dragger,
|
|
129
129
|
:host([data-theme*="dark"]) .upload-dragger {
|
|
130
|
-
background-color:
|
|
131
|
-
border-color:
|
|
130
|
+
background-color: #262626;
|
|
131
|
+
border-color: #525252;
|
|
132
132
|
}
|
|
133
133
|
:host-context([data-theme*="dark"]) .upload-dragger:hover,
|
|
134
134
|
:host([data-theme*="dark"]) .upload-dragger:hover {
|
|
135
|
-
border-color:
|
|
135
|
+
border-color: #78a9ff;
|
|
136
136
|
}
|
|
137
137
|
:host-context([data-theme*="dark"]) .upload-dragger.is-dragover,
|
|
138
138
|
:host([data-theme*="dark"]) .upload-dragger.is-dragover {
|
|
139
139
|
background-color: rgba(120, 169, 255, 0.1);
|
|
140
|
-
border-color:
|
|
140
|
+
border-color: #78a9ff;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/* Upload icon - dark theme */
|
|
144
144
|
:host-context([data-theme*="dark"]) .upload-icon,
|
|
145
145
|
:host([data-theme*="dark"]) .upload-icon {
|
|
146
|
-
color:
|
|
146
|
+
color: #8d8d8d;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/* Upload text - dark theme */
|
|
150
150
|
:host-context([data-theme*="dark"]) .upload-text,
|
|
151
151
|
:host([data-theme*="dark"]) .upload-text {
|
|
152
|
-
color:
|
|
152
|
+
color: #f4f4f4;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/* Upload tip - dark theme */
|
|
156
156
|
:host-context([data-theme*="dark"]) .upload-tip,
|
|
157
157
|
:host([data-theme*="dark"]) .upload-tip {
|
|
158
|
-
color:
|
|
158
|
+
color: #8d8d8d;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/* File item - dark theme */
|
|
162
162
|
:host-context([data-theme*="dark"]) .file-item,
|
|
163
163
|
:host([data-theme*="dark"]) .file-item {
|
|
164
|
-
background-color:
|
|
165
|
-
border-radius:
|
|
164
|
+
background-color: #262626;
|
|
165
|
+
border-radius: 4px;
|
|
166
166
|
}
|
|
167
167
|
:host-context([data-theme*="dark"]) .file-item:hover,
|
|
168
168
|
:host([data-theme*="dark"]) .file-item:hover {
|
|
169
|
-
background-color:
|
|
169
|
+
background-color: #393939;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
/* File name - dark theme */
|
|
173
173
|
:host-context([data-theme*="dark"]) .file-name,
|
|
174
174
|
:host([data-theme*="dark"]) .file-name {
|
|
175
|
-
color:
|
|
175
|
+
color: #f4f4f4;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
/* File size - dark theme */
|
|
179
179
|
:host-context([data-theme*="dark"]) .file-size,
|
|
180
180
|
:host([data-theme*="dark"]) .file-size {
|
|
181
|
-
color:
|
|
181
|
+
color: #8d8d8d;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/* File actions - dark theme */
|
|
185
185
|
:host-context([data-theme*="dark"]) .file-actions button,
|
|
186
186
|
:host([data-theme*="dark"]) .file-actions button {
|
|
187
|
-
color:
|
|
187
|
+
color: #8d8d8d;
|
|
188
188
|
}
|
|
189
189
|
:host-context([data-theme*="dark"]) .file-actions button:hover,
|
|
190
190
|
:host([data-theme*="dark"]) .file-actions button:hover {
|
|
191
|
-
color:
|
|
191
|
+
color: #78a9ff;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
/* File item SVG icons - dark theme */
|
|
195
195
|
:host-context([data-theme*="dark"]) .file-item > svg,
|
|
196
196
|
:host([data-theme*="dark"]) .file-item > svg {
|
|
197
|
-
color:
|
|
197
|
+
color: #8d8d8d;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/* Progress bar - dark theme */
|
|
201
201
|
:host-context([data-theme*="dark"]) .progress-bar,
|
|
202
202
|
:host([data-theme*="dark"]) .progress-bar {
|
|
203
|
-
background-color:
|
|
203
|
+
background-color: #525252;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/* Preview modal - dark theme */
|
|
@@ -213,7 +213,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
213
213
|
.progress-bar {
|
|
214
214
|
height: 2px;
|
|
215
215
|
width: 100%;
|
|
216
|
-
background-color:
|
|
216
|
+
background-color: #e6e6e6;
|
|
217
217
|
margin-top: 4px;
|
|
218
218
|
position: relative;
|
|
219
219
|
border-radius: 2px;
|
|
@@ -221,7 +221,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
221
221
|
}
|
|
222
222
|
.progress-inner {
|
|
223
223
|
height: 100%;
|
|
224
|
-
background-color:
|
|
224
|
+
background-color: #409eff;
|
|
225
225
|
position: absolute;
|
|
226
226
|
left: 0;
|
|
227
227
|
top: 0;
|
|
@@ -233,21 +233,21 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
233
233
|
position: absolute;
|
|
234
234
|
right: 0;
|
|
235
235
|
top: -18px;
|
|
236
|
-
font-size:
|
|
237
|
-
color:
|
|
236
|
+
font-size: 12px;
|
|
237
|
+
color: #409eff;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
.hidden {
|
|
241
241
|
display: none;
|
|
242
242
|
}
|
|
243
243
|
.success {
|
|
244
|
-
color:
|
|
244
|
+
color: #67c23a;
|
|
245
245
|
}
|
|
246
246
|
.error {
|
|
247
|
-
color:
|
|
247
|
+
color: #f56c6c;
|
|
248
248
|
}
|
|
249
249
|
.icon-delete {
|
|
250
|
-
color:
|
|
250
|
+
color: #f56c6c;
|
|
251
251
|
}
|
|
252
252
|
.file-preview {
|
|
253
253
|
width: 100%;
|
|
@@ -257,7 +257,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
257
257
|
display: block;
|
|
258
258
|
max-width: 100%;
|
|
259
259
|
max-height: 200px;
|
|
260
|
-
border-radius:
|
|
260
|
+
border-radius: 4px;
|
|
261
261
|
object-fit: contain;
|
|
262
262
|
cursor: zoom-in;
|
|
263
263
|
}
|
|
@@ -267,11 +267,11 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
267
267
|
left: 0;
|
|
268
268
|
width: 100%;
|
|
269
269
|
height: 100%;
|
|
270
|
-
background-color:
|
|
270
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
271
271
|
display: flex;
|
|
272
272
|
justify-content: center;
|
|
273
273
|
align-items: center;
|
|
274
|
-
z-index:
|
|
274
|
+
z-index: 1000;
|
|
275
275
|
}
|
|
276
276
|
.preview-modal img {
|
|
277
277
|
max-width: 90%;
|
|
@@ -282,7 +282,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
282
282
|
position: absolute;
|
|
283
283
|
top: 20px;
|
|
284
284
|
right: 20px;
|
|
285
|
-
color:
|
|
285
|
+
color: white;
|
|
286
286
|
font-size: 30px;
|
|
287
287
|
background: none;
|
|
288
288
|
border: none;
|
|
@@ -290,7 +290,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
290
290
|
}
|
|
291
291
|
.preview-icon {
|
|
292
292
|
padding: 4px;
|
|
293
|
-
color:
|
|
293
|
+
color: #409eff;
|
|
294
294
|
cursor: zoom-in;
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -305,14 +305,14 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
305
305
|
@media (max-width: 600px) {
|
|
306
306
|
.upload-dragger {
|
|
307
307
|
height: 140px;
|
|
308
|
-
padding:
|
|
308
|
+
padding: 12px;
|
|
309
309
|
}
|
|
310
310
|
.upload-icon {
|
|
311
311
|
font-size: 24px;
|
|
312
312
|
}
|
|
313
313
|
.upload-text,
|
|
314
314
|
.upload-tip {
|
|
315
|
-
font-size:
|
|
315
|
+
font-size: 13px;
|
|
316
316
|
}
|
|
317
317
|
.file-item {
|
|
318
318
|
display: grid;
|
|
@@ -324,7 +324,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
324
324
|
"actions actions";
|
|
325
325
|
gap: 4px 8px;
|
|
326
326
|
align-items: center;
|
|
327
|
-
padding:
|
|
327
|
+
padding: 8px;
|
|
328
328
|
width: 100%;
|
|
329
329
|
box-sizing: border-box;
|
|
330
330
|
overflow: hidden; /* Hide content that overflows */
|
|
@@ -365,10 +365,16 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
365
365
|
}
|
|
366
366
|
.upload-button {
|
|
367
367
|
width: 100%;
|
|
368
|
-
font-size:
|
|
368
|
+
font-size: 16px;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
`,n={isImageFile:e=>e.type.startsWith("image/"),formatFileSize(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return Number.parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB"][t]},createFilePreview:e=>new Promise(t=>{const
|
|
371
|
+
`,n={isImageFile:e=>e.type.startsWith("image/"),formatFileSize(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return Number.parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB"][t]},createFilePreview:e=>new Promise(t=>{const i=new FileReader;i.onload=e=>{var i;t(null===(i=e.target)||void 0===i?void 0:i.result)},i.readAsDataURL(e)})},d=e=>class extends e{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var e,t,i;super.disconnectedCallback(),null===(e=this.themeObserver)||void 0===e||e.disconnect(),null===(t=this.designSystemObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var e,t;const i=(null===(e=this.closest("[data-theme]"))||void 0===e?void 0:e.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return i||((null===(t=window.matchMedia)||void 0===t?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var e;const t=(null===(e=this.closest("[design-system]"))||void 0===e?void 0:e.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===t?t:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},l=()=>{var e;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(e=process.env)||void 0===e?void 0:e.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},h=e=>class extends e{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(l())for(const e of this.requiredComponents)if(!this.isComponentAvailable(e))throw new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${e}';`)}validateDependenciesWithHandler(e){if(!l())return!0;let t=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){t=!1;const o=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);e?e(i,o):console.error(o.message)}return t}isComponentAvailable(e){return!!customElements.get(e)}getMissingDependencies(){return this.requiredComponents.filter(e=>!this.isComponentAvailable(e))}areDependenciesAvailable(){return this.requiredComponents.every(e=>this.isComponentAvailable(e))}addRequiredComponent(e){this.requiredComponents.includes(e)||this.requiredComponents.push(e)}removeRequiredComponent(e){const t=this.requiredComponents.indexOf(e);t>-1&&this.requiredComponents.splice(t,1)}},c=e=>class extends e{dispatchCustomEvent(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(e,t){var i;const o=Object.assign(Object.assign({},t),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(e,o)}dispatchInputEvent(e,t){const i=Object.assign({target:t.target||this,value:t.value,originalEvent:t.originalEvent},t);this.dispatchCustomEvent(e,i)}dispatchFocusEvent(e,t){const i=Object.assign({target:t.target||this,value:t.value,focused:t.focused,cursorPosition:t.cursorPosition,selectedText:t.selectedText},t);this.dispatchCustomEvent(e,i)}dispatchValidationEvent(e,t){var i;const o=Object.assign({target:t.target||this,value:t.value,isValid:null!==(i=t.isValid)&&void 0!==i&&i,error:t.error},t);this.dispatchCustomEvent(e,o)}dispatchActionEvent(e,t){const i=Object.assign({target:t.target||this,action:t.action,previousValue:t.previousValue,newValue:t.newValue},t);this.dispatchCustomEvent(e,i)}isReadonlyKeyAllowed(e){if(e.ctrlKey||e.metaKey){return["KeyA","KeyC"].includes(e.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key)}isActivationKey(e){return"Enter"===e.key||" "===e.key}},p=new Set,u=new Map;
|
|
372
|
+
/**
|
|
373
|
+
* @license
|
|
374
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
375
|
+
* SPDX-License-Identifier: MIT
|
|
376
|
+
*/
|
|
377
|
+
const f=e=>{class t extends e{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const e=this.constructor.useShadowDom;if(!e&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!e){const e=this.constructor,t=this.tagName.toLowerCase(),i=e.styles;if(i){const e=g(i);e&&function(e,t,i){var o;if(!u.has(e)){const i=new CSSStyleSheet;i.replaceSync(t),u.set(e,i)}const s=u.get(e),r=`doc:${e}`;if(p.has(r)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,s],p.add(r)),i){let t=i;for(;t;){const i=t.getRootNode();if(!(i instanceof ShadowRoot))break;{const r=`shadow:${((null===(o=i.host)||void 0===o?void 0:o.tagName)||"").toLowerCase()}:${e}`;p.has(r)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s],p.add(r)),t=i.host}}}}(t,e,this)}}}get lightChildren(){return this.t?this.t.filter(e=>!(e instanceof Element&&e.hasAttribute("slot"))):[]}lightChildrenNamed(e){return this.t?this.t.filter(t=>t instanceof Element&&t.getAttribute("slot")===e):[]}}return t.useShadowDom=!1,t};function g(e){return Array.isArray(e)?e.map(e=>g(e)).filter(Boolean).join("\n"):e&&"string"==typeof e.cssText?e.cssText:"string"==typeof e?e:""}var m=function(e,t,i,o){for(var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o,n=e.length-1;n>=0;n--)(s=e[n])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},v=function(e,t,i,o){return new(i||(i=Promise))(function(s,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function n(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,n)}d((o=o.apply(e,t||[])).next())})};let w=class extends((e=>h(d(c(f(e)))))(i)){constructor(){super(...arguments),this.accept="",this.multiple=!1,this.drag=!0,this.tip="",this.limit=0,this.preview=!0,this.generatePreviewOnUpload=!1,this.fileList=[],this.isDragOver=!1,this.showDragArea=!1,this.inputElement=null,this.dragCounter=0,this.previewImage=null,this._onDocumentDragEnter=e=>{e.preventDefault(),this.dragCounter++,1===this.dragCounter&&(this.showDragArea=!0)},this._onDocumentDragLeave=e=>{e.preventDefault(),this.dragCounter--,0===this.dragCounter&&(this.showDragArea=!1,this.isDragOver=!1)},this._onDocumentDrop=e=>{e.target===this||this.contains(e.target)||(e.preventDefault(),this.dragCounter=0,this.showDragArea=!1,this.isDragOver=!1)},this._onDocumentDragOver=e=>{e.preventDefault();const t=e.composedPath().includes(this);this.isDragOver=!!t},this._onDrop=e=>{var t;e.preventDefault(),e.stopPropagation(),this.dragCounter=0,this.isDragOver=!1,this.showDragArea=!1,(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&(this.dispatchEvent(new CustomEvent("files-changed",{detail:e.dataTransfer.files,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("file-drop",{detail:{files:e.dataTransfer.files},bubbles:!0,composed:!0})),this._handleFiles(e.dataTransfer.files))},this._onClick=()=>{var e;null===(e=this.inputElement)||void 0===e||e.click()},this._onChange=e=>{const t=e.target;t.files&&(this.dispatchEvent(new CustomEvent("files-changed",{detail:t.files,bubbles:!0,composed:!0})),this._handleFiles(t.files),t.value="")}}connectedCallback(){super.connectedCallback(),this._updateThemeAttribute(),this.drag&&(document.addEventListener("dragenter",this._onDocumentDragEnter),document.addEventListener("dragleave",this._onDocumentDragLeave),document.addEventListener("drop",this._onDocumentDrop),document.addEventListener("dragover",this._onDocumentDragOver))}updated(e){super.updated(e),this._updateThemeAttribute()}_updateThemeAttribute(){const e=this.explicitTheme;e?this.setAttribute("data-theme",e):this.removeAttribute("data-theme")}disconnectedCallback(){super.disconnectedCallback(),this.drag&&(document.removeEventListener("dragenter",this._onDocumentDragEnter),document.removeEventListener("dragleave",this._onDocumentDragLeave),document.removeEventListener("drop",this._onDocumentDrop),document.removeEventListener("dragover",this._onDocumentDragOver))}firstUpdated(e){var t;super.firstUpdated(e),this.inputElement=(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="file"]'))||null}_handleFiles(e){return v(this,void 0,void 0,function*(){if(this.multiple&&this.limit>0&&this.fileList.length+e.length>this.limit)return void this._dispatchEvent("exceed",{files:e});if(!this.multiple&&e.length>0){const t=e[e.length-1];this.previewImage&&this.fileList.some(e=>e.url===this.previewImage)&&(this.previewImage=null);const i=[...this.fileList];for(const e of i)this._dispatchEvent("remove",{file:e});this.fileList=[];const o=n.isImageFile(t),s={name:t.name,size:n.formatFileSize(t.size),raw:t,status:"ready",percentage:0,uid:Date.now()+Math.random().toString(36).substring(2),isImage:o};return this.preview&&this.generatePreviewOnUpload&&o&&(s.url=yield n.createFilePreview(t)),this.fileList=[s],this.requestUpdate(),void this._dispatchEvent("select",{files:[s],fileList:this.fileList})}const t=[];for(const i of Array.from(e)){const e=n.isImageFile(i),o={name:i.name,size:n.formatFileSize(i.size),raw:i,status:"ready",percentage:0,uid:Date.now()+Math.random().toString(36).substring(2),isImage:e};this.preview&&this.generatePreviewOnUpload&&e&&(o.url=yield n.createFilePreview(i)),this.fileList=[...this.fileList,o],t.push(o)}this.requestUpdate(),this._dispatchEvent("select",{files:t,fileList:this.fileList})})}updateFileStatus(e,t,i){const o=this.fileList.find(t=>t.uid===e);o&&(o.status=t,void 0!==i&&(o.percentage=i),this._updateFile(o))}_updateFile(e){this.fileList=this.fileList.map(t=>t.uid===e.uid?e:t),this.requestUpdate()}_removeFile(e){const t=this.fileList.find(t=>t.uid===e);this.fileList=this.fileList.filter(t=>t.uid!==e),t&&this._dispatchEvent("remove",{file:t}),this.requestUpdate()}_dispatchEvent(e,t){this.dispatchEvent(new CustomEvent(`file-${e}`,{detail:t,bubbles:!0,composed:!0}))}_showPreview(e){this.previewImage=e}_closePreview(){this.previewImage=null}render(){return t`
|
|
372
378
|
<div class="upload" @drop=${this._onDrop} @dragover=${e=>e.preventDefault()}>
|
|
373
379
|
<input
|
|
374
380
|
type="file"
|
|
@@ -378,7 +384,7 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
378
384
|
@change=${this._onChange}
|
|
379
385
|
/>
|
|
380
386
|
|
|
381
|
-
${this.showDragArea?
|
|
387
|
+
${this.showDragArea?t`
|
|
382
388
|
<div
|
|
383
389
|
class="upload-dragger ${this.isDragOver?"is-dragover":""}"
|
|
384
390
|
@click=${this._onClick}
|
|
@@ -391,23 +397,23 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
391
397
|
</svg>
|
|
392
398
|
</div>
|
|
393
399
|
<div class="upload-text">Drop file here or click to upload</div>
|
|
394
|
-
${this.tip?
|
|
400
|
+
${this.tip?t`<div class="upload-tip">${this.tip}</div>`:""}
|
|
395
401
|
</div>
|
|
396
|
-
`:
|
|
402
|
+
`:t`
|
|
397
403
|
<nr-button @click=${this._onClick}>Upload File</nr-button>
|
|
398
|
-
${this.tip?
|
|
404
|
+
${this.tip?t`<div class="upload-tip">${this.tip}</div>`:""}
|
|
399
405
|
`}
|
|
400
406
|
|
|
401
407
|
<div class="file-list">
|
|
402
|
-
${this.fileList.map(e=>
|
|
408
|
+
${this.fileList.map(e=>t`
|
|
403
409
|
<div class="file-item">
|
|
404
|
-
${e.isImage?
|
|
410
|
+
${e.isImage?t`
|
|
405
411
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
406
412
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
407
413
|
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
|
408
414
|
<polyline points="21 15 16 10 5 21"></polyline>
|
|
409
415
|
</svg>
|
|
410
|
-
`:
|
|
416
|
+
`:t`
|
|
411
417
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
412
418
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
413
419
|
<polyline points="14 2 14 8 20 8"></polyline>
|
|
@@ -416,19 +422,19 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
416
422
|
<div class="file-name">${e.name}</div>
|
|
417
423
|
<div class="file-size">${e.size}</div>
|
|
418
424
|
<div class="file-status">
|
|
419
|
-
${"success"===e.status?
|
|
425
|
+
${"success"===e.status?t`
|
|
420
426
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#67c23a" stroke-width="2">
|
|
421
427
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
422
428
|
</svg>
|
|
423
|
-
`:"error"===e.status?
|
|
429
|
+
`:"error"===e.status?t`
|
|
424
430
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#f56c6c" stroke-width="2">
|
|
425
431
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
426
432
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
427
433
|
</svg>
|
|
428
|
-
`:"uploading"===e.status?
|
|
434
|
+
`:"uploading"===e.status?t`${e.percentage}%`:""}
|
|
429
435
|
</div>
|
|
430
436
|
<div class="file-actions">
|
|
431
|
-
${e.isImage&&e.url?
|
|
437
|
+
${e.isImage&&e.url?t`
|
|
432
438
|
<button class="preview-icon" @click=${()=>this._showPreview(e.url)}>
|
|
433
439
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
434
440
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
@@ -443,13 +449,13 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
443
449
|
</svg>
|
|
444
450
|
</button>
|
|
445
451
|
</div>
|
|
446
|
-
${"uploading"===e.status?
|
|
452
|
+
${"uploading"===e.status?t`
|
|
447
453
|
<div class="progress-bar">
|
|
448
454
|
<div class="progress-inner" style="width: ${e.percentage}%"></div>
|
|
449
455
|
</div>
|
|
450
456
|
`:""}
|
|
451
457
|
</div>
|
|
452
|
-
${this.preview&&e.isImage&&e.url?
|
|
458
|
+
${this.preview&&e.isImage&&e.url?t`
|
|
453
459
|
<div class="file-preview">
|
|
454
460
|
<img
|
|
455
461
|
class="image-preview"
|
|
@@ -462,11 +468,11 @@ import{css as e,LitElement as t,html as r}from"lit";import{property as o,state a
|
|
|
462
468
|
`)}
|
|
463
469
|
</div>
|
|
464
470
|
|
|
465
|
-
${this.previewImage?
|
|
471
|
+
${this.previewImage?t`
|
|
466
472
|
<div class="preview-modal" @click=${this._closePreview}>
|
|
467
473
|
<button class="preview-close">×</button>
|
|
468
474
|
<img src="${this.previewImage}" alt="Preview" />
|
|
469
475
|
</div>
|
|
470
476
|
`:""}
|
|
471
477
|
</div>
|
|
472
|
-
`}};
|
|
478
|
+
`}};w.useShadowDom=!0,w.styles=a,m([o({type:String})],w.prototype,"accept",void 0),m([o({type:Boolean})],w.prototype,"multiple",void 0),m([o({type:Boolean})],w.prototype,"drag",void 0),m([o({type:String})],w.prototype,"tip",void 0),m([o({type:Number})],w.prototype,"limit",void 0),m([o({type:Boolean})],w.prototype,"preview",void 0),m([o({type:Boolean})],w.prototype,"generatePreviewOnUpload",void 0),m([s()],w.prototype,"fileList",void 0),m([s()],w.prototype,"isDragOver",void 0),m([s()],w.prototype,"showDragArea",void 0),m([s()],w.prototype,"inputElement",void 0),m([s()],w.prototype,"dragCounter",void 0),m([s()],w.prototype,"previewImage",void 0),w=m([r("nr-file-upload")],w);export{w as FileUpload};
|
|
Binary file
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from 'lit';
|
|
2
2
|
import { UploadFile } from './types.js';
|
|
3
|
-
declare const FileUpload_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
3
|
+
declare const FileUpload_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & (new (...args: any[]) => import("packages/common/src/shared/base-mixin.js").LightDomContent) & typeof LitElement;
|
|
4
4
|
export declare class FileUpload extends FileUpload_base {
|
|
5
|
+
static useShadowDom: boolean;
|
|
5
6
|
static styles: import("lit").CSSResult;
|
|
6
7
|
/** Explicit theme from data-theme attribute (provided by ThemeAwareMixin) */
|
|
7
8
|
explicitTheme: string | null;
|