@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
|
@@ -6,16 +6,9 @@
|
|
|
6
6
|
import { css } from 'lit';
|
|
7
7
|
export const styles = css `
|
|
8
8
|
:host {
|
|
9
|
-
--nuraly-code-editor-width: 100%;
|
|
10
|
-
--nuraly-code-editor-height: 100%;
|
|
11
|
-
--nuraly-code-editor-min-height: 0;
|
|
12
|
-
--nuraly-code-editor-max-height: none;
|
|
13
|
-
--nuraly-code-editor-border-radius: 4px;
|
|
14
|
-
--nuraly-code-editor-border: 1px solid var(--nuraly-border-color, #e0e0e0);
|
|
15
|
-
|
|
16
9
|
display: block;
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
19
12
|
}
|
|
20
13
|
|
|
21
14
|
:host([hidden]) {
|
|
@@ -23,17 +16,148 @@ export const styles = css `
|
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
.editor-container {
|
|
19
|
+
display: flex;
|
|
26
20
|
width: 100%;
|
|
27
21
|
height: 100%;
|
|
28
|
-
min-height:
|
|
29
|
-
|
|
30
|
-
border
|
|
22
|
+
min-height: 80px;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
border: 1px solid var(--nr-border, #e0e0e0);
|
|
25
|
+
overflow: auto;
|
|
26
|
+
font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
line-height: 1.6;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Light theme */
|
|
32
|
+
.editor-container.light {
|
|
33
|
+
background: #fafafa;
|
|
34
|
+
color: #24292e;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.editor-container.light .line-numbers-gutter {
|
|
38
|
+
background: #f0f0f0;
|
|
39
|
+
color: #999;
|
|
40
|
+
border-right: 1px solid #e0e0e0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Dark theme */
|
|
44
|
+
.editor-container.dark {
|
|
45
|
+
background: #1e1e1e;
|
|
46
|
+
color: #d4d4d4;
|
|
47
|
+
border-color: #333;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.editor-container.dark .line-numbers-gutter {
|
|
51
|
+
background: #1a1a1a;
|
|
52
|
+
color: #555;
|
|
53
|
+
border-right: 1px solid #333;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Line numbers gutter */
|
|
57
|
+
.line-numbers-gutter {
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
width: 48px;
|
|
60
|
+
padding: 10px 0;
|
|
61
|
+
text-align: right;
|
|
62
|
+
user-select: none;
|
|
31
63
|
overflow: hidden;
|
|
32
64
|
}
|
|
33
65
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
.line-number {
|
|
67
|
+
padding: 0 12px 0 0;
|
|
68
|
+
font-size: inherit;
|
|
69
|
+
line-height: inherit;
|
|
37
70
|
}
|
|
71
|
+
|
|
72
|
+
/* Editor area */
|
|
73
|
+
.editor {
|
|
74
|
+
flex: 1;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
padding: 10px 16px;
|
|
77
|
+
outline: none;
|
|
78
|
+
overflow: auto;
|
|
79
|
+
font-family: inherit;
|
|
80
|
+
font-size: inherit;
|
|
81
|
+
line-height: inherit;
|
|
82
|
+
white-space: pre;
|
|
83
|
+
-webkit-font-smoothing: antialiased;
|
|
84
|
+
-moz-osx-font-smoothing: grayscale;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.editor:focus {
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Selection colors */
|
|
92
|
+
.editor-container.light .editor::selection,
|
|
93
|
+
.editor-container.light .editor *::selection {
|
|
94
|
+
background: rgba(124, 58, 237, 0.15);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.editor-container.dark .editor::selection,
|
|
98
|
+
.editor-container.dark .editor *::selection {
|
|
99
|
+
background: rgba(124, 58, 237, 0.3);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Caret color */
|
|
103
|
+
.editor-container.light .editor {
|
|
104
|
+
caret-color: #24292e;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.editor-container.dark .editor {
|
|
108
|
+
caret-color: #d4d4d4;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Readonly state */
|
|
112
|
+
:host([readonly]) .editor {
|
|
113
|
+
opacity: 0.7;
|
|
114
|
+
cursor: default;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ======== Syntax highlighting — Light theme ======== */
|
|
118
|
+
.editor-container.light .hljs-keyword { color: #d73a49; }
|
|
119
|
+
.editor-container.light .hljs-string { color: #032f62; }
|
|
120
|
+
.editor-container.light .hljs-number { color: #005cc5; }
|
|
121
|
+
.editor-container.light .hljs-comment { color: #6a737d; font-style: italic; }
|
|
122
|
+
.editor-container.light .hljs-function { color: #6f42c1; }
|
|
123
|
+
.editor-container.light .hljs-title { color: #6f42c1; }
|
|
124
|
+
.editor-container.light .hljs-params { color: #24292e; }
|
|
125
|
+
.editor-container.light .hljs-built_in { color: #e36209; }
|
|
126
|
+
.editor-container.light .hljs-literal { color: #005cc5; }
|
|
127
|
+
.editor-container.light .hljs-type { color: #005cc5; }
|
|
128
|
+
.editor-container.light .hljs-attr { color: #005cc5; }
|
|
129
|
+
.editor-container.light .hljs-tag { color: #22863a; }
|
|
130
|
+
.editor-container.light .hljs-name { color: #22863a; }
|
|
131
|
+
.editor-container.light .hljs-selector-class { color: #6f42c1; }
|
|
132
|
+
.editor-container.light .hljs-selector-id { color: #005cc5; }
|
|
133
|
+
.editor-container.light .hljs-attribute { color: #005cc5; }
|
|
134
|
+
.editor-container.light .hljs-variable { color: #e36209; }
|
|
135
|
+
.editor-container.light .hljs-regexp { color: #032f62; }
|
|
136
|
+
.editor-container.light .hljs-symbol { color: #005cc5; }
|
|
137
|
+
.editor-container.light .hljs-meta { color: #6a737d; }
|
|
138
|
+
.editor-container.light .hljs-punctuation { color: #24292e; }
|
|
139
|
+
|
|
140
|
+
/* ======== Syntax highlighting — Dark theme ======== */
|
|
141
|
+
.editor-container.dark .hljs-keyword { color: #c678dd; }
|
|
142
|
+
.editor-container.dark .hljs-string { color: #98c379; }
|
|
143
|
+
.editor-container.dark .hljs-number { color: #d19a66; }
|
|
144
|
+
.editor-container.dark .hljs-comment { color: #5c6370; font-style: italic; }
|
|
145
|
+
.editor-container.dark .hljs-function { color: #61afef; }
|
|
146
|
+
.editor-container.dark .hljs-title { color: #61afef; }
|
|
147
|
+
.editor-container.dark .hljs-params { color: #abb2bf; }
|
|
148
|
+
.editor-container.dark .hljs-built_in { color: #e6c07b; }
|
|
149
|
+
.editor-container.dark .hljs-literal { color: #d19a66; }
|
|
150
|
+
.editor-container.dark .hljs-type { color: #e6c07b; }
|
|
151
|
+
.editor-container.dark .hljs-attr { color: #d19a66; }
|
|
152
|
+
.editor-container.dark .hljs-tag { color: #e06c75; }
|
|
153
|
+
.editor-container.dark .hljs-name { color: #e06c75; }
|
|
154
|
+
.editor-container.dark .hljs-selector-class { color: #e6c07b; }
|
|
155
|
+
.editor-container.dark .hljs-selector-id { color: #61afef; }
|
|
156
|
+
.editor-container.dark .hljs-attribute { color: #d19a66; }
|
|
157
|
+
.editor-container.dark .hljs-variable { color: #e06c75; }
|
|
158
|
+
.editor-container.dark .hljs-regexp { color: #98c379; }
|
|
159
|
+
.editor-container.dark .hljs-symbol { color: #56b6c2; }
|
|
160
|
+
.editor-container.dark .hljs-meta { color: #5c6370; }
|
|
161
|
+
.editor-container.dark .hljs-punctuation { color: #abb2bf; }
|
|
38
162
|
`;
|
|
39
163
|
//# sourceMappingURL=code-editor.style.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{css as e,
|
|
1
|
+
import{css as e,html as t,nothing as i,LitElement as o}from"lit";import{property as s,customElement as n}from"lit/decorators.js";import{map as r}from"lit/directives/map.js";import{classMap as c}from"lit/directives/class-map.js";import{ifDefined as a}from"lit/directives/if-defined.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
7
|
+
const l=e`
|
|
8
8
|
:host {
|
|
9
9
|
display: block;
|
|
10
10
|
width: 100%;
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
/* Force CSS custom property inheritance to ensure theme switching works properly */
|
|
13
|
-
color:
|
|
14
|
-
background-color:
|
|
13
|
+
color: #161616;
|
|
14
|
+
background-color: #ffffff;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/* Force re-evaluation of theme-dependent properties on theme change */
|
|
@@ -23,17 +23,17 @@ const p=e`
|
|
|
23
23
|
.collapse-container {
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
|
-
gap:
|
|
27
|
-
border:
|
|
28
|
-
border-radius:
|
|
29
|
-
background-color:
|
|
26
|
+
gap: 0;
|
|
27
|
+
border: 1px solid #e0e0e0;
|
|
28
|
+
border-radius: 6px;
|
|
29
|
+
background-color: #ffffff;
|
|
30
30
|
overflow: visible;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.collapse-section {
|
|
34
34
|
position: relative;
|
|
35
|
-
border-bottom: 1px solid
|
|
36
|
-
transition:
|
|
35
|
+
border-bottom: 1px solid #e0e0e0;
|
|
36
|
+
transition: all 0.2s;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.collapse-section:last-child {
|
|
@@ -41,7 +41,7 @@ const p=e`
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.collapse-section--disabled {
|
|
44
|
-
opacity:
|
|
44
|
+
opacity: 0.5;
|
|
45
45
|
pointer-events: none;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -58,40 +58,40 @@ const p=e`
|
|
|
58
58
|
display: flex;
|
|
59
59
|
align-items: center;
|
|
60
60
|
justify-content: space-between;
|
|
61
|
-
padding:
|
|
62
|
-
background-color:
|
|
63
|
-
color:
|
|
64
|
-
font-weight:
|
|
65
|
-
font-size:
|
|
66
|
-
line-height:
|
|
61
|
+
padding: 0.75rem 1rem;
|
|
62
|
+
background-color: #f4f4f4;
|
|
63
|
+
color: #161616;
|
|
64
|
+
font-weight: 500;
|
|
65
|
+
font-size: 0.875rem;
|
|
66
|
+
line-height: 1.5;
|
|
67
67
|
border: none;
|
|
68
68
|
cursor: pointer;
|
|
69
69
|
user-select: none;
|
|
70
|
-
transition:
|
|
71
|
-
border-radius:
|
|
70
|
+
transition: 0.2s ease;
|
|
71
|
+
border-radius: 0;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.collapse-header--clickable:hover {
|
|
75
|
-
background-color:
|
|
75
|
+
background-color: #e8e8e8;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.collapse-header--clickable:active {
|
|
79
|
-
background-color:
|
|
79
|
+
background-color: #d8d8d8;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.collapse-header--expanded {
|
|
83
|
-
background-color:
|
|
83
|
+
background-color: #e8e8e8;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.collapse-header--disabled {
|
|
87
|
-
color:
|
|
87
|
+
color: #c6c6c6;
|
|
88
88
|
cursor: not-allowed;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.collapse-header:focus-visible {
|
|
92
|
-
outline: 2px solid
|
|
92
|
+
outline: 2px solid #7c3aed;
|
|
93
93
|
outline-offset: 2px;
|
|
94
|
-
box-shadow:
|
|
94
|
+
box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.collapse-header-text {
|
|
@@ -102,9 +102,9 @@ const p=e`
|
|
|
102
102
|
.collapse-header-right {
|
|
103
103
|
display: flex;
|
|
104
104
|
align-items: center;
|
|
105
|
-
gap:
|
|
106
|
-
margin-left:
|
|
107
|
-
color:
|
|
105
|
+
gap: 0.5rem;
|
|
106
|
+
margin-left: 0.75rem;
|
|
107
|
+
color: inherit;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.collapse-header-right > * {
|
|
@@ -116,89 +116,89 @@ const p=e`
|
|
|
116
116
|
display: flex;
|
|
117
117
|
align-items: center;
|
|
118
118
|
justify-content: center;
|
|
119
|
-
width:
|
|
120
|
-
height:
|
|
121
|
-
color:
|
|
122
|
-
transition:
|
|
119
|
+
width: 1rem;
|
|
120
|
+
height: 1rem;
|
|
121
|
+
color: #525252;
|
|
122
|
+
transition: transform 0.2s ease;
|
|
123
123
|
transform-origin: center;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.collapse-header--disabled .collapse-icon {
|
|
127
|
-
color:
|
|
127
|
+
color: #c6c6c6;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/* Content Styles */
|
|
131
131
|
.collapse-content {
|
|
132
|
-
background-color:
|
|
133
|
-
border-radius:
|
|
134
|
-
transition:
|
|
132
|
+
background-color: #ffffff;
|
|
133
|
+
border-radius: 0;
|
|
134
|
+
transition: 0.2s ease;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
.collapse-content-inner {
|
|
138
|
-
padding:
|
|
139
|
-
color:
|
|
140
|
-
font-weight:
|
|
141
|
-
font-size:
|
|
142
|
-
line-height:
|
|
138
|
+
padding: 1rem;
|
|
139
|
+
color: #161616;
|
|
140
|
+
font-weight: 400;
|
|
141
|
+
font-size: 0.875rem;
|
|
142
|
+
line-height: 1.5;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/* Size Variants */
|
|
146
146
|
:host([size="small"]) .collapse-header {
|
|
147
|
-
padding:
|
|
147
|
+
padding: 0.5rem 0.75rem;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
:host([size="small"]) .collapse-content-inner {
|
|
151
|
-
padding:
|
|
151
|
+
padding: 0.5rem 0.75rem;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
:host([size="medium"]) .collapse-header {
|
|
155
|
-
padding:
|
|
155
|
+
padding: 0.75rem 1rem;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
:host([size="medium"]) .collapse-content-inner {
|
|
159
|
-
padding:
|
|
159
|
+
padding: 0.75rem 1rem;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
:host([size="large"]) .collapse-header {
|
|
163
|
-
padding:
|
|
163
|
+
padding: 1rem 1.5rem;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
:host([size="large"]) .collapse-content-inner {
|
|
167
|
-
padding:
|
|
167
|
+
padding: 1rem 1.5rem;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/* Variant Styles */
|
|
171
171
|
:host([variant="default"]) .collapse-container {
|
|
172
|
-
background-color:
|
|
173
|
-
border: 1px solid
|
|
172
|
+
background-color: #ffffff;
|
|
173
|
+
border: 1px solid #e0e0e0;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
:host([variant="bordered"]) .collapse-container {
|
|
177
|
-
background-color:
|
|
178
|
-
border: 2px solid
|
|
177
|
+
background-color: #ffffff;
|
|
178
|
+
border: 2px solid #e0e0e0;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
:host([variant="ghost"]) .collapse-container {
|
|
182
|
-
background-color:
|
|
183
|
-
border: 1px solid
|
|
182
|
+
background-color: transparent;
|
|
183
|
+
border: 1px solid transparent;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
:host([variant="ghost"]) .collapse-header:hover {
|
|
187
|
-
background-color:
|
|
187
|
+
background-color: #f4f4f4;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
/* Accordion Mode */
|
|
191
191
|
:host([accordion]) .collapse-section {
|
|
192
|
-
border-bottom: 1px solid
|
|
192
|
+
border-bottom: 1px solid #e0e0e0;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/* Shadow Variants */
|
|
196
196
|
:host(:not([variant="ghost"])) .collapse-container {
|
|
197
|
-
box-shadow:
|
|
197
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
:host(:not([variant="ghost"])) .collapse-container:hover {
|
|
201
|
-
box-shadow:
|
|
201
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/* Accessibility */
|
|
@@ -209,7 +209,7 @@ const p=e`
|
|
|
209
209
|
.collapse-section {
|
|
210
210
|
transition: none;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
.collapse-icon--expanded {
|
|
214
214
|
transform: none;
|
|
215
215
|
}
|
|
@@ -218,14 +218,14 @@ const p=e`
|
|
|
218
218
|
/* High Contrast Mode */
|
|
219
219
|
@media (prefers-contrast: high) {
|
|
220
220
|
.collapse-header {
|
|
221
|
-
border: 2px solid
|
|
221
|
+
border: 2px solid #e0e0e0;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
|
|
224
224
|
.collapse-header:focus-visible {
|
|
225
|
-
outline: 3px solid
|
|
225
|
+
outline: 3px solid #7c3aed;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
`,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))}},h=()=>{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)},p=e=>class extends e{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(h())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(!h())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)}},u=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}},f=new Set,m=new Map;
|
|
229
229
|
/**
|
|
230
230
|
* @license
|
|
231
231
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
@@ -236,48 +236,60 @@ const p=e`
|
|
|
236
236
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
237
237
|
* SPDX-License-Identifier: MIT
|
|
238
238
|
*/
|
|
239
|
-
class
|
|
239
|
+
const v=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(!m.has(e)){const i=new CSSStyleSheet;i.replaceSync(t),m.set(e,i)}const s=m.get(e),n=`doc:${e}`;if(f.has(n)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,s],f.add(n)),i){let t=i;for(;t;){const i=t.getRootNode();if(!(i instanceof ShadowRoot))break;{const n=`shadow:${((null===(o=i.host)||void 0===o?void 0:o.tagName)||"").toLowerCase()}:${e}`;f.has(n)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s],f.add(n)),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:""}
|
|
240
|
+
/**
|
|
241
|
+
* @license
|
|
242
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
243
|
+
* SPDX-License-Identifier: MIT
|
|
244
|
+
*/class b{constructor(e){this._host=e,e.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(){try{this._host.requestUpdate()}catch(e){this.handleError(e,"requestUpdate")}}dispatchEvent(e){try{return this._host.dispatchEvent(e)}catch(e){return this.handleError(e,"dispatchEvent"),!1}}handleError(e,t){console.error(`[${this.constructor.name}] Error in ${t}:`,e);try{this._host.dispatchEvent(new CustomEvent("nr-controller-error",{detail:{error:e.message,context:t,controller:this.constructor.name},bubbles:!0,composed:!0}))}catch(e){}}safeExecute(e,t,i){try{return e()}catch(e){return this.handleError(e,t),i}}debounce(e,t){let i;const o=(...o)=>{void 0!==i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,e.apply(this,o)},t)};return o.cancel=()=>{void 0!==i&&(clearTimeout(i),i=void 0)},o}}
|
|
245
|
+
/**
|
|
246
|
+
* @license
|
|
247
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
248
|
+
* SPDX-License-Identifier: MIT
|
|
249
|
+
*/class x extends b{getSection(e){return this.host.sections[e]}updateSection(e,t){if(this.host.updateSection)return void this.host.updateSection(e,t);const i=this.getSection(e);if(i){const o=[...this.host.sections];o[e]=Object.assign(Object.assign({},i),t),this.host.sections=o,this.host.requestUpdate()}}updateSections(e){if(this.host.updateSections)return void this.host.updateSections(e);const t=[...this.host.sections];let i=!1;e.forEach(({index:e,updates:o})=>{const s=this.getSection(e);s&&(t[e]=Object.assign(Object.assign({},s),o),i=!0)}),i&&(this.host.sections=t,this.host.requestUpdate())}getOpenSections(){return this.host.sections.map((e,t)=>e.open?t:-1).filter(e=>-1!==e)}}
|
|
240
250
|
/**
|
|
241
251
|
* @license
|
|
242
252
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
243
253
|
* SPDX-License-Identifier: MIT
|
|
244
|
-
*/var
|
|
254
|
+
*/var w=function(e,t,i,o){return new(i||(i=Promise))(function(s,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function c(e){try{a(o.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,c)}a((o=o.apply(e,t||[])).next())})};class y extends x{constructor(e){super(e),this.animatingSections=new Set,this.animationDuration=300}animateToggle(e,t){return w(this,void 0,void 0,function*(){if(this.getSection(e)&&!this.animatingSections.has(e)){this.animatingSections.add(e);try{const i=this.getContentElement(e);if(!i)return;t?yield this.animateExpand(i):yield this.animateCollapse(i)}finally{this.animatingSections.delete(e)}}})}animateExpand(e){return w(this,void 0,void 0,function*(){const t=e.scrollHeight;return e.style.height="0px",e.style.overflow="hidden",e.style.transition=`height ${this.animationDuration}ms ease-out`,e.getAnimations(),e.style.height=`${t}px`,new Promise(t=>{const i=()=>{e.style.height="",e.style.overflow="",e.style.transition="",e.removeEventListener("transitionend",i),t()};e.addEventListener("transitionend",i),setTimeout(i,this.animationDuration+50)})})}animateCollapse(e){return w(this,void 0,void 0,function*(){const t=e.scrollHeight;return e.style.height=`${t}px`,e.style.overflow="hidden",e.style.transition=`height ${this.animationDuration}ms ease-out`,e.getAnimations(),e.style.height="0px",new Promise(t=>{const i=()=>{e.style.height="",e.style.overflow="",e.style.transition="",e.removeEventListener("transitionend",i),t()};e.addEventListener("transitionend",i),setTimeout(i,this.animationDuration+50)})})}getContentElement(e){var t;return(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(`.collapse-content[data-section-index="${e}"]`))||null}isAnimating(e){return this.animatingSections.has(e)}setAnimationDuration(e){this.animationDuration=Math.max(0,e)}}
|
|
245
255
|
/**
|
|
246
256
|
* @license
|
|
247
257
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
248
258
|
* SPDX-License-Identifier: MIT
|
|
249
|
-
*/class
|
|
259
|
+
*/class S extends x{handleSectionToggle(e,t){this.host.accordion&&t&&!this.host.allowMultiple&&this.closeOtherSections(e)}closeOtherSections(e){this.host.sections.forEach((t,i)=>{i!==e&&t.open&&!1!==t.collapsible&&this.updateSection(i,{open:!1})})}enforceAccordionMode(){if(!this.host.accordion||this.host.allowMultiple)return;const e=this.getOpenSections();if(e.length>1){const t=e.slice(1).map(e=>({index:e,updates:{open:!1}}));this.updateSections(t)}}openSection(e){const t=this.getSection(e);t&&!t.disabled&&!1!==t.collapsible&&(this.host.accordion&&!this.host.allowMultiple&&this.closeOtherSections(e),this.updateSection(e,{open:!0}))}closeSection(e){const t=this.getSection(e);t&&!t.disabled&&!1!==t.collapsible&&this.updateSection(e,{open:!1})}closeAllSections(){const e=this.host.sections.map((e,t)=>({section:e,index:t})).filter(({section:e})=>e.open&&!1!==e.collapsible&&!e.disabled).map(({index:e})=>({index:e,updates:{open:!1}}));e.length>0&&this.updateSections(e)}openAllSections(){if(this.host.accordion&&!this.host.allowMultiple){const e=this.host.sections.findIndex(e=>!1!==e.collapsible&&!e.disabled);return void(-1!==e&&this.openSection(e))}const e=this.host.sections.map((e,t)=>({section:e,index:t})).filter(({section:e})=>!e.open&&!1!==e.collapsible&&!e.disabled).map(({index:e})=>({index:e,updates:{open:!0}}));e.length>0&&this.updateSections(e)}getActiveSectionIndex(){if(!this.host.accordion)return-1;const e=this.getOpenSections();return e.length>0?e[0]:-1}isAccordionMode(){return!!this.host.accordion}allowsMultiple(){return!!this.host.allowMultiple}}
|
|
250
260
|
/**
|
|
251
261
|
* @license
|
|
252
262
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
253
263
|
* SPDX-License-Identifier: MIT
|
|
254
|
-
*/var
|
|
255
|
-
<div class="collapse-container ${
|
|
256
|
-
${
|
|
264
|
+
*/var $=function(e,t,i,o){for(var s,n=arguments.length,r=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o,c=e.length-1;c>=0;c--)(s=e[c])&&(r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},k=function(e,t,i,o){return new(i||(i=Promise))(function(s,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function c(e){try{a(o.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,c)}a((o=o.apply(e,t||[])).next())})};let E=class extends((e=>p(d(u(v(e)))))(o)){constructor(){super(...arguments),this.requiredComponents=["nr-icon"],this.animationController=new y(this),this.accordionController=new S(this),this.sections=[],this.size="medium",this.variant="default",this.animation="slide",this.accordion=!1,this.allowMultiple=!1,this.disabled=!1,this.expandIcon="chevron-right",this.collapseIcon="chevron-down",this.handleToggleRequest=e=>{const{index:t}=e.detail;this.toggleSection(t)}}connectedCallback(){super.connectedCallback(),this.addEventListener("section-toggle-requested",this.handleToggleRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("section-toggle-requested",this.handleToggleRequest)}updated(e){super.updated(e),(e.has("accordion")||e.has("allowMultiple"))&&this.accordionController.enforceAccordionMode()}toggleSection(e){return k(this,void 0,void 0,function*(){const t=this.sections[e];if(!t||t.disabled||!1===t.collapsible)return;const i=!!t.open,o=!i,s=new CustomEvent("section-before-toggle",{detail:{index:e,section:t,isOpen:i,preventDefault:()=>s.preventDefault()},cancelable:!0,bubbles:!0});this.dispatchEvent(s)&&(this.accordionController.handleSectionToggle(e,o),this.updateSection(e,{open:o}),"none"!==this.animation&&(yield this.animationController.animateToggle(e,o)),this.dispatchEvent(new CustomEvent("section-toggle",{detail:{index:e,section:this.sections[e],isOpen:o},bubbles:!0})))})}openSection(e){return k(this,void 0,void 0,function*(){const t=this.sections[e];t&&!t.open&&(yield this.toggleSection(e))})}closeSection(e){return k(this,void 0,void 0,function*(){const t=this.sections[e];t&&t.open&&(yield this.toggleSection(e))})}openAllSections(){this.accordionController.openAllSections()}closeAllSections(){this.accordionController.closeAllSections()}updateSection(e,t){e<0||e>=this.sections.length||(this.sections=this.sections.map((i,o)=>o===e?Object.assign(Object.assign({},i),t):i))}updateSections(e){0!==e.length&&(this.sections=this.sections.map((t,i)=>{const o=e.find(e=>e.index===i);return o?Object.assign(Object.assign({},t),o.updates):t}))}getSectionIcon(e){return e.expandIcon&&e.collapseIcon?e.open?e.collapseIcon:e.expandIcon:e.headerIcon?e.headerIcon:e.open?this.collapseIcon:this.expandIcon}isSectionAnimating(e){return this.animationController.isAnimating(e)}render(){return t`
|
|
265
|
+
<div part="container" class="collapse-container ${c({[`collapse-${this.size}`]:!0,[`collapse-${this.variant}`]:!0,"collapse-accordion":this.accordion,"collapse-disabled":this.disabled})}">
|
|
266
|
+
${r(this.sections,(e,t)=>this.renderSection(e,t))}
|
|
257
267
|
</div>
|
|
258
|
-
`}renderSection(e,o){const
|
|
259
|
-
<div
|
|
260
|
-
|
|
268
|
+
`}renderSection(e,o){const s=!!e.open,n=this.disabled||e.disabled,r=!1!==e.collapsible,l=this.isSectionAnimating(o);return t`
|
|
269
|
+
<div
|
|
270
|
+
part="item"
|
|
271
|
+
class="collapse-section ${c({"collapse-section--open":s,"collapse-section--disabled":null!=n&&n,"collapse-section--non-collapsible":!r,"collapse-section--animating":l,[e.className||""]:!!e.className})}"
|
|
261
272
|
data-section-index="${o}"
|
|
262
273
|
>
|
|
263
274
|
<!-- Section Header -->
|
|
264
275
|
<div
|
|
265
|
-
|
|
276
|
+
part="item-header"
|
|
277
|
+
class="collapse-header ${c({"collapse-header--expanded":s,"collapse-header--disabled":null!=n&&n,"collapse-header--clickable":r&&!n})}"
|
|
266
278
|
data-section-index="${o}"
|
|
267
279
|
role="button"
|
|
268
|
-
tabindex="${
|
|
269
|
-
aria-expanded="${
|
|
280
|
+
tabindex="${r&&!n?"0":"-1"}"
|
|
281
|
+
aria-expanded="${s}"
|
|
270
282
|
aria-controls="collapse-content-${o}"
|
|
271
|
-
aria-disabled="${
|
|
272
|
-
@click="${
|
|
283
|
+
aria-disabled="${a(n)}"
|
|
284
|
+
@click="${r&&!n?()=>this.toggleSection(o):i}"
|
|
273
285
|
>
|
|
274
|
-
${
|
|
286
|
+
${r?t`
|
|
275
287
|
<nr-icon
|
|
276
|
-
class="collapse-icon ${
|
|
288
|
+
class="collapse-icon ${c({"collapse-icon--expanded":s})}"
|
|
277
289
|
name="${this.getSectionIcon(e)}"
|
|
278
290
|
aria-hidden="true"
|
|
279
291
|
></nr-icon>
|
|
280
|
-
`:
|
|
292
|
+
`:i}
|
|
281
293
|
|
|
282
294
|
<span class="collapse-header-text">
|
|
283
295
|
${e.headerSlot?t`<slot name="${e.headerSlot}"></slot>`:t`<nr-label .size=${this.size}>${e.header}</nr-label>`}
|
|
@@ -287,12 +299,13 @@ class h extends d{getSection(e){return this.host.sections[e]}updateSection(e,o){
|
|
|
287
299
|
<div class="collapse-header-right" @click="${e=>e.stopPropagation()}">
|
|
288
300
|
${e.headerRightSlot?t`<slot name="${e.headerRightSlot}"></slot>`:e.headerRight}
|
|
289
301
|
</div>
|
|
290
|
-
`:
|
|
302
|
+
`:i}
|
|
291
303
|
</div>
|
|
292
304
|
|
|
293
305
|
<!-- Section Content -->
|
|
294
|
-
${
|
|
306
|
+
${s?t`
|
|
295
307
|
<div
|
|
308
|
+
part="item-content"
|
|
296
309
|
id="collapse-content-${o}"
|
|
297
310
|
class="collapse-content"
|
|
298
311
|
data-section-index="${o}"
|
|
@@ -303,6 +316,6 @@ class h extends d{getSection(e){return this.host.sections[e]}updateSection(e,o){
|
|
|
303
316
|
${e.contentSlot?t`<slot name="${e.contentSlot}"></slot>`:e.content}
|
|
304
317
|
</div>
|
|
305
318
|
</div>
|
|
306
|
-
`:
|
|
319
|
+
`:i}
|
|
307
320
|
</div>
|
|
308
|
-
`}};
|
|
321
|
+
`}};E.useShadowDom=!0,E.styles=l,$([s({type:Array})],E.prototype,"sections",void 0),$([s({type:String})],E.prototype,"size",void 0),$([s({type:String})],E.prototype,"variant",void 0),$([s({type:String})],E.prototype,"animation",void 0),$([s({type:Boolean})],E.prototype,"accordion",void 0),$([s({type:Boolean,attribute:"allow-multiple"})],E.prototype,"allowMultiple",void 0),$([s({type:Boolean})],E.prototype,"disabled",void 0),$([s({type:String,attribute:"expand-icon"})],E.prototype,"expandIcon",void 0),$([s({type:String,attribute:"collapse-icon"})],E.prototype,"collapseIcon",void 0),E=$([n("nr-collapse")],E);export{E as HyCollapse};
|
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement } from 'lit';
|
|
7
7
|
import { CollapseSection, CollapseSize, CollapseVariant, CollapseAnimation } from './collapse.type.js';
|
|
8
|
-
declare const HyCollapse_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;
|
|
8
|
+
declare const HyCollapse_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;
|
|
9
9
|
/**
|
|
10
10
|
* Versatile collapse/accordion component with multiple variants, animations, and accessibility features.
|
|
11
11
|
*
|
|
@@ -22,8 +22,14 @@ declare const HyCollapse_base: (new (...args: any[]) => import("@nuralyui/common
|
|
|
22
22
|
* @element nr-collapse
|
|
23
23
|
* @fires section-toggle - Fired when a section is toggled
|
|
24
24
|
* @fires section-before-toggle - Fired before a section is toggled (cancellable)
|
|
25
|
+
*
|
|
26
|
+
* @csspart container - The outermost collapse container div
|
|
27
|
+
* @csspart item - An individual collapse section wrapper
|
|
28
|
+
* @csspart item-header - The header/trigger element of a collapse section
|
|
29
|
+
* @csspart item-content - The collapsible content area of a section
|
|
25
30
|
*/
|
|
26
31
|
export declare class HyCollapse extends HyCollapse_base {
|
|
32
|
+
static useShadowDom: boolean;
|
|
27
33
|
static styles: import("lit").CSSResult;
|
|
28
34
|
requiredComponents: string[];
|
|
29
35
|
private animationController;
|