@wirabyte/ui 2.0.0-beta.0 → 2.0.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/CHANGELOG.md +31 -0
- package/README.md +6 -6
- package/avatar/avatar.component.d.ts +4 -2
- package/avatar/avatar.types.d.ts +3 -0
- package/breadcrumb/breadcrumb.component.d.ts +3 -1
- package/button/button.styles.d.ts +1 -1
- package/chat/chat.component.d.ts +118 -0
- package/chat/chat.module.d.ts +8 -0
- package/chat/chat.types.d.ts +64 -0
- package/chat/index.d.ts +5 -0
- package/chat/public-api.d.ts +3 -0
- package/config/options.d.ts +6 -0
- package/config/theme.service.d.ts +5 -0
- package/config/wu-config.service.d.ts +6 -0
- package/core/catalog.d.ts +6 -1
- package/core/overrides.d.ts +7 -0
- package/core/thai/locale.d.ts +47 -0
- package/datepicker/datepicker.component.d.ts +1 -1
- package/descriptions/descriptions.component.d.ts +56 -0
- package/descriptions/descriptions.module.d.ts +8 -0
- package/descriptions/index.d.ts +5 -0
- package/descriptions/public-api.d.ts +2 -0
- package/esm2022/accordion/accordion.component.mjs +4 -4
- package/esm2022/alert/alert-dialog.component.mjs +3 -3
- package/esm2022/avatar/avatar.component.mjs +11 -5
- package/esm2022/avatar/avatar.types.mjs +2 -2
- package/esm2022/breadcrumb/breadcrumb.component.mjs +5 -3
- package/esm2022/button/button.component.mjs +2 -2
- package/esm2022/button/button.styles.mjs +2 -2
- package/esm2022/card/card.component.mjs +8 -8
- package/esm2022/chat/chat.component.mjs +370 -0
- package/esm2022/chat/chat.module.mjs +17 -0
- package/esm2022/chat/chat.types.mjs +2 -0
- package/esm2022/chat/public-api.mjs +4 -0
- package/esm2022/chat/wirabyte-ui-chat.mjs +5 -0
- package/esm2022/config/options.mjs +1 -1
- package/esm2022/config/theme.service.mjs +35 -3
- package/esm2022/config/wu-config.service.mjs +9 -1
- package/esm2022/core/catalog.mjs +22 -2
- package/esm2022/core/families.mjs +43 -1
- package/esm2022/core/overrides.mjs +26 -1
- package/esm2022/core/thai/locale.mjs +67 -1
- package/esm2022/datepicker/datepicker.component.mjs +3 -3
- package/esm2022/descriptions/descriptions.component.mjs +112 -0
- package/esm2022/descriptions/descriptions.module.mjs +17 -0
- package/esm2022/descriptions/public-api.mjs +3 -0
- package/esm2022/descriptions/wirabyte-ui-descriptions.mjs +5 -0
- package/esm2022/dialog/dialog.component.mjs +3 -3
- package/esm2022/drawer/drawer.component.mjs +3 -3
- package/esm2022/emptystate/emptystate.component.mjs +3 -3
- package/esm2022/errorpage/errorpage.component.mjs +3 -3
- package/esm2022/fieldset/fieldset.component.mjs +4 -4
- package/esm2022/metergroup/metergroup.component.mjs +19 -5
- package/esm2022/metergroup/metergroup.types.mjs +1 -1
- package/esm2022/navbar/navbar.component.mjs +3 -3
- package/esm2022/panel/panel.component.mjs +6 -6
- package/esm2022/popover/popover.base.mjs +3 -3
- package/esm2022/result/result.component.mjs +3 -3
- package/esm2022/scheduler/public-api.mjs +4 -0
- package/esm2022/scheduler/scheduler.component.mjs +483 -0
- package/esm2022/scheduler/scheduler.module.mjs +17 -0
- package/esm2022/scheduler/scheduler.types.mjs +2 -0
- package/esm2022/scheduler/wirabyte-ui-scheduler.mjs +5 -0
- package/esm2022/selectbutton/selectbutton.component.mjs +25 -4
- package/esm2022/signaturepad/public-api.mjs +3 -0
- package/esm2022/signaturepad/signaturepad.component.mjs +289 -0
- package/esm2022/signaturepad/signaturepad.module.mjs +17 -0
- package/esm2022/signaturepad/wirabyte-ui-signaturepad.mjs +5 -0
- package/esm2022/stat/public-api.mjs +3 -0
- package/esm2022/stat/stat.component.mjs +128 -0
- package/esm2022/stat/stat.module.mjs +17 -0
- package/esm2022/stat/wirabyte-ui-stat.mjs +5 -0
- package/esm2022/table/table.celleditor.mjs +4 -4
- package/esm2022/tabs/tabs.component.mjs +3 -3
- package/esm2022/tag/tag.component.mjs +2 -2
- package/esm2022/textarea/textarea.directive.mjs +19 -1
- package/esm2022/thai/thai.pipes.mjs +2 -2
- package/esm2022/toolbar/toolbar.component.mjs +7 -7
- package/fesm2022/wirabyte-ui-accordion.mjs +3 -3
- package/fesm2022/wirabyte-ui-accordion.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-alert.mjs +2 -2
- package/fesm2022/wirabyte-ui-alert.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-avatar.mjs +12 -5
- package/fesm2022/wirabyte-ui-avatar.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-breadcrumb.mjs +4 -2
- package/fesm2022/wirabyte-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-button.mjs +3 -3
- package/fesm2022/wirabyte-ui-button.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-card.mjs +7 -7
- package/fesm2022/wirabyte-ui-card.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-chat.mjs +391 -0
- package/fesm2022/wirabyte-ui-chat.mjs.map +1 -0
- package/fesm2022/wirabyte-ui-config.mjs +42 -2
- package/fesm2022/wirabyte-ui-config.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-core.mjs +155 -2
- package/fesm2022/wirabyte-ui-core.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-datepicker.mjs +2 -2
- package/fesm2022/wirabyte-ui-datepicker.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-descriptions.mjs +133 -0
- package/fesm2022/wirabyte-ui-descriptions.mjs.map +1 -0
- package/fesm2022/wirabyte-ui-dialog.mjs +2 -2
- package/fesm2022/wirabyte-ui-dialog.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-drawer.mjs +2 -2
- package/fesm2022/wirabyte-ui-drawer.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-emptystate.mjs +2 -2
- package/fesm2022/wirabyte-ui-emptystate.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-errorpage.mjs +2 -2
- package/fesm2022/wirabyte-ui-errorpage.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-fieldset.mjs +3 -3
- package/fesm2022/wirabyte-ui-fieldset.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-metergroup.mjs +18 -4
- package/fesm2022/wirabyte-ui-metergroup.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-navbar.mjs +2 -2
- package/fesm2022/wirabyte-ui-navbar.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-panel.mjs +5 -5
- package/fesm2022/wirabyte-ui-panel.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-popover.mjs +2 -2
- package/fesm2022/wirabyte-ui-popover.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-result.mjs +2 -2
- package/fesm2022/wirabyte-ui-result.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-scheduler.mjs +504 -0
- package/fesm2022/wirabyte-ui-scheduler.mjs.map +1 -0
- package/fesm2022/wirabyte-ui-selectbutton.mjs +24 -3
- package/fesm2022/wirabyte-ui-selectbutton.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-signaturepad.mjs +310 -0
- package/fesm2022/wirabyte-ui-signaturepad.mjs.map +1 -0
- package/fesm2022/wirabyte-ui-stat.mjs +149 -0
- package/fesm2022/wirabyte-ui-stat.mjs.map +1 -0
- package/fesm2022/wirabyte-ui-table.mjs +3 -3
- package/fesm2022/wirabyte-ui-table.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-tabs.mjs +2 -2
- package/fesm2022/wirabyte-ui-tabs.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-tag.mjs +2 -2
- package/fesm2022/wirabyte-ui-tag.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-textarea.mjs +18 -0
- package/fesm2022/wirabyte-ui-textarea.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-thai.mjs +1 -1
- package/fesm2022/wirabyte-ui-thai.mjs.map +1 -1
- package/fesm2022/wirabyte-ui-toolbar.mjs +6 -6
- package/fesm2022/wirabyte-ui-toolbar.mjs.map +1 -1
- package/metergroup/metergroup.component.d.ts +11 -2
- package/metergroup/metergroup.types.d.ts +6 -0
- package/package.json +60 -30
- package/scheduler/index.d.ts +5 -0
- package/scheduler/public-api.d.ts +3 -0
- package/scheduler/scheduler.component.d.ts +143 -0
- package/scheduler/scheduler.module.d.ts +8 -0
- package/scheduler/scheduler.types.d.ts +46 -0
- package/schematics/core/catalog.cjs +22 -1
- package/schematics/core/families.cjs +42 -0
- package/schematics/core/overrides.cjs +25 -0
- package/schematics/core/thai/locale.cjs +66 -0
- package/schematics/ng-add/index.cjs +3 -1
- package/selectbutton/selectbutton.component.d.ts +12 -1
- package/signaturepad/index.d.ts +5 -0
- package/signaturepad/public-api.d.ts +2 -0
- package/signaturepad/signaturepad.component.d.ts +98 -0
- package/signaturepad/signaturepad.module.d.ts +8 -0
- package/stat/index.d.ts +5 -0
- package/stat/public-api.d.ts +2 -0
- package/stat/stat.component.d.ts +61 -0
- package/stat/stat.module.d.ts +8 -0
- package/textarea/textarea.directive.d.ts +2 -0
- package/theme/_data.scss +239 -7
- package/theme/_index.scss +29 -0
- package/themes/mali/amber.css +30 -1
- package/themes/mali/blue.css +30 -1
- package/themes/mali/cyan.css +30 -1
- package/themes/mali/emerald.css +30 -1
- package/themes/mali/fuchsia.css +30 -1
- package/themes/mali/green.css +30 -1
- package/themes/mali/indigo.css +30 -1
- package/themes/mali/lime.css +30 -1
- package/themes/mali/orange.css +30 -1
- package/themes/mali/pink.css +30 -1
- package/themes/mali/purple.css +30 -1
- package/themes/mali/red.css +30 -1
- package/themes/mali/rose.css +30 -1
- package/themes/mali/sky.css +30 -1
- package/themes/mali/teal.css +30 -1
- package/themes/mali/theme.css +30 -1
- package/themes/mali/violet.css +30 -1
- package/themes/mali/wira.css +30 -1
- package/themes/mali/yellow.css +30 -1
- package/themes/material/amber.css +30 -1
- package/themes/material/blue.css +30 -1
- package/themes/material/cyan.css +30 -1
- package/themes/material/emerald.css +30 -1
- package/themes/material/fuchsia.css +30 -1
- package/themes/material/green.css +30 -1
- package/themes/material/indigo.css +30 -1
- package/themes/material/lime.css +30 -1
- package/themes/material/orange.css +30 -1
- package/themes/material/pink.css +30 -1
- package/themes/material/purple.css +30 -1
- package/themes/material/red.css +30 -1
- package/themes/material/rose.css +30 -1
- package/themes/material/sky.css +30 -1
- package/themes/material/teal.css +30 -1
- package/themes/material/theme.css +30 -1
- package/themes/material/violet.css +30 -1
- package/themes/material/wira.css +30 -1
- package/themes/material/yellow.css +30 -1
- package/themes/phet/amber.css +30 -1
- package/themes/phet/blue.css +30 -1
- package/themes/phet/cyan.css +30 -1
- package/themes/phet/emerald.css +30 -1
- package/themes/phet/fuchsia.css +30 -1
- package/themes/phet/green.css +30 -1
- package/themes/phet/indigo.css +30 -1
- package/themes/phet/lime.css +30 -1
- package/themes/phet/orange.css +30 -1
- package/themes/phet/pink.css +30 -1
- package/themes/phet/purple.css +30 -1
- package/themes/phet/red.css +30 -1
- package/themes/phet/rose.css +30 -1
- package/themes/phet/sky.css +30 -1
- package/themes/phet/teal.css +30 -1
- package/themes/phet/theme.css +30 -1
- package/themes/phet/violet.css +30 -1
- package/themes/phet/wira.css +30 -1
- package/themes/phet/yellow.css +30 -1
- package/themes/sila/amber.css +30 -1
- package/themes/sila/blue.css +30 -1
- package/themes/sila/cyan.css +30 -1
- package/themes/sila/emerald.css +30 -1
- package/themes/sila/fuchsia.css +30 -1
- package/themes/sila/green.css +30 -1
- package/themes/sila/indigo.css +30 -1
- package/themes/sila/lime.css +30 -1
- package/themes/sila/orange.css +30 -1
- package/themes/sila/pink.css +30 -1
- package/themes/sila/purple.css +30 -1
- package/themes/sila/red.css +30 -1
- package/themes/sila/rose.css +30 -1
- package/themes/sila/sky.css +30 -1
- package/themes/sila/teal.css +30 -1
- package/themes/sila/theme.css +30 -1
- package/themes/sila/violet.css +30 -1
- package/themes/sila/wira.css +30 -1
- package/themes/sila/yellow.css +30 -1
|
@@ -27,7 +27,7 @@ class WuToolbar {
|
|
|
27
27
|
return this.endRef || this.rightRef || _findTemplate(this.slotTemplates, 'end') || _findTemplate(this.slotTemplates, 'right');
|
|
28
28
|
}
|
|
29
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WuToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WuToolbar, isStandalone: true, selector: "wu-toolbar", inputs: { ariaLabel: "ariaLabel", styleClass: "styleClass", style: "style" }, queries: [{ propertyName: "startRef", first: true, predicate: ["start"],
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WuToolbar, isStandalone: true, selector: "wu-toolbar", inputs: { ariaLabel: "ariaLabel", styleClass: "styleClass", style: "style" }, queries: [{ propertyName: "startRef", first: true, predicate: ["start"], read: TemplateRef }, { propertyName: "centerRef", first: true, predicate: ["center"], read: TemplateRef }, { propertyName: "endRef", first: true, predicate: ["end"], read: TemplateRef }, { propertyName: "leftRef", first: true, predicate: ["left"], read: TemplateRef }, { propertyName: "rightRef", first: true, predicate: ["right"], read: TemplateRef }, { propertyName: "slotTemplates", predicate: WuTemplate }], ngImport: i0, template: `<div class="wu-toolbar p-toolbar p-component" role="toolbar" [class]="styleClass || ''" [style]="hostStyle" [attr.aria-label]="ariaLabel || null">
|
|
31
31
|
<div class="wu-toolbar-start p-toolbar-start p-toolbar-group-start p-toolbar-group-left"><ng-content select="[wuToolbarStart]"></ng-content><ng-content></ng-content><ng-container *ngIf="startTemplate"><ng-container *ngTemplateOutlet="startTemplate"></ng-container></ng-container></div>
|
|
32
32
|
<div class="wu-toolbar-center p-toolbar-center p-toolbar-group-center"><ng-content select="[wuToolbarCenter]"></ng-content><ng-container *ngIf="centerTemplate"><ng-container *ngTemplateOutlet="centerTemplate"></ng-container></ng-container></div>
|
|
33
33
|
<div class="wu-toolbar-end p-toolbar-end p-toolbar-group-end p-toolbar-group-right"><ng-content select="[wuToolbarEnd]"></ng-content><ng-container *ngIf="endTemplate"><ng-container *ngTemplateOutlet="endTemplate"></ng-container></ng-container></div>
|
|
@@ -51,19 +51,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
51
51
|
args: [WuTemplate]
|
|
52
52
|
}], startRef: [{
|
|
53
53
|
type: ContentChild,
|
|
54
|
-
args: ['start', { read: TemplateRef }]
|
|
54
|
+
args: ['start', { read: TemplateRef, descendants: false }]
|
|
55
55
|
}], centerRef: [{
|
|
56
56
|
type: ContentChild,
|
|
57
|
-
args: ['center', { read: TemplateRef }]
|
|
57
|
+
args: ['center', { read: TemplateRef, descendants: false }]
|
|
58
58
|
}], endRef: [{
|
|
59
59
|
type: ContentChild,
|
|
60
|
-
args: ['end', { read: TemplateRef }]
|
|
60
|
+
args: ['end', { read: TemplateRef, descendants: false }]
|
|
61
61
|
}], leftRef: [{
|
|
62
62
|
type: ContentChild,
|
|
63
|
-
args: ['left', { read: TemplateRef }]
|
|
63
|
+
args: ['left', { read: TemplateRef, descendants: false }]
|
|
64
64
|
}], rightRef: [{
|
|
65
65
|
type: ContentChild,
|
|
66
|
-
args: ['right', { read: TemplateRef }]
|
|
66
|
+
args: ['right', { read: TemplateRef, descendants: false }]
|
|
67
67
|
}] } });
|
|
68
68
|
|
|
69
69
|
/** For NgModule apps. Standalone apps can import `WuToolbar` directly. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wirabyte-ui-toolbar.mjs","sources":["../../lib/toolbar/toolbar.component.ts","../../lib/toolbar/toolbar.module.ts","../../lib/toolbar/wirabyte-ui-toolbar.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, inject, Input, QueryList, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { ɵassertSupportedAngular, ɵfindTemplate, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\n\n/**\n * Row of actions in three groups that wrap on narrow screens:\n * `<wu-toolbar><div wuToolbarStart>…</div><div wuToolbarCenter>…</div><div wuToolbarEnd>…</div></wu-toolbar>`.\n * Unmarked content goes to the start group. The `start` / `center` / `end` templates (`left` / `right` in the older\n * names) work too.\n */\n@Component({\n selector: 'wu-toolbar',\n standalone: true,\n imports: [NgIf, NgTemplateOutlet],\n template: `<div class=\"wu-toolbar p-toolbar p-component\" role=\"toolbar\" [class]=\"styleClass || ''\" [style]=\"hostStyle\" [attr.aria-label]=\"ariaLabel || null\">\n <div class=\"wu-toolbar-start p-toolbar-start p-toolbar-group-start p-toolbar-group-left\"><ng-content select=\"[wuToolbarStart]\"></ng-content><ng-content></ng-content><ng-container *ngIf=\"startTemplate\"><ng-container *ngTemplateOutlet=\"startTemplate\"></ng-container></ng-container></div>\n <div class=\"wu-toolbar-center p-toolbar-center p-toolbar-group-center\"><ng-content select=\"[wuToolbarCenter]\"></ng-content><ng-container *ngIf=\"centerTemplate\"><ng-container *ngTemplateOutlet=\"centerTemplate\"></ng-container></ng-container></div>\n <div class=\"wu-toolbar-end p-toolbar-end p-toolbar-group-end p-toolbar-group-right\"><ng-content select=\"[wuToolbarEnd]\"></ng-content><ng-container *ngIf=\"endTemplate\"><ng-container *ngTemplateOutlet=\"endTemplate\"></ng-container></ng-container></div>\n</div>`,\n styleUrls: ['./toolbar.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuToolbar {\n @Input() ariaLabel?: string;\n /** Classes for the element, as before. */\n @Input() styleClass?: string | null;\n /** Inline styles as an object: `[style]=\"{ width: '20rem' }\"` (a plain style attribute works as it is). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get hostStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n\n @ContentChildren(WuTemplate) protected slotTemplates?: QueryList<WuTemplate>;\n @ContentChild('start', { read: TemplateRef }) protected startRef?: TemplateRef<unknown>;\n @ContentChild('center', { read: TemplateRef }) protected centerRef?: TemplateRef<unknown>;\n @ContentChild('end', { read: TemplateRef }) protected endRef?: TemplateRef<unknown>;\n @ContentChild('left', { read: TemplateRef }) protected leftRef?: TemplateRef<unknown>;\n @ContentChild('right', { read: TemplateRef }) protected rightRef?: TemplateRef<unknown>;\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n get startTemplate(): TemplateRef<unknown> | null {\n return this.startRef || this.leftRef || ɵfindTemplate(this.slotTemplates, 'start') || ɵfindTemplate(this.slotTemplates, 'left');\n }\n get centerTemplate(): TemplateRef<unknown> | null {\n return this.centerRef || ɵfindTemplate(this.slotTemplates, 'center');\n }\n get endTemplate(): TemplateRef<unknown> | null {\n return this.endRef || this.rightRef || ɵfindTemplate(this.slotTemplates, 'end') || ɵfindTemplate(this.slotTemplates, 'right');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { WuTemplate } from '@wirabyte/ui/config';\nimport { WuToolbar } from './toolbar.component';\n\n/** For NgModule apps. Standalone apps can import `WuToolbar` directly. */\n@NgModule({\n imports: [WuToolbar, WuTemplate],\n exports: [WuToolbar, WuTemplate],\n})\nexport class WuToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵassertSupportedAngular","ɵWU_SKIP_VERSION_CHECK","ɵfindTemplate"],"mappings":";;;;;AAIA;;;;;AAKG;MAcU,SAAS,CAAA;;AAQpB,IAAA,IAAI,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI;IACzE;AASA,IAAA,WAAA,GAAA;AACE,QAAAA,uBAAuB,CAAC,MAAM,CAACC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7E;AAEA,IAAA,IAAI,aAAa,GAAA;QACf,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAIC,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,IAAIA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IACjI;AACA,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,SAAS,IAAIA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC;IACtE;AACA,IAAA,IAAI,WAAW,GAAA;QACb,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,IAAIA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,IAAIA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAC/H;+GA/BW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,UAAA,EAAA,YAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,UAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,OAAA,CAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"wirabyte-ui-toolbar.mjs","sources":["../../lib/toolbar/toolbar.component.ts","../../lib/toolbar/toolbar.module.ts","../../lib/toolbar/wirabyte-ui-toolbar.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, inject, Input, QueryList, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { ɵassertSupportedAngular, ɵfindTemplate, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\n\n/**\n * Row of actions in three groups that wrap on narrow screens:\n * `<wu-toolbar><div wuToolbarStart>…</div><div wuToolbarCenter>…</div><div wuToolbarEnd>…</div></wu-toolbar>`.\n * Unmarked content goes to the start group. The `start` / `center` / `end` templates (`left` / `right` in the older\n * names) work too.\n */\n@Component({\n selector: 'wu-toolbar',\n standalone: true,\n imports: [NgIf, NgTemplateOutlet],\n template: `<div class=\"wu-toolbar p-toolbar p-component\" role=\"toolbar\" [class]=\"styleClass || ''\" [style]=\"hostStyle\" [attr.aria-label]=\"ariaLabel || null\">\n <div class=\"wu-toolbar-start p-toolbar-start p-toolbar-group-start p-toolbar-group-left\"><ng-content select=\"[wuToolbarStart]\"></ng-content><ng-content></ng-content><ng-container *ngIf=\"startTemplate\"><ng-container *ngTemplateOutlet=\"startTemplate\"></ng-container></ng-container></div>\n <div class=\"wu-toolbar-center p-toolbar-center p-toolbar-group-center\"><ng-content select=\"[wuToolbarCenter]\"></ng-content><ng-container *ngIf=\"centerTemplate\"><ng-container *ngTemplateOutlet=\"centerTemplate\"></ng-container></ng-container></div>\n <div class=\"wu-toolbar-end p-toolbar-end p-toolbar-group-end p-toolbar-group-right\"><ng-content select=\"[wuToolbarEnd]\"></ng-content><ng-container *ngIf=\"endTemplate\"><ng-container *ngTemplateOutlet=\"endTemplate\"></ng-container></ng-container></div>\n</div>`,\n styleUrls: ['./toolbar.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuToolbar {\n @Input() ariaLabel?: string;\n /** Classes for the element, as before. */\n @Input() styleClass?: string | null;\n /** Inline styles as an object: `[style]=\"{ width: '20rem' }\"` (a plain style attribute works as it is). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get hostStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n\n @ContentChildren(WuTemplate) protected slotTemplates?: QueryList<WuTemplate>;\n @ContentChild('start', { read: TemplateRef, descendants: false }) protected startRef?: TemplateRef<unknown>;\n @ContentChild('center', { read: TemplateRef, descendants: false }) protected centerRef?: TemplateRef<unknown>;\n @ContentChild('end', { read: TemplateRef, descendants: false }) protected endRef?: TemplateRef<unknown>;\n @ContentChild('left', { read: TemplateRef, descendants: false }) protected leftRef?: TemplateRef<unknown>;\n @ContentChild('right', { read: TemplateRef, descendants: false }) protected rightRef?: TemplateRef<unknown>;\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n get startTemplate(): TemplateRef<unknown> | null {\n return this.startRef || this.leftRef || ɵfindTemplate(this.slotTemplates, 'start') || ɵfindTemplate(this.slotTemplates, 'left');\n }\n get centerTemplate(): TemplateRef<unknown> | null {\n return this.centerRef || ɵfindTemplate(this.slotTemplates, 'center');\n }\n get endTemplate(): TemplateRef<unknown> | null {\n return this.endRef || this.rightRef || ɵfindTemplate(this.slotTemplates, 'end') || ɵfindTemplate(this.slotTemplates, 'right');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { WuTemplate } from '@wirabyte/ui/config';\nimport { WuToolbar } from './toolbar.component';\n\n/** For NgModule apps. Standalone apps can import `WuToolbar` directly. */\n@NgModule({\n imports: [WuToolbar, WuTemplate],\n exports: [WuToolbar, WuTemplate],\n})\nexport class WuToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵassertSupportedAngular","ɵWU_SKIP_VERSION_CHECK","ɵfindTemplate"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { WuMeterContext, WuMeterGroupContext, WuMeterItem, WuMeterLabelPosition, WuMeterOrientation } from './metergroup.types';
|
|
2
|
+
import { WuMeterContext, WuMeterGroupContext, WuMeterItem, WuMeterItemClickEvent, WuMeterLabelPosition, WuMeterOrientation } from './metergroup.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Several values on one bar, with a legend: `<wu-metergroup [value]="[{ label: 'รูปภาพ', value: 24 }, …]">`.
|
|
@@ -16,6 +16,11 @@ export declare class WuMeterGroup {
|
|
|
16
16
|
readonly labelPosition: import("@angular/core").InputSignal<WuMeterLabelPosition>;
|
|
17
17
|
/** Legend items in a row or a column. */
|
|
18
18
|
readonly labelOrientation: import("@angular/core").InputSignal<WuMeterOrientation>;
|
|
19
|
+
/** Each legend item shows its value too: `เปิด 12 (24%)`. */
|
|
20
|
+
readonly showValue: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
21
|
+
/** Legend items become buttons that emit `(onItemClick)`, e.g. to open the list for that status. */
|
|
22
|
+
readonly clickable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
23
|
+
readonly onItemClick: import("@angular/core").OutputEmitterRef<WuMeterItemClickEvent>;
|
|
19
24
|
readonly styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
20
25
|
/** Inline styles for the root element, as an object: `[style]="{ width: '20rem' }"`. */
|
|
21
26
|
readonly style: import("@angular/core").InputSignal<string | Record<string, any> | null | undefined>;
|
|
@@ -47,8 +52,12 @@ export declare class WuMeterGroup {
|
|
|
47
52
|
readonly groupContext: import("@angular/core").Signal<WuMeterGroupContext>;
|
|
48
53
|
readonly classes: import("@angular/core").Signal<string>;
|
|
49
54
|
readonly labelClasses: import("@angular/core").Signal<string>;
|
|
55
|
+
private readonly config;
|
|
50
56
|
constructor();
|
|
57
|
+
/** The legend text of one item. */
|
|
58
|
+
labelText(item: WuMeterItem, percent: number): string;
|
|
59
|
+
itemClick(event: Event, item: WuMeterItem, index: number): void;
|
|
51
60
|
meterContext(index: number): WuMeterContext;
|
|
52
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<WuMeterGroup, never>;
|
|
53
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WuMeterGroup, "wu-metergroup, wu-meterGroup, wu-meter-group", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "reverse": { "alias": "reverse"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelOrientation": { "alias": "labelOrientation"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, ["labelRef", "meterRef", "startRef", "endRef", "iconRef", "templates"], never, true, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WuMeterGroup, "wu-metergroup, wu-meterGroup, wu-meter-group", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "reverse": { "alias": "reverse"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "labelOrientation": { "alias": "labelOrientation"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "clickable": { "alias": "clickable"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "onItemClick": "onItemClick"; }, ["labelRef", "meterRef", "startRef", "endRef", "iconRef", "templates"], never, true, never>;
|
|
54
63
|
}
|
|
@@ -7,6 +7,12 @@ export interface WuMeterItem {
|
|
|
7
7
|
/** Icon class shown in the legend instead of the colour dot. */
|
|
8
8
|
icon?: string;
|
|
9
9
|
}
|
|
10
|
+
/** `(onItemClick)` of a clickable legend: the item, its place in `value`, and the click. */
|
|
11
|
+
export interface WuMeterItemClickEvent {
|
|
12
|
+
originalEvent: Event;
|
|
13
|
+
item: WuMeterItem;
|
|
14
|
+
index: number;
|
|
15
|
+
}
|
|
10
16
|
export type WuMeterOrientation = 'horizontal' | 'vertical';
|
|
11
17
|
export type WuMeterLabelPosition = 'start' | 'end';
|
|
12
18
|
/** Context of the `label`, `start` and `end` templates. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirabyte/ui",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "WiraUI UI components for Angular 18–20: familiar API, Thai-first, themable with SCSS, CSS or TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://ui.wirabyte.com",
|
|
@@ -73,6 +73,12 @@
|
|
|
73
73
|
"esm": "./esm2022/accordion/wirabyte-ui-accordion.mjs",
|
|
74
74
|
"default": "./fesm2022/wirabyte-ui-accordion.mjs"
|
|
75
75
|
},
|
|
76
|
+
"./alert": {
|
|
77
|
+
"types": "./alert/index.d.ts",
|
|
78
|
+
"esm2022": "./esm2022/alert/wirabyte-ui-alert.mjs",
|
|
79
|
+
"esm": "./esm2022/alert/wirabyte-ui-alert.mjs",
|
|
80
|
+
"default": "./fesm2022/wirabyte-ui-alert.mjs"
|
|
81
|
+
},
|
|
76
82
|
"./api": {
|
|
77
83
|
"types": "./api/index.d.ts",
|
|
78
84
|
"esm2022": "./esm2022/api/wirabyte-ui-api.mjs",
|
|
@@ -91,6 +97,12 @@
|
|
|
91
97
|
"esm": "./esm2022/autocomplete/wirabyte-ui-autocomplete.mjs",
|
|
92
98
|
"default": "./fesm2022/wirabyte-ui-autocomplete.mjs"
|
|
93
99
|
},
|
|
100
|
+
"./animate": {
|
|
101
|
+
"types": "./animate/index.d.ts",
|
|
102
|
+
"esm2022": "./esm2022/animate/wirabyte-ui-animate.mjs",
|
|
103
|
+
"esm": "./esm2022/animate/wirabyte-ui-animate.mjs",
|
|
104
|
+
"default": "./fesm2022/wirabyte-ui-animate.mjs"
|
|
105
|
+
},
|
|
94
106
|
"./avatar": {
|
|
95
107
|
"types": "./avatar/index.d.ts",
|
|
96
108
|
"esm2022": "./esm2022/avatar/wirabyte-ui-avatar.mjs",
|
|
@@ -103,24 +115,12 @@
|
|
|
103
115
|
"esm": "./esm2022/badge/wirabyte-ui-badge.mjs",
|
|
104
116
|
"default": "./fesm2022/wirabyte-ui-badge.mjs"
|
|
105
117
|
},
|
|
106
|
-
"./alert": {
|
|
107
|
-
"types": "./alert/index.d.ts",
|
|
108
|
-
"esm2022": "./esm2022/alert/wirabyte-ui-alert.mjs",
|
|
109
|
-
"esm": "./esm2022/alert/wirabyte-ui-alert.mjs",
|
|
110
|
-
"default": "./fesm2022/wirabyte-ui-alert.mjs"
|
|
111
|
-
},
|
|
112
118
|
"./blockui": {
|
|
113
119
|
"types": "./blockui/index.d.ts",
|
|
114
120
|
"esm2022": "./esm2022/blockui/wirabyte-ui-blockui.mjs",
|
|
115
121
|
"esm": "./esm2022/blockui/wirabyte-ui-blockui.mjs",
|
|
116
122
|
"default": "./fesm2022/wirabyte-ui-blockui.mjs"
|
|
117
123
|
},
|
|
118
|
-
"./animate": {
|
|
119
|
-
"types": "./animate/index.d.ts",
|
|
120
|
-
"esm2022": "./esm2022/animate/wirabyte-ui-animate.mjs",
|
|
121
|
-
"esm": "./esm2022/animate/wirabyte-ui-animate.mjs",
|
|
122
|
-
"default": "./fesm2022/wirabyte-ui-animate.mjs"
|
|
123
|
-
},
|
|
124
124
|
"./bottombar": {
|
|
125
125
|
"types": "./bottombar/index.d.ts",
|
|
126
126
|
"esm2022": "./esm2022/bottombar/wirabyte-ui-bottombar.mjs",
|
|
@@ -151,17 +151,23 @@
|
|
|
151
151
|
"esm": "./esm2022/carousel/wirabyte-ui-carousel.mjs",
|
|
152
152
|
"default": "./fesm2022/wirabyte-ui-carousel.mjs"
|
|
153
153
|
},
|
|
154
|
+
"./chart": {
|
|
155
|
+
"types": "./chart/index.d.ts",
|
|
156
|
+
"esm2022": "./esm2022/chart/wirabyte-ui-chart.mjs",
|
|
157
|
+
"esm": "./esm2022/chart/wirabyte-ui-chart.mjs",
|
|
158
|
+
"default": "./fesm2022/wirabyte-ui-chart.mjs"
|
|
159
|
+
},
|
|
154
160
|
"./chartjs": {
|
|
155
161
|
"types": "./chartjs/index.d.ts",
|
|
156
162
|
"esm2022": "./esm2022/chartjs/wirabyte-ui-chartjs.mjs",
|
|
157
163
|
"esm": "./esm2022/chartjs/wirabyte-ui-chartjs.mjs",
|
|
158
164
|
"default": "./fesm2022/wirabyte-ui-chartjs.mjs"
|
|
159
165
|
},
|
|
160
|
-
"./
|
|
161
|
-
"types": "./
|
|
162
|
-
"esm2022": "./esm2022/
|
|
163
|
-
"esm": "./esm2022/
|
|
164
|
-
"default": "./fesm2022/wirabyte-ui-
|
|
166
|
+
"./chat": {
|
|
167
|
+
"types": "./chat/index.d.ts",
|
|
168
|
+
"esm2022": "./esm2022/chat/wirabyte-ui-chat.mjs",
|
|
169
|
+
"esm": "./esm2022/chat/wirabyte-ui-chat.mjs",
|
|
170
|
+
"default": "./fesm2022/wirabyte-ui-chat.mjs"
|
|
165
171
|
},
|
|
166
172
|
"./checkbox": {
|
|
167
173
|
"types": "./checkbox/index.d.ts",
|
|
@@ -211,6 +217,12 @@
|
|
|
211
217
|
"esm": "./esm2022/datepicker/wirabyte-ui-datepicker.mjs",
|
|
212
218
|
"default": "./fesm2022/wirabyte-ui-datepicker.mjs"
|
|
213
219
|
},
|
|
220
|
+
"./descriptions": {
|
|
221
|
+
"types": "./descriptions/index.d.ts",
|
|
222
|
+
"esm2022": "./esm2022/descriptions/wirabyte-ui-descriptions.mjs",
|
|
223
|
+
"esm": "./esm2022/descriptions/wirabyte-ui-descriptions.mjs",
|
|
224
|
+
"default": "./fesm2022/wirabyte-ui-descriptions.mjs"
|
|
225
|
+
},
|
|
214
226
|
"./dialog": {
|
|
215
227
|
"types": "./dialog/index.d.ts",
|
|
216
228
|
"esm2022": "./esm2022/dialog/wirabyte-ui-dialog.mjs",
|
|
@@ -379,18 +391,18 @@
|
|
|
379
391
|
"esm": "./esm2022/listbox/wirabyte-ui-listbox.mjs",
|
|
380
392
|
"default": "./fesm2022/wirabyte-ui-listbox.mjs"
|
|
381
393
|
},
|
|
382
|
-
"./menubar": {
|
|
383
|
-
"types": "./menubar/index.d.ts",
|
|
384
|
-
"esm2022": "./esm2022/menubar/wirabyte-ui-menubar.mjs",
|
|
385
|
-
"esm": "./esm2022/menubar/wirabyte-ui-menubar.mjs",
|
|
386
|
-
"default": "./fesm2022/wirabyte-ui-menubar.mjs"
|
|
387
|
-
},
|
|
388
394
|
"./menu": {
|
|
389
395
|
"types": "./menu/index.d.ts",
|
|
390
396
|
"esm2022": "./esm2022/menu/wirabyte-ui-menu.mjs",
|
|
391
397
|
"esm": "./esm2022/menu/wirabyte-ui-menu.mjs",
|
|
392
398
|
"default": "./fesm2022/wirabyte-ui-menu.mjs"
|
|
393
399
|
},
|
|
400
|
+
"./menubar": {
|
|
401
|
+
"types": "./menubar/index.d.ts",
|
|
402
|
+
"esm2022": "./esm2022/menubar/wirabyte-ui-menubar.mjs",
|
|
403
|
+
"esm": "./esm2022/menubar/wirabyte-ui-menubar.mjs",
|
|
404
|
+
"default": "./fesm2022/wirabyte-ui-menubar.mjs"
|
|
405
|
+
},
|
|
394
406
|
"./message": {
|
|
395
407
|
"types": "./message/index.d.ts",
|
|
396
408
|
"esm2022": "./esm2022/message/wirabyte-ui-message.mjs",
|
|
@@ -403,12 +415,6 @@
|
|
|
403
415
|
"esm": "./esm2022/metergroup/wirabyte-ui-metergroup.mjs",
|
|
404
416
|
"default": "./fesm2022/wirabyte-ui-metergroup.mjs"
|
|
405
417
|
},
|
|
406
|
-
"./multiselect": {
|
|
407
|
-
"types": "./multiselect/index.d.ts",
|
|
408
|
-
"esm2022": "./esm2022/multiselect/wirabyte-ui-multiselect.mjs",
|
|
409
|
-
"esm": "./esm2022/multiselect/wirabyte-ui-multiselect.mjs",
|
|
410
|
-
"default": "./fesm2022/wirabyte-ui-multiselect.mjs"
|
|
411
|
-
},
|
|
412
418
|
"./navbar": {
|
|
413
419
|
"types": "./navbar/index.d.ts",
|
|
414
420
|
"esm2022": "./esm2022/navbar/wirabyte-ui-navbar.mjs",
|
|
@@ -427,6 +433,12 @@
|
|
|
427
433
|
"esm": "./esm2022/organizationchart/wirabyte-ui-organizationchart.mjs",
|
|
428
434
|
"default": "./fesm2022/wirabyte-ui-organizationchart.mjs"
|
|
429
435
|
},
|
|
436
|
+
"./multiselect": {
|
|
437
|
+
"types": "./multiselect/index.d.ts",
|
|
438
|
+
"esm2022": "./esm2022/multiselect/wirabyte-ui-multiselect.mjs",
|
|
439
|
+
"esm": "./esm2022/multiselect/wirabyte-ui-multiselect.mjs",
|
|
440
|
+
"default": "./fesm2022/wirabyte-ui-multiselect.mjs"
|
|
441
|
+
},
|
|
430
442
|
"./paginator": {
|
|
431
443
|
"types": "./paginator/index.d.ts",
|
|
432
444
|
"esm2022": "./esm2022/paginator/wirabyte-ui-paginator.mjs",
|
|
@@ -505,6 +517,12 @@
|
|
|
505
517
|
"esm": "./esm2022/ripple/wirabyte-ui-ripple.mjs",
|
|
506
518
|
"default": "./fesm2022/wirabyte-ui-ripple.mjs"
|
|
507
519
|
},
|
|
520
|
+
"./scheduler": {
|
|
521
|
+
"types": "./scheduler/index.d.ts",
|
|
522
|
+
"esm2022": "./esm2022/scheduler/wirabyte-ui-scheduler.mjs",
|
|
523
|
+
"esm": "./esm2022/scheduler/wirabyte-ui-scheduler.mjs",
|
|
524
|
+
"default": "./fesm2022/wirabyte-ui-scheduler.mjs"
|
|
525
|
+
},
|
|
508
526
|
"./scroller": {
|
|
509
527
|
"types": "./scroller/index.d.ts",
|
|
510
528
|
"esm2022": "./esm2022/scroller/wirabyte-ui-scroller.mjs",
|
|
@@ -529,6 +547,12 @@
|
|
|
529
547
|
"esm": "./esm2022/selectbutton/wirabyte-ui-selectbutton.mjs",
|
|
530
548
|
"default": "./fesm2022/wirabyte-ui-selectbutton.mjs"
|
|
531
549
|
},
|
|
550
|
+
"./signaturepad": {
|
|
551
|
+
"types": "./signaturepad/index.d.ts",
|
|
552
|
+
"esm2022": "./esm2022/signaturepad/wirabyte-ui-signaturepad.mjs",
|
|
553
|
+
"esm": "./esm2022/signaturepad/wirabyte-ui-signaturepad.mjs",
|
|
554
|
+
"default": "./fesm2022/wirabyte-ui-signaturepad.mjs"
|
|
555
|
+
},
|
|
532
556
|
"./sitefooter": {
|
|
533
557
|
"types": "./sitefooter/index.d.ts",
|
|
534
558
|
"esm2022": "./esm2022/sitefooter/wirabyte-ui-sitefooter.mjs",
|
|
@@ -559,6 +583,12 @@
|
|
|
559
583
|
"esm": "./esm2022/splitter/wirabyte-ui-splitter.mjs",
|
|
560
584
|
"default": "./fesm2022/wirabyte-ui-splitter.mjs"
|
|
561
585
|
},
|
|
586
|
+
"./stat": {
|
|
587
|
+
"types": "./stat/index.d.ts",
|
|
588
|
+
"esm2022": "./esm2022/stat/wirabyte-ui-stat.mjs",
|
|
589
|
+
"esm": "./esm2022/stat/wirabyte-ui-stat.mjs",
|
|
590
|
+
"default": "./fesm2022/wirabyte-ui-stat.mjs"
|
|
591
|
+
},
|
|
562
592
|
"./stepper": {
|
|
563
593
|
"types": "./stepper/index.d.ts",
|
|
564
594
|
"esm2022": "./esm2022/stepper/wirabyte-ui-stepper.mjs",
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, QueryList, TemplateRef } from '@angular/core';
|
|
2
|
+
import { WuTemplate } from '@wirabyte/ui/config';
|
|
3
|
+
import { WuSchedulerDateClickEvent, WuSchedulerEvent, WuSchedulerEventChangeEvent, WuSchedulerEventClickEvent, WuSchedulerView, ɵWuPlacedEvent } from './scheduler.types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** One day column of the day / week views, or one cell of the month grid. */
|
|
6
|
+
interface DayCell {
|
|
7
|
+
key: string;
|
|
8
|
+
date: Date;
|
|
9
|
+
today: boolean;
|
|
10
|
+
outside: boolean;
|
|
11
|
+
allDay: ɵWuPlacedEvent[];
|
|
12
|
+
timed: ɵWuPlacedEvent[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Appointments on a calendar: `<wu-scheduler [events]="appointments" [(view)]="view" [(date)]="day" [editable]="true"
|
|
16
|
+
* (onEventChange)="move($event)" (onDateClick)="create($event)">`. A month grid, a week or a day of hours
|
|
17
|
+
* (`startHour`–`endHour`), all-day events in their own row, overlapping events side by side, a line at the current
|
|
18
|
+
* time. Years follow the app's calendar (พ.ศ. in Thai). With `editable`, events are dragged to another day or time
|
|
19
|
+
* (snapped to `slotMinutes`); the scheduler emits the new times and the app updates `events`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class WuScheduler implements OnDestroy {
|
|
22
|
+
set events(v: WuSchedulerEvent[] | null | undefined);
|
|
23
|
+
get events(): WuSchedulerEvent[];
|
|
24
|
+
set view(v: WuSchedulerView | null | undefined);
|
|
25
|
+
get view(): WuSchedulerView;
|
|
26
|
+
/** The day the view shows (week and month views: the period around it). Default: today. */
|
|
27
|
+
set date(v: Date | string | number | null | undefined);
|
|
28
|
+
get date(): Date;
|
|
29
|
+
/** The view buttons offered. Default all three. */
|
|
30
|
+
views: WuSchedulerView[] | null | undefined;
|
|
31
|
+
/** First and last hour of the day and week views. Default 7–20. */
|
|
32
|
+
set startHour(v: unknown);
|
|
33
|
+
get startHour(): number;
|
|
34
|
+
set endHour(v: unknown);
|
|
35
|
+
get endHour(): number;
|
|
36
|
+
/** Rows of the time grid, and where a dragged event snaps to. Default 30 minutes. */
|
|
37
|
+
set slotMinutes(v: unknown);
|
|
38
|
+
get slotMinutes(): number;
|
|
39
|
+
/** First day of the week, 0 = Sunday. Default: the locale's. */
|
|
40
|
+
firstDayOfWeek?: number | null;
|
|
41
|
+
/** Events can be dragged to another day or time. */
|
|
42
|
+
set editable(v: unknown);
|
|
43
|
+
get editable(): boolean;
|
|
44
|
+
/** Events a month cell lists before "+N more". Default 3. */
|
|
45
|
+
set maxEventsPerDay(v: unknown);
|
|
46
|
+
get maxEventsPerDay(): number;
|
|
47
|
+
/** Height of the day and week views' hour grid area. Default: the theme's hour height × the hours shown. */
|
|
48
|
+
height?: string | number | null;
|
|
49
|
+
styleClass?: string | null;
|
|
50
|
+
style?: Record<string, any> | string | null;
|
|
51
|
+
readonly viewChange: EventEmitter<WuSchedulerView>;
|
|
52
|
+
readonly dateChange: EventEmitter<Date>;
|
|
53
|
+
readonly onEventClick: EventEmitter<WuSchedulerEventClickEvent>;
|
|
54
|
+
readonly onDateClick: EventEmitter<WuSchedulerDateClickEvent>;
|
|
55
|
+
readonly onEventChange: EventEmitter<WuSchedulerEventChangeEvent>;
|
|
56
|
+
protected templates?: QueryList<WuTemplate>;
|
|
57
|
+
protected eventRef?: unknown;
|
|
58
|
+
private _events;
|
|
59
|
+
private _view;
|
|
60
|
+
private _date;
|
|
61
|
+
private _startHour;
|
|
62
|
+
private _endHour;
|
|
63
|
+
private _slot;
|
|
64
|
+
private _editable;
|
|
65
|
+
private _max;
|
|
66
|
+
private cache;
|
|
67
|
+
private dragged;
|
|
68
|
+
private now;
|
|
69
|
+
private readonly timer;
|
|
70
|
+
private readonly cdr;
|
|
71
|
+
private readonly config;
|
|
72
|
+
private readonly i18n;
|
|
73
|
+
private readonly translated;
|
|
74
|
+
constructor();
|
|
75
|
+
ngOnDestroy(): void;
|
|
76
|
+
get t(): {
|
|
77
|
+
today: string;
|
|
78
|
+
previous: string;
|
|
79
|
+
next: string;
|
|
80
|
+
day: string;
|
|
81
|
+
week: string;
|
|
82
|
+
month: string;
|
|
83
|
+
allDay: string;
|
|
84
|
+
more: string;
|
|
85
|
+
noEvents: string;
|
|
86
|
+
} | undefined;
|
|
87
|
+
get eventTemplate(): TemplateRef<unknown> | null;
|
|
88
|
+
get rootClass(): string;
|
|
89
|
+
get rootStyle(): Record<string, any>;
|
|
90
|
+
get viewButtons(): WuSchedulerView[];
|
|
91
|
+
viewLabel(v: WuSchedulerView): string;
|
|
92
|
+
get hours(): number[];
|
|
93
|
+
get weekdayNames(): string[];
|
|
94
|
+
get days(): DayCell[];
|
|
95
|
+
/** Month view: the days in rows of seven. */
|
|
96
|
+
get weeks(): DayCell[][];
|
|
97
|
+
get title(): string;
|
|
98
|
+
dayHeader(cell: DayCell): string;
|
|
99
|
+
hourLabel(h: number): string;
|
|
100
|
+
/** The current-time line: % down the visible hours, or `null` outside them. */
|
|
101
|
+
nowTop(cell: DayCell): number | null;
|
|
102
|
+
visible(cell: DayCell): ɵWuPlacedEvent[];
|
|
103
|
+
hidden(cell: DayCell): number;
|
|
104
|
+
moreText(n: number): string;
|
|
105
|
+
eventStyle(p: ɵWuPlacedEvent): Record<string, string>;
|
|
106
|
+
placedStyle(p: ɵWuPlacedEvent): Record<string, string>;
|
|
107
|
+
canDrag(p: ɵWuPlacedEvent): boolean;
|
|
108
|
+
trackCell(_: number, c: DayCell): string;
|
|
109
|
+
trackEvent(_: number, p: ɵWuPlacedEvent): string;
|
|
110
|
+
setView(v: WuSchedulerView): void;
|
|
111
|
+
move(step: -1 | 1): void;
|
|
112
|
+
goToday(): void;
|
|
113
|
+
/** Month view: a day's "+N more" opens that day. */
|
|
114
|
+
openDay(date: Date): void;
|
|
115
|
+
eventClick(event: Event, p: ɵWuPlacedEvent): void;
|
|
116
|
+
/** A click on an empty month cell. */
|
|
117
|
+
cellClick(event: Event, cell: DayCell): void;
|
|
118
|
+
/** A click on the hour grid: the slot under the pointer. */
|
|
119
|
+
slotClick(event: MouseEvent, cell: DayCell): void;
|
|
120
|
+
allDayClick(event: Event, cell: DayCell): void;
|
|
121
|
+
dragStart(event: DragEvent, p: ɵWuPlacedEvent): void;
|
|
122
|
+
dragOver(event: DragEvent): void;
|
|
123
|
+
dragEnd(): void;
|
|
124
|
+
/** Dropped on a month cell or an all-day row: same time of day, another date. */
|
|
125
|
+
dropOnDay(event: DragEvent, cell: DayCell): void;
|
|
126
|
+
/** Dropped on the hour grid: the slot under the pointer, same length. */
|
|
127
|
+
dropOnTime(event: DragEvent, cell: DayCell): void;
|
|
128
|
+
private get weekStart();
|
|
129
|
+
private go;
|
|
130
|
+
private tick;
|
|
131
|
+
/** The slot under the pointer on a day column, snapped to `slotMinutes`. */
|
|
132
|
+
private timeAt;
|
|
133
|
+
private range;
|
|
134
|
+
private build;
|
|
135
|
+
private year;
|
|
136
|
+
private monthName;
|
|
137
|
+
private monthShort;
|
|
138
|
+
private dayName;
|
|
139
|
+
private weekdayShort;
|
|
140
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WuScheduler, never>;
|
|
141
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WuScheduler, "wu-scheduler", never, { "events": { "alias": "events"; "required": false; }; "view": { "alias": "view"; "required": false; }; "date": { "alias": "date"; "required": false; }; "views": { "alias": "views"; "required": false; }; "startHour": { "alias": "startHour"; "required": false; }; "endHour": { "alias": "endHour"; "required": false; }; "slotMinutes": { "alias": "slotMinutes"; "required": false; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "maxEventsPerDay": { "alias": "maxEventsPerDay"; "required": false; }; "height": { "alias": "height"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "style": { "alias": "style"; "required": false; }; }, { "viewChange": "viewChange"; "dateChange": "dateChange"; "onEventClick": "onEventClick"; "onDateClick": "onDateClick"; "onEventChange": "onEventChange"; }, ["eventRef", "templates"], never, true, never>;
|
|
142
|
+
}
|
|
143
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./scheduler.component";
|
|
3
|
+
/** For NgModule apps. Standalone apps can import `WuScheduler` directly. */
|
|
4
|
+
export declare class WuSchedulerModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WuSchedulerModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<WuSchedulerModule, never, [typeof i1.WuScheduler], [typeof i1.WuScheduler]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<WuSchedulerModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type WuSchedulerView = 'day' | 'week' | 'month';
|
|
2
|
+
export interface WuSchedulerEvent {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
title: string;
|
|
5
|
+
start: Date | string | number;
|
|
6
|
+
/** Default: an hour after `start` (all-day events: the same day). */
|
|
7
|
+
end?: Date | string | number | null;
|
|
8
|
+
allDay?: boolean;
|
|
9
|
+
/** Any CSS colour for the bar and tint. Default: the theme's primary colour. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** A line under the title in the day and week views. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** `false` keeps this one in place when the scheduler is `editable`. */
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
/** Anything else the app needs back in the events it gets. */
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface WuSchedulerEventClickEvent {
|
|
19
|
+
originalEvent: Event;
|
|
20
|
+
event: WuSchedulerEvent;
|
|
21
|
+
}
|
|
22
|
+
/** `(onDateClick)`: an empty day (month view, `allDay`) or a time slot (day and week views) was clicked. */
|
|
23
|
+
export interface WuSchedulerDateClickEvent {
|
|
24
|
+
originalEvent: Event;
|
|
25
|
+
date: Date;
|
|
26
|
+
allDay: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** `(onEventChange)`: an event was dragged to a new time. The app saves it and passes new `events`. */
|
|
29
|
+
export interface WuSchedulerEventChangeEvent {
|
|
30
|
+
event: WuSchedulerEvent;
|
|
31
|
+
start: Date;
|
|
32
|
+
end: Date;
|
|
33
|
+
}
|
|
34
|
+
/** An event placed on the grid (time views: its column lane; month view: just the day). */
|
|
35
|
+
export interface ɵWuPlacedEvent {
|
|
36
|
+
key: string;
|
|
37
|
+
event: WuSchedulerEvent;
|
|
38
|
+
start: Date;
|
|
39
|
+
end: Date;
|
|
40
|
+
/** Day and week views: top and height in % of the visible hours; left and width in % of the day column. */
|
|
41
|
+
top: number;
|
|
42
|
+
height: number;
|
|
43
|
+
left: number;
|
|
44
|
+
width: number;
|
|
45
|
+
time: string;
|
|
46
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** Fixed design data. packages/themes/scripts/gen-scss-data.mjs writes the Sass copy of these tables. */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.COMPONENT_TOKENS = exports.VERSION_CATALOG = exports.CLASSIC_THEMES = exports.PRESET_NAMES = exports.PRESETS = exports.FAMILY_GENERATION = exports.SEMANTIC_DEFAULTS = exports.SEMANTIC_KEYS = exports.FOCUS_STYLES = exports.SHADOWS = exports.DENSITY = exports.FONTS = exports.SURFACES = exports.PRIMARY_SWATCHES = void 0;
|
|
5
|
+
exports.googleFontHref = googleFontHref;
|
|
5
6
|
exports.presetExportName = presetExportName;
|
|
6
7
|
exports.PRIMARY_SWATCHES = [
|
|
7
8
|
/** Wirabyte brand blue (wirabyte.com --wb-primary). */
|
|
@@ -43,6 +44,26 @@ exports.SURFACES = {
|
|
|
43
44
|
ink: ['#f6f8fc', '#eef2f9', '#e3e8f1', '#cfd7e4', '#98a5b8', '#556274', '#334155', '#2a3a52', '#1c2839', '#0e1624', '#070b14'],
|
|
44
45
|
};
|
|
45
46
|
exports.FONTS = ['Kanit', 'Sarabun', 'Prompt', 'Noto Sans Thai', 'IBM Plex Sans Thai', 'Anuphan', 'Inter', 'Roboto'];
|
|
47
|
+
/** Google Fonts families the presets, ng add and the Studio use, with the weights to ask for (the API refuses weights a family lacks). */
|
|
48
|
+
const GOOGLE_FONT_WEIGHTS = {
|
|
49
|
+
...Object.fromEntries(exports.FONTS.map((f) => [f, ':wght@400;500;600;700'])),
|
|
50
|
+
'Noto Sans Thai Looped': ':wght@400;500;600;700',
|
|
51
|
+
'Noto Serif Thai': ':wght@400;500;600;700',
|
|
52
|
+
Taviraj: ':wght@400;500;600;700',
|
|
53
|
+
Trirong: ':wght@400;500;600;700',
|
|
54
|
+
Pridi: ':wght@400;500;600;700',
|
|
55
|
+
Itim: '',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The Google Fonts stylesheet for the first family of a CSS `font-family` value (`"'Kanit', sans-serif"`), or `null` when
|
|
59
|
+
* it is not a family the themes know.
|
|
60
|
+
*/
|
|
61
|
+
function googleFontHref(fontFamily) {
|
|
62
|
+
const name = fontFamily.split(',')[0].trim().replace(/^['"]|['"]$/g, '');
|
|
63
|
+
if (!Object.prototype.hasOwnProperty.call(GOOGLE_FONT_WEIGHTS, name))
|
|
64
|
+
return null;
|
|
65
|
+
return `https://fonts.googleapis.com/css2?family=${name.replace(/ /g, '+')}${GOOGLE_FONT_WEIGHTS[name]}&display=swap`;
|
|
66
|
+
}
|
|
46
67
|
/** Density multiplies every padding a preset defines (1 = the preset's own spacing). */
|
|
47
68
|
exports.DENSITY = {
|
|
48
69
|
compact: 0.8,
|
|
@@ -125,7 +146,7 @@ exports.PRESETS = {
|
|
|
125
146
|
material: { ...styled, family: 'material', label: 'Material', fontFamily: 'Roboto', primary: '#10b981', surface: 'slate', semantic: MATERIAL_SEMANTIC, radius: 6, shadow: 'material', ripple: true, focusRing: 'inset' },
|
|
126
147
|
phet: { ...styled, family: 'phet', label: 'Phet', primary: '#10b981', surface: 'slate', semantic: PHET_SEMANTIC, radius: 6, shadow: 'phet', ripple: false, focusRing: 'bold', transition: 0 },
|
|
127
148
|
// ---- v3: WiraUI's own ----
|
|
128
|
-
wira: { family: 'wira', label: 'Wira', primary: '#1e7ae0', surface: 'ink', semantic: exports.SEMANTIC_DEFAULTS, fontFamily: 'Kanit', fontSize: 14, lineHeight: 1.6, radius:
|
|
149
|
+
wira: { family: 'wira', label: 'Wira', primary: '#1e7ae0', surface: 'ink', semantic: exports.SEMANTIC_DEFAULTS, fontFamily: 'Kanit', fontSize: 14, lineHeight: 1.6, radius: 10, density: 'normal', shadow: 'soft', ripple: false, focusRing: 'ring', transition: 150, scheme: 'light' },
|
|
129
150
|
lanna: { family: 'wira', label: 'Lanna', primary: '#0d9488', surface: 'stone', semantic: exports.SEMANTIC_DEFAULTS, fontFamily: 'Sarabun', fontSize: 15, lineHeight: 1.7, radius: 12, density: 'comfortable', shadow: 'soft', ripple: false, focusRing: 'ring', transition: 200, scheme: 'light' },
|
|
130
151
|
siam: { family: 'wira', label: 'Siam', primary: '#6366f1', surface: 'gray', semantic: exports.SEMANTIC_DEFAULTS, fontFamily: 'Prompt', fontSize: 14, lineHeight: 1.6, radius: 4, density: 'normal', shadow: 'elevated', ripple: true, focusRing: 'outline', transition: 200, scheme: 'light' },
|
|
131
152
|
nakhon: { family: 'wira', label: 'Nakhon', primary: '#3b82f6', surface: 'zinc', semantic: exports.SEMANTIC_DEFAULTS, fontFamily: 'IBM Plex Sans Thai', fontSize: 13, lineHeight: 1.55, radius: 2, density: 'compact', shadow: 'none', ripple: false, focusRing: 'outline', transition: 100, scheme: 'light' },
|