tikal-ui-components 0.0.1 → 0.3.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.
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, input, output, Component } from '@angular/core';
|
|
2
|
+
import { Pipe, input, output, Component, model, signal } from '@angular/core';
|
|
3
3
|
import { PIcon, Spinner } from '@primeicons/angular';
|
|
4
4
|
import * as i1 from 'primeng/button';
|
|
5
5
|
import { ButtonModule } from 'primeng/button';
|
|
6
|
+
import * as i1$1 from 'primeng/inputtext';
|
|
7
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
8
|
+
import { form, required, maxLength, disabled, FormRoot, FormField } from '@angular/forms/signals';
|
|
6
9
|
|
|
7
10
|
var ButtonColour;
|
|
8
11
|
(function (ButtonColour) {
|
|
@@ -31,6 +34,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
31
34
|
}]
|
|
32
35
|
}] });
|
|
33
36
|
|
|
37
|
+
var ButtonType;
|
|
38
|
+
(function (ButtonType) {
|
|
39
|
+
ButtonType["Button"] = "button";
|
|
40
|
+
ButtonType["Submit"] = "submit";
|
|
41
|
+
ButtonType["Reset"] = "reset";
|
|
42
|
+
})(ButtonType || (ButtonType = {}));
|
|
43
|
+
|
|
34
44
|
class ButtonComponent {
|
|
35
45
|
/** What icon should the button display? */
|
|
36
46
|
icon = input('', /* @ts-ignore */
|
|
@@ -54,23 +64,100 @@ class ButtonComponent {
|
|
|
54
64
|
/** Should the button have an outline? */
|
|
55
65
|
outline = input(false, /* @ts-ignore */
|
|
56
66
|
...(ngDevMode ? [{ debugName: "outline" }] : /* istanbul ignore next */ []));
|
|
67
|
+
/** What type should the button be? */
|
|
68
|
+
type = input(ButtonType.Button, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
57
70
|
/** @ignore */
|
|
58
71
|
clicked = output();
|
|
59
72
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: ButtonComponent, isStandalone: true, selector: "tikal-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, colour: { classPropertyName: "colour", publicName: "colour", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n pButton\n
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: ButtonComponent, isStandalone: true, selector: "tikal-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, colour: { classPropertyName: "colour", publicName: "colour", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n pButton\n [disabled]=\"isLoading()\"\n [iconOnly]=\"!label()\"\n [outlined]=\"outline()\"\n [severity]=\"colour()\"\n [size]=\"size() | enumMap: sizeMap\"\n [type]=\"type()\"\n (click)=\"clicked.emit()\"\n>\n @if (isLoading()) {\n <svg data-p-icon=\"spinner\" [spin]=\"true\"></svg>\n } @else if (icon()) {\n <svg [pIcon]=\"icon()\"></svg>\n }\n {{ label() }}\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1.ButtonDirective, selector: "[pButton]", inputs: ["pButton", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "link", "rounded", "fluid", "variant", "iconOnly", "loading", "severity"] }, { kind: "component", type: PIcon, selector: "svg[pIcon]", inputs: ["pIcon"] }, { kind: "component", type: Spinner, selector: "svg[data-p-icon=\"spinner\"]" }, { kind: "pipe", type: EnumMapPipe, name: "enumMap" }] });
|
|
61
74
|
}
|
|
62
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
63
76
|
type: Component,
|
|
64
|
-
args: [{ selector: 'tikal-button', imports: [ButtonModule, PIcon, EnumMapPipe, Spinner], template: "<button\n pButton\n
|
|
65
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], colour: [{ type: i0.Input, args: [{ isSignal: true, alias: "colour", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], outline: [{ type: i0.Input, args: [{ isSignal: true, alias: "outline", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
77
|
+
args: [{ selector: 'tikal-button', imports: [ButtonModule, PIcon, EnumMapPipe, Spinner], template: "<button\n pButton\n [disabled]=\"isLoading()\"\n [iconOnly]=\"!label()\"\n [outlined]=\"outline()\"\n [severity]=\"colour()\"\n [size]=\"size() | enumMap: sizeMap\"\n [type]=\"type()\"\n (click)=\"clicked.emit()\"\n>\n @if (isLoading()) {\n <svg data-p-icon=\"spinner\" [spin]=\"true\"></svg>\n } @else if (icon()) {\n <svg [pIcon]=\"icon()\"></svg>\n }\n {{ label() }}\n</button>\n" }]
|
|
78
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], colour: [{ type: i0.Input, args: [{ isSignal: true, alias: "colour", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], outline: [{ type: i0.Input, args: [{ isSignal: true, alias: "outline", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
79
|
+
|
|
80
|
+
class InputComponent {
|
|
81
|
+
/** What value should the input have */
|
|
82
|
+
value = model('', /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
84
|
+
/** Should the input be disabled */
|
|
85
|
+
disabled = input(false, /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/** Is the content of the input invalid? */
|
|
88
|
+
invalid = input(false, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
90
|
+
/** Is the input required? */
|
|
91
|
+
required = input(false, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
93
|
+
/** Was the input touched */
|
|
94
|
+
touched = input(false, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
96
|
+
/** What is the max input length? */
|
|
97
|
+
maxLength = input(/* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [undefined, { debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
99
|
+
/** What is the label of the input element? */
|
|
100
|
+
label = input(/* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
102
|
+
/** What placeholder should the input display? */
|
|
103
|
+
placeholder = input(/* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: InputComponent, isStandalone: true, selector: "tikal-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<input\n pInputText\n [ariaLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid() && touched()\"\n [maxLength]=\"maxLength()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [value]=\"value()\"\n (input)=\"value.set($event.target.value)\"\n/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i1$1.InputText, selector: "[pInputText]", inputs: ["hostName", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }] });
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: InputComponent, decorators: [{
|
|
109
|
+
type: Component,
|
|
110
|
+
args: [{ selector: 'tikal-input', imports: [InputTextModule], template: "<input\n pInputText\n [ariaLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid() && touched()\"\n [maxLength]=\"maxLength()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [value]=\"value()\"\n (input)=\"value.set($event.target.value)\"\n/>\n" }]
|
|
111
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
112
|
+
|
|
113
|
+
class ChatFormComponent {
|
|
114
|
+
/** @ignore */
|
|
115
|
+
chatFormData = signal({ message: '' }, /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "chatFormData" }] : /* istanbul ignore next */ []));
|
|
117
|
+
/** What should happen when the form is submitted? */
|
|
118
|
+
onSubmission = input.required(/* @ts-ignore */
|
|
119
|
+
...(ngDevMode ? [{ debugName: "onSubmission" }] : /* istanbul ignore next */ []));
|
|
120
|
+
/** What placeholder should be displayed on the input? */
|
|
121
|
+
placeholder = input(/* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
123
|
+
/** What is the max input length? */
|
|
124
|
+
maxLength = input(50, /* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/** What is the label of the input element? */
|
|
127
|
+
label = input(/* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
129
|
+
/** @ignore */
|
|
130
|
+
buttonTypeSubmit = ButtonType.Submit;
|
|
131
|
+
/** @ignore */
|
|
132
|
+
chatForm = form(this.chatFormData, (schemaPath) => {
|
|
133
|
+
required(schemaPath.message);
|
|
134
|
+
maxLength(schemaPath.message, () => this.maxLength());
|
|
135
|
+
disabled(schemaPath, { when: () => this.chatForm().submitting() });
|
|
136
|
+
}, {
|
|
137
|
+
submission: {
|
|
138
|
+
action: async (field) => {
|
|
139
|
+
const message = field().value().message;
|
|
140
|
+
await this.onSubmission()(message);
|
|
141
|
+
field.message().reset('');
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ChatFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: ChatFormComponent, isStandalone: true, selector: "tikal-chat-form", inputs: { onSubmission: { classPropertyName: "onSubmission", publicName: "onSubmission", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form [formRoot]=\"chatForm\">\n <tikal-input [formField]=\"chatForm.message\" [label]=\"label()\" [placeholder]=\"placeholder()\" />\n <tikal-button icon=\"send\" [isLoading]=\"chatForm().submitting()\" [type]=\"buttonTypeSubmit\" />\n</form>\n", styles: ["form{display:flex;gap:.5rem}\n"], dependencies: [{ kind: "directive", type: FormRoot, selector: "form[formRoot]", inputs: ["formRoot"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "component", type: InputComponent, selector: "tikal-input", inputs: ["value", "disabled", "invalid", "required", "touched", "maxLength", "label", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: ButtonComponent, selector: "tikal-button", inputs: ["icon", "colour", "size", "label", "isLoading", "outline", "type"], outputs: ["clicked"] }] });
|
|
147
|
+
}
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ChatFormComponent, decorators: [{
|
|
149
|
+
type: Component,
|
|
150
|
+
args: [{ selector: 'tikal-chat-form', imports: [FormRoot, FormField, InputComponent, ButtonComponent], template: "<form [formRoot]=\"chatForm\">\n <tikal-input [formField]=\"chatForm.message\" [label]=\"label()\" [placeholder]=\"placeholder()\" />\n <tikal-button icon=\"send\" [isLoading]=\"chatForm().submitting()\" [type]=\"buttonTypeSubmit\" />\n</form>\n", styles: ["form{display:flex;gap:.5rem}\n"] }]
|
|
151
|
+
}], propDecorators: { onSubmission: [{ type: i0.Input, args: [{ isSignal: true, alias: "onSubmission", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
|
|
66
152
|
|
|
67
153
|
/*
|
|
68
154
|
* Public API Surface of tikal-ui-components
|
|
69
155
|
*/
|
|
156
|
+
// Button
|
|
70
157
|
|
|
71
158
|
/**
|
|
72
159
|
* Generated bundle index. Do not edit.
|
|
73
160
|
*/
|
|
74
161
|
|
|
75
|
-
export { ButtonComponent };
|
|
162
|
+
export { ButtonComponent, ChatFormComponent, InputComponent };
|
|
76
163
|
//# sourceMappingURL=tikal-ui-components.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tikal-ui-components.mjs","sources":["../../../projects/tikal-ui-components/src/lib/enums/button-colour.ts","../../../projects/tikal-ui-components/src/lib/enums/button-size.ts","../../../projects/tikal-ui-components/src/pipes/enum-map.ts","../../../projects/tikal-ui-components/src/lib/components/button/button.ts","../../../projects/tikal-ui-components/src/lib/components/button/button.html","../../../projects/tikal-ui-components/src/public-api.ts","../../../projects/tikal-ui-components/src/tikal-ui-components.ts"],"sourcesContent":["export enum ButtonColour {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n","export enum ButtonSize {\n Small = 'small',\n Normal = 'normal',\n Large = 'large',\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'enumMap',\n})\nexport class EnumMapPipe<T> implements PipeTransform {\n transform(value: unknown, enumMap: object, defaultValue?: T): T {\n return enumMap[value as keyof typeof enumMap] ?? defaultValue ?? value;\n }\n}\n","import { Component, input, output } from '@angular/core';\nimport { PIcon, Spinner } from '@primeicons/angular';\nimport { ButtonModule } from 'primeng/button';\nimport { ButtonColour } from '../../enums/button-colour';\nimport { ButtonSize } from '../../enums/button-size';\nimport { EnumMapPipe } from '../../../pipes/enum-map';\n\n@Component({\n selector: 'tikal-button',\n imports: [ButtonModule, PIcon, EnumMapPipe, Spinner],\n templateUrl: './button.html',\n styleUrl: './button.scss',\n})\nexport class ButtonComponent {\n /** What icon should the button display? */\n readonly icon = input<string>('');\n\n /** What colour should the button be? */\n readonly colour = input<ButtonColour>(ButtonColour.Primary);\n\n /** What size should the button be? */\n readonly size = input<ButtonSize>(ButtonSize.Normal);\n\n /** @ignore */\n readonly sizeMap = {\n normal: undefined,\n };\n\n /** What text should the button display? */\n readonly label = input<string>();\n\n /** Is the action related to the button currently running? */\n readonly isLoading = input<boolean>(false);\n\n /** Should the button have an outline? */\n readonly outline = input<boolean>(false);\n\n /** @ignore */\n readonly clicked = output<void>();\n}\n","<button\n pButton\n type=\"button\"\n [disabled]=\"isLoading()\"\n [iconOnly]=\"!label()\"\n [outlined]=\"outline()\"\n [severity]=\"colour()\"\n [size]=\"size() | enumMap: sizeMap\"\n (click)=\"clicked.emit()\"\n>\n @if (isLoading()) {\n <svg data-p-icon=\"spinner\" [spin]=\"true\"></svg>\n } @else if (icon()) {\n <svg [pIcon]=\"icon()\"></svg>\n }\n {{ label() }}\n</button>\n","/*\n * Public API Surface of tikal-ui-components\n */\nexport * from './lib/components/button/button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA,IAAY,YAGX;AAHD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACzB,CAAC,EAHW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;ACAxB,IAAY,UAIX;AAJD,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;;MCKT,WAAW,CAAA;AACtB,IAAA,SAAS,CAAC,KAAc,EAAE,OAAe,EAAE,YAAgB,EAAA;QACzD,OAAO,OAAO,CAAC,KAA6B,CAAC,IAAI,YAAY,IAAI,KAAK;IACxE;uGAHW,WAAW,EAAA,IAAA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":"tikal-ui-components.mjs","sources":["../../../projects/tikal-ui-components/src/lib/enums/button-colour.ts","../../../projects/tikal-ui-components/src/lib/enums/button-size.ts","../../../projects/tikal-ui-components/src/pipes/enum-map.ts","../../../projects/tikal-ui-components/src/lib/enums/button-type.ts","../../../projects/tikal-ui-components/src/lib/components/button/button.ts","../../../projects/tikal-ui-components/src/lib/components/button/button.html","../../../projects/tikal-ui-components/src/lib/components/input/input.ts","../../../projects/tikal-ui-components/src/lib/components/input/input.html","../../../projects/tikal-ui-components/src/lib/components/chat-form/chat-form.ts","../../../projects/tikal-ui-components/src/lib/components/chat-form/chat-form.html","../../../projects/tikal-ui-components/src/public-api.ts","../../../projects/tikal-ui-components/src/tikal-ui-components.ts"],"sourcesContent":["export enum ButtonColour {\n Primary = 'primary',\n Secondary = 'secondary',\n}\n","export enum ButtonSize {\n Small = 'small',\n Normal = 'normal',\n Large = 'large',\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'enumMap',\n})\nexport class EnumMapPipe<T> implements PipeTransform {\n transform(value: unknown, enumMap: object, defaultValue?: T): T {\n return enumMap[value as keyof typeof enumMap] ?? defaultValue ?? value;\n }\n}\n","export enum ButtonType {\n Button = 'button',\n Submit = 'submit',\n Reset = 'reset',\n}\n","import { Component, input, output } from '@angular/core';\nimport { PIcon, Spinner } from '@primeicons/angular';\nimport { ButtonModule } from 'primeng/button';\nimport { ButtonColour } from '../../enums/button-colour';\nimport { ButtonSize } from '../../enums/button-size';\nimport { EnumMapPipe } from '../../../pipes/enum-map';\nimport { ButtonType } from '../../enums/button-type';\n\n@Component({\n selector: 'tikal-button',\n imports: [ButtonModule, PIcon, EnumMapPipe, Spinner],\n templateUrl: './button.html',\n styleUrl: './button.scss',\n})\nexport class ButtonComponent {\n /** What icon should the button display? */\n readonly icon = input<string>('');\n\n /** What colour should the button be? */\n readonly colour = input<ButtonColour>(ButtonColour.Primary);\n\n /** What size should the button be? */\n readonly size = input<ButtonSize>(ButtonSize.Normal);\n\n /** @ignore */\n readonly sizeMap = {\n normal: undefined,\n };\n\n /** What text should the button display? */\n readonly label = input<string>();\n\n /** Is the action related to the button currently running? */\n readonly isLoading = input<boolean>(false);\n\n /** Should the button have an outline? */\n readonly outline = input<boolean>(false);\n\n /** What type should the button be? */\n readonly type = input<ButtonType>(ButtonType.Button);\n\n /** @ignore */\n readonly clicked = output<void>();\n}\n","<button\n pButton\n [disabled]=\"isLoading()\"\n [iconOnly]=\"!label()\"\n [outlined]=\"outline()\"\n [severity]=\"colour()\"\n [size]=\"size() | enumMap: sizeMap\"\n [type]=\"type()\"\n (click)=\"clicked.emit()\"\n>\n @if (isLoading()) {\n <svg data-p-icon=\"spinner\" [spin]=\"true\"></svg>\n } @else if (icon()) {\n <svg [pIcon]=\"icon()\"></svg>\n }\n {{ label() }}\n</button>\n","import { Component, model, input } from '@angular/core';\nimport { FormValueControl } from '@angular/forms/signals';\nimport { InputTextModule } from 'primeng/inputtext';\n\n@Component({\n selector: 'tikal-input',\n imports: [InputTextModule],\n templateUrl: './input.html',\n styleUrl: './input.scss',\n})\nexport class InputComponent implements FormValueControl<string> {\n /** What value should the input have */\n readonly value = model('');\n\n /** Should the input be disabled */\n readonly disabled = input<boolean>(false);\n\n /** Is the content of the input invalid? */\n readonly invalid = input<boolean>(false);\n\n /** Is the input required? */\n readonly required = input<boolean>(false);\n\n /** Was the input touched */\n readonly touched = input<boolean>(false);\n\n /** What is the max input length? */\n readonly maxLength = input<number>();\n\n /** What is the label of the input element? */\n readonly label = input<string>();\n\n /** What placeholder should the input display? */\n readonly placeholder = input<string>();\n}\n","<input\n pInputText\n [ariaLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [invalid]=\"invalid() && touched()\"\n [maxLength]=\"maxLength()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [value]=\"value()\"\n (input)=\"value.set($event.target.value)\"\n/>\n","import { Component, input, signal } from '@angular/core';\nimport { disabled, form, required, FormRoot, FormField, maxLength } from '@angular/forms/signals';\nimport { InputComponent } from '../input/input';\nimport { ButtonComponent } from '../button/button';\nimport { ButtonType } from '../../enums/button-type';\n\ntype ChatFormData = {\n message: string;\n};\n\n@Component({\n selector: 'tikal-chat-form',\n imports: [FormRoot, FormField, InputComponent, ButtonComponent],\n templateUrl: './chat-form.html',\n styleUrl: './chat-form.scss',\n})\nexport class ChatFormComponent {\n /** @ignore */\n private readonly chatFormData = signal<ChatFormData>({ message: '' });\n\n /** What should happen when the form is submitted? */\n readonly onSubmission = input.required<(message: string) => Promise<void>>();\n\n /** What placeholder should be displayed on the input? */\n readonly placeholder = input<string>();\n\n /** What is the max input length? */\n readonly maxLength = input<number>(50);\n\n /** What is the label of the input element? */\n readonly label = input<string>();\n\n /** @ignore */\n readonly buttonTypeSubmit = ButtonType.Submit;\n\n /** @ignore */\n readonly chatForm = form(\n this.chatFormData,\n (schemaPath) => {\n required(schemaPath.message);\n maxLength(schemaPath.message, () => this.maxLength());\n disabled(schemaPath, { when: () => this.chatForm().submitting() });\n },\n {\n submission: {\n action: async (field) => {\n const message = field().value().message;\n\n await this.onSubmission()(message);\n\n field.message().reset('');\n },\n },\n },\n );\n}\n","<form [formRoot]=\"chatForm\">\n <tikal-input [formField]=\"chatForm.message\" [label]=\"label()\" [placeholder]=\"placeholder()\" />\n <tikal-button icon=\"send\" [isLoading]=\"chatForm().submitting()\" [type]=\"buttonTypeSubmit\" />\n</form>\n","/*\n * Public API Surface of tikal-ui-components\n */\n\n// Button\nexport * from './lib/components/button/button';\n\n// Input\nexport * from './lib/components/input/input';\n\n// Chat form\nexport * from './lib/components/chat-form/chat-form';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;AAAA,IAAY,YAGX;AAHD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACzB,C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"
|
|
7
|
+
},
|
|
4
8
|
"peerDependencies": {
|
|
5
9
|
"@angular/common": "^22.1.0",
|
|
6
10
|
"@angular/core": "^22.1.0",
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _angular_forms_signals from '@angular/forms/signals';
|
|
3
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
2
4
|
|
|
3
5
|
declare enum ButtonColour {
|
|
4
6
|
Primary = "primary",
|
|
@@ -11,6 +13,12 @@ declare enum ButtonSize {
|
|
|
11
13
|
Large = "large"
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
declare enum ButtonType {
|
|
17
|
+
Button = "button",
|
|
18
|
+
Submit = "submit",
|
|
19
|
+
Reset = "reset"
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
declare class ButtonComponent {
|
|
15
23
|
/** What icon should the button display? */
|
|
16
24
|
readonly icon: _angular_core.InputSignal<string>;
|
|
@@ -28,10 +36,55 @@ declare class ButtonComponent {
|
|
|
28
36
|
readonly isLoading: _angular_core.InputSignal<boolean>;
|
|
29
37
|
/** Should the button have an outline? */
|
|
30
38
|
readonly outline: _angular_core.InputSignal<boolean>;
|
|
39
|
+
/** What type should the button be? */
|
|
40
|
+
readonly type: _angular_core.InputSignal<ButtonType>;
|
|
31
41
|
/** @ignore */
|
|
32
42
|
readonly clicked: _angular_core.OutputEmitterRef<void>;
|
|
33
43
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
34
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonComponent, "tikal-button", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "colour": { "alias": "colour"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "outline": { "alias": "outline"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
44
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonComponent, "tikal-button", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "colour": { "alias": "colour"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "outline": { "alias": "outline"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare class InputComponent implements FormValueControl<string> {
|
|
48
|
+
/** What value should the input have */
|
|
49
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
50
|
+
/** Should the input be disabled */
|
|
51
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
52
|
+
/** Is the content of the input invalid? */
|
|
53
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
54
|
+
/** Is the input required? */
|
|
55
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
56
|
+
/** Was the input touched */
|
|
57
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
58
|
+
/** What is the max input length? */
|
|
59
|
+
readonly maxLength: _angular_core.InputSignal<number | undefined>;
|
|
60
|
+
/** What is the label of the input element? */
|
|
61
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
62
|
+
/** What placeholder should the input display? */
|
|
63
|
+
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
64
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputComponent, never>;
|
|
65
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputComponent, "tikal-input", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
type ChatFormData = {
|
|
69
|
+
message: string;
|
|
70
|
+
};
|
|
71
|
+
declare class ChatFormComponent {
|
|
72
|
+
/** @ignore */
|
|
73
|
+
private readonly chatFormData;
|
|
74
|
+
/** What should happen when the form is submitted? */
|
|
75
|
+
readonly onSubmission: _angular_core.InputSignal<(message: string) => Promise<void>>;
|
|
76
|
+
/** What placeholder should be displayed on the input? */
|
|
77
|
+
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
78
|
+
/** What is the max input length? */
|
|
79
|
+
readonly maxLength: _angular_core.InputSignal<number>;
|
|
80
|
+
/** What is the label of the input element? */
|
|
81
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
82
|
+
/** @ignore */
|
|
83
|
+
readonly buttonTypeSubmit = ButtonType.Submit;
|
|
84
|
+
/** @ignore */
|
|
85
|
+
readonly chatForm: _angular_forms_signals.FieldTree<ChatFormData, string | number, "writable">;
|
|
86
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatFormComponent, never>;
|
|
87
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatFormComponent, "tikal-chat-form", never, { "onSubmission": { "alias": "onSubmission"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
35
88
|
}
|
|
36
89
|
|
|
37
|
-
export { ButtonComponent };
|
|
90
|
+
export { ButtonComponent, ChatFormComponent, InputComponent };
|