@tickean/checkout-elements 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +770 -0
- package/dist/index.mjs +733 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @tickean/checkout-elements
|
|
2
|
+
|
|
3
|
+
Tickean Checkout web components with Shadow DOM, appearance themes, and i18n.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<script type="module">
|
|
7
|
+
import '@tickean/checkout-elements';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<tickean-checkout
|
|
11
|
+
publishable-key="pk_test_demo"
|
|
12
|
+
event-slug="demo-festival"
|
|
13
|
+
demo
|
|
14
|
+
locale="es-AR"
|
|
15
|
+
appearance="default"
|
|
16
|
+
></tickean-checkout>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Elements
|
|
20
|
+
|
|
21
|
+
- `tickean-checkout` — full flow
|
|
22
|
+
- `tickean-ticket-selector`
|
|
23
|
+
- `tickean-discount`
|
|
24
|
+
- `tickean-buyer-verification`
|
|
25
|
+
- `tickean-payment` — handles `nextAction` (transfer instructions, redirect, provider placeholders)
|
|
26
|
+
- `tickean-order-summary`
|
|
27
|
+
|
|
28
|
+
## Appearance
|
|
29
|
+
|
|
30
|
+
Themes: `default` | `flat` | `night` | `none`. CSS variables: `--tickean-*`.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CheckoutController, CheckoutState } from '@tickean/checkout-js';
|
|
2
|
+
|
|
3
|
+
type Locale = "es-AR" | "es-CL" | "en";
|
|
4
|
+
|
|
5
|
+
declare function registerController(controller: CheckoutController, id?: string): string;
|
|
6
|
+
declare function unregisterController(id: string): void;
|
|
7
|
+
declare function getController(id: string | null | undefined): CheckoutController | null;
|
|
8
|
+
|
|
9
|
+
declare const NativeHTMLElement: {
|
|
10
|
+
new (): HTMLElement;
|
|
11
|
+
prototype: HTMLElement;
|
|
12
|
+
};
|
|
13
|
+
declare abstract class TickeanElementBase extends NativeHTMLElement {
|
|
14
|
+
protected root: ShadowRoot;
|
|
15
|
+
protected unsubscribe: (() => void) | null;
|
|
16
|
+
protected state: CheckoutState | null;
|
|
17
|
+
private lastPhase;
|
|
18
|
+
private lastErrorCode;
|
|
19
|
+
constructor();
|
|
20
|
+
static get observedAttributes(): string[];
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
attributeChangedCallback(_name?: string, _oldValue?: string | null, _newValue?: string | null): void;
|
|
24
|
+
protected get elementLocale(): Locale;
|
|
25
|
+
protected get controller(): CheckoutController | null;
|
|
26
|
+
protected applyTheme(): void;
|
|
27
|
+
protected bindController(): void;
|
|
28
|
+
protected styles(): string;
|
|
29
|
+
protected abstract renderBody(): string;
|
|
30
|
+
protected render(): void;
|
|
31
|
+
protected afterRender(): void;
|
|
32
|
+
protected money(amount: number): string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class TickeanTicketSelector extends TickeanElementBase {
|
|
36
|
+
protected renderBody(): string;
|
|
37
|
+
protected afterRender(): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare class TickeanDiscount extends TickeanElementBase {
|
|
41
|
+
protected renderBody(): string;
|
|
42
|
+
protected afterRender(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class TickeanBuyerVerification extends TickeanElementBase {
|
|
46
|
+
private phone;
|
|
47
|
+
private name;
|
|
48
|
+
private email;
|
|
49
|
+
private code;
|
|
50
|
+
protected renderBody(): string;
|
|
51
|
+
protected afterRender(): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class TickeanPayment extends TickeanElementBase {
|
|
55
|
+
static get observedAttributes(): string[];
|
|
56
|
+
protected renderBody(): string;
|
|
57
|
+
protected afterRender(): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare class TickeanOrderSummary extends TickeanElementBase {
|
|
61
|
+
protected renderBody(): string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class TickeanCheckout extends TickeanElementBase {
|
|
65
|
+
private ownedControllerId;
|
|
66
|
+
private ownedController;
|
|
67
|
+
static get observedAttributes(): string[];
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
70
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
71
|
+
private ensureController;
|
|
72
|
+
protected renderBody(): string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type AppearanceTheme = "default" | "flat" | "night" | "none";
|
|
76
|
+
type Appearance = {
|
|
77
|
+
theme?: AppearanceTheme;
|
|
78
|
+
variables?: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
declare function applyAppearance(host: HTMLElement, appearance?: Appearance | string): void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Explicit registration helper. Elements also auto-register on module import.
|
|
84
|
+
*/
|
|
85
|
+
declare function defineTickeanElements(): void;
|
|
86
|
+
declare function attachController(el: HTMLElement, controller: CheckoutController, id?: string): string;
|
|
87
|
+
declare function detachController(id: string): void;
|
|
88
|
+
|
|
89
|
+
export { type Appearance, type AppearanceTheme, TickeanBuyerVerification, TickeanCheckout, TickeanDiscount, TickeanOrderSummary, TickeanPayment, TickeanTicketSelector, applyAppearance, attachController, defineTickeanElements, detachController, getController, registerController, unregisterController };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CheckoutController, CheckoutState } from '@tickean/checkout-js';
|
|
2
|
+
|
|
3
|
+
type Locale = "es-AR" | "es-CL" | "en";
|
|
4
|
+
|
|
5
|
+
declare function registerController(controller: CheckoutController, id?: string): string;
|
|
6
|
+
declare function unregisterController(id: string): void;
|
|
7
|
+
declare function getController(id: string | null | undefined): CheckoutController | null;
|
|
8
|
+
|
|
9
|
+
declare const NativeHTMLElement: {
|
|
10
|
+
new (): HTMLElement;
|
|
11
|
+
prototype: HTMLElement;
|
|
12
|
+
};
|
|
13
|
+
declare abstract class TickeanElementBase extends NativeHTMLElement {
|
|
14
|
+
protected root: ShadowRoot;
|
|
15
|
+
protected unsubscribe: (() => void) | null;
|
|
16
|
+
protected state: CheckoutState | null;
|
|
17
|
+
private lastPhase;
|
|
18
|
+
private lastErrorCode;
|
|
19
|
+
constructor();
|
|
20
|
+
static get observedAttributes(): string[];
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
attributeChangedCallback(_name?: string, _oldValue?: string | null, _newValue?: string | null): void;
|
|
24
|
+
protected get elementLocale(): Locale;
|
|
25
|
+
protected get controller(): CheckoutController | null;
|
|
26
|
+
protected applyTheme(): void;
|
|
27
|
+
protected bindController(): void;
|
|
28
|
+
protected styles(): string;
|
|
29
|
+
protected abstract renderBody(): string;
|
|
30
|
+
protected render(): void;
|
|
31
|
+
protected afterRender(): void;
|
|
32
|
+
protected money(amount: number): string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class TickeanTicketSelector extends TickeanElementBase {
|
|
36
|
+
protected renderBody(): string;
|
|
37
|
+
protected afterRender(): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare class TickeanDiscount extends TickeanElementBase {
|
|
41
|
+
protected renderBody(): string;
|
|
42
|
+
protected afterRender(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class TickeanBuyerVerification extends TickeanElementBase {
|
|
46
|
+
private phone;
|
|
47
|
+
private name;
|
|
48
|
+
private email;
|
|
49
|
+
private code;
|
|
50
|
+
protected renderBody(): string;
|
|
51
|
+
protected afterRender(): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class TickeanPayment extends TickeanElementBase {
|
|
55
|
+
static get observedAttributes(): string[];
|
|
56
|
+
protected renderBody(): string;
|
|
57
|
+
protected afterRender(): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare class TickeanOrderSummary extends TickeanElementBase {
|
|
61
|
+
protected renderBody(): string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class TickeanCheckout extends TickeanElementBase {
|
|
65
|
+
private ownedControllerId;
|
|
66
|
+
private ownedController;
|
|
67
|
+
static get observedAttributes(): string[];
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
70
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
71
|
+
private ensureController;
|
|
72
|
+
protected renderBody(): string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type AppearanceTheme = "default" | "flat" | "night" | "none";
|
|
76
|
+
type Appearance = {
|
|
77
|
+
theme?: AppearanceTheme;
|
|
78
|
+
variables?: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
declare function applyAppearance(host: HTMLElement, appearance?: Appearance | string): void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Explicit registration helper. Elements also auto-register on module import.
|
|
84
|
+
*/
|
|
85
|
+
declare function defineTickeanElements(): void;
|
|
86
|
+
declare function attachController(el: HTMLElement, controller: CheckoutController, id?: string): string;
|
|
87
|
+
declare function detachController(id: string): void;
|
|
88
|
+
|
|
89
|
+
export { type Appearance, type AppearanceTheme, TickeanBuyerVerification, TickeanCheckout, TickeanDiscount, TickeanOrderSummary, TickeanPayment, TickeanTicketSelector, applyAppearance, attachController, defineTickeanElements, detachController, getController, registerController, unregisterController };
|