@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,9 +1,9 @@
|
|
|
1
|
-
import{css as t,
|
|
1
|
+
import{css as t,html as i,LitElement as e}from"lit";import{property as s,state as n,customElement as r}from"lit/decorators.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
|
-
*/const
|
|
6
|
+
*/const o=t`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
9
|
width: 100%;
|
|
@@ -18,7 +18,7 @@ import{css as t,LitElement as i,html as s}from"lit";import{property as e,state a
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
gap:
|
|
21
|
+
gap: 16px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.form-wrapper[disabled] {
|
|
@@ -60,7 +60,7 @@ import{css as t,LitElement as i,html as s}from"lit";import{property as e,state a
|
|
|
60
60
|
/* Responsive design */
|
|
61
61
|
@media (max-width: 768px) {
|
|
62
62
|
.form-wrapper {
|
|
63
|
-
gap:
|
|
63
|
+
gap: 12px;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
`
|
|
@@ -68,23 +68,35 @@ import{css as t,LitElement as i,html as s}from"lit";import{property as e,state a
|
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
70
70
|
* SPDX-License-Identifier: MIT
|
|
71
|
-
*/;var d
|
|
71
|
+
*/;var a,d;!function(t){t.Pristine="pristine",t.Pending="pending",t.Valid="valid",t.Invalid="invalid",t.Submitted="submitted"}(a||(a={})),function(t){t.Idle="idle",t.Submitting="submitting",t.Success="success",t.Error="error"}(d||(d={}));const h={VALIDATION_CHANGED:"nr-form-validation-changed",FIELD_CHANGED:"nr-form-field-changed",SUBMIT_ATTEMPT:"nr-form-submit-attempt",SUBMIT_SUCCESS:"nr-form-submit-success",SUBMIT_ERROR:"nr-form-submit-error",RESET:"nr-form-reset"},l=t=>class extends t{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 t,i,e;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.designSystemObserver)||void 0===i||i.disconnect(),null===(e=this.mediaQuery)||void 0===e||e.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const e=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return e||((null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const i=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===i?i:"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))}},c=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},u=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(c())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!c())return!0;let i=!0;for(const e of this.requiredComponents)if(!this.isComponentAvailable(e)){i=!1;const s=new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(e,s):console.error(s.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter(t=>!this.isComponentAvailable(t))}areDependenciesAvailable(){return this.requiredComponents.every(t=>this.isComponentAvailable(t))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},v=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var e;const s=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(e=this.tagName)||void 0===e?void 0:e.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,e)}dispatchFocusEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,e)}dispatchValidationEvent(t,i){var e;const s=Object.assign({target:i.target||this,value:i.value,isValid:null!==(e=i.isValid)&&void 0!==e&&e,error:i.error},i);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,i){const e=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,e)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},m=new Set,f=new Map;
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
75
75
|
* SPDX-License-Identifier: MIT
|
|
76
|
-
*/
|
|
76
|
+
*/
|
|
77
77
|
/**
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
80
80
|
* SPDX-License-Identifier: MIT
|
|
81
|
-
*/
|
|
81
|
+
*/
|
|
82
|
+
const p=t=>{class i extends t{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const t=this.constructor.useShadowDom;if(!t&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!t){const t=this.constructor,i=this.tagName.toLowerCase(),e=t.styles;if(e){const t=b(e);t&&function(t,i,e){var s;if(!f.has(t)){const e=new CSSStyleSheet;e.replaceSync(i),f.set(t,e)}const n=f.get(t),r=`doc:${t}`;if(m.has(r)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],m.add(r)),e){let i=e;for(;i;){const e=i.getRootNode();if(!(e instanceof ShadowRoot))break;{const r=`shadow:${((null===(s=e.host)||void 0===s?void 0:s.tagName)||"").toLowerCase()}:${t}`;m.has(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],m.add(r)),i=e.host}}}}(i,t,this)}}}get lightChildren(){return this.t?this.t.filter(t=>!(t instanceof Element&&t.hasAttribute("slot"))):[]}lightChildrenNamed(t){return this.t?this.t.filter(i=>i instanceof Element&&i.getAttribute("slot")===t):[]}}return i.useShadowDom=!1,i};function b(t){return Array.isArray(t)?t.map(t=>b(t)).filter(Boolean).join("\n"):t&&"string"==typeof t.cssText?t.cssText:"string"==typeof t?t:""}
|
|
82
83
|
/**
|
|
83
84
|
* @license
|
|
84
85
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
85
86
|
* SPDX-License-Identifier: MIT
|
|
86
|
-
*/var
|
|
87
|
-
|
|
87
|
+
*/var g=function(t,i,e,s){return new(e||(e=Promise))(function(n,r){function o(t){try{d(s.next(t))}catch(t){r(t)}}function a(t){try{d(s.throw(t))}catch(t){r(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(o,a)}d((s=s.apply(t,i||[])).next())})};class y{constructor(t){this.host=t,this.fields=new Map,this.validationState=a.Pristine,this.validationPromise=null}registerField(t){var i;const e=t.name||t.getAttribute("name")||`field-${Date.now()}`,s={element:t,name:e,value:t.value,isValid:t.getValidationStatus().isValid,validationMessage:t.validationMessage||"",required:null!==(i=t.required)&&void 0!==i&&i,touched:!1,dirty:!1};this.fields.set(e,s),this.addFieldListeners(t,e)}unregisterField(t){const i=this.fields.get(t);i&&(this.removeFieldListeners(i.element),this.fields.delete(t))}addFieldListeners(t,i){t.addEventListener("nr-validation",t=>this.handleFieldValidation(i,t))}removeFieldListeners(t){}handleFieldValidation(t,i){const e=this.fields.get(t);if(e){if(i&&i.detail)e.isValid=i.detail.isValid||!1,e.validationMessage=i.detail.validationMessage||"";else{const t=e.element.getValidationStatus();e.isValid=t.isValid,e.validationMessage=e.element.validationMessage||""}this.updateFormValidationState()}}updateFormValidationState(){const t=this.getInvalidFields(),i=0===t.length;this.validationState=i?a.Valid:a.Invalid;const e={isValid:i,invalidFields:t,validationErrors:this.buildValidationErrors(),summary:i?"Form is valid":`${t.length} field(s) have errors`};this.dispatchValidationEvent(e)}buildValidationErrors(){const t={};for(const[i,e]of this.fields)!e.isValid&&e.validationMessage&&(t[i]=e.validationMessage);return t}validateForm(){return null!==this.validationPromise||(this.validationState=a.Pending,this.validationPromise=this.performValidation()),this.validationPromise}performValidation(){return g(this,void 0,void 0,function*(){const t=[],i={};for(const[e,s]of this.fields){const n=s.element.getValidationStatus().isValid;s.isValid=n,s.validationMessage=s.element.validationMessage||"",n||(t.push(s),i[e]=s.validationMessage)}const e=0===t.length;this.validationState=e?a.Valid:a.Invalid;const s={isValid:e,invalidFields:t,validationErrors:i,summary:e?"Form is valid":`${t.length} field(s) have errors`};return this.dispatchValidationEvent(s),this.validationPromise=null,s})}getValidationState(){return this.validationState}getFields(){return Array.from(this.fields.values())}getInvalidFields(){return Array.from(this.fields.values()).filter(t=>!t.isValid)}isValid(){return this.validationState===a.Valid&&Array.from(this.fields.values()).every(t=>t.isValid)}focusFirstInvalidField(){const t=Array.from(this.fields.values()).find(t=>!t.isValid);return!(!t||"function"!=typeof t.element.focus)&&(t.element.focus(),!0)}reset(){for(const t of this.fields.values())"clearValidation"in t.element&&"function"==typeof t.element.clearValidation&&t.element.clearValidation(),"value"in t.element&&(t.element.value=""),t.touched=!1,t.dirty=!1,t.isValid=!0,t.validationMessage="";this.validationState=a.Pristine,this.dispatchResetEvent()}dispatchValidationEvent(t){var i,e;null===(e=(i=this.host).dispatchCustomEvent)||void 0===e||e.call(i,h.VALIDATION_CHANGED,{validationResult:t})}dispatchResetEvent(){var t,i;null===(i=(t=this.host).dispatchCustomEvent)||void 0===i||i.call(t,h.RESET,{})}}
|
|
88
|
+
/**
|
|
89
|
+
* @license
|
|
90
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
91
|
+
* SPDX-License-Identifier: MIT
|
|
92
|
+
*/var w=function(t,i,e,s){return new(e||(e=Promise))(function(n,r){function o(t){try{d(s.next(t))}catch(t){r(t)}}function a(t){try{d(s.throw(t))}catch(t){r(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(o,a)}d((s=s.apply(t,i||[])).next())})};class F{constructor(t){this.host=t,this.submissionState=d.Idle,this.lastSubmissionData=null}getSubmissionState(){return this.submissionState}isSubmitting(){return this.submissionState===d.Submitting}collectFormData(){const t=new FormData,i={},e={};return this.getFormFields().forEach(s=>{const n=s.name||s.getAttribute("name");if(!n)return;const r=s.value;null!=r&&t.append(n,String(r)),i[n]=r,e[n]={element:s,value:r,name:n,type:s.tagName.toLowerCase(),required:s.required||!1,disabled:s.disabled||!1}}),{formData:t,jsonData:i,fields:e}}submitForm(t){return w(this,void 0,void 0,function*(){if(this.isSubmitting())throw new Error("Form is already submitting");try{this.setSubmissionState(d.Submitting);const i=this.host.validationController;if(i){const t=yield i.validateForm();if(!t.isValid)throw i.focusFirstInvalidField(),this.dispatchSubmitAttemptEvent(t),new Error(`Form validation failed: ${t.summary}`)}const e=this.collectFormData();return t&&(Object.assign(e.jsonData,t),Object.entries(t).forEach(([t,i])=>{e.formData.append(t,String(i))})),this.lastSubmissionData=e,this.dispatchSubmitSuccessEvent(e),this.setSubmissionState(d.Success),e}catch(t){throw this.setSubmissionState(d.Error),this.dispatchSubmitErrorEvent(t),t}})}resetSubmission(){this.submissionState=d.Idle,this.lastSubmissionData=null}getLastSubmissionData(){return this.lastSubmissionData}getFormFields(){var t;const i=this.host,e=[],s=["nr-input","nr-select","nr-radio","nr-checkbox","nr-textarea","nr-timepicker","nr-datepicker","input","select","textarea"];s.forEach(t=>{i.querySelectorAll(t).forEach(t=>{(t.name||t.getAttribute("name"))&&e.push(t)})});return((null===(t=i.shadowRoot)||void 0===t?void 0:t.querySelectorAll("slot"))||[]).forEach(t=>{t.assignedElements({flatten:!0}).forEach(t=>{s.forEach(i=>{if(t.matches&&t.matches(i)){const i=t;(i.name||i.getAttribute("name"))&&e.push(i)}t.querySelectorAll(i).forEach(t=>{const i=t;(i.name||i.getAttribute("name"))&&e.push(i)})})})}),e}setSubmissionState(t){var i,e;this.submissionState=t,null===(e=(i=this.host).requestUpdate)||void 0===e||e.call(i)}dispatchSubmitAttemptEvent(t){var i,e;null===(e=(i=this.host).dispatchCustomEvent)||void 0===e||e.call(i,h.SUBMIT_ATTEMPT,{validationResult:t})}dispatchSubmitSuccessEvent(t){var i,e;null===(e=(i=this.host).dispatchCustomEvent)||void 0===e||e.call(i,h.SUBMIT_SUCCESS,{formData:t})}dispatchSubmitErrorEvent(t){var i,e;null===(e=(i=this.host).dispatchCustomEvent)||void 0===e||e.call(i,h.SUBMIT_ERROR,{error:t})}}
|
|
93
|
+
/**
|
|
94
|
+
* @license
|
|
95
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
96
|
+
* SPDX-License-Identifier: MIT
|
|
97
|
+
*/var S=function(t,i,e,s){for(var n,r=arguments.length,o=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(i,e,o):n(i,e))||o);return r>3&&o&&Object.defineProperty(i,e,o),o},E=function(t,i,e,s){return new(e||(e=Promise))(function(n,r){function o(t){try{d(s.next(t))}catch(t){r(t)}}function a(t){try{d(s.throw(t))}catch(t){r(t)}}function d(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(o,a)}d((s=s.apply(t,i||[])).next())})};let O=class extends((t=>u(l(v(p(t)))))(e)){constructor(){super(...arguments),this.config={validateOnChange:!1,validateOnBlur:!0,showErrorsImmediately:!1,preventInvalidSubmission:!0,resetOnSuccess:!1,validationDelay:300},this.validateOnChange=!1,this.validateOnBlur=!0,this.preventInvalidSubmission=!0,this.resetOnSuccess=!1,this.method="POST",this.enctype="multipart/form-data",this.disabled=!1,this._validationState=a.Pristine,this._submissionState=d.Idle,this.validationController=new y(this),this.submissionController=new F(this),this.handleValidationChanged=t=>{const i=t.detail.validationResult;i&&(this._validationState=i.isValid?a.Valid:a.Invalid)}}get validationState(){return this._validationState}get submissionState(){return this._submissionState}connectedCallback(){super.connectedCallback(),this.setupFormObserver()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupFormObserver()}willUpdate(t){super.willUpdate(t),(t.has("validateOnChange")||t.has("validateOnBlur")||t.has("preventInvalidSubmission")||t.has("resetOnSuccess"))&&(this.config=Object.assign(Object.assign({},this.config),{validateOnChange:this.validateOnChange,validateOnBlur:this.validateOnBlur,preventInvalidSubmission:this.preventInvalidSubmission,resetOnSuccess:this.resetOnSuccess}))}firstUpdated(){this.registerExistingFields(),this.setupFormEvents()}setupFormObserver(){const t=new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&this.registerFieldsInElement(t)})})});t.observe(this,{childList:!0,subtree:!0}),this._formObserver=t}cleanupFormObserver(){const t=this._formObserver;t&&t.disconnect()}registerExistingFields(){this.registerFieldsInElement(this)}registerFieldsInElement(t){["nr-input","nr-select","nr-radio","nr-checkbox","nr-textarea","nr-timepicker","nr-datepicker"].forEach(i=>{t.querySelectorAll(i).forEach(t=>{t.getAttribute("name")&&this.validationController.registerField(t)})})}setupFormEvents(){this.addEventListener("submit",this.handleFormSubmit),this.addEventListener("reset",this.handleFormReset),this.addEventListener(h.VALIDATION_CHANGED,this.handleValidationChanged)}handleFormSubmit(t){return E(this,void 0,void 0,function*(){if(t.preventDefault(),!this.disabled)try{const t=yield this.submissionController.submitForm();this.resetOnSuccess&&this.reset(),this.action&&this.performNativeSubmission(t.formData)}catch(t){console.error("Form submission failed:",t)}})}handleFormReset(t){t.preventDefault(),this.reset()}performNativeSubmission(t){const i=document.createElement("form");i.action=this.action,i.method=this.method,i.enctype=this.enctype,this.target&&(i.target=this.target);for(const[e,s]of t.entries()){const t=document.createElement("input");t.type="hidden",t.name=e,t.value=s,i.appendChild(t)}document.body.appendChild(i),i.submit(),document.body.removeChild(i)}validate(){return E(this,void 0,void 0,function*(){return(yield this.validationController.validateForm()).isValid})}submit(t){return E(this,void 0,void 0,function*(){yield this.submissionController.submitForm(t)})}reset(){this.validationController.reset(),this.submissionController.resetSubmission(),this._validationState=a.Pristine,this._submissionState=d.Idle}get isValid(){return this.validationController.isValid()}get isSubmitting(){return this.submissionController.isSubmitting()}getFormData(){return this.submissionController.collectFormData()}getInvalidFields(){return this.validationController.getInvalidFields()}getFieldsValue(t){const i=this.getFormData().jsonData;if(t&&t.length>0){const e={};return t.forEach(t=>{t in i&&(e[t]=i[t])}),e}return i}getFieldValue(t){return this.getFieldsValue()[t]}setFieldsValue(t){Object.entries(t).forEach(([t,i])=>{this.setFieldValue(t,i)})}setFieldValue(t,i){const e=this.validationController.getFields().find(i=>i.name===t);e&&e.element&&(e.element.value=i,e.value=i,e.element.dispatchEvent(new Event("change",{bubbles:!0})))}validateFields(t){return E(this,void 0,void 0,function*(){const i=yield this.validationController.validateForm();if(t&&t.length>0){const e={};if(t.forEach(t=>{i.validationErrors[t]&&(e[t]=i.validationErrors[t])}),Object.keys(e).length>0)throw new Error(JSON.stringify(e));return this.getFieldsValue(t)}if(!i.isValid)throw new Error(JSON.stringify(i.validationErrors));return this.getFieldsValue()})}resetFields(t){if(!t||0===t.length)return void this.reset();const i=this.validationController.getFields();t.forEach(t=>{const e=i.find(i=>i.name===t);e&&e.element&&(e.element.value="",e.value="",e.touched=!1,e.dirty=!1,e.isValid=!0,e.validationMessage="",e.element.dispatchEvent(new Event("change",{bubbles:!0})))})}getFieldError(t){const i=this.validationController.getFields().find(i=>i.name===t);return i&&!i.isValid?i.validationMessage:null}getFieldsError(t){const i=this.validationController.getFields(),e={};return(t?i.filter(i=>t.includes(i.name)):i).forEach(t=>{e[t.name]=t.isValid?null:t.validationMessage}),e}isFieldTouched(t){const i=this.validationController.getFields().find(i=>i.name===t);return!!i&&i.touched}isFieldsTouched(t){const i=this.validationController.getFields();return(t?i.filter(i=>t.includes(i.name)):i).some(t=>t.touched)}isFieldDirty(t){const i=this.validationController.getFields().find(i=>i.name===t);return!!i&&i.dirty}isFieldsDirty(t){const i=this.validationController.getFields();return(t?i.filter(i=>t.includes(i.name)):i).some(t=>t.dirty)}getFieldInstance(t){const i=this.validationController.getFields().find(i=>i.name===t);return i?i.element:null}scrollToField(t){if(t){const i=this.getFieldInstance(t);return!!i&&(i.scrollIntoView({behavior:"smooth",block:"center"}),"function"==typeof i.focus&&i.focus(),!0)}return this.validationController.focusFirstInvalidField()}finish(){return E(this,void 0,void 0,function*(){try{const t=yield this.validateFields();return yield this.submit(),t}catch(t){throw this.scrollToField(),t}})}getFieldsWithErrors(){return this.validationController.getFields().filter(t=>!t.isValid).map(t=>t.name)}hasErrors(){return this.getFieldsWithErrors().length>0}getFormState(){const t=this.validationController.getFields();return{isValid:this.isValid,isSubmitting:this.isSubmitting,hasErrors:this.hasErrors(),errorCount:this.getFieldsWithErrors().length,fieldCount:t.length,touchedFields:t.filter(t=>t.touched).map(t=>t.name),dirtyFields:t.filter(t=>t.dirty).map(t=>t.name),invalidFields:this.getFieldsWithErrors()}}setLoading(t){this.disabled=t,this.requestUpdate()}render(){return i`
|
|
98
|
+
<form
|
|
99
|
+
part="form"
|
|
88
100
|
action="${this.action||""}"
|
|
89
101
|
method="${this.method.toLowerCase()}"
|
|
90
102
|
enctype="${this.enctype}"
|
|
@@ -95,4 +107,4 @@ import{css as t,LitElement as i,html as s}from"lit";import{property as e,state a
|
|
|
95
107
|
>
|
|
96
108
|
<slot></slot>
|
|
97
109
|
</form>
|
|
98
|
-
`}};
|
|
110
|
+
`}};O.useShadowDom=!0,O.styles=o,S([s({type:Object})],O.prototype,"config",void 0),S([s({type:Boolean,attribute:"validate-on-change"})],O.prototype,"validateOnChange",void 0),S([s({type:Boolean,attribute:"validate-on-blur"})],O.prototype,"validateOnBlur",void 0),S([s({type:Boolean,attribute:"prevent-invalid-submission"})],O.prototype,"preventInvalidSubmission",void 0),S([s({type:Boolean,attribute:"reset-on-success"})],O.prototype,"resetOnSuccess",void 0),S([s({type:String})],O.prototype,"action",void 0),S([s({type:String})],O.prototype,"method",void 0),S([s({type:String,attribute:"enctype"})],O.prototype,"enctype",void 0),S([s({type:String})],O.prototype,"target",void 0),S([s({type:Boolean,reflect:!0})],O.prototype,"disabled",void 0),S([n()],O.prototype,"_validationState",void 0),S([n()],O.prototype,"_submissionState",void 0),O=S([r("nr-form")],O);export{h as FORM_EVENTS,F as FormSubmissionController,d as FormSubmissionState,y as FormValidationController,a as FormValidationState,O as NrFormElement};
|
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement, type PropertyValues } from 'lit';
|
|
7
7
|
import { FormConfig, FormValidationState, FormSubmissionState } from './form.types.js';
|
|
8
|
-
declare const NrFormElement_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 NrFormElement_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
|
* Comprehensive form component with field management and validation API
|
|
11
11
|
*
|
|
@@ -56,8 +56,11 @@ declare const NrFormElement_base: (new (...args: any[]) => import("@nuralyui/com
|
|
|
56
56
|
* @fires nr-form-reset - Form was reset
|
|
57
57
|
*
|
|
58
58
|
* @slot default - Form content (inputs, buttons, etc.)
|
|
59
|
+
*
|
|
60
|
+
* @csspart form - The inner native form element
|
|
59
61
|
*/
|
|
60
62
|
export declare class NrFormElement extends NrFormElement_base {
|
|
63
|
+
static useShadowDom: boolean;
|
|
61
64
|
static styles: import("lit").CSSResult;
|
|
62
65
|
/** Form configuration */
|
|
63
66
|
config: FormConfig;
|
|
@@ -75,6 +75,8 @@ import { FormSubmissionController } from './controllers/submission.controller.js
|
|
|
75
75
|
* @fires nr-form-reset - Form was reset
|
|
76
76
|
*
|
|
77
77
|
* @slot default - Form content (inputs, buttons, etc.)
|
|
78
|
+
*
|
|
79
|
+
* @csspart form - The inner native form element
|
|
78
80
|
*/
|
|
79
81
|
let NrFormElement = class NrFormElement extends NuralyUIBaseMixin(LitElement) {
|
|
80
82
|
constructor() {
|
|
@@ -586,7 +588,8 @@ let NrFormElement = class NrFormElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
586
588
|
}
|
|
587
589
|
render() {
|
|
588
590
|
return html `
|
|
589
|
-
<form
|
|
591
|
+
<form
|
|
592
|
+
part="form"
|
|
590
593
|
action="${this.action || ''}"
|
|
591
594
|
method="${this.method.toLowerCase()}"
|
|
592
595
|
enctype="${this.enctype}"
|
|
@@ -600,6 +603,7 @@ let NrFormElement = class NrFormElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
600
603
|
`;
|
|
601
604
|
}
|
|
602
605
|
};
|
|
606
|
+
NrFormElement.useShadowDom = true;
|
|
603
607
|
NrFormElement.styles = styles;
|
|
604
608
|
__decorate([
|
|
605
609
|
property({ type: Object })
|
|
@@ -19,7 +19,7 @@ export const styles = css `
|
|
|
19
19
|
width: 100%;
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
gap:
|
|
22
|
+
gap: 16px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.form-wrapper[disabled] {
|
|
@@ -61,7 +61,7 @@ export const styles = css `
|
|
|
61
61
|
/* Responsive design */
|
|
62
62
|
@media (max-width: 768px) {
|
|
63
63
|
.form-wrapper {
|
|
64
|
-
gap:
|
|
64
|
+
gap: 12px;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as t,
|
|
1
|
+
import{css as t,html as e,LitElement as s}from"lit";import{property as a,state as o,customElement as i}from"lit/decorators.js";const r=t`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: 100%;
|
|
@@ -8,9 +8,9 @@ import{css as t,LitElement as a,html as s}from"lit";import{property as e,state a
|
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-flow: row wrap;
|
|
10
10
|
min-width: 0;
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
/* Theme-aware */
|
|
13
|
-
color:
|
|
13
|
+
color: #161616;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* Wrap control */
|
|
@@ -59,25 +59,36 @@ import{css as t,LitElement as a,html as s}from"lit";import{property as e,state a
|
|
|
59
59
|
.nr-row[data-align="stretch"] {
|
|
60
60
|
align-items: stretch;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
`
|
|
63
|
+
/**
|
|
64
|
+
* @license
|
|
65
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
66
|
+
* SPDX-License-Identifier: MIT
|
|
67
|
+
*/,n=t=>class extends t{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 t,e,s;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(s=this.mediaQuery)||void 0===s||s.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,e;const s=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return s||((null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"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))}},d=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},h=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(d())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!d())return!0;let e=!0;for(const s of this.requiredComponents)if(!this.isComponentAvailable(s)){e=!1;const a=new Error(`Required component "${s}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(s,a):console.error(a.message)}return e}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter(t=>!this.isComponentAvailable(t))}areDependenciesAvailable(){return this.requiredComponents.every(t=>this.isComponentAvailable(t))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const e=this.requiredComponents.indexOf(t);e>-1&&this.requiredComponents.splice(e,1)}},l=t=>class extends t{dispatchCustomEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,e){var s;const a=Object.assign(Object.assign({},e),{timestamp:Date.now(),componentName:(null===(s=this.tagName)||void 0===s?void 0:s.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,a)}dispatchInputEvent(t,e){const s=Object.assign({target:e.target||this,value:e.value,originalEvent:e.originalEvent},e);this.dispatchCustomEvent(t,s)}dispatchFocusEvent(t,e){const s=Object.assign({target:e.target||this,value:e.value,focused:e.focused,cursorPosition:e.cursorPosition,selectedText:e.selectedText},e);this.dispatchCustomEvent(t,s)}dispatchValidationEvent(t,e){var s;const a=Object.assign({target:e.target||this,value:e.value,isValid:null!==(s=e.isValid)&&void 0!==s&&s,error:e.error},e);this.dispatchCustomEvent(t,a)}dispatchActionEvent(t,e){const s=Object.assign({target:e.target||this,action:e.action,previousValue:e.previousValue,newValue:e.newValue},e);this.dispatchCustomEvent(t,s)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},u=new Set,f=new Map;
|
|
63
68
|
/**
|
|
64
69
|
* @license
|
|
65
70
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
66
71
|
* SPDX-License-Identifier: MIT
|
|
67
72
|
*/
|
|
68
|
-
|
|
73
|
+
const p=t=>{class e extends t{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const t=this.constructor.useShadowDom;if(!t&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!t){const t=this.constructor,e=this.tagName.toLowerCase(),s=t.styles;if(s){const t=m(s);t&&function(t,e,s){var a;if(!f.has(t)){const s=new CSSStyleSheet;s.replaceSync(e),f.set(t,s)}const o=f.get(t),i=`doc:${t}`;if(u.has(i)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,o],u.add(i)),s){let e=s;for(;e;){const s=e.getRootNode();if(!(s instanceof ShadowRoot))break;{const i=`shadow:${((null===(a=s.host)||void 0===a?void 0:a.tagName)||"").toLowerCase()}:${t}`;u.has(i)||(s.adoptedStyleSheets=[...s.adoptedStyleSheets,o],u.add(i)),e=s.host}}}}(e,t,this)}}}get lightChildren(){return this.t?this.t.filter(t=>!(t instanceof Element&&t.hasAttribute("slot"))):[]}lightChildrenNamed(t){return this.t?this.t.filter(e=>e instanceof Element&&e.getAttribute("slot")===t):[]}}return e.useShadowDom=!1,e},c=t=>h(n(l(p(t))));function m(t){return Array.isArray(t)?t.map(t=>m(t)).filter(Boolean).join("\n"):t&&"string"==typeof t.cssText?t.cssText:"string"==typeof t?t:""}const g="",x={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1600};
|
|
74
|
+
/**
|
|
75
|
+
* @license
|
|
76
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
77
|
+
* SPDX-License-Identifier: MIT
|
|
78
|
+
*/
|
|
79
|
+
var v=function(t,e,s,a){for(var o,i=arguments.length,r=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,s):a,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i<3?o(r):i>3?o(e,s,r):o(e,s))||r);return i>3&&r&&Object.defineProperty(e,s,r),r};let w=class extends(c(s)){constructor(){super(...arguments),this.align="",this.justify="",this.gutter=0,this.wrap=!0,this.currentBreakpoint="xs"}connectedCallback(){super.connectedCallback(),this.setupResponsiveGutter()}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}setupResponsiveGutter(){"object"!=typeof this.gutter||Array.isArray(this.gutter)||(this.updateBreakpoint(),this.resizeObserver=new ResizeObserver(()=>{this.updateBreakpoint()}),this.resizeObserver.observe(document.documentElement))}updateBreakpoint(){const t=window.innerWidth;this.currentBreakpoint=t>=x.xxl?"xxl":t>=x.xl?"xl":t>=x.lg?"lg":t>=x.md?"md":t>=x.sm?"sm":"xs"}getGutterValues(){if("number"==typeof this.gutter)return[this.gutter,this.gutter];if(Array.isArray(this.gutter))return this.gutter;const t=[this.currentBreakpoint,"xl","lg","md","sm","xs"];for(const e of t){const t=this.gutter[e];if(void 0!==t)return"number"==typeof t?[t,t]:t}return[0,0]}getRowStyle(){const[t,e]=this.getGutterValues(),s={};return t>0&&(s["margin-left"]=`-${t/2}px`,s["margin-right"]=`-${t/2}px`),e>0&&(s["row-gap"]=`${e}px`),s}getGutterContext(){const[t]=this.getGutterValues();return t}render(){const t=this.getRowStyle(),s=this.getGutterContext();return e`
|
|
69
80
|
<div
|
|
81
|
+
part="row"
|
|
70
82
|
class="nr-row"
|
|
71
83
|
data-align="${this.align}"
|
|
72
84
|
data-justify="${this.justify}"
|
|
73
85
|
data-wrap="${this.wrap}"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
data-gutter="${a}"
|
|
86
|
+
style="${Object.entries(t).map(([t,e])=>`${t}: ${e}`).join("; ")}"
|
|
87
|
+
data-gutter="${s}"
|
|
77
88
|
>
|
|
78
89
|
<slot></slot>
|
|
79
90
|
</div>
|
|
80
|
-
`}};
|
|
91
|
+
`}};w.styles=r,w.useShadowDom=!0,v([a({type:String})],w.prototype,"align",void 0),v([a({type:String})],w.prototype,"justify",void 0),v([a({type:Object})],w.prototype,"gutter",void 0),v([a({type:Boolean})],w.prototype,"wrap",void 0),v([o()],w.prototype,"currentBreakpoint",void 0),w=v([i("nr-row")],w);const y=t`
|
|
81
92
|
:host {
|
|
82
93
|
display: block;
|
|
83
94
|
box-sizing: border-box;
|
|
@@ -89,9 +100,9 @@ var l=function(t,a,s,e){for(var o,r=arguments.length,i=r<3?a:null===e?e=Object.g
|
|
|
89
100
|
box-sizing: border-box;
|
|
90
101
|
width: 100%;
|
|
91
102
|
height: 100%;
|
|
92
|
-
|
|
103
|
+
|
|
93
104
|
/* Theme-aware */
|
|
94
|
-
color:
|
|
105
|
+
color: #161616;
|
|
95
106
|
}
|
|
96
107
|
|
|
97
108
|
/* Column spans (1-24) - Apply flex to :host */
|
|
@@ -192,11 +203,12 @@ var l=function(t,a,s,e){for(var o,r=arguments.length,i=r<3?a:null===e?e=Object.g
|
|
|
192
203
|
* @license
|
|
193
204
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
194
205
|
* SPDX-License-Identifier: MIT
|
|
195
|
-
*/;var
|
|
206
|
+
*/;var b=function(t,e,s,a){for(var o,i=arguments.length,r=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,s):a,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i<3?o(r):i>3?o(e,s,r):o(e,s))||r);return i>3&&r&&Object.defineProperty(e,s,r),r};let j=class extends(c(s)){constructor(){super(...arguments),this.offset=0,this.pull=0,this.push=0,this.flex="",this.currentBreakpoint="xs"}connectedCallback(){super.connectedCallback(),this.setupResponsive()}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}setupResponsive(){this.updateBreakpoint(),this.resizeObserver=new ResizeObserver(()=>{this.updateBreakpoint()}),this.resizeObserver.observe(document.documentElement)}updateBreakpoint(){const t=window.innerWidth;let e;e=t>=x.xxl?"xxl":t>=x.xl?"xl":t>=x.lg?"lg":t>=x.md?"md":t>=x.sm?"sm":"xs",e!==this.currentBreakpoint&&(this.currentBreakpoint=e)}getResponsiveConfig(){const t=[this.currentBreakpoint,"xl","lg","md","sm","xs"];for(const e of t){const t=this[e];if(void 0!==t)return"number"==typeof t?{span:t}:t}return{}}getColProperties(){var t,e,s,a,o;const i=this.getResponsiveConfig();return{span:null!==(t=i.span)&&void 0!==t?t:this.span,offset:null!==(e=i.offset)&&void 0!==e?e:this.offset,order:null!==(s=i.order)&&void 0!==s?s:this.order,pull:null!==(a=i.pull)&&void 0!==a?a:this.pull,push:null!==(o=i.push)&&void 0!==o?o:this.push}}getGutterFromParent(){const t=this.closest("nr-row");if(t){const e=t.getAttribute("data-gutter");return e?Number.parseInt(e,10):0}return 0}getColStyle(){const t={},e=this.getGutterFromParent();return e>0&&(t["padding-left"]=e/2+"px",t["padding-right"]=e/2+"px"),this.flex&&("auto"===this.flex?t.flex="1 1 auto":"none"===this.flex?t.flex="0 0 auto":"number"==typeof this.flex?t.flex=`${this.flex} ${this.flex} auto`:t.flex=this.flex),t}render(){var t;const s=this.getColStyle(),a=this.getColProperties();return this.setAttribute("data-span",(null===(t=a.span)||void 0===t?void 0:t.toString())||""),this.setAttribute("data-offset",a.offset.toString()),void 0!==a.order?this.setAttribute("data-order",a.order.toString()):this.removeAttribute("data-order"),this.setAttribute("data-pull",a.pull.toString()),this.setAttribute("data-push",a.push.toString()),e`
|
|
196
207
|
<div
|
|
208
|
+
part="col"
|
|
197
209
|
class="nr-col"
|
|
198
|
-
style="${Object.entries(
|
|
210
|
+
style="${Object.entries(s).map(([t,e])=>`${t}: ${e}`).join("; ")}"
|
|
199
211
|
>
|
|
200
212
|
<slot></slot>
|
|
201
213
|
</div>
|
|
202
|
-
`}};
|
|
214
|
+
`}};j.styles=y,j.useShadowDom=!0,b([a({type:Number})],j.prototype,"span",void 0),b([a({type:Number})],j.prototype,"offset",void 0),b([a({type:Number})],j.prototype,"order",void 0),b([a({type:Number})],j.prototype,"pull",void 0),b([a({type:Number})],j.prototype,"push",void 0),b([a({type:String})],j.prototype,"flex",void 0),b([a({type:Object})],j.prototype,"xs",void 0),b([a({type:Object})],j.prototype,"sm",void 0),b([a({type:Object})],j.prototype,"md",void 0),b([a({type:Object})],j.prototype,"lg",void 0),b([a({type:Object})],j.prototype,"xl",void 0),b([a({type:Object})],j.prototype,"xxl",void 0),b([o()],j.prototype,"currentBreakpoint",void 0),j=b([i("nr-col")],j);export{x as BREAKPOINTS,g as EMPTY_STRING,j as NrColElement,w as NrRowElement};
|
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement } from 'lit';
|
|
7
7
|
import { ColSize, FlexType } from './grid.types.js';
|
|
8
|
-
declare const NrColElement_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 NrColElement_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
|
* Column component for grid layout system
|
|
11
11
|
*
|
|
@@ -36,9 +36,12 @@ declare const NrColElement_base: (new (...args: any[]) => import("@nuralyui/comm
|
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
38
|
* @slot default - Column content
|
|
39
|
+
*
|
|
40
|
+
* @csspart col - The inner div applying column width, offset, and gutter padding
|
|
39
41
|
*/
|
|
40
42
|
export declare class NrColElement extends NrColElement_base {
|
|
41
43
|
static styles: import("lit").CSSResult;
|
|
44
|
+
static useShadowDom: boolean;
|
|
42
45
|
/** Number of columns to span (out of 24) */
|
|
43
46
|
span?: number;
|
|
44
47
|
/** Number of columns to offset */
|
|
@@ -44,6 +44,8 @@ import { BREAKPOINTS, EMPTY_STRING } from './grid.types.js';
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* @slot default - Column content
|
|
47
|
+
*
|
|
48
|
+
* @csspart col - The inner div applying column width, offset, and gutter padding
|
|
47
49
|
*/
|
|
48
50
|
let NrColElement = class NrColElement extends NuralyUIBaseMixin(LitElement) {
|
|
49
51
|
constructor() {
|
|
@@ -195,9 +197,9 @@ let NrColElement = class NrColElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
195
197
|
}
|
|
196
198
|
this.setAttribute('data-pull', props.pull.toString());
|
|
197
199
|
this.setAttribute('data-push', props.push.toString());
|
|
198
|
-
this.setAttribute('data-theme', this.currentTheme);
|
|
199
200
|
return html `
|
|
200
201
|
<div
|
|
202
|
+
part="col"
|
|
201
203
|
class="nr-col"
|
|
202
204
|
style="${Object.entries(colStyle).map(([key, value]) => `${key}: ${value}`).join('; ')}"
|
|
203
205
|
>
|
|
@@ -207,6 +209,7 @@ let NrColElement = class NrColElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
207
209
|
}
|
|
208
210
|
};
|
|
209
211
|
NrColElement.styles = styles;
|
|
212
|
+
NrColElement.useShadowDom = true;
|
|
210
213
|
__decorate([
|
|
211
214
|
property({ type: Number })
|
|
212
215
|
], NrColElement.prototype, "span", void 0);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement } from 'lit';
|
|
7
7
|
import { RowAlign, RowJustify, Gutter } from './grid.types.js';
|
|
8
|
-
declare const NrRowElement_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 NrRowElement_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
|
* Row component for grid layout system
|
|
11
11
|
*
|
|
@@ -36,9 +36,12 @@ declare const NrRowElement_base: (new (...args: any[]) => import("@nuralyui/comm
|
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
38
|
* @slot default - Column elements
|
|
39
|
+
*
|
|
40
|
+
* @csspart row - The inner div applying the grid row styles, gutter margins, and alignment
|
|
39
41
|
*/
|
|
40
42
|
export declare class NrRowElement extends NrRowElement_base {
|
|
41
43
|
static styles: import("lit").CSSResult;
|
|
44
|
+
static useShadowDom: boolean;
|
|
42
45
|
/** Vertical alignment of columns */
|
|
43
46
|
align: RowAlign | '';
|
|
44
47
|
/** Horizontal alignment of columns */
|
|
@@ -44,6 +44,8 @@ import { EMPTY_STRING, BREAKPOINTS } from './grid.types.js';
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* @slot default - Column elements
|
|
47
|
+
*
|
|
48
|
+
* @csspart row - The inner div applying the grid row styles, gutter margins, and alignment
|
|
47
49
|
*/
|
|
48
50
|
let NrRowElement = class NrRowElement extends NuralyUIBaseMixin(LitElement) {
|
|
49
51
|
constructor() {
|
|
@@ -161,11 +163,11 @@ let NrRowElement = class NrRowElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
161
163
|
const gutter = this.getGutterContext();
|
|
162
164
|
return html `
|
|
163
165
|
<div
|
|
166
|
+
part="row"
|
|
164
167
|
class="nr-row"
|
|
165
168
|
data-align="${this.align}"
|
|
166
169
|
data-justify="${this.justify}"
|
|
167
170
|
data-wrap="${this.wrap}"
|
|
168
|
-
data-theme="${this.currentTheme}"
|
|
169
171
|
style="${Object.entries(rowStyle).map(([key, value]) => `${key}: ${value}`).join('; ')}"
|
|
170
172
|
data-gutter="${gutter}"
|
|
171
173
|
>
|
|
@@ -175,6 +177,7 @@ let NrRowElement = class NrRowElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
175
177
|
}
|
|
176
178
|
};
|
|
177
179
|
NrRowElement.styles = styles;
|
|
180
|
+
NrRowElement.useShadowDom = true;
|
|
178
181
|
__decorate([
|
|
179
182
|
property({ type: String })
|
|
180
183
|
], NrRowElement.prototype, "align", void 0);
|