@wirekyt/angular 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fesm2022/wirekyt-angular-client-only.mjs +57 -0
- package/dist/fesm2022/wirekyt-angular-client-only.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-clipboard.mjs +301 -0
- package/dist/fesm2022/wirekyt-angular-clipboard.mjs.map +1 -0
- package/dist/package.json +9 -1
- package/dist/types/wirekyt-angular-checkbox.d.ts +1 -1
- package/dist/types/wirekyt-angular-client-only.d.ts +14 -0
- package/dist/types/wirekyt-angular-client-only.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-clipboard.d.ts +111 -0
- package/dist/types/wirekyt-angular-clipboard.d.ts.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, signal, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
class ClientOnly {
|
|
6
|
+
fallback = input(null, /* @ts-ignore */
|
|
7
|
+
...(ngDevMode ? [{ debugName: "fallback" }] : /* istanbul ignore next */ []));
|
|
8
|
+
clientTemplate = input(null, /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "clientTemplate" }] : /* istanbul ignore next */ []));
|
|
10
|
+
isClient = signal(false, /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "isClient" }] : /* istanbul ignore next */ []));
|
|
12
|
+
constructor() {
|
|
13
|
+
afterNextRender(() => {
|
|
14
|
+
this.isClient.set(true);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClientOnly, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: ClientOnly, isStandalone: true, selector: "client-only", inputs: { fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null }, clientTemplate: { classPropertyName: "clientTemplate", publicName: "clientTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
19
|
+
@if (isClient()) {
|
|
20
|
+
@if (clientTemplate(); as tpl) {
|
|
21
|
+
<ng-container [ngTemplateOutlet]="tpl"></ng-container>
|
|
22
|
+
} @else {
|
|
23
|
+
<ng-content />
|
|
24
|
+
}
|
|
25
|
+
} @else if (fallback(); as fb) {
|
|
26
|
+
<ng-container [ngTemplateOutlet]="fb"></ng-container>
|
|
27
|
+
}
|
|
28
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClientOnly, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{
|
|
33
|
+
selector: "client-only",
|
|
34
|
+
standalone: true,
|
|
35
|
+
imports: [NgTemplateOutlet],
|
|
36
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
37
|
+
host: { style: "display: contents" },
|
|
38
|
+
template: `
|
|
39
|
+
@if (isClient()) {
|
|
40
|
+
@if (clientTemplate(); as tpl) {
|
|
41
|
+
<ng-container [ngTemplateOutlet]="tpl"></ng-container>
|
|
42
|
+
} @else {
|
|
43
|
+
<ng-content />
|
|
44
|
+
}
|
|
45
|
+
} @else if (fallback(); as fb) {
|
|
46
|
+
<ng-container [ngTemplateOutlet]="fb"></ng-container>
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
}]
|
|
50
|
+
}], ctorParameters: () => [], propDecorators: { fallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallback", required: false }] }], clientTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "clientTemplate", required: false }] }] } });
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Generated bundle index. Do not edit.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export { ClientOnly };
|
|
57
|
+
//# sourceMappingURL=wirekyt-angular-client-only.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-client-only.mjs","sources":["../../src/components/client-only/client-only.ts","../../src/components/client-only/wirekyt-angular-client-only.ts"],"sourcesContent":["import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n type TemplateRef,\n afterNextRender,\n input,\n signal,\n} from \"@angular/core\";\n\n@Component({\n selector: \"client-only\",\n standalone: true,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: \"display: contents\" },\n template: `\n @if (isClient()) {\n @if (clientTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\"></ng-container>\n } @else {\n <ng-content />\n }\n } @else if (fallback(); as fb) {\n <ng-container [ngTemplateOutlet]=\"fb\"></ng-container>\n }\n `,\n})\nexport class ClientOnly {\n readonly fallback = input<TemplateRef<unknown> | null>(null);\n readonly clientTemplate = input<TemplateRef<unknown> | null>(null);\n protected readonly isClient = signal(false);\n\n constructor() {\n afterNextRender(() => {\n this.isClient.set(true);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MA4Ba,UAAU,CAAA;IACZ,QAAQ,GAAG,KAAK,CAA8B,IAAI;iFAAC;IACnD,cAAc,GAAG,KAAK,CAA8B,IAAI;uFAAC;IAC/C,QAAQ,GAAG,MAAM,CAAC,KAAK;iFAAC;AAE3C,IAA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AU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;AACpC,oBAAA,QAAQ,EAAE;;;;;;;;;;AAUT,EAAA,CAAA;AACF,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import * as clipboard from '@wirekyt/dom/machines/clipboard';
|
|
2
|
+
export { anatomy as clipboardAnatomy } from '@wirekyt/dom/machines/clipboard';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, input, model, output, computed, DestroyRef, Renderer2, ElementRef, forwardRef, Directive, TemplateRef, ViewContainerRef, effect } from '@angular/core';
|
|
5
|
+
import { injectEnvironment, createId, useMachine, bindProps } from '@wirekyt/angular';
|
|
6
|
+
|
|
7
|
+
const CLIPBOARD_CONTEXT = new InjectionToken("WIREKYT.CLIPBOARD_CONTEXT");
|
|
8
|
+
function injectClipboardContext() {
|
|
9
|
+
return inject(CLIPBOARD_CONTEXT);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function useClipboard(options = { context: () => ({}) }) {
|
|
13
|
+
const environment = injectEnvironment();
|
|
14
|
+
const fallbackId = createId();
|
|
15
|
+
return useMachine({
|
|
16
|
+
machine: clipboard.machine,
|
|
17
|
+
context: () => {
|
|
18
|
+
const props = options.context();
|
|
19
|
+
return {
|
|
20
|
+
...props,
|
|
21
|
+
getRootNode: environment.getRootNode,
|
|
22
|
+
id: props.id ?? fallbackId,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
connect: (service, normalize) => clipboard.connect(service, normalize),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class ClipboardRoot {
|
|
30
|
+
id = input(undefined, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
32
|
+
ids = input(undefined, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
|
|
34
|
+
translations = input(undefined, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
|
|
36
|
+
value = model(undefined, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
38
|
+
defaultValue = input(undefined, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
|
|
40
|
+
timeout = input(undefined, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "timeout" }] : /* istanbul ignore next */ []));
|
|
42
|
+
statusChange = output();
|
|
43
|
+
stableIds = computed(() => this.stabilizeIds(this.ids()), /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "stableIds" }] : /* istanbul ignore next */ []));
|
|
45
|
+
prevIds = undefined;
|
|
46
|
+
machine = useClipboard({
|
|
47
|
+
context: () => ({
|
|
48
|
+
id: this.id(),
|
|
49
|
+
ids: this.stableIds(),
|
|
50
|
+
translations: this.translations(),
|
|
51
|
+
value: this.value(),
|
|
52
|
+
defaultValue: this.defaultValue(),
|
|
53
|
+
timeout: this.timeout(),
|
|
54
|
+
onValueChange: (details) => this.value.set(details.value),
|
|
55
|
+
onStatusChange: (details) => this.statusChange.emit(details),
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
state = this.machine.state;
|
|
59
|
+
api = this.machine.api;
|
|
60
|
+
service = this.machine.service;
|
|
61
|
+
send = this.machine.send;
|
|
62
|
+
stabilizeIds(next) {
|
|
63
|
+
if (next === this.prevIds)
|
|
64
|
+
return this.prevIds;
|
|
65
|
+
if (next === undefined || this.prevIds === undefined) {
|
|
66
|
+
this.prevIds = next;
|
|
67
|
+
return this.prevIds;
|
|
68
|
+
}
|
|
69
|
+
const keys = new Set([...Object.keys(next), ...Object.keys(this.prevIds)]);
|
|
70
|
+
const hasEqualEntries = [...keys].every((key) => Object.is(next[key], this.prevIds?.[key]));
|
|
71
|
+
if (hasEqualEntries) {
|
|
72
|
+
return this.prevIds;
|
|
73
|
+
}
|
|
74
|
+
this.prevIds = next;
|
|
75
|
+
return this.prevIds;
|
|
76
|
+
}
|
|
77
|
+
constructor() {
|
|
78
|
+
bindProps({
|
|
79
|
+
elementRef: inject(ElementRef),
|
|
80
|
+
renderer: inject(Renderer2),
|
|
81
|
+
destroyRef: inject(DestroyRef),
|
|
82
|
+
props: () => this.api().getRootProps(),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
86
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: ClipboardRoot, isStandalone: true, selector: "[clipboardRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, translations: { classPropertyName: "translations", publicName: "translations", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, timeout: { classPropertyName: "timeout", publicName: "timeout", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", statusChange: "statusChange" }, providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRoot) }], exportAs: ["clipboardRoot"], ngImport: i0 });
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardRoot, decorators: [{
|
|
89
|
+
type: Directive,
|
|
90
|
+
args: [{
|
|
91
|
+
selector: "[clipboardRoot]",
|
|
92
|
+
standalone: true,
|
|
93
|
+
exportAs: "clipboardRoot",
|
|
94
|
+
providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRoot) }],
|
|
95
|
+
}]
|
|
96
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], translations: [{ type: i0.Input, args: [{ isSignal: true, alias: "translations", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], timeout: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeout", required: false }] }], statusChange: [{ type: i0.Output, args: ["statusChange"] }] } });
|
|
97
|
+
|
|
98
|
+
class ClipboardRootProvider {
|
|
99
|
+
value = input.required(/* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
101
|
+
state = computed(() => this.value().state(), /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
103
|
+
api = computed(() => this.value().api(), /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
|
|
105
|
+
send = (event) => this.value().send(event);
|
|
106
|
+
get service() {
|
|
107
|
+
return this.value().service;
|
|
108
|
+
}
|
|
109
|
+
resolveValue() {
|
|
110
|
+
return this.value();
|
|
111
|
+
}
|
|
112
|
+
constructor() {
|
|
113
|
+
bindProps({
|
|
114
|
+
elementRef: inject(ElementRef),
|
|
115
|
+
renderer: inject(Renderer2),
|
|
116
|
+
destroyRef: inject(DestroyRef),
|
|
117
|
+
props: () => this.api().getRootProps(),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardRootProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
121
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: ClipboardRootProvider, isStandalone: true, selector: "[clipboardRootProvider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRootProvider) }], exportAs: ["clipboardRootProvider"], ngImport: i0 });
|
|
122
|
+
}
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardRootProvider, decorators: [{
|
|
124
|
+
type: Directive,
|
|
125
|
+
args: [{
|
|
126
|
+
selector: "[clipboardRootProvider]",
|
|
127
|
+
standalone: true,
|
|
128
|
+
exportAs: "clipboardRootProvider",
|
|
129
|
+
providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRootProvider) }],
|
|
130
|
+
}]
|
|
131
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
132
|
+
|
|
133
|
+
class ClipboardLabel {
|
|
134
|
+
constructor() {
|
|
135
|
+
const context = injectClipboardContext();
|
|
136
|
+
bindProps({
|
|
137
|
+
elementRef: inject(ElementRef),
|
|
138
|
+
renderer: inject(Renderer2),
|
|
139
|
+
destroyRef: inject(DestroyRef),
|
|
140
|
+
props: () => context.api().getLabelProps(),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardLabel, isStandalone: true, selector: "[clipboardLabel]", exportAs: ["clipboardLabel"], ngImport: i0 });
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardLabel, decorators: [{
|
|
147
|
+
type: Directive,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: "[clipboardLabel]",
|
|
150
|
+
standalone: true,
|
|
151
|
+
exportAs: "clipboardLabel",
|
|
152
|
+
}]
|
|
153
|
+
}], ctorParameters: () => [] });
|
|
154
|
+
|
|
155
|
+
class ClipboardControl {
|
|
156
|
+
constructor() {
|
|
157
|
+
const context = injectClipboardContext();
|
|
158
|
+
bindProps({
|
|
159
|
+
elementRef: inject(ElementRef),
|
|
160
|
+
renderer: inject(Renderer2),
|
|
161
|
+
destroyRef: inject(DestroyRef),
|
|
162
|
+
props: () => context.api().getControlProps(),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
166
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardControl, isStandalone: true, selector: "[clipboardControl]", exportAs: ["clipboardControl"], ngImport: i0 });
|
|
167
|
+
}
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardControl, decorators: [{
|
|
169
|
+
type: Directive,
|
|
170
|
+
args: [{
|
|
171
|
+
selector: "[clipboardControl]",
|
|
172
|
+
standalone: true,
|
|
173
|
+
exportAs: "clipboardControl",
|
|
174
|
+
}]
|
|
175
|
+
}], ctorParameters: () => [] });
|
|
176
|
+
|
|
177
|
+
class ClipboardContext {
|
|
178
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
179
|
+
void context;
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
clipboard = injectClipboardContext();
|
|
183
|
+
templateRef = inject(TemplateRef);
|
|
184
|
+
viewContainer = inject(ViewContainerRef);
|
|
185
|
+
constructor() {
|
|
186
|
+
const view = this.viewContainer.createEmbeddedView(this.templateRef, {
|
|
187
|
+
$implicit: this.clipboard.api,
|
|
188
|
+
api: this.clipboard.api,
|
|
189
|
+
});
|
|
190
|
+
effect(() => {
|
|
191
|
+
this.clipboard.api();
|
|
192
|
+
view.detectChanges();
|
|
193
|
+
});
|
|
194
|
+
inject(DestroyRef).onDestroy(() => view.destroy());
|
|
195
|
+
}
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
197
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardContext, isStandalone: true, selector: "[clipboardContext]", exportAs: ["clipboardContext"], ngImport: i0 });
|
|
198
|
+
}
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardContext, decorators: [{
|
|
200
|
+
type: Directive,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: "[clipboardContext]",
|
|
203
|
+
standalone: true,
|
|
204
|
+
exportAs: "clipboardContext",
|
|
205
|
+
}]
|
|
206
|
+
}], ctorParameters: () => [] });
|
|
207
|
+
|
|
208
|
+
class ClipboardInput {
|
|
209
|
+
constructor() {
|
|
210
|
+
const context = injectClipboardContext();
|
|
211
|
+
bindProps({
|
|
212
|
+
elementRef: inject(ElementRef),
|
|
213
|
+
renderer: inject(Renderer2),
|
|
214
|
+
destroyRef: inject(DestroyRef),
|
|
215
|
+
props: () => context.api().getInputProps(),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
219
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardInput, isStandalone: true, selector: "input[clipboardInput]", exportAs: ["clipboardInput"], ngImport: i0 });
|
|
220
|
+
}
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardInput, decorators: [{
|
|
222
|
+
type: Directive,
|
|
223
|
+
args: [{
|
|
224
|
+
selector: "input[clipboardInput]",
|
|
225
|
+
standalone: true,
|
|
226
|
+
exportAs: "clipboardInput",
|
|
227
|
+
}]
|
|
228
|
+
}], ctorParameters: () => [] });
|
|
229
|
+
|
|
230
|
+
class ClipboardTrigger {
|
|
231
|
+
constructor() {
|
|
232
|
+
const context = injectClipboardContext();
|
|
233
|
+
bindProps({
|
|
234
|
+
elementRef: inject(ElementRef),
|
|
235
|
+
renderer: inject(Renderer2),
|
|
236
|
+
destroyRef: inject(DestroyRef),
|
|
237
|
+
props: () => context.api().getTriggerProps(),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
241
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardTrigger, isStandalone: true, selector: "[clipboardTrigger]", exportAs: ["clipboardTrigger"], ngImport: i0 });
|
|
242
|
+
}
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardTrigger, decorators: [{
|
|
244
|
+
type: Directive,
|
|
245
|
+
args: [{
|
|
246
|
+
selector: "[clipboardTrigger]",
|
|
247
|
+
standalone: true,
|
|
248
|
+
exportAs: "clipboardTrigger",
|
|
249
|
+
}]
|
|
250
|
+
}], ctorParameters: () => [] });
|
|
251
|
+
|
|
252
|
+
class ClipboardIndicator {
|
|
253
|
+
copied;
|
|
254
|
+
constructor() {
|
|
255
|
+
const context = injectClipboardContext();
|
|
256
|
+
this.copied = computed(() => context.api().copied, /* @ts-ignore */
|
|
257
|
+
...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
|
|
258
|
+
bindProps({
|
|
259
|
+
elementRef: inject(ElementRef),
|
|
260
|
+
renderer: inject(Renderer2),
|
|
261
|
+
destroyRef: inject(DestroyRef),
|
|
262
|
+
props: () => {
|
|
263
|
+
const api = context.api();
|
|
264
|
+
return api.getIndicatorProps({ copied: this.copied() });
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
269
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardIndicator, isStandalone: true, selector: "[clipboardIndicator]", exportAs: ["clipboardIndicator"], ngImport: i0 });
|
|
270
|
+
}
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardIndicator, decorators: [{
|
|
272
|
+
type: Directive,
|
|
273
|
+
args: [{
|
|
274
|
+
selector: "[clipboardIndicator]",
|
|
275
|
+
standalone: true,
|
|
276
|
+
exportAs: "clipboardIndicator",
|
|
277
|
+
}]
|
|
278
|
+
}], ctorParameters: () => [] });
|
|
279
|
+
|
|
280
|
+
class ClipboardValueText {
|
|
281
|
+
context = injectClipboardContext();
|
|
282
|
+
value = computed(() => this.context.api().value, /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
284
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardValueText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
285
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.0", type: ClipboardValueText, isStandalone: true, selector: "[clipboardValueText]", exportAs: ["clipboardValueText"], ngImport: i0 });
|
|
286
|
+
}
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ClipboardValueText, decorators: [{
|
|
288
|
+
type: Directive,
|
|
289
|
+
args: [{
|
|
290
|
+
selector: "[clipboardValueText]",
|
|
291
|
+
standalone: true,
|
|
292
|
+
exportAs: "clipboardValueText",
|
|
293
|
+
}]
|
|
294
|
+
}] });
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Generated bundle index. Do not edit.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
export { CLIPBOARD_CONTEXT, ClipboardContext, ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardRootProvider, ClipboardTrigger, ClipboardValueText, injectClipboardContext, useClipboard };
|
|
301
|
+
//# sourceMappingURL=wirekyt-angular-clipboard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-clipboard.mjs","sources":["../../src/components/clipboard/use-context.ts","../../src/components/clipboard/use.ts","../../src/components/clipboard/root.ts","../../src/components/clipboard/root-provider.ts","../../src/components/clipboard/label.ts","../../src/components/clipboard/control.ts","../../src/components/clipboard/context.ts","../../src/components/clipboard/input.ts","../../src/components/clipboard/trigger.ts","../../src/components/clipboard/indicator.ts","../../src/components/clipboard/value-text.ts","../../src/components/clipboard/wirekyt-angular-clipboard.ts"],"sourcesContent":["import { InjectionToken, inject } from \"@angular/core\";\n\nimport type { UseClipboardReturn } from \"./use\";\n\nexport const CLIPBOARD_CONTEXT = new InjectionToken<UseClipboardReturn>(\n \"WIREKYT.CLIPBOARD_CONTEXT\",\n);\n\nexport function injectClipboardContext(): UseClipboardReturn {\n return inject(CLIPBOARD_CONTEXT);\n}\n","import type { Machine } from \"@wirekyt/dom\";\n\nimport { createId, injectEnvironment, useMachine, UseMachineReturn } from \"@wirekyt/angular\";\nimport * as clipboard from \"@wirekyt/dom/machines/clipboard\";\n\nimport type { ClipboardMachineProps } from \"./types\";\n\ntype OptionalId<T extends { id: string }> = Omit<T, \"id\"> & { id?: string };\n\nexport interface UseClipboardProps extends OptionalId<Omit<ClipboardMachineProps, \"getRootNode\">> {}\n\nexport type UseClipboardReturn = UseMachineReturn<\n clipboard.Service[\"state\"],\n clipboard.Api,\n clipboard.Service\n>;\n\nexport interface UseClipboardOptions {\n context: () => UseClipboardProps;\n}\n\ntype ClipboardContext = Record<string, unknown>;\ntype ClipboardSchema = clipboard.Machine extends Machine<infer TSchema> ? TSchema : never;\n\nexport function useClipboard(\n options: UseClipboardOptions = { context: () => ({}) },\n): UseClipboardReturn {\n const environment = injectEnvironment();\n const fallbackId = createId();\n\n return useMachine<ClipboardSchema, clipboard.Api>({\n machine: clipboard.machine,\n context: () => {\n const props = options.context();\n return {\n ...props,\n getRootNode: environment.getRootNode,\n id: props.id ?? fallbackId,\n } as ClipboardContext;\n },\n connect: (service, normalize) => clipboard.connect(service, normalize),\n });\n}\n","import type * as clipboard from \"@wirekyt/dom/machines/clipboard\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type ModelSignal,\n type OutputEmitterRef,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type {\n ClipboardCopyStatusDetails,\n ClipboardElementIds,\n ClipboardIntlTranslations,\n} from \"./types\";\n\nimport { useClipboard, type UseClipboardReturn } from \"./use\";\nimport { CLIPBOARD_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardRoot]\",\n standalone: true,\n exportAs: \"clipboardRoot\",\n providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRoot) }],\n})\nexport class ClipboardRoot implements UseClipboardReturn {\n readonly id: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly ids: InputSignal<Partial<ClipboardElementIds> | undefined> = input<\n Partial<ClipboardElementIds> | undefined\n >(undefined);\n readonly translations: InputSignal<ClipboardIntlTranslations | undefined> = input<\n ClipboardIntlTranslations | undefined\n >(undefined);\n readonly value: ModelSignal<string | undefined> = model<string | undefined>(undefined);\n readonly defaultValue: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly timeout: InputSignal<number | undefined> = input<number | undefined>(undefined);\n readonly statusChange: OutputEmitterRef<ClipboardCopyStatusDetails> =\n output<ClipboardCopyStatusDetails>();\n private readonly stableIds = computed(() => this.stabilizeIds(this.ids()));\n private prevIds: Partial<ClipboardElementIds> | undefined = undefined;\n\n private readonly machine = useClipboard({\n context: () => ({\n id: this.id(),\n ids: this.stableIds(),\n translations: this.translations(),\n value: this.value(),\n defaultValue: this.defaultValue(),\n timeout: this.timeout(),\n onValueChange: (details) => this.value.set(details.value),\n onStatusChange: (details) => this.statusChange.emit(details),\n }),\n });\n\n readonly state: Signal<clipboard.Service[\"state\"]> = this.machine.state;\n readonly api: Signal<clipboard.Api> = this.machine.api;\n readonly service: clipboard.Service = this.machine.service;\n readonly send: clipboard.Service[\"send\"] = this.machine.send;\n\n private stabilizeIds(\n next: Partial<ClipboardElementIds> | undefined,\n ): Partial<ClipboardElementIds> | undefined {\n if (next === this.prevIds) return this.prevIds;\n if (next === undefined || this.prevIds === undefined) {\n this.prevIds = next;\n return this.prevIds;\n }\n const keys = new Set([...Object.keys(next), ...Object.keys(this.prevIds)]);\n const hasEqualEntries = [...keys].every((key) =>\n Object.is(\n next[key as keyof ClipboardElementIds],\n this.prevIds?.[key as keyof ClipboardElementIds],\n ),\n );\n if (hasEqualEntries) {\n return this.prevIds;\n }\n this.prevIds = next;\n return this.prevIds;\n }\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import type * as clipboard from \"@wirekyt/dom/machines/clipboard\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { UseClipboardReturn } from \"./use\";\n\nimport { CLIPBOARD_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardRootProvider]\",\n standalone: true,\n exportAs: \"clipboardRootProvider\",\n providers: [{ provide: CLIPBOARD_CONTEXT, useExisting: forwardRef(() => ClipboardRootProvider) }],\n})\nexport class ClipboardRootProvider implements UseClipboardReturn {\n readonly value: InputSignal<UseClipboardReturn> = input.required<UseClipboardReturn>();\n readonly state: Signal<clipboard.Service[\"state\"]> = computed(() => this.value().state());\n readonly api: Signal<clipboard.Api> = computed(() => this.value().api());\n readonly send: clipboard.Service[\"send\"] = (event) => this.value().send(event);\n\n get service(): clipboard.Service {\n return this.value().service;\n }\n\n resolveValue(): UseClipboardReturn {\n return this.value();\n }\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardLabel]\",\n standalone: true,\n exportAs: \"clipboardLabel\",\n})\nexport class ClipboardLabel {\n constructor() {\n const context = injectClipboardContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getLabelProps(),\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardControl]\",\n standalone: true,\n exportAs: \"clipboardControl\",\n})\nexport class ClipboardControl {\n constructor() {\n const context = injectClipboardContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getControlProps(),\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\n\nimport type { UseClipboardReturn } from \"./use\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\nexport interface ClipboardContextTemplate {\n $implicit: UseClipboardReturn[\"api\"];\n api: UseClipboardReturn[\"api\"];\n}\n\n@Directive({\n selector: \"[clipboardContext]\",\n standalone: true,\n exportAs: \"clipboardContext\",\n})\nexport class ClipboardContext {\n static ngTemplateContextGuard(\n _directive: ClipboardContext,\n context: unknown,\n ): context is ClipboardContextTemplate {\n void context;\n return true;\n }\n\n private readonly clipboard = injectClipboardContext();\n private readonly templateRef = inject<TemplateRef<ClipboardContextTemplate>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n constructor() {\n const view = this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: this.clipboard.api,\n api: this.clipboard.api,\n });\n\n effect(() => {\n this.clipboard.api();\n view.detectChanges();\n });\n\n inject(DestroyRef).onDestroy(() => view.destroy());\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"input[clipboardInput]\",\n standalone: true,\n exportAs: \"clipboardInput\",\n})\nexport class ClipboardInput {\n constructor() {\n const context = injectClipboardContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getInputProps(),\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardTrigger]\",\n standalone: true,\n exportAs: \"clipboardTrigger\",\n})\nexport class ClipboardTrigger {\n constructor() {\n const context = injectClipboardContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getTriggerProps(),\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type Signal,\n computed,\n inject,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardIndicator]\",\n standalone: true,\n exportAs: \"clipboardIndicator\",\n})\nexport class ClipboardIndicator {\n readonly copied: Signal<boolean>;\n\n constructor() {\n const context = injectClipboardContext();\n this.copied = computed(() => context.api().copied);\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => {\n const api = context.api();\n return api.getIndicatorProps({ copied: this.copied() });\n },\n });\n }\n}\n","import { Directive, type Signal, computed } from \"@angular/core\";\n\nimport { injectClipboardContext } from \"./use-context\";\n\n@Directive({\n selector: \"[clipboardValueText]\",\n standalone: true,\n exportAs: \"clipboardValueText\",\n})\nexport class ClipboardValueText {\n private readonly context = injectClipboardContext();\n readonly value: Signal<string> = computed(() => this.context.api().value);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,iBAAiB,GAAG,IAAI,cAAc,CACjD,2BAA2B;SAGb,sBAAsB,GAAA;AACpC,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC;AAClC;;ACcM,SAAU,YAAY,CAC1B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/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirekyt/angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Angular adapter for Wirekyt",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -34,6 +34,14 @@
|
|
|
34
34
|
"types": "./types/wirekyt-angular-checkbox.d.ts",
|
|
35
35
|
"default": "./fesm2022/wirekyt-angular-checkbox.mjs"
|
|
36
36
|
},
|
|
37
|
+
"./clipboard": {
|
|
38
|
+
"types": "./types/wirekyt-angular-clipboard.d.ts",
|
|
39
|
+
"default": "./fesm2022/wirekyt-angular-clipboard.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./client-only": {
|
|
42
|
+
"types": "./types/wirekyt-angular-client-only.d.ts",
|
|
43
|
+
"default": "./fesm2022/wirekyt-angular-client-only.mjs"
|
|
44
|
+
},
|
|
37
45
|
"./collapsible": {
|
|
38
46
|
"types": "./types/wirekyt-angular-collapsible.d.ts",
|
|
39
47
|
"default": "./fesm2022/wirekyt-angular-collapsible.mjs"
|
|
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
|
|
|
7
7
|
import { Signal, InputSignal, ModelSignal, InputSignalWithTransform, OutputEmitterRef, InjectionToken } from '@angular/core';
|
|
8
8
|
import { ControlValueAccessor } from '@angular/forms';
|
|
9
9
|
|
|
10
|
-
declare const checkboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "
|
|
10
|
+
declare const checkboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "label" | "control" | "indicator" | "group">;
|
|
11
11
|
|
|
12
12
|
type OptionalId<T extends {
|
|
13
13
|
id: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class ClientOnly {
|
|
5
|
+
readonly fallback: _angular_core.InputSignal<TemplateRef<unknown> | null>;
|
|
6
|
+
readonly clientTemplate: _angular_core.InputSignal<TemplateRef<unknown> | null>;
|
|
7
|
+
protected readonly isClient: _angular_core.WritableSignal<boolean>;
|
|
8
|
+
constructor();
|
|
9
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientOnly, never>;
|
|
10
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientOnly, "client-only", never, { "fallback": { "alias": "fallback"; "required": false; "isSignal": true; }; "clientTemplate": { "alias": "clientTemplate"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ClientOnly };
|
|
14
|
+
//# sourceMappingURL=wirekyt-angular-client-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-client-only.d.ts","sources":["../../src/components/client-only/client-only.ts"],"mappings":";;;AAUA,cAkBa,UAAU;uBACJ,aAAA,CAAA,WAAA,CAAA,WAAA;6BACM,aAAA,CAAA,WAAA,CAAA,WAAA;AACvB,iCAA2B,aAAA,CAAA,cAAA;;oDAHhB,UAAU;sDAAV,UAAU;AAUtB;;;;","names":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as clipboard from '@wirekyt/dom/machines/clipboard';
|
|
2
|
+
import { Props, ElementIds, IntlTranslations, CopyStatusDetails } from '@wirekyt/dom/machines/clipboard';
|
|
3
|
+
export { Api as ClipboardApi, CopyStatusDetails as ClipboardCopyStatusDetails, ElementIds as ClipboardElementIds, IndicatorProps as ClipboardIndicatorProps, IntlTranslations as ClipboardIntlTranslations, Machine as ClipboardMachine, Props as ClipboardMachineProps, Service as ClipboardService, ValueChangeDetails as ClipboardValueChangeDetails, anatomy as clipboardAnatomy } from '@wirekyt/dom/machines/clipboard';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { InjectionToken, InputSignal, ModelSignal, OutputEmitterRef, Signal } from '@angular/core';
|
|
6
|
+
import { UseMachineReturn } from '@wirekyt/angular';
|
|
7
|
+
|
|
8
|
+
type OptionalId<T extends {
|
|
9
|
+
id: string;
|
|
10
|
+
}> = Omit<T, "id"> & {
|
|
11
|
+
id?: string;
|
|
12
|
+
};
|
|
13
|
+
interface UseClipboardProps extends OptionalId<Omit<Props, "getRootNode">> {
|
|
14
|
+
}
|
|
15
|
+
type UseClipboardReturn = UseMachineReturn<clipboard.Service["state"], clipboard.Api, clipboard.Service>;
|
|
16
|
+
interface UseClipboardOptions {
|
|
17
|
+
context: () => UseClipboardProps;
|
|
18
|
+
}
|
|
19
|
+
declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;
|
|
20
|
+
|
|
21
|
+
declare const CLIPBOARD_CONTEXT: InjectionToken<UseClipboardReturn>;
|
|
22
|
+
declare function injectClipboardContext(): UseClipboardReturn;
|
|
23
|
+
|
|
24
|
+
declare class ClipboardRoot implements UseClipboardReturn {
|
|
25
|
+
readonly id: InputSignal<string | undefined>;
|
|
26
|
+
readonly ids: InputSignal<Partial<ElementIds> | undefined>;
|
|
27
|
+
readonly translations: InputSignal<IntlTranslations | undefined>;
|
|
28
|
+
readonly value: ModelSignal<string | undefined>;
|
|
29
|
+
readonly defaultValue: InputSignal<string | undefined>;
|
|
30
|
+
readonly timeout: InputSignal<number | undefined>;
|
|
31
|
+
readonly statusChange: OutputEmitterRef<CopyStatusDetails>;
|
|
32
|
+
private readonly stableIds;
|
|
33
|
+
private prevIds;
|
|
34
|
+
private readonly machine;
|
|
35
|
+
readonly state: Signal<clipboard.Service["state"]>;
|
|
36
|
+
readonly api: Signal<clipboard.Api>;
|
|
37
|
+
readonly service: clipboard.Service;
|
|
38
|
+
readonly send: clipboard.Service["send"];
|
|
39
|
+
private stabilizeIds;
|
|
40
|
+
constructor();
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardRoot, never>;
|
|
42
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardRoot, "[clipboardRoot]", ["clipboardRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ids": { "alias": "ids"; "required": false; "isSignal": true; }; "translations": { "alias": "translations"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "timeout": { "alias": "timeout"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "statusChange": "statusChange"; }, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class ClipboardRootProvider implements UseClipboardReturn {
|
|
46
|
+
readonly value: InputSignal<UseClipboardReturn>;
|
|
47
|
+
readonly state: Signal<clipboard.Service["state"]>;
|
|
48
|
+
readonly api: Signal<clipboard.Api>;
|
|
49
|
+
readonly send: clipboard.Service["send"];
|
|
50
|
+
get service(): clipboard.Service;
|
|
51
|
+
resolveValue(): UseClipboardReturn;
|
|
52
|
+
constructor();
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardRootProvider, never>;
|
|
54
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardRootProvider, "[clipboardRootProvider]", ["clipboardRootProvider"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class ClipboardLabel {
|
|
58
|
+
constructor();
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardLabel, never>;
|
|
60
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardLabel, "[clipboardLabel]", ["clipboardLabel"], {}, {}, never, never, true, never>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare class ClipboardControl {
|
|
64
|
+
constructor();
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardControl, never>;
|
|
66
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardControl, "[clipboardControl]", ["clipboardControl"], {}, {}, never, never, true, never>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ClipboardContextTemplate {
|
|
70
|
+
$implicit: UseClipboardReturn["api"];
|
|
71
|
+
api: UseClipboardReturn["api"];
|
|
72
|
+
}
|
|
73
|
+
declare class ClipboardContext {
|
|
74
|
+
static ngTemplateContextGuard(_directive: ClipboardContext, context: unknown): context is ClipboardContextTemplate;
|
|
75
|
+
private readonly clipboard;
|
|
76
|
+
private readonly templateRef;
|
|
77
|
+
private readonly viewContainer;
|
|
78
|
+
constructor();
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardContext, never>;
|
|
80
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardContext, "[clipboardContext]", ["clipboardContext"], {}, {}, never, never, true, never>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class ClipboardInput {
|
|
84
|
+
constructor();
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardInput, never>;
|
|
86
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardInput, "input[clipboardInput]", ["clipboardInput"], {}, {}, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare class ClipboardTrigger {
|
|
90
|
+
constructor();
|
|
91
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardTrigger, never>;
|
|
92
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardTrigger, "[clipboardTrigger]", ["clipboardTrigger"], {}, {}, never, never, true, never>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class ClipboardIndicator {
|
|
96
|
+
readonly copied: Signal<boolean>;
|
|
97
|
+
constructor();
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardIndicator, never>;
|
|
99
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardIndicator, "[clipboardIndicator]", ["clipboardIndicator"], {}, {}, never, never, true, never>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare class ClipboardValueText {
|
|
103
|
+
private readonly context;
|
|
104
|
+
readonly value: Signal<string>;
|
|
105
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardValueText, never>;
|
|
106
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClipboardValueText, "[clipboardValueText]", ["clipboardValueText"], {}, {}, never, never, true, never>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { CLIPBOARD_CONTEXT, ClipboardContext, ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardRootProvider, ClipboardTrigger, ClipboardValueText, injectClipboardContext, useClipboard };
|
|
110
|
+
export type { ClipboardContextTemplate, UseClipboardOptions, UseClipboardProps, UseClipboardReturn };
|
|
111
|
+
//# sourceMappingURL=wirekyt-angular-clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-clipboard.d.ts","sources":["../../src/components/clipboard/use.ts","../../src/components/clipboard/use-context.ts","../../src/components/clipboard/root.ts","../../src/components/clipboard/root-provider.ts","../../src/components/clipboard/label.ts","../../src/components/clipboard/control.ts","../../src/components/clipboard/context.ts","../../src/components/clipboard/input.ts","../../src/components/clipboard/trigger.ts","../../src/components/clipboard/indicator.ts","../../src/components/clipboard/value-text.ts"],"mappings":";;;;;;;AAOA,KAAK,UAAU;;AAAyB,KAAI,IAAI;;;AAE1C,UAAW,iBAAkB,SAAQ,UAAU,CAAC,IAAI,CAACA,KAAqB;AAAoB;AAE9F,KAAM,kBAAkB,GAAG,gBAAgB,CAC/C,SAAS,CAAC,OAAO,WACjB,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,OAAO;UAGF,mBAAmB;mBACnB,iBAAiB;AACjC;AAKD,iBAAgB,YAAY,WACjB,mBAA6C,GACrD,kBAAkB;;ACtBrB,cAAa,iBAAiB,EAAA,cAAA,CAAA,kBAAA;AAI9B,iBAAgB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B;AAC7B;AACA,oBAAgB,MAAM;yCAFX,kBAAkB;2CAAlB,kBAAkB;AAG9B;;;;","names":["ClipboardMachineProps","ClipboardElementIds","ClipboardIntlTranslations","ClipboardCopyStatusDetails"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirekyt/angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Angular adapter for Wirekyt",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -34,6 +34,14 @@
|
|
|
34
34
|
"types": "./dist/types/wirekyt-angular-checkbox.d.ts",
|
|
35
35
|
"default": "./dist/fesm2022/wirekyt-angular-checkbox.mjs"
|
|
36
36
|
},
|
|
37
|
+
"./clipboard": {
|
|
38
|
+
"types": "./dist/types/wirekyt-angular-clipboard.d.ts",
|
|
39
|
+
"default": "./dist/fesm2022/wirekyt-angular-clipboard.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./client-only": {
|
|
42
|
+
"types": "./dist/types/wirekyt-angular-client-only.d.ts",
|
|
43
|
+
"default": "./dist/fesm2022/wirekyt-angular-client-only.mjs"
|
|
44
|
+
},
|
|
37
45
|
"./collapsible": {
|
|
38
46
|
"types": "./dist/types/wirekyt-angular-collapsible.d.ts",
|
|
39
47
|
"default": "./dist/fesm2022/wirekyt-angular-collapsible.mjs"
|
|
@@ -56,7 +64,7 @@
|
|
|
56
64
|
"@internationalized/date": "^3.12.3",
|
|
57
65
|
"@internationalized/number": "^3.6.7",
|
|
58
66
|
"tslib": "^2.8.1",
|
|
59
|
-
"@wirekyt/dom": "0.0.
|
|
67
|
+
"@wirekyt/dom": "0.0.8"
|
|
60
68
|
},
|
|
61
69
|
"peerDependencies": {
|
|
62
70
|
"@angular/common": ">=22.0.0",
|