snice 1.14.2 → 2.1.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/bin/templates/base/tsconfig.json +5 -4
- package/components/accordion/demo.html +403 -0
- package/components/alert/demo.html +445 -0
- package/components/avatar/demo.html +598 -0
- package/components/badge/demo.html +523 -0
- package/components/breadcrumbs/demo.html +404 -0
- package/components/button/demo.html +42 -0
- package/components/card/demo.html +525 -0
- package/components/checkbox/demo.html +253 -0
- package/components/chip/demo.html +383 -0
- package/components/date-picker/demo.html +191 -0
- package/components/divider/demo.html +233 -0
- package/components/drawer/demo.html +328 -0
- package/components/input/demo.html +303 -0
- package/components/input/test.html +77 -0
- package/components/layout/demo.html +538 -0
- package/components/login/demo-auth-controller.ts +185 -0
- package/components/login/demo.html +470 -0
- package/components/login/snice-login.ts +2 -2
- package/components/modal/demo.html +291 -0
- package/components/pagination/demo.html +395 -0
- package/components/progress/demo.html +510 -0
- package/components/radio/demo.html +287 -0
- package/components/select/demo.html +511 -0
- package/components/skeleton/demo.html +514 -0
- package/components/switch/demo.html +284 -0
- package/components/table/demo-table-controller.ts +100 -0
- package/components/table/demo.html +480 -0
- package/components/table/snice-table.ts +2 -2
- package/components/tabs/demo.html +487 -0
- package/components/toast/demo.html +329 -0
- package/components/tooltip/demo.html +350 -0
- package/dist/index.cjs +441 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.cjs.min.map +1 -1
- package/dist/index.esm.js +441 -329
- 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 +441 -329
- 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/dist/types/controller.d.ts +1 -1
- package/dist/types/element.d.ts +10 -10
- package/dist/types/events.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/observe.d.ts +1 -1
- package/dist/types/request-response.d.ts +2 -3
- package/dist/types/router.d.ts +1 -1
- package/package.json +9 -10
- package/dist/components/accordion/snice-accordion-item.d.ts +0 -25
- package/dist/components/accordion/snice-accordion-item.js +0 -260
- package/dist/components/accordion/snice-accordion-item.js.map +0 -1
- package/dist/components/accordion/snice-accordion.d.ts +0 -28
- package/dist/components/accordion/snice-accordion.js +0 -221
- package/dist/components/accordion/snice-accordion.js.map +0 -1
- package/dist/components/accordion/snice-accordion.types.d.ts +0 -29
- package/dist/components/accordion/snice-accordion.types.js +0 -2
- package/dist/components/accordion/snice-accordion.types.js.map +0 -1
- package/dist/components/alert/snice-alert.d.ts +0 -26
- package/dist/components/alert/snice-alert.js +0 -191
- package/dist/components/alert/snice-alert.js.map +0 -1
- package/dist/components/alert/snice-alert.types.d.ts +0 -11
- package/dist/components/alert/snice-alert.types.js +0 -2
- package/dist/components/alert/snice-alert.types.js.map +0 -1
- package/dist/components/avatar/snice-avatar.d.ts +0 -24
- package/dist/components/avatar/snice-avatar.js +0 -177
- package/dist/components/avatar/snice-avatar.js.map +0 -1
- package/dist/components/avatar/snice-avatar.types.d.ts +0 -12
- package/dist/components/avatar/snice-avatar.types.js +0 -2
- package/dist/components/avatar/snice-avatar.types.js.map +0 -1
- package/dist/components/badge/snice-badge.d.ts +0 -25
- package/dist/components/badge/snice-badge.js +0 -157
- package/dist/components/badge/snice-badge.js.map +0 -1
- package/dist/components/badge/snice-badge.types.d.ts +0 -15
- package/dist/components/badge/snice-badge.types.js +0 -2
- package/dist/components/badge/snice-badge.types.js.map +0 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +0 -27
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +0 -212
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.d.ts +0 -23
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.js +0 -2
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.js.map +0 -1
- package/dist/components/breadcrumbs/snice-crumb.d.ts +0 -9
- package/dist/components/breadcrumbs/snice-crumb.js +0 -50
- package/dist/components/breadcrumbs/snice-crumb.js.map +0 -1
- package/dist/components/button/snice-button.d.ts +0 -32
- package/dist/components/button/snice-button.js +0 -212
- package/dist/components/button/snice-button.js.map +0 -1
- package/dist/components/button/snice-button.types.d.ts +0 -23
- package/dist/components/button/snice-button.types.js +0 -2
- package/dist/components/button/snice-button.types.js.map +0 -1
- package/dist/components/card/snice-card.d.ts +0 -19
- package/dist/components/card/snice-card.js +0 -132
- package/dist/components/card/snice-card.js.map +0 -1
- package/dist/components/card/snice-card.types.d.ts +0 -9
- package/dist/components/card/snice-card.types.js +0 -2
- package/dist/components/card/snice-card.types.js.map +0 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +0 -34
- package/dist/components/checkbox/snice-checkbox.js +0 -289
- package/dist/components/checkbox/snice-checkbox.js.map +0 -1
- package/dist/components/checkbox/snice-checkbox.types.d.ts +0 -20
- package/dist/components/checkbox/snice-checkbox.types.js +0 -2
- package/dist/components/checkbox/snice-checkbox.types.js.map +0 -1
- package/dist/components/chip/snice-chip.d.ts +0 -28
- package/dist/components/chip/snice-chip.js +0 -203
- package/dist/components/chip/snice-chip.js.map +0 -1
- package/dist/components/chip/snice-chip.types.d.ts +0 -14
- package/dist/components/chip/snice-chip.types.js +0 -2
- package/dist/components/chip/snice-chip.types.js.map +0 -1
- package/dist/components/date-picker/snice-date-picker.d.ts +0 -82
- package/dist/components/date-picker/snice-date-picker.js +0 -880
- package/dist/components/date-picker/snice-date-picker.js.map +0 -1
- package/dist/components/date-picker/snice-date-picker.types.d.ts +0 -71
- package/dist/components/date-picker/snice-date-picker.types.js +0 -2
- package/dist/components/date-picker/snice-date-picker.types.js.map +0 -1
- package/dist/components/divider/snice-divider.d.ts +0 -17
- package/dist/components/divider/snice-divider.js +0 -111
- package/dist/components/divider/snice-divider.js.map +0 -1
- package/dist/components/divider/snice-divider.types.d.ts +0 -14
- package/dist/components/divider/snice-divider.types.js +0 -2
- package/dist/components/divider/snice-divider.types.js.map +0 -1
- package/dist/components/drawer/snice-drawer.d.ts +0 -37
- package/dist/components/drawer/snice-drawer.js +0 -335
- package/dist/components/drawer/snice-drawer.js.map +0 -1
- package/dist/components/drawer/snice-drawer.types.d.ts +0 -16
- package/dist/components/drawer/snice-drawer.types.js +0 -2
- package/dist/components/drawer/snice-drawer.types.js.map +0 -1
- package/dist/components/input/snice-input.d.ts +0 -65
- package/dist/components/input/snice-input.js +0 -603
- package/dist/components/input/snice-input.js.map +0 -1
- package/dist/components/input/snice-input.types.d.ts +0 -53
- package/dist/components/input/snice-input.types.js +0 -2
- package/dist/components/input/snice-input.types.js.map +0 -1
- package/dist/components/layout/snice-layout-blog.d.ts +0 -4
- package/dist/components/layout/snice-layout-blog.js +0 -56
- package/dist/components/layout/snice-layout-blog.js.map +0 -1
- package/dist/components/layout/snice-layout-card.d.ts +0 -6
- package/dist/components/layout/snice-layout-card.js +0 -53
- package/dist/components/layout/snice-layout-card.js.map +0 -1
- package/dist/components/layout/snice-layout-centered.d.ts +0 -5
- package/dist/components/layout/snice-layout-centered.js +0 -38
- package/dist/components/layout/snice-layout-centered.js.map +0 -1
- package/dist/components/layout/snice-layout-dashboard.d.ts +0 -4
- package/dist/components/layout/snice-layout-dashboard.js +0 -53
- package/dist/components/layout/snice-layout-dashboard.js.map +0 -1
- package/dist/components/layout/snice-layout-fullscreen.d.ts +0 -5
- package/dist/components/layout/snice-layout-fullscreen.js +0 -50
- package/dist/components/layout/snice-layout-fullscreen.js.map +0 -1
- package/dist/components/layout/snice-layout-landing.d.ts +0 -4
- package/dist/components/layout/snice-layout-landing.js +0 -55
- package/dist/components/layout/snice-layout-landing.js.map +0 -1
- package/dist/components/layout/snice-layout-minimal.d.ts +0 -4
- package/dist/components/layout/snice-layout-minimal.js +0 -27
- package/dist/components/layout/snice-layout-minimal.js.map +0 -1
- package/dist/components/layout/snice-layout-sidebar.d.ts +0 -5
- package/dist/components/layout/snice-layout-sidebar.js +0 -64
- package/dist/components/layout/snice-layout-sidebar.js.map +0 -1
- package/dist/components/layout/snice-layout-split.d.ts +0 -6
- package/dist/components/layout/snice-layout-split.js +0 -47
- package/dist/components/layout/snice-layout-split.js.map +0 -1
- package/dist/components/layout/snice-layout.d.ts +0 -4
- package/dist/components/layout/snice-layout.js +0 -43
- package/dist/components/layout/snice-layout.js.map +0 -1
- package/dist/components/layout/snice-layout.types.d.ts +0 -3
- package/dist/components/layout/snice-layout.types.js +0 -2
- package/dist/components/layout/snice-layout.types.js.map +0 -1
- package/dist/components/login/snice-login.d.ts +0 -45
- package/dist/components/login/snice-login.js +0 -385
- package/dist/components/login/snice-login.js.map +0 -1
- package/dist/components/login/snice-login.types.d.ts +0 -31
- package/dist/components/login/snice-login.types.js +0 -2
- package/dist/components/login/snice-login.types.js.map +0 -1
- package/dist/components/modal/snice-modal.d.ts +0 -32
- package/dist/components/modal/snice-modal.js +0 -288
- package/dist/components/modal/snice-modal.js.map +0 -1
- package/dist/components/modal/snice-modal.types.d.ts +0 -18
- package/dist/components/modal/snice-modal.types.js +0 -2
- package/dist/components/modal/snice-modal.types.js.map +0 -1
- package/dist/components/pagination/snice-pagination.d.ts +0 -26
- package/dist/components/pagination/snice-pagination.js +0 -373
- package/dist/components/pagination/snice-pagination.js.map +0 -1
- package/dist/components/pagination/snice-pagination.types.d.ts +0 -18
- package/dist/components/pagination/snice-pagination.types.js +0 -2
- package/dist/components/pagination/snice-pagination.types.js.map +0 -1
- package/dist/components/progress/snice-progress.d.ts +0 -35
- package/dist/components/progress/snice-progress.js +0 -295
- package/dist/components/progress/snice-progress.js.map +0 -1
- package/dist/components/progress/snice-progress.types.d.ts +0 -18
- package/dist/components/progress/snice-progress.types.js +0 -2
- package/dist/components/progress/snice-progress.types.js.map +0 -1
- package/dist/components/radio/snice-radio.d.ts +0 -33
- package/dist/components/radio/snice-radio.js +0 -286
- package/dist/components/radio/snice-radio.js.map +0 -1
- package/dist/components/radio/snice-radio.types.d.ts +0 -19
- package/dist/components/radio/snice-radio.types.js +0 -2
- package/dist/components/radio/snice-radio.types.js.map +0 -1
- package/dist/components/select/snice-option.d.ts +0 -17
- package/dist/components/select/snice-option.js +0 -77
- package/dist/components/select/snice-option.js.map +0 -1
- package/dist/components/select/snice-option.types.d.ts +0 -14
- package/dist/components/select/snice-option.types.js +0 -2
- package/dist/components/select/snice-option.types.js.map +0 -1
- package/dist/components/select/snice-select.d.ts +0 -89
- package/dist/components/select/snice-select.js +0 -900
- package/dist/components/select/snice-select.js.map +0 -1
- package/dist/components/select/snice-select.types.d.ts +0 -49
- package/dist/components/select/snice-select.types.js +0 -2
- package/dist/components/select/snice-select.types.js.map +0 -1
- package/dist/components/skeleton/snice-skeleton.d.ts +0 -16
- package/dist/components/skeleton/snice-skeleton.js +0 -159
- package/dist/components/skeleton/snice-skeleton.js.map +0 -1
- package/dist/components/skeleton/snice-skeleton.types.d.ts +0 -10
- package/dist/components/skeleton/snice-skeleton.types.js +0 -2
- package/dist/components/skeleton/snice-skeleton.types.js.map +0 -1
- package/dist/components/switch/snice-switch.d.ts +0 -38
- package/dist/components/switch/snice-switch.js +0 -309
- package/dist/components/switch/snice-switch.js.map +0 -1
- package/dist/components/switch/snice-switch.types.d.ts +0 -21
- package/dist/components/switch/snice-switch.types.js +0 -2
- package/dist/components/switch/snice-switch.types.js.map +0 -1
- package/dist/components/symbols.d.ts +0 -1
- package/dist/components/symbols.js +0 -20
- package/dist/components/symbols.js.map +0 -1
- package/dist/components/table/snice-cell-boolean.d.ts +0 -21
- package/dist/components/table/snice-cell-boolean.js +0 -152
- package/dist/components/table/snice-cell-boolean.js.map +0 -1
- package/dist/components/table/snice-cell-date.d.ts +0 -24
- package/dist/components/table/snice-cell-date.js +0 -240
- package/dist/components/table/snice-cell-date.js.map +0 -1
- package/dist/components/table/snice-cell-duration.d.ts +0 -16
- package/dist/components/table/snice-cell-duration.js +0 -123
- package/dist/components/table/snice-cell-duration.js.map +0 -1
- package/dist/components/table/snice-cell-filesize.d.ts +0 -16
- package/dist/components/table/snice-cell-filesize.js +0 -119
- package/dist/components/table/snice-cell-filesize.js.map +0 -1
- package/dist/components/table/snice-cell-number.d.ts +0 -23
- package/dist/components/table/snice-cell-number.js +0 -202
- package/dist/components/table/snice-cell-number.js.map +0 -1
- package/dist/components/table/snice-cell-progress.d.ts +0 -17
- package/dist/components/table/snice-cell-progress.js +0 -114
- package/dist/components/table/snice-cell-progress.js.map +0 -1
- package/dist/components/table/snice-cell-rating.d.ts +0 -17
- package/dist/components/table/snice-cell-rating.js +0 -113
- package/dist/components/table/snice-cell-rating.js.map +0 -1
- package/dist/components/table/snice-cell-sparkline.d.ts +0 -29
- package/dist/components/table/snice-cell-sparkline.js +0 -290
- package/dist/components/table/snice-cell-sparkline.js.map +0 -1
- package/dist/components/table/snice-cell-text.d.ts +0 -19
- package/dist/components/table/snice-cell-text.js +0 -153
- package/dist/components/table/snice-cell-text.js.map +0 -1
- package/dist/components/table/snice-cell.d.ts +0 -32
- package/dist/components/table/snice-cell.js +0 -451
- package/dist/components/table/snice-cell.js.map +0 -1
- package/dist/components/table/snice-column.d.ts +0 -62
- package/dist/components/table/snice-column.js +0 -440
- package/dist/components/table/snice-column.js.map +0 -1
- package/dist/components/table/snice-header.d.ts +0 -33
- package/dist/components/table/snice-header.js +0 -303
- package/dist/components/table/snice-header.js.map +0 -1
- package/dist/components/table/snice-progress.d.ts +0 -10
- package/dist/components/table/snice-progress.js +0 -91
- package/dist/components/table/snice-progress.js.map +0 -1
- package/dist/components/table/snice-rating.d.ts +0 -9
- package/dist/components/table/snice-rating.js +0 -68
- package/dist/components/table/snice-rating.js.map +0 -1
- package/dist/components/table/snice-row.d.ts +0 -43
- package/dist/components/table/snice-row.js +0 -365
- package/dist/components/table/snice-row.js.map +0 -1
- package/dist/components/table/snice-table.d.ts +0 -69
- package/dist/components/table/snice-table.js +0 -814
- package/dist/components/table/snice-table.js.map +0 -1
- package/dist/components/table/snice-table.types.d.ts +0 -137
- package/dist/components/table/snice-table.types.js +0 -2
- package/dist/components/table/snice-table.types.js.map +0 -1
- package/dist/components/tabs/snice-tab-panel.d.ts +0 -12
- package/dist/components/tabs/snice-tab-panel.js +0 -78
- package/dist/components/tabs/snice-tab-panel.js.map +0 -1
- package/dist/components/tabs/snice-tab.d.ts +0 -13
- package/dist/components/tabs/snice-tab.js +0 -90
- package/dist/components/tabs/snice-tab.js.map +0 -1
- package/dist/components/tabs/snice-tabs.d.ts +0 -34
- package/dist/components/tabs/snice-tabs.js +0 -367
- package/dist/components/tabs/snice-tabs.js.map +0 -1
- package/dist/components/tabs/snice-tabs.types.d.ts +0 -23
- package/dist/components/tabs/snice-tabs.types.js +0 -2
- package/dist/components/tabs/snice-tabs.types.js.map +0 -1
- package/dist/components/toast/snice-toast-container.d.ts +0 -25
- package/dist/components/toast/snice-toast-container.js +0 -251
- package/dist/components/toast/snice-toast-container.js.map +0 -1
- package/dist/components/toast/snice-toast.d.ts +0 -23
- package/dist/components/toast/snice-toast.js +0 -316
- package/dist/components/toast/snice-toast.js.map +0 -1
- package/dist/components/toast/snice-toast.types.d.ts +0 -30
- package/dist/components/toast/snice-toast.types.js +0 -2
- package/dist/components/toast/snice-toast.types.js.map +0 -1
- package/dist/components/tooltip/snice-tooltip.d.ts +0 -50
- package/dist/components/tooltip/snice-tooltip.js +0 -656
- package/dist/components/tooltip/snice-tooltip.js.map +0 -1
- package/dist/components/tooltip/snice-tooltip.types.d.ts +0 -18
- package/dist/components/tooltip/snice-tooltip.types.js +0 -2
- package/dist/components/tooltip/snice-tooltip.types.js.map +0 -1
- package/dist/components/transitions.d.ts +0 -11
- package/dist/components/transitions.js +0 -69
- package/dist/components/transitions.js.map +0 -1
- package/dist/index.cjs.min +0 -15
- package/dist/symbols.cjs +0 -103
- package/dist/transitions.cjs +0 -219
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { element, property, watch, query, on, dispatch, part } from 'snice';
|
|
11
|
-
import css from './snice-alert.css?inline';
|
|
12
|
-
let SniceAlert = class SniceAlert extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.variant = 'info';
|
|
16
|
-
this.size = 'medium';
|
|
17
|
-
this.title = '';
|
|
18
|
-
this.dismissible = false;
|
|
19
|
-
this.icon = '';
|
|
20
|
-
this.isHidden = false;
|
|
21
|
-
}
|
|
22
|
-
html() {
|
|
23
|
-
return /*html*/ `
|
|
24
|
-
<div class="alert ${this.isHidden ? 'alert--hidden' : ''}" role="alert" aria-live="polite">
|
|
25
|
-
<div part="icon-section"></div>
|
|
26
|
-
<div class="alert-content">
|
|
27
|
-
<div part="title-section"></div>
|
|
28
|
-
<div part="description-section"></div>
|
|
29
|
-
</div>
|
|
30
|
-
<div part="dismiss-section"></div>
|
|
31
|
-
</div>
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
renderIconSection() {
|
|
35
|
-
const hasIcon = this.icon || this.shouldShowDefaultIcon();
|
|
36
|
-
return hasIcon ? /*html*/ `
|
|
37
|
-
<div class="alert-icon ${!this.icon ? 'alert-icon--default' : ''}">
|
|
38
|
-
${this.icon || ''}
|
|
39
|
-
</div>
|
|
40
|
-
` : '';
|
|
41
|
-
}
|
|
42
|
-
renderTitleSection() {
|
|
43
|
-
return this.title ? /*html*/ `
|
|
44
|
-
<div class="alert-title">${this.title}</div>
|
|
45
|
-
` : '';
|
|
46
|
-
}
|
|
47
|
-
renderDescriptionSection() {
|
|
48
|
-
return /*html*/ `
|
|
49
|
-
<div class="alert-description">
|
|
50
|
-
<slot></slot>
|
|
51
|
-
</div>
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
renderDismissSection() {
|
|
55
|
-
return this.dismissible ? /*html*/ `
|
|
56
|
-
<button class="alert-dismiss" type="button" aria-label="Dismiss alert">
|
|
57
|
-
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
58
|
-
<path d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z"/>
|
|
59
|
-
</svg>
|
|
60
|
-
</button>
|
|
61
|
-
` : '';
|
|
62
|
-
}
|
|
63
|
-
css() {
|
|
64
|
-
return css;
|
|
65
|
-
}
|
|
66
|
-
shouldShowDefaultIcon() {
|
|
67
|
-
// Show default icons for variants unless explicitly disabled
|
|
68
|
-
return this.icon !== 'none';
|
|
69
|
-
}
|
|
70
|
-
handleDismiss() {
|
|
71
|
-
this.hide();
|
|
72
|
-
return {
|
|
73
|
-
variant: this.variant,
|
|
74
|
-
title: this.title
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
handleAnimationEnd(event) {
|
|
78
|
-
if (event.animationName === 'slideOut') {
|
|
79
|
-
this.isHidden = true;
|
|
80
|
-
if (this.alertElement) {
|
|
81
|
-
this.alertElement.classList.add('alert--hidden');
|
|
82
|
-
this.alertElement.classList.remove('alert--hiding');
|
|
83
|
-
}
|
|
84
|
-
this.dispatchAlertHidden();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
dispatchAlertHidden() {
|
|
88
|
-
return {
|
|
89
|
-
variant: this.variant,
|
|
90
|
-
title: this.title
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
dispatchAlertShown() {
|
|
94
|
-
return {
|
|
95
|
-
variant: this.variant,
|
|
96
|
-
title: this.title
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
show() {
|
|
100
|
-
this.isHidden = false;
|
|
101
|
-
if (this.alertElement) {
|
|
102
|
-
this.alertElement.classList.remove('alert--hidden', 'alert--hiding');
|
|
103
|
-
}
|
|
104
|
-
this.dispatchAlertShown();
|
|
105
|
-
}
|
|
106
|
-
hide() {
|
|
107
|
-
if (this.alertElement && !this.isHidden) {
|
|
108
|
-
this.alertElement.classList.add('alert--hiding');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
__decorate([
|
|
113
|
-
property({ reflect: true }),
|
|
114
|
-
__metadata("design:type", String)
|
|
115
|
-
], SniceAlert.prototype, "variant", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
property({ reflect: true }),
|
|
118
|
-
__metadata("design:type", String)
|
|
119
|
-
], SniceAlert.prototype, "size", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
property({ reflect: true }),
|
|
122
|
-
__metadata("design:type", Object)
|
|
123
|
-
], SniceAlert.prototype, "title", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: Boolean, reflect: true }),
|
|
126
|
-
__metadata("design:type", Object)
|
|
127
|
-
], SniceAlert.prototype, "dismissible", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
property({ reflect: true }),
|
|
130
|
-
__metadata("design:type", Object)
|
|
131
|
-
], SniceAlert.prototype, "icon", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
query('.alert'),
|
|
134
|
-
__metadata("design:type", HTMLElement)
|
|
135
|
-
], SniceAlert.prototype, "alertElement", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
part('icon-section'),
|
|
138
|
-
__metadata("design:type", Function),
|
|
139
|
-
__metadata("design:paramtypes", []),
|
|
140
|
-
__metadata("design:returntype", void 0)
|
|
141
|
-
], SniceAlert.prototype, "renderIconSection", null);
|
|
142
|
-
__decorate([
|
|
143
|
-
watch('title'),
|
|
144
|
-
part('title-section'),
|
|
145
|
-
__metadata("design:type", Function),
|
|
146
|
-
__metadata("design:paramtypes", []),
|
|
147
|
-
__metadata("design:returntype", void 0)
|
|
148
|
-
], SniceAlert.prototype, "renderTitleSection", null);
|
|
149
|
-
__decorate([
|
|
150
|
-
part('description-section'),
|
|
151
|
-
__metadata("design:type", Function),
|
|
152
|
-
__metadata("design:paramtypes", []),
|
|
153
|
-
__metadata("design:returntype", void 0)
|
|
154
|
-
], SniceAlert.prototype, "renderDescriptionSection", null);
|
|
155
|
-
__decorate([
|
|
156
|
-
watch('dismissible'),
|
|
157
|
-
part('dismiss-section'),
|
|
158
|
-
__metadata("design:type", Function),
|
|
159
|
-
__metadata("design:paramtypes", []),
|
|
160
|
-
__metadata("design:returntype", void 0)
|
|
161
|
-
], SniceAlert.prototype, "renderDismissSection", null);
|
|
162
|
-
__decorate([
|
|
163
|
-
on('click', '.alert-dismiss'),
|
|
164
|
-
dispatch('alert-dismiss'),
|
|
165
|
-
__metadata("design:type", Function),
|
|
166
|
-
__metadata("design:paramtypes", []),
|
|
167
|
-
__metadata("design:returntype", void 0)
|
|
168
|
-
], SniceAlert.prototype, "handleDismiss", null);
|
|
169
|
-
__decorate([
|
|
170
|
-
on('animationend', '.alert'),
|
|
171
|
-
__metadata("design:type", Function),
|
|
172
|
-
__metadata("design:paramtypes", [AnimationEvent]),
|
|
173
|
-
__metadata("design:returntype", void 0)
|
|
174
|
-
], SniceAlert.prototype, "handleAnimationEnd", null);
|
|
175
|
-
__decorate([
|
|
176
|
-
dispatch('alert-hidden'),
|
|
177
|
-
__metadata("design:type", Function),
|
|
178
|
-
__metadata("design:paramtypes", []),
|
|
179
|
-
__metadata("design:returntype", void 0)
|
|
180
|
-
], SniceAlert.prototype, "dispatchAlertHidden", null);
|
|
181
|
-
__decorate([
|
|
182
|
-
dispatch('alert-shown'),
|
|
183
|
-
__metadata("design:type", Function),
|
|
184
|
-
__metadata("design:paramtypes", []),
|
|
185
|
-
__metadata("design:returntype", void 0)
|
|
186
|
-
], SniceAlert.prototype, "dispatchAlertShown", null);
|
|
187
|
-
SniceAlert = __decorate([
|
|
188
|
-
element('snice-alert')
|
|
189
|
-
], SniceAlert);
|
|
190
|
-
export { SniceAlert };
|
|
191
|
-
//# sourceMappingURL=snice-alert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-alert.js","sourceRoot":"","sources":["../../../components/alert/snice-alert.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAIpC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QAEL,YAAO,GAAiB,MAAM,CAAC;QAG/B,SAAI,GAAc,QAAQ,CAAC;QAG3B,UAAK,GAAG,EAAE,CAAC;QAGX,gBAAW,GAAG,KAAK,CAAC;QAGpB,SAAI,GAAG,EAAE,CAAC;QAKF,aAAQ,GAAG,KAAK,CAAC;IAoH3B,CAAC;IAlHC,IAAI;QACF,OAAO,QAAQ,CAAA;0BACO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;;;;;;;;KAQzD,CAAC;IACJ,CAAC;IAGD,iBAAiB;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC1D,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAA;+BACE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAq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B,CAAC;;;;sDASvB;AAcD;IAFC,EAAE,CAAC,OAAO,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC;;;;+CAOzB;AAGD;IADC,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC;;qCACH,cAAc;;oDASvC;AAGO;IADP,QAAQ,CAAC,cAAc,CAAC;;;;qDAMxB;AAGO;IADP,QAAQ,CAAC,aAAa,CAAC;;;;oDAMvB;AAvHU,UAAU;IADtB,OAAO,CAAC,aAAa,CAAC;GACV,UAAU,CAuItB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
2
|
-
export type AlertSize = 'small' | 'medium' | 'large';
|
|
3
|
-
export interface SniceAlertElement extends HTMLElement {
|
|
4
|
-
variant: AlertVariant;
|
|
5
|
-
size: AlertSize;
|
|
6
|
-
title: string;
|
|
7
|
-
dismissible: boolean;
|
|
8
|
-
icon: string;
|
|
9
|
-
show(): void;
|
|
10
|
-
hide(): void;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-alert.types.js","sourceRoot":"","sources":["../../../components/alert/snice-alert.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AvatarSize, AvatarShape, SniceAvatarElement } from './snice-avatar.types';
|
|
2
|
-
export declare class SniceAvatar extends HTMLElement implements SniceAvatarElement {
|
|
3
|
-
src: string;
|
|
4
|
-
alt: string;
|
|
5
|
-
name: string;
|
|
6
|
-
size: AvatarSize;
|
|
7
|
-
shape: AvatarShape;
|
|
8
|
-
fallbackColor: string;
|
|
9
|
-
fallbackBackground: string;
|
|
10
|
-
imageElement?: HTMLImageElement;
|
|
11
|
-
fallbackElement?: HTMLElement;
|
|
12
|
-
private imageError;
|
|
13
|
-
html(): string;
|
|
14
|
-
renderImageSection(): string;
|
|
15
|
-
renderFallbackSection(): string;
|
|
16
|
-
css(): string;
|
|
17
|
-
init(): void;
|
|
18
|
-
private setupImageHandlers;
|
|
19
|
-
handleImageLoad(): void;
|
|
20
|
-
handleImageError(): void;
|
|
21
|
-
getInitials(name: string): string;
|
|
22
|
-
private getColorClass;
|
|
23
|
-
private renderIcon;
|
|
24
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { element, property, watch, query, ready, on, part } from 'snice';
|
|
11
|
-
import css from './snice-avatar.css?inline';
|
|
12
|
-
let SniceAvatar = class SniceAvatar extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.src = '';
|
|
16
|
-
this.alt = '';
|
|
17
|
-
this.name = '';
|
|
18
|
-
this.size = 'medium';
|
|
19
|
-
this.shape = 'circle';
|
|
20
|
-
this.fallbackColor = '#ffffff';
|
|
21
|
-
this.fallbackBackground = '';
|
|
22
|
-
this.imageError = false;
|
|
23
|
-
}
|
|
24
|
-
html() {
|
|
25
|
-
const colorClass = this.fallbackBackground ? '' : this.getColorClass(this.name);
|
|
26
|
-
const bgStyle = this.fallbackBackground ? `style="--avatar-bg: ${this.fallbackBackground}; --avatar-color: ${this.fallbackColor}"` : '';
|
|
27
|
-
return /*html*/ `
|
|
28
|
-
<div class="avatar ${colorClass}" ${bgStyle}>
|
|
29
|
-
<div part="image-section"></div>
|
|
30
|
-
<div part="fallback-section"></div>
|
|
31
|
-
</div>
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
renderImageSection() {
|
|
35
|
-
return this.src ? /*html*/ `
|
|
36
|
-
<img class="avatar-image ${this.imageError ? 'avatar-image--error' : ''}"
|
|
37
|
-
src="${this.src}"
|
|
38
|
-
alt="${this.alt || this.name}"
|
|
39
|
-
loading="lazy">
|
|
40
|
-
` : '';
|
|
41
|
-
}
|
|
42
|
-
renderFallbackSection() {
|
|
43
|
-
const initials = this.getInitials(this.name);
|
|
44
|
-
return /*html*/ `
|
|
45
|
-
<div class="avatar-fallback ${!this.src || this.imageError ? 'avatar-fallback--visible' : ''}">
|
|
46
|
-
${initials || this.renderIcon()}
|
|
47
|
-
</div>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
css() {
|
|
51
|
-
return css;
|
|
52
|
-
}
|
|
53
|
-
init() {
|
|
54
|
-
this.setupImageHandlers();
|
|
55
|
-
}
|
|
56
|
-
setupImageHandlers() {
|
|
57
|
-
if (this.imageElement) {
|
|
58
|
-
this.imageElement.addEventListener('load', this.handleImageLoad.bind(this));
|
|
59
|
-
this.imageElement.addEventListener('error', this.handleImageError.bind(this));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
handleImageLoad() {
|
|
63
|
-
this.imageError = false;
|
|
64
|
-
this.renderImageSection();
|
|
65
|
-
this.renderFallbackSection();
|
|
66
|
-
}
|
|
67
|
-
handleImageError() {
|
|
68
|
-
this.imageError = true;
|
|
69
|
-
this.renderImageSection();
|
|
70
|
-
this.renderFallbackSection();
|
|
71
|
-
}
|
|
72
|
-
getInitials(name) {
|
|
73
|
-
if (!name)
|
|
74
|
-
return '';
|
|
75
|
-
const words = name.trim().split(/\s+/);
|
|
76
|
-
if (words.length === 1) {
|
|
77
|
-
return words[0].substring(0, 2).toUpperCase();
|
|
78
|
-
}
|
|
79
|
-
return (words[0][0] + words[words.length - 1][0]).toUpperCase();
|
|
80
|
-
}
|
|
81
|
-
getColorClass(name) {
|
|
82
|
-
if (!name)
|
|
83
|
-
return '';
|
|
84
|
-
const colors = [
|
|
85
|
-
'red', 'orange', 'yellow', 'lime', 'green',
|
|
86
|
-
'teal', 'cyan', 'sky', 'blue', 'indigo',
|
|
87
|
-
'violet', 'purple', 'fuchsia', 'pink', 'rose'
|
|
88
|
-
];
|
|
89
|
-
// Hash the name to get a consistent index
|
|
90
|
-
let hash = 0;
|
|
91
|
-
for (let i = 0; i < name.length; i++) {
|
|
92
|
-
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
93
|
-
}
|
|
94
|
-
const colorIndex = Math.abs(hash) % colors.length;
|
|
95
|
-
return `avatar--${colors[colorIndex]}`;
|
|
96
|
-
}
|
|
97
|
-
renderIcon() {
|
|
98
|
-
return /*html*/ `
|
|
99
|
-
<svg class="avatar-icon" viewBox="0 0 24 24" fill="currentColor">
|
|
100
|
-
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
|
101
|
-
</svg>
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
__decorate([
|
|
106
|
-
property({ reflect: true }),
|
|
107
|
-
__metadata("design:type", Object)
|
|
108
|
-
], SniceAvatar.prototype, "src", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
property({ reflect: true }),
|
|
111
|
-
__metadata("design:type", Object)
|
|
112
|
-
], SniceAvatar.prototype, "alt", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
property({ reflect: true }),
|
|
115
|
-
__metadata("design:type", Object)
|
|
116
|
-
], SniceAvatar.prototype, "name", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
property({ reflect: true }),
|
|
119
|
-
__metadata("design:type", String)
|
|
120
|
-
], SniceAvatar.prototype, "size", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ reflect: true }),
|
|
123
|
-
__metadata("design:type", String)
|
|
124
|
-
], SniceAvatar.prototype, "shape", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
property({ attribute: 'fallback-color', reflect: true }),
|
|
127
|
-
__metadata("design:type", Object)
|
|
128
|
-
], SniceAvatar.prototype, "fallbackColor", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
property({ attribute: 'fallback-background', reflect: true }),
|
|
131
|
-
__metadata("design:type", Object)
|
|
132
|
-
], SniceAvatar.prototype, "fallbackBackground", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
query('.avatar-image'),
|
|
135
|
-
__metadata("design:type", HTMLImageElement)
|
|
136
|
-
], SniceAvatar.prototype, "imageElement", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
query('.avatar-fallback'),
|
|
139
|
-
__metadata("design:type", HTMLElement)
|
|
140
|
-
], SniceAvatar.prototype, "fallbackElement", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
watch('src'),
|
|
143
|
-
part('image-section'),
|
|
144
|
-
__metadata("design:type", Function),
|
|
145
|
-
__metadata("design:paramtypes", []),
|
|
146
|
-
__metadata("design:returntype", void 0)
|
|
147
|
-
], SniceAvatar.prototype, "renderImageSection", null);
|
|
148
|
-
__decorate([
|
|
149
|
-
watch('name'),
|
|
150
|
-
part('fallback-section'),
|
|
151
|
-
__metadata("design:type", Function),
|
|
152
|
-
__metadata("design:paramtypes", []),
|
|
153
|
-
__metadata("design:returntype", void 0)
|
|
154
|
-
], SniceAvatar.prototype, "renderFallbackSection", null);
|
|
155
|
-
__decorate([
|
|
156
|
-
ready(),
|
|
157
|
-
__metadata("design:type", Function),
|
|
158
|
-
__metadata("design:paramtypes", []),
|
|
159
|
-
__metadata("design:returntype", void 0)
|
|
160
|
-
], SniceAvatar.prototype, "init", null);
|
|
161
|
-
__decorate([
|
|
162
|
-
on('load', '.avatar-image'),
|
|
163
|
-
__metadata("design:type", Function),
|
|
164
|
-
__metadata("design:paramtypes", []),
|
|
165
|
-
__metadata("design:returntype", void 0)
|
|
166
|
-
], SniceAvatar.prototype, "handleImageLoad", null);
|
|
167
|
-
__decorate([
|
|
168
|
-
on('error', '.avatar-image'),
|
|
169
|
-
__metadata("design:type", Function),
|
|
170
|
-
__metadata("design:paramtypes", []),
|
|
171
|
-
__metadata("design:returntype", void 0)
|
|
172
|
-
], SniceAvatar.prototype, "handleImageError", null);
|
|
173
|
-
SniceAvatar = __decorate([
|
|
174
|
-
element('snice-avatar')
|
|
175
|
-
], SniceAvatar);
|
|
176
|
-
export { SniceAvatar };
|
|
177
|
-
//# sourceMappingURL=snice-avatar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-avatar.js","sourceRoot":"","sources":["../../../components/avatar/snice-avatar.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,GAAG,MAAM,2BAA2B,CAAC;AAIrC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QAEL,QAAG,GAAG,EAAE,CAAC;QAGT,QAAG,GAAG,EAAE,CAAC;QAGT,SAAI,GAAG,EAAE,CAAC;QAGV,SAAI,GAAe,QAAQ,CAAC;QAG5B,UAAK,GAAgB,QAAQ,CAAC;QAG9B,kBAAa,GAAG,SAAS,CAAC;QAG1B,uBAAkB,GAAG,EAAE,CAAC;QAQhB,eAAU,GAAG,KAAK,CAAC;IAsG7B,CAAC;IApGC,IAAI;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAA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UD;IADC,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC;;;;kDAK3B;AAGD;IADC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC;;;;mDAK5B;AA5FU,WAAW;IADvB,OAAO,CAAC,cAAc,CAAC;GACX,WAAW,CAkIvB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type AvatarSize = 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl';
|
|
2
|
-
export type AvatarShape = 'circle' | 'square' | 'rounded';
|
|
3
|
-
export interface SniceAvatarElement extends HTMLElement {
|
|
4
|
-
src: string;
|
|
5
|
-
alt: string;
|
|
6
|
-
name: string;
|
|
7
|
-
size: AvatarSize;
|
|
8
|
-
shape: AvatarShape;
|
|
9
|
-
fallbackColor: string;
|
|
10
|
-
fallbackBackground: string;
|
|
11
|
-
getInitials(name: string): string;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-avatar.types.js","sourceRoot":"","sources":["../../../components/avatar/snice-avatar.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { BadgeVariant, BadgePosition, BadgeSize, SniceBadgeElement } from './snice-badge.types';
|
|
2
|
-
export declare class SniceBadge extends HTMLElement implements SniceBadgeElement {
|
|
3
|
-
content: string;
|
|
4
|
-
count: number;
|
|
5
|
-
max: number;
|
|
6
|
-
dot: boolean;
|
|
7
|
-
variant: BadgeVariant;
|
|
8
|
-
position: BadgePosition;
|
|
9
|
-
inline: boolean;
|
|
10
|
-
size: BadgeSize;
|
|
11
|
-
pulse: boolean;
|
|
12
|
-
offset: number;
|
|
13
|
-
badgeElement?: HTMLElement;
|
|
14
|
-
html(): string;
|
|
15
|
-
renderBadgeSection(): string;
|
|
16
|
-
css(): string;
|
|
17
|
-
private getDisplayContent;
|
|
18
|
-
private shouldShowBadge;
|
|
19
|
-
init(): void;
|
|
20
|
-
updateOffset(): void;
|
|
21
|
-
setBadgeContent(content: string): void;
|
|
22
|
-
setBadgeCount(count: number): void;
|
|
23
|
-
showDot(): void;
|
|
24
|
-
hide(): void;
|
|
25
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { element, property, watch, query, ready, part } from 'snice';
|
|
11
|
-
import css from './snice-badge.css?inline';
|
|
12
|
-
let SniceBadge = class SniceBadge extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.content = '';
|
|
16
|
-
this.count = 0;
|
|
17
|
-
this.max = 99;
|
|
18
|
-
this.dot = false;
|
|
19
|
-
this.variant = 'default';
|
|
20
|
-
this.position = 'top-right';
|
|
21
|
-
this.inline = false;
|
|
22
|
-
this.size = 'medium';
|
|
23
|
-
this.pulse = false;
|
|
24
|
-
this.offset = 0;
|
|
25
|
-
}
|
|
26
|
-
html() {
|
|
27
|
-
return /*html*/ `
|
|
28
|
-
<div class="badge-wrapper">
|
|
29
|
-
<slot></slot>
|
|
30
|
-
<div part="badge-section"></div>
|
|
31
|
-
</div>
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
renderBadgeSection() {
|
|
35
|
-
const displayContent = this.getDisplayContent();
|
|
36
|
-
const showBadge = this.shouldShowBadge();
|
|
37
|
-
if (!showBadge)
|
|
38
|
-
return '';
|
|
39
|
-
return /*html*/ `
|
|
40
|
-
<span class="badge ${this.dot ? 'badge--dot' : ''} ${this.pulse ? 'badge--pulse' : ''}"
|
|
41
|
-
aria-label="${displayContent}"
|
|
42
|
-
role="status">
|
|
43
|
-
${!this.dot ? displayContent : ''}
|
|
44
|
-
</span>
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
css() {
|
|
48
|
-
return css;
|
|
49
|
-
}
|
|
50
|
-
getDisplayContent() {
|
|
51
|
-
if (this.dot)
|
|
52
|
-
return 'notification';
|
|
53
|
-
if (this.content)
|
|
54
|
-
return this.content;
|
|
55
|
-
if (this.count > 0) {
|
|
56
|
-
return this.count > this.max ? `${this.max}+` : String(this.count);
|
|
57
|
-
}
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
shouldShowBadge() {
|
|
61
|
-
return this.dot || this.content !== '' || this.count > 0;
|
|
62
|
-
}
|
|
63
|
-
init() {
|
|
64
|
-
this.updateOffset();
|
|
65
|
-
}
|
|
66
|
-
updateOffset() {
|
|
67
|
-
this.style.setProperty('--badge-offset', `${this.offset}px`);
|
|
68
|
-
}
|
|
69
|
-
setBadgeContent(content) {
|
|
70
|
-
this.content = content;
|
|
71
|
-
this.count = 0;
|
|
72
|
-
this.dot = false;
|
|
73
|
-
}
|
|
74
|
-
setBadgeCount(count) {
|
|
75
|
-
this.count = count;
|
|
76
|
-
this.content = '';
|
|
77
|
-
this.dot = false;
|
|
78
|
-
}
|
|
79
|
-
showDot() {
|
|
80
|
-
this.dot = true;
|
|
81
|
-
this.content = '';
|
|
82
|
-
this.count = 0;
|
|
83
|
-
}
|
|
84
|
-
hide() {
|
|
85
|
-
this.dot = false;
|
|
86
|
-
this.content = '';
|
|
87
|
-
this.count = 0;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
__decorate([
|
|
91
|
-
property({ reflect: true }),
|
|
92
|
-
__metadata("design:type", Object)
|
|
93
|
-
], SniceBadge.prototype, "content", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
property({ type: Number, reflect: true }),
|
|
96
|
-
__metadata("design:type", Object)
|
|
97
|
-
], SniceBadge.prototype, "count", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
property({ type: Number, reflect: true }),
|
|
100
|
-
__metadata("design:type", Object)
|
|
101
|
-
], SniceBadge.prototype, "max", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
property({ type: Boolean, reflect: true }),
|
|
104
|
-
__metadata("design:type", Object)
|
|
105
|
-
], SniceBadge.prototype, "dot", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
property({ reflect: true }),
|
|
108
|
-
__metadata("design:type", String)
|
|
109
|
-
], SniceBadge.prototype, "variant", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
property({ reflect: true }),
|
|
112
|
-
__metadata("design:type", String)
|
|
113
|
-
], SniceBadge.prototype, "position", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
property({ type: Boolean, reflect: true }),
|
|
116
|
-
__metadata("design:type", Object)
|
|
117
|
-
], SniceBadge.prototype, "inline", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
property({ reflect: true }),
|
|
120
|
-
__metadata("design:type", String)
|
|
121
|
-
], SniceBadge.prototype, "size", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
property({ type: Boolean, reflect: true }),
|
|
124
|
-
__metadata("design:type", Object)
|
|
125
|
-
], SniceBadge.prototype, "pulse", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
property({ type: Number, reflect: true }),
|
|
128
|
-
__metadata("design:type", Object)
|
|
129
|
-
], SniceBadge.prototype, "offset", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
query('.badge'),
|
|
132
|
-
__metadata("design:type", HTMLElement)
|
|
133
|
-
], SniceBadge.prototype, "badgeElement", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
watch('content', 'count', 'max', 'dot', 'pulse'),
|
|
136
|
-
part('badge-section'),
|
|
137
|
-
__metadata("design:type", Function),
|
|
138
|
-
__metadata("design:paramtypes", []),
|
|
139
|
-
__metadata("design:returntype", void 0)
|
|
140
|
-
], SniceBadge.prototype, "renderBadgeSection", null);
|
|
141
|
-
__decorate([
|
|
142
|
-
ready(),
|
|
143
|
-
__metadata("design:type", Function),
|
|
144
|
-
__metadata("design:paramtypes", []),
|
|
145
|
-
__metadata("design:returntype", void 0)
|
|
146
|
-
], SniceBadge.prototype, "init", null);
|
|
147
|
-
__decorate([
|
|
148
|
-
watch('offset'),
|
|
149
|
-
__metadata("design:type", Function),
|
|
150
|
-
__metadata("design:paramtypes", []),
|
|
151
|
-
__metadata("design:returntype", void 0)
|
|
152
|
-
], SniceBadge.prototype, "updateOffset", null);
|
|
153
|
-
SniceBadge = __decorate([
|
|
154
|
-
element('snice-badge')
|
|
155
|
-
], SniceBadge);
|
|
156
|
-
export { SniceBadge };
|
|
157
|
-
//# sourceMappingURL=snice-badge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-badge.js","sourceRoot":"","sources":["../../../components/badge/snice-badge.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAIpC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QAEL,YAAO,GAAG,EAAE,CAAC;QAGb,UAAK,GAAG,CAAC,CAAC;QAGV,QAAG,GAAG,EAAE,CAAC;QAGT,QAAG,GAAG,KAAK,CAAC;QAGZ,YAAO,GAAiB,SAAS,CAAC;QAGlC,aAAQ,GAAkB,WAAW,CAAC;QAGtC,WAAM,GAAG,KAAK,CAAC;QAGf,SAAI,GAAc,QAAQ,CAAC;QA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AC;;4CACU;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;0CAC5B;AAGf;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wCACD;AAG3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCAC7B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;0CAC/B;AAGX;IADC,KAAK,CAAC,QAAQ,CAAC;8BACD,WAAW;gDAAC;AAa3B;IAFC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;IAChD,IAAI,CAAC,eAAe,CAAC;;;;oDAcrB;AAoBD;IADC,KAAK,EAAE;;;;sCAGP;AAID;IADC,KAAK,CAAC,QAAQ,CAAC;;;;8CAGf;AAtFU,UAAU;IADtB,OAAO,CAAC,aAAa,CAAC;GACV,UAAU,CA+GtB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
2
|
-
export type BadgePosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
3
|
-
export type BadgeSize = 'small' | 'medium' | 'large';
|
|
4
|
-
export interface SniceBadgeElement extends HTMLElement {
|
|
5
|
-
content: string;
|
|
6
|
-
count: number;
|
|
7
|
-
max: number;
|
|
8
|
-
dot: boolean;
|
|
9
|
-
variant: BadgeVariant;
|
|
10
|
-
position: BadgePosition;
|
|
11
|
-
inline: boolean;
|
|
12
|
-
size: BadgeSize;
|
|
13
|
-
pulse: boolean;
|
|
14
|
-
offset: number;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-badge.types.js","sourceRoot":"","sources":["../../../components/badge/snice-badge.types.ts"],"names":[],"mappings":""}
|