snice 2.1.4 → 2.2.0
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/components/accordion/snice-accordion-item.d.ts +25 -0
- package/dist/components/accordion/snice-accordion-item.js +255 -0
- package/dist/components/accordion/snice-accordion-item.js.map +1 -0
- package/dist/components/accordion/snice-accordion.d.ts +28 -0
- package/dist/components/accordion/snice-accordion.js +206 -0
- package/dist/components/accordion/snice-accordion.js.map +1 -0
- package/dist/components/accordion/snice-accordion.types.d.ts +29 -0
- package/dist/components/alert/snice-alert.d.ts +26 -0
- package/dist/components/alert/snice-alert.js +180 -0
- package/dist/components/alert/snice-alert.js.map +1 -0
- package/{components/alert/snice-alert.types.ts → dist/components/alert/snice-alert.types.d.ts} +8 -9
- package/dist/components/avatar/snice-avatar.d.ts +24 -0
- package/dist/components/avatar/snice-avatar.js +180 -0
- package/dist/components/avatar/snice-avatar.js.map +1 -0
- package/dist/components/avatar/snice-avatar.types.d.ts +12 -0
- package/dist/components/badge/snice-badge.d.ts +25 -0
- package/dist/components/badge/snice-badge.js +169 -0
- package/dist/components/badge/snice-badge.js.map +1 -0
- package/{components/badge/snice-badge.types.ts → dist/components/badge/snice-badge.types.d.ts} +11 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +27 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +214 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.d.ts +23 -0
- package/dist/components/breadcrumbs/snice-crumb.d.ts +9 -0
- package/dist/components/breadcrumbs/snice-crumb.js +63 -0
- package/dist/components/breadcrumbs/snice-crumb.js.map +1 -0
- package/dist/components/button/snice-button.d.ts +32 -0
- package/dist/components/button/snice-button.js +232 -0
- package/dist/components/button/snice-button.js.map +1 -0
- package/dist/components/button/snice-button.types.d.ts +23 -0
- package/dist/components/card/snice-card.d.ts +19 -0
- package/dist/components/card/snice-card.js +136 -0
- package/dist/components/card/snice-card.js.map +1 -0
- package/{components/card/snice-card.types.ts → dist/components/card/snice-card.types.d.ts} +6 -7
- package/dist/components/checkbox/snice-checkbox.d.ts +34 -0
- package/dist/components/checkbox/snice-checkbox.js +286 -0
- package/dist/components/checkbox/snice-checkbox.js.map +1 -0
- package/dist/components/checkbox/snice-checkbox.types.d.ts +20 -0
- package/dist/components/chip/snice-chip.d.ts +28 -0
- package/dist/components/chip/snice-chip.js +199 -0
- package/dist/components/chip/snice-chip.js.map +1 -0
- package/dist/components/chip/snice-chip.types.d.ts +14 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +82 -0
- package/dist/components/date-picker/snice-date-picker.js +847 -0
- package/dist/components/date-picker/snice-date-picker.js.map +1 -0
- package/dist/components/date-picker/snice-date-picker.types.d.ts +71 -0
- package/dist/components/divider/snice-divider.d.ts +17 -0
- package/dist/components/divider/snice-divider.js +122 -0
- package/dist/components/divider/snice-divider.js.map +1 -0
- package/{components/divider/snice-divider.types.ts → dist/components/divider/snice-divider.types.d.ts} +9 -10
- package/dist/components/drawer/snice-drawer.d.ts +37 -0
- package/dist/components/drawer/snice-drawer.js +337 -0
- package/dist/components/drawer/snice-drawer.js.map +1 -0
- package/dist/components/drawer/snice-drawer.types.d.ts +16 -0
- package/dist/components/input/snice-input.d.ts +65 -0
- package/dist/components/input/snice-input.js +567 -0
- package/dist/components/input/snice-input.js.map +1 -0
- package/dist/components/input/snice-input.types.d.ts +53 -0
- package/dist/components/layout/snice-layout-blog.d.ts +4 -0
- package/dist/components/layout/snice-layout-blog.js +67 -0
- package/dist/components/layout/snice-layout-blog.js.map +1 -0
- package/dist/components/layout/snice-layout-card.d.ts +6 -0
- package/dist/components/layout/snice-layout-card.js +64 -0
- package/dist/components/layout/snice-layout-card.js.map +1 -0
- package/dist/components/layout/snice-layout-centered.d.ts +5 -0
- package/dist/components/layout/snice-layout-centered.js +48 -0
- package/dist/components/layout/snice-layout-centered.js.map +1 -0
- package/dist/components/layout/snice-layout-dashboard.d.ts +4 -0
- package/dist/components/layout/snice-layout-dashboard.js +64 -0
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -0
- package/dist/components/layout/snice-layout-fullscreen.d.ts +5 -0
- package/dist/components/layout/snice-layout-fullscreen.js +60 -0
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -0
- package/dist/components/layout/snice-layout-landing.d.ts +4 -0
- package/dist/components/layout/snice-layout-landing.js +66 -0
- package/dist/components/layout/snice-layout-landing.js.map +1 -0
- package/dist/components/layout/snice-layout-minimal.d.ts +4 -0
- package/dist/components/layout/snice-layout-minimal.js +38 -0
- package/dist/components/layout/snice-layout-minimal.js.map +1 -0
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -0
- package/dist/components/layout/snice-layout-sidebar.js +74 -0
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -0
- package/dist/components/layout/snice-layout-split.d.ts +6 -0
- package/dist/components/layout/snice-layout-split.js +58 -0
- package/dist/components/layout/snice-layout-split.js.map +1 -0
- package/dist/components/layout/snice-layout.d.ts +4 -0
- package/dist/components/layout/snice-layout.js +54 -0
- package/dist/components/layout/snice-layout.js.map +1 -0
- package/{components/layout/snice-layout.types.ts → dist/components/layout/snice-layout.types.d.ts} +1 -3
- package/dist/components/login/snice-login.d.ts +44 -0
- package/dist/components/login/snice-login.js +382 -0
- package/dist/components/login/snice-login.js.map +1 -0
- package/dist/components/login/snice-login.types.d.ts +26 -0
- package/dist/components/modal/snice-modal.d.ts +32 -0
- package/dist/components/modal/snice-modal.js +280 -0
- package/dist/components/modal/snice-modal.js.map +1 -0
- package/dist/components/modal/snice-modal.types.d.ts +18 -0
- package/dist/components/pagination/snice-pagination.d.ts +26 -0
- package/dist/components/pagination/snice-pagination.js +373 -0
- package/dist/components/pagination/snice-pagination.js.map +1 -0
- package/dist/components/pagination/snice-pagination.types.d.ts +18 -0
- package/dist/components/progress/snice-progress.d.ts +35 -0
- package/dist/components/progress/snice-progress.js +305 -0
- package/dist/components/progress/snice-progress.js.map +1 -0
- package/dist/components/progress/snice-progress.types.d.ts +18 -0
- package/dist/components/radio/snice-radio.d.ts +33 -0
- package/dist/components/radio/snice-radio.js +279 -0
- package/dist/components/radio/snice-radio.js.map +1 -0
- package/dist/components/radio/snice-radio.types.d.ts +19 -0
- package/dist/components/select/snice-option.d.ts +17 -0
- package/dist/components/select/snice-option.js +88 -0
- package/dist/components/select/snice-option.js.map +1 -0
- package/{components/select/snice-option.types.ts → dist/components/select/snice-option.types.d.ts} +8 -8
- package/dist/components/select/snice-select.d.ts +89 -0
- package/dist/components/select/snice-select.js +864 -0
- package/dist/components/select/snice-select.js.map +1 -0
- package/dist/components/select/snice-select.types.d.ts +49 -0
- package/dist/components/skeleton/snice-skeleton.d.ts +16 -0
- package/dist/components/skeleton/snice-skeleton.js +166 -0
- package/dist/components/skeleton/snice-skeleton.js.map +1 -0
- package/{components/skeleton/snice-skeleton.types.ts → dist/components/skeleton/snice-skeleton.types.d.ts} +7 -8
- package/dist/components/snice-cell-C8aBfN72.js +4 -0
- package/dist/components/snice-cell-C8aBfN72.js.map +1 -0
- package/dist/components/switch/snice-switch.d.ts +38 -0
- package/dist/components/switch/snice-switch.js +305 -0
- package/dist/components/switch/snice-switch.js.map +1 -0
- package/dist/components/switch/snice-switch.types.d.ts +21 -0
- package/dist/components/symbols.d.ts +1 -0
- package/dist/components/symbols.js +22 -0
- package/dist/components/symbols.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +21 -0
- package/dist/components/table/snice-cell-boolean.js +164 -0
- package/dist/components/table/snice-cell-boolean.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +24 -0
- package/dist/components/table/snice-cell-date.js +253 -0
- package/dist/components/table/snice-cell-date.js.map +1 -0
- package/dist/components/table/snice-cell-duration.d.ts +16 -0
- package/dist/components/table/snice-cell-duration.js +130 -0
- package/dist/components/table/snice-cell-duration.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +16 -0
- package/dist/components/table/snice-cell-filesize.js +126 -0
- package/dist/components/table/snice-cell-filesize.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +23 -0
- package/dist/components/table/snice-cell-number.js +215 -0
- package/dist/components/table/snice-cell-number.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +17 -0
- package/dist/components/table/snice-cell-progress.js +121 -0
- package/dist/components/table/snice-cell-progress.js.map +1 -0
- package/dist/components/table/snice-cell-rating.d.ts +17 -0
- package/dist/components/table/snice-cell-rating.js +120 -0
- package/dist/components/table/snice-cell-rating.js.map +1 -0
- package/dist/components/table/snice-cell-sparkline.d.ts +29 -0
- package/dist/components/table/snice-cell-sparkline.js +306 -0
- package/dist/components/table/snice-cell-sparkline.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +19 -0
- package/dist/components/table/snice-cell-text.js +161 -0
- package/dist/components/table/snice-cell-text.js.map +1 -0
- package/dist/components/table/snice-cell.d.ts +32 -0
- package/dist/components/table/snice-cell.js +458 -0
- package/dist/components/table/snice-cell.js.map +1 -0
- package/dist/components/table/snice-column.d.ts +62 -0
- package/dist/components/table/snice-column.js +506 -0
- package/dist/components/table/snice-column.js.map +1 -0
- package/dist/components/table/snice-header.d.ts +33 -0
- package/dist/components/table/snice-header.js +289 -0
- package/dist/components/table/snice-header.js.map +1 -0
- package/dist/components/table/snice-progress.d.ts +10 -0
- package/dist/components/table/snice-progress.js +105 -0
- package/dist/components/table/snice-progress.js.map +1 -0
- package/dist/components/table/snice-rating.d.ts +9 -0
- package/dist/components/table/snice-rating.js +81 -0
- package/dist/components/table/snice-rating.js.map +1 -0
- package/dist/components/table/snice-row.d.ts +43 -0
- package/dist/components/table/snice-row.js +353 -0
- package/dist/components/table/snice-row.js.map +1 -0
- package/dist/components/table/snice-table.d.ts +69 -0
- package/dist/components/table/snice-table.js +792 -0
- package/dist/components/table/snice-table.js.map +1 -0
- package/dist/components/table/snice-table.types.d.ts +137 -0
- package/dist/components/tabs/snice-tab-panel.d.ts +12 -0
- package/dist/components/tabs/snice-tab-panel.js +87 -0
- package/dist/components/tabs/snice-tab-panel.js.map +1 -0
- package/dist/components/tabs/snice-tab.d.ts +13 -0
- package/dist/components/tabs/snice-tab.js +98 -0
- package/dist/components/tabs/snice-tab.js.map +1 -0
- package/dist/components/tabs/snice-tabs.d.ts +34 -0
- package/dist/components/tabs/snice-tabs.js +375 -0
- package/dist/components/tabs/snice-tabs.js.map +1 -0
- package/dist/components/tabs/snice-tabs.types.d.ts +23 -0
- package/dist/components/toast/snice-toast-container.d.ts +25 -0
- package/dist/components/toast/snice-toast-container.js +252 -0
- package/dist/components/toast/snice-toast-container.js.map +1 -0
- package/dist/components/toast/snice-toast.d.ts +23 -0
- package/dist/components/toast/snice-toast.js +321 -0
- package/dist/components/toast/snice-toast.js.map +1 -0
- package/dist/components/toast/snice-toast.types.d.ts +30 -0
- package/dist/components/tooltip/snice-tooltip.d.ts +50 -0
- package/dist/components/tooltip/snice-tooltip.js +644 -0
- package/dist/components/tooltip/snice-tooltip.js.map +1 -0
- package/dist/components/tooltip/snice-tooltip.types.d.ts +18 -0
- package/dist/components/transitions.d.ts +11 -0
- package/dist/components/transitions.js +72 -0
- package/dist/components/transitions.js.map +1 -0
- package/dist/index.cjs +16 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.cjs.min.map +1 -1
- package/dist/index.esm.js +16 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +16 -20
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +3 -3
- package/dist/index.iife.min.js.map +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.esm.js +1 -1
- package/package.json +10 -6
- package/components/accordion/demo.html +0 -403
- package/components/accordion/snice-accordion-item.css +0 -85
- package/components/accordion/snice-accordion-item.ts +0 -226
- package/components/accordion/snice-accordion.css +0 -31
- package/components/accordion/snice-accordion.ts +0 -182
- package/components/accordion/snice-accordion.types.ts +0 -32
- package/components/alert/demo.html +0 -445
- package/components/alert/snice-alert.css +0 -195
- package/components/alert/snice-alert.ts +0 -141
- package/components/avatar/demo.html +0 -598
- package/components/avatar/snice-avatar.css +0 -131
- package/components/avatar/snice-avatar.ts +0 -136
- package/components/avatar/snice-avatar.types.ts +0 -13
- package/components/badge/demo.html +0 -523
- package/components/badge/snice-badge.css +0 -161
- package/components/badge/snice-badge.ts +0 -117
- package/components/breadcrumbs/demo.html +0 -404
- package/components/breadcrumbs/snice-breadcrumbs.css +0 -133
- package/components/breadcrumbs/snice-breadcrumbs.ts +0 -191
- package/components/breadcrumbs/snice-breadcrumbs.types.ts +0 -26
- package/components/breadcrumbs/snice-crumb.ts +0 -26
- package/components/button/demo.html +0 -42
- package/components/button/snice-button.css +0 -230
- package/components/button/snice-button.ts +0 -169
- package/components/button/snice-button.types.ts +0 -25
- package/components/card/demo.html +0 -525
- package/components/card/snice-card.css +0 -140
- package/components/card/snice-card.ts +0 -102
- package/components/checkbox/demo.html +0 -253
- package/components/checkbox/snice-checkbox.css +0 -164
- package/components/checkbox/snice-checkbox.ts +0 -223
- package/components/checkbox/snice-checkbox.types.ts +0 -22
- package/components/chip/demo.html +0 -383
- package/components/chip/snice-chip.css +0 -195
- package/components/chip/snice-chip.ts +0 -139
- package/components/chip/snice-chip.types.ts +0 -15
- package/components/date-picker/README.md +0 -233
- package/components/date-picker/demo.html +0 -191
- package/components/date-picker/snice-date-picker.css +0 -330
- package/components/date-picker/snice-date-picker.ts +0 -777
- package/components/date-picker/snice-date-picker.types.ts +0 -83
- package/components/divider/demo.html +0 -233
- package/components/divider/snice-divider.css +0 -155
- package/components/divider/snice-divider.ts +0 -69
- package/components/drawer/demo.html +0 -328
- package/components/drawer/snice-drawer.css +0 -476
- package/components/drawer/snice-drawer.ts +0 -287
- package/components/drawer/snice-drawer.types.ts +0 -17
- package/components/global.d.ts +0 -14
- package/components/input/demo.html +0 -303
- package/components/input/snice-input.css +0 -257
- package/components/input/snice-input.ts +0 -442
- package/components/input/snice-input.types.ts +0 -59
- package/components/input/test.html +0 -77
- package/components/layout/README.md +0 -260
- package/components/layout/demo.html +0 -538
- package/components/layout/snice-layout-blog.css +0 -129
- package/components/layout/snice-layout-blog.ts +0 -48
- package/components/layout/snice-layout-card.css +0 -104
- package/components/layout/snice-layout-card.ts +0 -35
- package/components/layout/snice-layout-centered.css +0 -51
- package/components/layout/snice-layout-centered.ts +0 -22
- package/components/layout/snice-layout-dashboard.css +0 -98
- package/components/layout/snice-layout-dashboard.ts +0 -45
- package/components/layout/snice-layout-fullscreen.css +0 -72
- package/components/layout/snice-layout-fullscreen.ts +0 -34
- package/components/layout/snice-layout-landing.css +0 -92
- package/components/layout/snice-layout-landing.ts +0 -47
- package/components/layout/snice-layout-minimal.css +0 -16
- package/components/layout/snice-layout-minimal.ts +0 -19
- package/components/layout/snice-layout-sidebar.css +0 -117
- package/components/layout/snice-layout-sidebar.ts +0 -48
- package/components/layout/snice-layout-split.css +0 -103
- package/components/layout/snice-layout-split.ts +0 -29
- package/components/layout/snice-layout.css +0 -72
- package/components/layout/snice-layout.ts +0 -35
- package/components/login/demo-auth-controller.ts +0 -185
- package/components/login/demo.html +0 -470
- package/components/login/snice-login.css +0 -204
- package/components/login/snice-login.ts +0 -326
- package/components/login/snice-login.types.ts +0 -29
- package/components/modal/demo.html +0 -291
- package/components/modal/snice-modal.css +0 -203
- package/components/modal/snice-modal.ts +0 -233
- package/components/modal/snice-modal.types.ts +0 -21
- package/components/pagination/demo.html +0 -395
- package/components/pagination/snice-pagination.ts +0 -333
- package/components/pagination/snice-pagination.types.ts +0 -21
- package/components/progress/demo.html +0 -510
- package/components/progress/snice-progress.css +0 -267
- package/components/progress/snice-progress.ts +0 -247
- package/components/progress/snice-progress.types.ts +0 -19
- package/components/radio/demo.html +0 -287
- package/components/radio/snice-radio.css +0 -171
- package/components/radio/snice-radio.ts +0 -218
- package/components/radio/snice-radio.types.ts +0 -21
- package/components/select/demo.html +0 -511
- package/components/select/snice-option.ts +0 -52
- package/components/select/snice-select.css +0 -392
- package/components/select/snice-select.ts +0 -796
- package/components/select/snice-select.types.ts +0 -55
- package/components/skeleton/demo.html +0 -514
- package/components/skeleton/snice-skeleton.css +0 -109
- package/components/skeleton/snice-skeleton.ts +0 -126
- package/components/switch/demo.html +0 -284
- package/components/switch/snice-switch.css +0 -221
- package/components/switch/snice-switch.ts +0 -229
- package/components/switch/snice-switch.types.ts +0 -23
- package/components/symbols.ts +0 -23
- package/components/table/demo-table-controller.ts +0 -100
- package/components/table/demo.html +0 -480
- package/components/table/snice-cell-boolean.ts +0 -112
- package/components/table/snice-cell-date.ts +0 -210
- package/components/table/snice-cell-duration.ts +0 -91
- package/components/table/snice-cell-filesize.ts +0 -90
- package/components/table/snice-cell-number.ts +0 -165
- package/components/table/snice-cell-progress.ts +0 -83
- package/components/table/snice-cell-rating.ts +0 -82
- package/components/table/snice-cell-sparkline.ts +0 -253
- package/components/table/snice-cell-text.ts +0 -125
- package/components/table/snice-cell.css +0 -296
- package/components/table/snice-cell.ts +0 -473
- package/components/table/snice-column.ts +0 -353
- package/components/table/snice-header.css +0 -243
- package/components/table/snice-header.ts +0 -261
- package/components/table/snice-progress.ts +0 -66
- package/components/table/snice-rating.ts +0 -45
- package/components/table/snice-row.css +0 -255
- package/components/table/snice-row.ts +0 -331
- package/components/table/snice-table.css +0 -241
- package/components/table/snice-table.ts +0 -737
- package/components/table/snice-table.types.ts +0 -158
- package/components/tabs/demo.html +0 -487
- package/components/tabs/snice-tab-panel.css +0 -264
- package/components/tabs/snice-tab-panel.ts +0 -47
- package/components/tabs/snice-tab.css +0 -96
- package/components/tabs/snice-tab.ts +0 -65
- package/components/tabs/snice-tabs.css +0 -189
- package/components/tabs/snice-tabs.ts +0 -332
- package/components/tabs/snice-tabs.types.ts +0 -28
- package/components/theme/theme.css +0 -234
- package/components/toast/demo.html +0 -329
- package/components/toast/snice-toast-container.ts +0 -256
- package/components/toast/snice-toast.css +0 -213
- package/components/toast/snice-toast.ts +0 -276
- package/components/toast/snice-toast.types.ts +0 -35
- package/components/tooltip/demo.html +0 -350
- package/components/tooltip/snice-tooltip-portal.css +0 -79
- package/components/tooltip/snice-tooltip.css +0 -117
- package/components/tooltip/snice-tooltip.ts +0 -612
- package/components/tooltip/snice-tooltip.types.ts +0 -32
- package/components/transitions.ts +0 -94
- package/components/tsconfig.json +0 -18
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from 'tslib';
|
|
2
|
+
import { element, property } from 'snice';
|
|
3
|
+
|
|
4
|
+
var css = '';
|
|
5
|
+
|
|
6
|
+
let SniceLayoutSidebar = (() => {
|
|
7
|
+
let _classDecorators = [element('snice-layout-sidebar')];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
let _classSuper = HTMLElement;
|
|
12
|
+
let _collapsed_decorators;
|
|
13
|
+
let _collapsed_initializers = [];
|
|
14
|
+
let _collapsed_extraInitializers = [];
|
|
15
|
+
(class extends _classSuper {
|
|
16
|
+
static { _classThis = this; }
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
_collapsed_decorators = [property({ type: Boolean, reflect: true })];
|
|
20
|
+
__esDecorate(null, null, _collapsed_decorators, { kind: "field", name: "collapsed", static: false, private: false, access: { has: obj => "collapsed" in obj, get: obj => obj.collapsed, set: (obj, value) => { obj.collapsed = value; } }, metadata: _metadata }, _collapsed_initializers, _collapsed_extraInitializers);
|
|
21
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
22
|
+
_classThis = _classDescriptor.value;
|
|
23
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
25
|
+
}
|
|
26
|
+
html() {
|
|
27
|
+
return /*html*/ `
|
|
28
|
+
<div class="layout">
|
|
29
|
+
<aside class="sidebar">
|
|
30
|
+
<div class="sidebar-header">
|
|
31
|
+
<slot name="brand">
|
|
32
|
+
<h2>App</h2>
|
|
33
|
+
</slot>
|
|
34
|
+
</div>
|
|
35
|
+
<nav class="sidebar-nav">
|
|
36
|
+
<slot name="nav"></slot>
|
|
37
|
+
</nav>
|
|
38
|
+
</aside>
|
|
39
|
+
|
|
40
|
+
<div class="content-area">
|
|
41
|
+
<header class="header">
|
|
42
|
+
<button class="sidebar-toggle" type="button" aria-label="Toggle sidebar">
|
|
43
|
+
<svg viewBox="0 0 24 24" width="20" height="20">
|
|
44
|
+
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"/>
|
|
45
|
+
</svg>
|
|
46
|
+
</button>
|
|
47
|
+
<slot name="header"></slot>
|
|
48
|
+
</header>
|
|
49
|
+
|
|
50
|
+
<main class="main">
|
|
51
|
+
<slot></slot>
|
|
52
|
+
</main>
|
|
53
|
+
|
|
54
|
+
<footer class="footer">
|
|
55
|
+
<slot name="footer"></slot>
|
|
56
|
+
</footer>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
css() {
|
|
62
|
+
return css;
|
|
63
|
+
}
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
this.collapsed = __runInitializers(this, _collapsed_initializers, false);
|
|
67
|
+
__runInitializers(this, _collapsed_extraInitializers);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return _classThis;
|
|
71
|
+
})();
|
|
72
|
+
|
|
73
|
+
export { SniceLayoutSidebar };
|
|
74
|
+
//# sourceMappingURL=snice-layout-sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snice-layout-sidebar.js","sources":["../../../snice-layout-sidebar.css?inline","../../../../components/layout/snice-layout-sidebar.ts"],"sourcesContent":["export default '';",null],"names":[],"mappings":";;;AAAA,UAAe,EAAE;;ICIJ,kBAAkB,GAAA,CAAA,MAAA;4BAD9B,OAAO,CAAC,sBAAsB,CAAC,CAAA;;;;sBACQ,WAAW;;;;AAAnB,KAAA,cAAQ,WAAW,CAAA;;;;qCAChD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;YAC3C,YAAA,CAAA,IAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,WAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,IAAA,WAAA,IAAA,GAAA,EAAA,GAAA,EAAA,GAAA,IAAA,GAAA,CAAA,SAAS,EAAA,GAAA,EAAA,CAAA,GAAA,EAAA,KAAA,KAAA,EAAA,GAAA,CAAT,SAAS,GAAA,KAAA,CAAA,CAAA,CAAA,EAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,uBAAA,EAAA,4BAAA,CAAA;YAFX,YAAA,CAAA,IAAA,EAAA,gBAAA,GAAA,EAAA,KAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,UAAA,CAAA,IAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,uBAAA,CAAA;;;YAAa,iBAAA,CAAA,UAAA,EAAA,uBAAA,CAAA;;QAIX,IAAI,GAAA;AACF,YAAA,gBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCd;QACH;QAEA,GAAG,GAAA;AACD,YAAA,OAAO,GAAG;QACZ;;;YAxCA,IAAA,CAAA,SAAS,GAAA,iBAAA,CAAA,IAAA,EAAA,uBAAA,EAAG,KAAK,CAAA;;;;;;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from 'tslib';
|
|
2
|
+
import { element, property } from 'snice';
|
|
3
|
+
|
|
4
|
+
var css = '';
|
|
5
|
+
|
|
6
|
+
let SniceLayoutSplit = (() => {
|
|
7
|
+
let _classDecorators = [element('snice-layout-split')];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
let _classSuper = HTMLElement;
|
|
12
|
+
let _direction_decorators;
|
|
13
|
+
let _direction_initializers = [];
|
|
14
|
+
let _direction_extraInitializers = [];
|
|
15
|
+
let _ratio_decorators;
|
|
16
|
+
let _ratio_initializers = [];
|
|
17
|
+
let _ratio_extraInitializers = [];
|
|
18
|
+
(class extends _classSuper {
|
|
19
|
+
static { _classThis = this; }
|
|
20
|
+
static {
|
|
21
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
22
|
+
_direction_decorators = [property({ reflect: true })];
|
|
23
|
+
_ratio_decorators = [property({ reflect: true })];
|
|
24
|
+
__esDecorate(null, null, _direction_decorators, { kind: "field", name: "direction", static: false, private: false, access: { has: obj => "direction" in obj, get: obj => obj.direction, set: (obj, value) => { obj.direction = value; } }, metadata: _metadata }, _direction_initializers, _direction_extraInitializers);
|
|
25
|
+
__esDecorate(null, null, _ratio_decorators, { kind: "field", name: "ratio", static: false, private: false, access: { has: obj => "ratio" in obj, get: obj => obj.ratio, set: (obj, value) => { obj.ratio = value; } }, metadata: _metadata }, _ratio_initializers, _ratio_extraInitializers);
|
|
26
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
27
|
+
_classThis = _classDescriptor.value;
|
|
28
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
29
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
30
|
+
}
|
|
31
|
+
html() {
|
|
32
|
+
return /*html*/ `
|
|
33
|
+
<div class="layout">
|
|
34
|
+
<div class="panel panel-left">
|
|
35
|
+
<slot name="left"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="divider"></div>
|
|
38
|
+
<div class="panel panel-right">
|
|
39
|
+
<slot name="right"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
css() {
|
|
45
|
+
return css;
|
|
46
|
+
}
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
this.direction = __runInitializers(this, _direction_initializers, 'horizontal');
|
|
50
|
+
this.ratio = (__runInitializers(this, _direction_extraInitializers), __runInitializers(this, _ratio_initializers, '50-50'));
|
|
51
|
+
__runInitializers(this, _ratio_extraInitializers);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return _classThis;
|
|
55
|
+
})();
|
|
56
|
+
|
|
57
|
+
export { SniceLayoutSplit };
|
|
58
|
+
//# sourceMappingURL=snice-layout-split.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snice-layout-split.js","sources":["../../../snice-layout-split.css?inline","../../../../components/layout/snice-layout-split.ts"],"sourcesContent":["export default '';",null],"names":[],"mappings":";;;AAAA,UAAe,EAAE;;ICIJ,gBAAgB,GAAA,CAAA,MAAA;4BAD5B,OAAO,CAAC,oBAAoB,CAAC,CAAA;;;;sBACQ,WAAW;;;;;;;AAAnB,KAAA,cAAQ,WAAW,CAAA;;;;AAC9C,YAAA,qBAAA,GAAA,CAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;AAG3B,YAAA,iBAAA,GAAA,CAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;YAF5B,YAAA,CAAA,IAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,WAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,IAAA,WAAA,IAAA,GAAA,EAAA,GAAA,EAAA,GAAA,IAAA,GAAA,CAAA,SAAS,EAAA,GAAA,EAAA,CAAA,GAAA,EAAA,KAAA,KAAA,EAAA,GAAA,CAAT,SAAS,GAAA,KAAA,CAAA,CAAA,CAAA,EAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,uBAAA,EAAA,4BAAA,CAAA;YAGT,YAAA,CAAA,IAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,OAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,IAAA,OAAA,IAAA,GAAA,EAAA,GAAA,EAAA,GAAA,IAAA,GAAA,CAAA,KAAK,EAAA,GAAA,EAAA,CAAA,GAAA,EAAA,KAAA,KAAA,EAAA,GAAA,CAAL,KAAK,GAAA,KAAA,CAAA,CAAA,CAAA,EAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,mBAAA,EAAA,wBAAA,CAAA;YALP,YAAA,CAAA,IAAA,EAAA,gBAAA,GAAA,EAAA,KAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,UAAA,CAAA,IAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,uBAAA,CAAA;;;YAAa,iBAAA,CAAA,UAAA,EAAA,uBAAA,CAAA;;QAOX,IAAI,GAAA;AACF,YAAA,gBAAe;;;;;;;;;;KAUd;QACH;QAEA,GAAG,GAAA;AACD,YAAA,OAAO,GAAG;QACZ;;;YArBA,IAAA,CAAA,SAAS,GAAA,iBAAA,CAAA,IAAA,EAAA,uBAAA,EAA8B,YAAY,CAAA;YAGnD,IAAA,CAAA,KAAK,IAAA,iBAAA,CAAA,IAAA,EAAA,4BAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,mBAAA,EAAoD,OAAO,CAAA,CAAA;;;;;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from 'tslib';
|
|
2
|
+
import { element } from 'snice';
|
|
3
|
+
|
|
4
|
+
var css = '';
|
|
5
|
+
|
|
6
|
+
let SniceLayout = (() => {
|
|
7
|
+
let _classDecorators = [element('snice-layout')];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
let _classSuper = HTMLElement;
|
|
12
|
+
(class extends _classSuper {
|
|
13
|
+
static { _classThis = this; }
|
|
14
|
+
static {
|
|
15
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
16
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
17
|
+
_classThis = _classDescriptor.value;
|
|
18
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
19
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
20
|
+
}
|
|
21
|
+
html() {
|
|
22
|
+
return /*html*/ `
|
|
23
|
+
<div class="layout">
|
|
24
|
+
<header class="header">
|
|
25
|
+
<div class="brand">
|
|
26
|
+
<slot name="brand">
|
|
27
|
+
<h1>App</h1>
|
|
28
|
+
</slot>
|
|
29
|
+
</div>
|
|
30
|
+
<nav class="nav">
|
|
31
|
+
<slot name="nav"></slot>
|
|
32
|
+
</nav>
|
|
33
|
+
</header>
|
|
34
|
+
|
|
35
|
+
<main class="main">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</main>
|
|
38
|
+
|
|
39
|
+
<footer class="footer">
|
|
40
|
+
<slot name="footer">
|
|
41
|
+
</slot>
|
|
42
|
+
</footer>
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
css() {
|
|
47
|
+
return css;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return _classThis;
|
|
51
|
+
})();
|
|
52
|
+
|
|
53
|
+
export { SniceLayout };
|
|
54
|
+
//# sourceMappingURL=snice-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snice-layout.js","sources":["../../../snice-layout.css?inline","../../../../components/layout/snice-layout.ts"],"sourcesContent":["export default '';",null],"names":[],"mappings":";;;AAAA,UAAe,EAAE;;ICIJ,WAAW,GAAA,CAAA,MAAA;4BADvB,OAAO,CAAC,cAAc,CAAC,CAAA;;;;sBACS,WAAW;AAAnB,KAAA,cAAQ,WAAW,CAAA;;;;YAA5C,YAAA,CAAA,IAAA,EAAA,gBAAA,GAAA,EAAA,KAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,UAAA,CAAA,IAAA,EAAA,QAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,uBAAA,CAAA;;;YAAa,iBAAA,CAAA,UAAA,EAAA,uBAAA,CAAA;;QACX,IAAI,GAAA;AACF,YAAA,gBAAe;;;;;;;;;;;;;;;;;;;;;;KAsBd;QACH;QAEA,GAAG,GAAA;AACD,YAAA,OAAO,GAAG;QACZ;;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LoginVariant, LoginSize, LoginCredentials, SniceLoginElement } from './snice-login.types';
|
|
2
|
+
import '../alert/snice-alert';
|
|
3
|
+
import '../button/snice-button';
|
|
4
|
+
export declare class SniceLogin extends HTMLElement implements SniceLoginElement {
|
|
5
|
+
variant: LoginVariant;
|
|
6
|
+
size: LoginSize;
|
|
7
|
+
title: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
showRememberMe: boolean;
|
|
11
|
+
showForgotPassword: boolean;
|
|
12
|
+
actionText: string;
|
|
13
|
+
form: HTMLFormElement;
|
|
14
|
+
usernameInput: HTMLInputElement;
|
|
15
|
+
passwordInput: HTMLInputElement;
|
|
16
|
+
rememberInput?: HTMLInputElement;
|
|
17
|
+
alertElement: HTMLElement;
|
|
18
|
+
buttonElement: HTMLElement;
|
|
19
|
+
inputElements: NodeListOf<HTMLInputElement>;
|
|
20
|
+
private alertMessage;
|
|
21
|
+
private alertVariant;
|
|
22
|
+
html(): string;
|
|
23
|
+
css(): string;
|
|
24
|
+
login(credentials?: LoginCredentials): any;
|
|
25
|
+
handleButtonClick(event: Event): Promise<void>;
|
|
26
|
+
handleSubmit(event: Event): Promise<{
|
|
27
|
+
username: string;
|
|
28
|
+
timestamp: string;
|
|
29
|
+
} | undefined>;
|
|
30
|
+
handleEnterKey(): void;
|
|
31
|
+
handleForgotPassword(event: Event): {
|
|
32
|
+
timestamp: string;
|
|
33
|
+
};
|
|
34
|
+
private dispatchLoginSuccess;
|
|
35
|
+
private dispatchLoginError;
|
|
36
|
+
private getFormData;
|
|
37
|
+
showAlert(message: string, variant: 'error' | 'success'): void;
|
|
38
|
+
clearAlert(): void;
|
|
39
|
+
private updateAlert;
|
|
40
|
+
private updateLoadingState;
|
|
41
|
+
setError(message: string): void;
|
|
42
|
+
clearError(): void;
|
|
43
|
+
reset(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { __runInitializers, __esDecorate } from 'tslib';
|
|
2
|
+
import { element, property, query, queryAll, request, on, dispatch } from 'snice';
|
|
3
|
+
import '../alert/snice-alert.js';
|
|
4
|
+
import '../button/snice-button.js';
|
|
5
|
+
|
|
6
|
+
var css = '';
|
|
7
|
+
|
|
8
|
+
let SniceLogin = (() => {
|
|
9
|
+
let _classDecorators = [element('snice-login')];
|
|
10
|
+
let _classDescriptor;
|
|
11
|
+
let _classExtraInitializers = [];
|
|
12
|
+
let _classThis;
|
|
13
|
+
let _classSuper = HTMLElement;
|
|
14
|
+
let _instanceExtraInitializers = [];
|
|
15
|
+
let _variant_decorators;
|
|
16
|
+
let _variant_initializers = [];
|
|
17
|
+
let _variant_extraInitializers = [];
|
|
18
|
+
let _size_decorators;
|
|
19
|
+
let _size_initializers = [];
|
|
20
|
+
let _size_extraInitializers = [];
|
|
21
|
+
let _title_decorators;
|
|
22
|
+
let _title_initializers = [];
|
|
23
|
+
let _title_extraInitializers = [];
|
|
24
|
+
let _disabled_decorators;
|
|
25
|
+
let _disabled_initializers = [];
|
|
26
|
+
let _disabled_extraInitializers = [];
|
|
27
|
+
let _loading_decorators;
|
|
28
|
+
let _loading_initializers = [];
|
|
29
|
+
let _loading_extraInitializers = [];
|
|
30
|
+
let _showRememberMe_decorators;
|
|
31
|
+
let _showRememberMe_initializers = [];
|
|
32
|
+
let _showRememberMe_extraInitializers = [];
|
|
33
|
+
let _showForgotPassword_decorators;
|
|
34
|
+
let _showForgotPassword_initializers = [];
|
|
35
|
+
let _showForgotPassword_extraInitializers = [];
|
|
36
|
+
let _actionText_decorators;
|
|
37
|
+
let _actionText_initializers = [];
|
|
38
|
+
let _actionText_extraInitializers = [];
|
|
39
|
+
let _form_decorators;
|
|
40
|
+
let _form_initializers = [];
|
|
41
|
+
let _form_extraInitializers = [];
|
|
42
|
+
let _usernameInput_decorators;
|
|
43
|
+
let _usernameInput_initializers = [];
|
|
44
|
+
let _usernameInput_extraInitializers = [];
|
|
45
|
+
let _passwordInput_decorators;
|
|
46
|
+
let _passwordInput_initializers = [];
|
|
47
|
+
let _passwordInput_extraInitializers = [];
|
|
48
|
+
let _rememberInput_decorators;
|
|
49
|
+
let _rememberInput_initializers = [];
|
|
50
|
+
let _rememberInput_extraInitializers = [];
|
|
51
|
+
let _alertElement_decorators;
|
|
52
|
+
let _alertElement_initializers = [];
|
|
53
|
+
let _alertElement_extraInitializers = [];
|
|
54
|
+
let _buttonElement_decorators;
|
|
55
|
+
let _buttonElement_initializers = [];
|
|
56
|
+
let _buttonElement_extraInitializers = [];
|
|
57
|
+
let _inputElements_decorators;
|
|
58
|
+
let _inputElements_initializers = [];
|
|
59
|
+
let _inputElements_extraInitializers = [];
|
|
60
|
+
let _login_decorators;
|
|
61
|
+
let _handleButtonClick_decorators;
|
|
62
|
+
let _handleSubmit_decorators;
|
|
63
|
+
let _handleEnterKey_decorators;
|
|
64
|
+
let _handleForgotPassword_decorators;
|
|
65
|
+
let _dispatchLoginSuccess_decorators;
|
|
66
|
+
let _dispatchLoginError_decorators;
|
|
67
|
+
(class extends _classSuper {
|
|
68
|
+
static { _classThis = this; }
|
|
69
|
+
constructor() {
|
|
70
|
+
super(...arguments);
|
|
71
|
+
this.variant = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _variant_initializers, 'default'));
|
|
72
|
+
this.size = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
73
|
+
this.title = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _title_initializers, 'Sign In'));
|
|
74
|
+
this.disabled = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
75
|
+
this.loading = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _loading_initializers, false));
|
|
76
|
+
this.showRememberMe = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _showRememberMe_initializers, true));
|
|
77
|
+
this.showForgotPassword = (__runInitializers(this, _showRememberMe_extraInitializers), __runInitializers(this, _showForgotPassword_initializers, true));
|
|
78
|
+
this.actionText = (__runInitializers(this, _showForgotPassword_extraInitializers), __runInitializers(this, _actionText_initializers, 'Sign In'));
|
|
79
|
+
this.form = (__runInitializers(this, _actionText_extraInitializers), __runInitializers(this, _form_initializers, void 0));
|
|
80
|
+
this.usernameInput = (__runInitializers(this, _form_extraInitializers), __runInitializers(this, _usernameInput_initializers, void 0));
|
|
81
|
+
this.passwordInput = (__runInitializers(this, _usernameInput_extraInitializers), __runInitializers(this, _passwordInput_initializers, void 0));
|
|
82
|
+
this.rememberInput = (__runInitializers(this, _passwordInput_extraInitializers), __runInitializers(this, _rememberInput_initializers, void 0));
|
|
83
|
+
this.alertElement = (__runInitializers(this, _rememberInput_extraInitializers), __runInitializers(this, _alertElement_initializers, void 0));
|
|
84
|
+
this.buttonElement = (__runInitializers(this, _alertElement_extraInitializers), __runInitializers(this, _buttonElement_initializers, void 0));
|
|
85
|
+
this.inputElements = (__runInitializers(this, _buttonElement_extraInitializers), __runInitializers(this, _inputElements_initializers, void 0));
|
|
86
|
+
this.alertMessage = (__runInitializers(this, _inputElements_extraInitializers), '');
|
|
87
|
+
this.alertVariant = '';
|
|
88
|
+
}
|
|
89
|
+
static {
|
|
90
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
91
|
+
_variant_decorators = [property({ reflect: true })];
|
|
92
|
+
_size_decorators = [property({ reflect: true })];
|
|
93
|
+
_title_decorators = [property({ reflect: true })];
|
|
94
|
+
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
95
|
+
_loading_decorators = [property({ type: Boolean, reflect: true })];
|
|
96
|
+
_showRememberMe_decorators = [property({ type: Boolean, reflect: true, attribute: 'show-remember-me' })];
|
|
97
|
+
_showForgotPassword_decorators = [property({ type: Boolean, reflect: true, attribute: 'show-forgot-password' })];
|
|
98
|
+
_actionText_decorators = [property({ reflect: true, attribute: 'action-text' })];
|
|
99
|
+
_form_decorators = [query('.login__form')];
|
|
100
|
+
_usernameInput_decorators = [query('input[name="username"]')];
|
|
101
|
+
_passwordInput_decorators = [query('input[name="password"]')];
|
|
102
|
+
_rememberInput_decorators = [query('input[name="remember"]')];
|
|
103
|
+
_alertElement_decorators = [query('snice-alert')];
|
|
104
|
+
_buttonElement_decorators = [query('snice-button')];
|
|
105
|
+
_inputElements_decorators = [queryAll('input')];
|
|
106
|
+
_login_decorators = [request('login-user')];
|
|
107
|
+
_handleButtonClick_decorators = [on('click', 'snice-button')];
|
|
108
|
+
_handleSubmit_decorators = [on('submit', '.login__form'), dispatch('@snice/login-attempt', { bubbles: true, composed: true })];
|
|
109
|
+
_handleEnterKey_decorators = [on('keydown:Enter', '.login__input')];
|
|
110
|
+
_handleForgotPassword_decorators = [on('click', '.login__forgot'), dispatch('@snice/login-forgot-password', { bubbles: true, composed: true })];
|
|
111
|
+
_dispatchLoginSuccess_decorators = [dispatch('@snice/login-success', { bubbles: true, composed: true })];
|
|
112
|
+
_dispatchLoginError_decorators = [dispatch('@snice/login-error', { bubbles: true, composed: true })];
|
|
113
|
+
__esDecorate(this, null, _login_decorators, { kind: "method", name: "login", static: false, private: false, access: { has: obj => "login" in obj, get: obj => obj.login }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
114
|
+
__esDecorate(this, null, _handleButtonClick_decorators, { kind: "method", name: "handleButtonClick", static: false, private: false, access: { has: obj => "handleButtonClick" in obj, get: obj => obj.handleButtonClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
115
|
+
__esDecorate(this, null, _handleSubmit_decorators, { kind: "method", name: "handleSubmit", static: false, private: false, access: { has: obj => "handleSubmit" in obj, get: obj => obj.handleSubmit }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
116
|
+
__esDecorate(this, null, _handleEnterKey_decorators, { kind: "method", name: "handleEnterKey", static: false, private: false, access: { has: obj => "handleEnterKey" in obj, get: obj => obj.handleEnterKey }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
117
|
+
__esDecorate(this, null, _handleForgotPassword_decorators, { kind: "method", name: "handleForgotPassword", static: false, private: false, access: { has: obj => "handleForgotPassword" in obj, get: obj => obj.handleForgotPassword }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
118
|
+
__esDecorate(this, null, _dispatchLoginSuccess_decorators, { kind: "method", name: "dispatchLoginSuccess", static: false, private: false, access: { has: obj => "dispatchLoginSuccess" in obj, get: obj => obj.dispatchLoginSuccess }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
119
|
+
__esDecorate(this, null, _dispatchLoginError_decorators, { kind: "method", name: "dispatchLoginError", static: false, private: false, access: { has: obj => "dispatchLoginError" in obj, get: obj => obj.dispatchLoginError }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
120
|
+
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
121
|
+
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
122
|
+
__esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
123
|
+
__esDecorate(null, null, _disabled_decorators, { kind: "field", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
124
|
+
__esDecorate(null, null, _loading_decorators, { kind: "field", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
|
|
125
|
+
__esDecorate(null, null, _showRememberMe_decorators, { kind: "field", name: "showRememberMe", static: false, private: false, access: { has: obj => "showRememberMe" in obj, get: obj => obj.showRememberMe, set: (obj, value) => { obj.showRememberMe = value; } }, metadata: _metadata }, _showRememberMe_initializers, _showRememberMe_extraInitializers);
|
|
126
|
+
__esDecorate(null, null, _showForgotPassword_decorators, { kind: "field", name: "showForgotPassword", static: false, private: false, access: { has: obj => "showForgotPassword" in obj, get: obj => obj.showForgotPassword, set: (obj, value) => { obj.showForgotPassword = value; } }, metadata: _metadata }, _showForgotPassword_initializers, _showForgotPassword_extraInitializers);
|
|
127
|
+
__esDecorate(null, null, _actionText_decorators, { kind: "field", name: "actionText", static: false, private: false, access: { has: obj => "actionText" in obj, get: obj => obj.actionText, set: (obj, value) => { obj.actionText = value; } }, metadata: _metadata }, _actionText_initializers, _actionText_extraInitializers);
|
|
128
|
+
__esDecorate(null, null, _form_decorators, { kind: "field", name: "form", static: false, private: false, access: { has: obj => "form" in obj, get: obj => obj.form, set: (obj, value) => { obj.form = value; } }, metadata: _metadata }, _form_initializers, _form_extraInitializers);
|
|
129
|
+
__esDecorate(null, null, _usernameInput_decorators, { kind: "field", name: "usernameInput", static: false, private: false, access: { has: obj => "usernameInput" in obj, get: obj => obj.usernameInput, set: (obj, value) => { obj.usernameInput = value; } }, metadata: _metadata }, _usernameInput_initializers, _usernameInput_extraInitializers);
|
|
130
|
+
__esDecorate(null, null, _passwordInput_decorators, { kind: "field", name: "passwordInput", static: false, private: false, access: { has: obj => "passwordInput" in obj, get: obj => obj.passwordInput, set: (obj, value) => { obj.passwordInput = value; } }, metadata: _metadata }, _passwordInput_initializers, _passwordInput_extraInitializers);
|
|
131
|
+
__esDecorate(null, null, _rememberInput_decorators, { kind: "field", name: "rememberInput", static: false, private: false, access: { has: obj => "rememberInput" in obj, get: obj => obj.rememberInput, set: (obj, value) => { obj.rememberInput = value; } }, metadata: _metadata }, _rememberInput_initializers, _rememberInput_extraInitializers);
|
|
132
|
+
__esDecorate(null, null, _alertElement_decorators, { kind: "field", name: "alertElement", static: false, private: false, access: { has: obj => "alertElement" in obj, get: obj => obj.alertElement, set: (obj, value) => { obj.alertElement = value; } }, metadata: _metadata }, _alertElement_initializers, _alertElement_extraInitializers);
|
|
133
|
+
__esDecorate(null, null, _buttonElement_decorators, { kind: "field", name: "buttonElement", static: false, private: false, access: { has: obj => "buttonElement" in obj, get: obj => obj.buttonElement, set: (obj, value) => { obj.buttonElement = value; } }, metadata: _metadata }, _buttonElement_initializers, _buttonElement_extraInitializers);
|
|
134
|
+
__esDecorate(null, null, _inputElements_decorators, { kind: "field", name: "inputElements", static: false, private: false, access: { has: obj => "inputElements" in obj, get: obj => obj.inputElements, set: (obj, value) => { obj.inputElements = value; } }, metadata: _metadata }, _inputElements_initializers, _inputElements_extraInitializers);
|
|
135
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
136
|
+
_classThis = _classDescriptor.value;
|
|
137
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
138
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
139
|
+
}
|
|
140
|
+
html() {
|
|
141
|
+
return /*html*/ `
|
|
142
|
+
<div class="login login--${this.variant} login--${this.size}">
|
|
143
|
+
<slot name="before-header"></slot>
|
|
144
|
+
|
|
145
|
+
<div class="login__header">
|
|
146
|
+
<h1 class="login__title">${this.title}</h1>
|
|
147
|
+
<slot name="subtitle">
|
|
148
|
+
<p class="login__subtitle">Enter your credentials to continue</p>
|
|
149
|
+
</slot>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<slot name="after-header"></slot>
|
|
153
|
+
<slot name="before-form"></slot>
|
|
154
|
+
|
|
155
|
+
<form class="login__form">
|
|
156
|
+
<slot name="form-top"></slot>
|
|
157
|
+
|
|
158
|
+
<div class="login__field">
|
|
159
|
+
<label class="login__label" for="username">Username</label>
|
|
160
|
+
<input
|
|
161
|
+
class="login__input"
|
|
162
|
+
type="text"
|
|
163
|
+
name="username"
|
|
164
|
+
id="username"
|
|
165
|
+
required
|
|
166
|
+
autocomplete="username"
|
|
167
|
+
placeholder="Enter your username"
|
|
168
|
+
${this.disabled || this.loading ? 'disabled' : ''}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<slot name="between-fields"></slot>
|
|
173
|
+
|
|
174
|
+
<div class="login__field">
|
|
175
|
+
<label class="login__label" for="password">Password</label>
|
|
176
|
+
<input
|
|
177
|
+
class="login__input"
|
|
178
|
+
type="password"
|
|
179
|
+
name="password"
|
|
180
|
+
id="password"
|
|
181
|
+
required
|
|
182
|
+
autocomplete="current-password"
|
|
183
|
+
placeholder="Enter your password"
|
|
184
|
+
${this.disabled || this.loading ? 'disabled' : ''}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div class="login__options" ${!this.showRememberMe && !this.showForgotPassword ? 'hidden' : ''}>
|
|
189
|
+
<label class="login__remember" ${!this.showRememberMe ? 'hidden' : ''}>
|
|
190
|
+
<input class="login__checkbox" type="checkbox" name="remember" ${this.disabled || this.loading ? 'disabled' : ''} />
|
|
191
|
+
Remember me
|
|
192
|
+
</label>
|
|
193
|
+
|
|
194
|
+
<a href="#" class="login__forgot" ${!this.showForgotPassword ? 'hidden' : ''}>Forgot password?</a>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<slot name="before-submit"></slot>
|
|
198
|
+
|
|
199
|
+
<snice-button type="submit" variant="primary" ${this.disabled ? 'disabled' : ''} ${this.loading ? 'loading' : ''}>
|
|
200
|
+
${this.actionText}
|
|
201
|
+
</snice-button>
|
|
202
|
+
|
|
203
|
+
<slot name="after-submit"></slot>
|
|
204
|
+
</form>
|
|
205
|
+
|
|
206
|
+
<slot name="after-form"></slot>
|
|
207
|
+
|
|
208
|
+
<snice-alert variant="${this.alertVariant}" ${!this.alertMessage ? 'hidden' : ''}>${this.alertMessage}</snice-alert>
|
|
209
|
+
|
|
210
|
+
<div class="login__footer">
|
|
211
|
+
<slot name="footer"></slot>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
css() {
|
|
217
|
+
return css;
|
|
218
|
+
}
|
|
219
|
+
async *login(credentials) {
|
|
220
|
+
if (!credentials) {
|
|
221
|
+
credentials = this.getFormData();
|
|
222
|
+
}
|
|
223
|
+
if (!credentials.username || !credentials.password) {
|
|
224
|
+
return {
|
|
225
|
+
success: false,
|
|
226
|
+
error: 'Username and password are required'
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
const result = await (yield credentials);
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return {
|
|
235
|
+
success: false,
|
|
236
|
+
error: error instanceof Error ? error.message : 'Login failed'
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async handleButtonClick(event) {
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
// Trigger form submit
|
|
243
|
+
if (this.form) {
|
|
244
|
+
this.form.requestSubmit();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async handleSubmit(event) {
|
|
248
|
+
event.preventDefault();
|
|
249
|
+
if (this.loading || this.disabled) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
this.clearAlert();
|
|
253
|
+
this.loading = true;
|
|
254
|
+
this.updateLoadingState();
|
|
255
|
+
// Wait a tick to ensure the form is properly rendered
|
|
256
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
257
|
+
try {
|
|
258
|
+
const credentials = this.getFormData();
|
|
259
|
+
if (!credentials.username || !credentials.password) {
|
|
260
|
+
this.showAlert('Username and password are required', 'error');
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const result = await this.login(credentials);
|
|
264
|
+
if (result.success) {
|
|
265
|
+
this.showAlert('Login successful!', 'success');
|
|
266
|
+
this.dispatchLoginSuccess(result);
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
this.showAlert(result.error || 'Login failed', 'error');
|
|
270
|
+
this.dispatchLoginError(result.error || 'Login failed');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
const errorMessage = error instanceof Error ? error.message : 'Login failed';
|
|
275
|
+
this.showAlert(errorMessage, 'error');
|
|
276
|
+
this.dispatchLoginError(errorMessage);
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
this.loading = false;
|
|
280
|
+
this.updateLoadingState();
|
|
281
|
+
}
|
|
282
|
+
const credentials = this.getFormData();
|
|
283
|
+
return {
|
|
284
|
+
username: credentials.username,
|
|
285
|
+
timestamp: new Date().toISOString()
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
handleEnterKey() {
|
|
289
|
+
if (!this.loading && !this.disabled && this.form) {
|
|
290
|
+
this.form.requestSubmit();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
handleForgotPassword(event) {
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
return {
|
|
296
|
+
timestamp: new Date().toISOString()
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
dispatchLoginSuccess(result) {
|
|
300
|
+
return { timestamp: new Date().toISOString() };
|
|
301
|
+
}
|
|
302
|
+
dispatchLoginError(error) {
|
|
303
|
+
return {
|
|
304
|
+
error,
|
|
305
|
+
timestamp: new Date().toISOString()
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
getFormData() {
|
|
309
|
+
const usernameInput = this.shadowRoot?.querySelector('#username');
|
|
310
|
+
const passwordInput = this.shadowRoot?.querySelector('#password');
|
|
311
|
+
const rememberInput = this.shadowRoot?.querySelector('input[name="remember"]');
|
|
312
|
+
return {
|
|
313
|
+
username: usernameInput?.value || '',
|
|
314
|
+
password: passwordInput?.value || '',
|
|
315
|
+
remember: rememberInput?.checked || false
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
showAlert(message, variant) {
|
|
319
|
+
this.alertMessage = message;
|
|
320
|
+
this.alertVariant = variant;
|
|
321
|
+
this.updateAlert();
|
|
322
|
+
}
|
|
323
|
+
clearAlert() {
|
|
324
|
+
this.alertMessage = '';
|
|
325
|
+
this.alertVariant = '';
|
|
326
|
+
this.updateAlert();
|
|
327
|
+
}
|
|
328
|
+
updateAlert() {
|
|
329
|
+
if (this.alertElement) {
|
|
330
|
+
this.alertElement.setAttribute('variant', this.alertVariant);
|
|
331
|
+
this.alertElement.textContent = this.alertMessage;
|
|
332
|
+
if (this.alertMessage) {
|
|
333
|
+
this.alertElement.removeAttribute('hidden');
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
this.alertElement.setAttribute('hidden', '');
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
updateLoadingState() {
|
|
341
|
+
if (this.buttonElement) {
|
|
342
|
+
if (this.loading) {
|
|
343
|
+
this.buttonElement.setAttribute('loading', '');
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
this.buttonElement.removeAttribute('loading');
|
|
347
|
+
}
|
|
348
|
+
if (this.disabled) {
|
|
349
|
+
this.buttonElement.setAttribute('disabled', '');
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.buttonElement.removeAttribute('disabled');
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
this.inputElements?.forEach(input => {
|
|
356
|
+
if (this.disabled || this.loading) {
|
|
357
|
+
input.setAttribute('disabled', '');
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
input.removeAttribute('disabled');
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
setError(message) {
|
|
365
|
+
this.showAlert(message, 'error');
|
|
366
|
+
}
|
|
367
|
+
clearError() {
|
|
368
|
+
this.clearAlert();
|
|
369
|
+
}
|
|
370
|
+
reset() {
|
|
371
|
+
if (this.form) {
|
|
372
|
+
this.form.reset();
|
|
373
|
+
}
|
|
374
|
+
this.clearAlert();
|
|
375
|
+
this.loading = false;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
return _classThis;
|
|
379
|
+
})();
|
|
380
|
+
|
|
381
|
+
export { SniceLogin };
|
|
382
|
+
//# sourceMappingURL=snice-login.js.map
|