@trustme24/flext 1.8.0 → 1.9.1
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 +3 -1
- package/dist/errors.d.ts +8 -2
- package/dist/index.cjs +279 -311
- package/dist/index.css +1 -1
- package/dist/index.d.ts +35 -62
- package/dist/index.js +28 -21
- package/dist/lib.d.ts +20 -7
- package/dist/modules/date/index.d.ts +1 -0
- package/dist/modules/match/index.d.ts +3 -3
- package/dist/types.d.ts +64 -8
- package/package.json +9 -9
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-500:oklch(62.3% .214 259.815);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.text-blue-500{color:var(--color-blue-500)}}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,58 +1,28 @@
|
|
|
1
1
|
import { AST } from '@handlebars/parser';
|
|
2
|
-
import { Obj, DataModelNode,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fieldName: string;
|
|
9
|
-
label?: string | null;
|
|
10
|
-
descr?: string | null;
|
|
11
|
-
value?: FieldValue | null;
|
|
12
|
-
isDisabled: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type Field = {
|
|
15
|
-
type: FieldType;
|
|
16
|
-
name: string;
|
|
17
|
-
label?: string | null;
|
|
18
|
-
descr?: string | null;
|
|
19
|
-
hint?: string | null;
|
|
20
|
-
order?: number | null;
|
|
21
|
-
options?: FieldValueOption[] | null;
|
|
22
|
-
value?: FieldValue;
|
|
23
|
-
isRequired: boolean;
|
|
24
|
-
extra?: {
|
|
25
|
-
macroName?: string | null;
|
|
26
|
-
absoluteOrder?: number | null;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type MetadataModelNode = DataModelNode & {
|
|
30
|
-
type: FieldType;
|
|
31
|
-
label?: string | null;
|
|
32
|
-
descr?: string | null;
|
|
33
|
-
hint?: string | null;
|
|
34
|
-
order?: number | null;
|
|
35
|
-
options?: FieldValueOption[] | null;
|
|
36
|
-
value?: string | null;
|
|
37
|
-
isRequired: boolean;
|
|
38
|
-
extra?: {
|
|
39
|
-
fieldName?: string | null;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
2
|
+
import { Obj, Macro, Field, FieldType, FieldValue, FieldValueOption, DataModel, DataModelNode, MetadataModelNode, CollectorFilterHandler, GetTemplateAstHandler, GetTemplateTitleHandler, GetTemplateMacroHandler } from './types';
|
|
3
|
+
import { BaseThrowable, BaseWarning, BaseError, PotentialLoopError, TemplateError, TemplateSyntaxError, TemplateDataValidationError } from './errors';
|
|
4
|
+
import * as types from './types';
|
|
5
|
+
import * as lib from './lib';
|
|
6
|
+
import * as errors from './errors';
|
|
7
|
+
import * as modules from './modules';
|
|
42
8
|
export declare const DEFAULT_HELPER_NAME = "__default";
|
|
43
|
-
export declare const DEFAULT_FIELD_TYPE: FieldType;
|
|
9
|
+
export declare const DEFAULT_FIELD_TYPE: types.FieldType;
|
|
44
10
|
export declare const DEFAULT_MODEL_DEPTH = 10;
|
|
45
11
|
export declare class SimpleFlext {
|
|
46
12
|
ast: AST.Program;
|
|
47
|
-
data: Obj;
|
|
48
|
-
helpers: Obj;
|
|
49
|
-
|
|
13
|
+
data: types.Obj;
|
|
14
|
+
helpers: types.Obj;
|
|
15
|
+
onGetProcessed: types.GetProcessedTemplateHandler;
|
|
16
|
+
onGetAst: types.GetTemplateAstHandler;
|
|
17
|
+
constructor(val?: string | null, data?: types.Obj, helpers?: types.Obj);
|
|
50
18
|
setTemplate(val: string): this;
|
|
51
|
-
setData(val: Obj): this;
|
|
52
|
-
setHelpers(val: Obj): this;
|
|
19
|
+
setData(val: types.Obj): this;
|
|
20
|
+
setHelpers(val: types.Obj): this;
|
|
53
21
|
addHelper(name: string, val: any): this;
|
|
54
|
-
|
|
55
|
-
|
|
22
|
+
setOnGetProcessed(val: types.GetProcessedTemplateHandler): this;
|
|
23
|
+
setOnGetAst(val: types.GetTemplateAstHandler): this;
|
|
24
|
+
getHtml(data?: types.Obj | null, helpers?: types.Obj | null): string;
|
|
25
|
+
getCss(data?: types.Obj | null, options?: types.Obj): Promise<string>;
|
|
56
26
|
get html(): string;
|
|
57
27
|
}
|
|
58
28
|
export declare class Flext extends SimpleFlext {
|
|
@@ -61,8 +31,11 @@ export declare class Flext extends SimpleFlext {
|
|
|
61
31
|
title: string;
|
|
62
32
|
timeZone: string;
|
|
63
33
|
lineHeight: number;
|
|
64
|
-
assets: Obj<Blob>;
|
|
65
|
-
fields: Field[];
|
|
34
|
+
assets: types.Obj<Blob>;
|
|
35
|
+
fields: types.Field[];
|
|
36
|
+
onGetTitle: types.GetTemplateTitleHandler;
|
|
37
|
+
onGetMacro: types.GetTemplateMacroHandler;
|
|
38
|
+
constructor(val?: string | null, data?: types.Obj, helpers?: types.Obj);
|
|
66
39
|
useModule(...val: string[]): this;
|
|
67
40
|
setTemplate(val: string): this;
|
|
68
41
|
setVersion(val: string): this;
|
|
@@ -70,20 +43,20 @@ export declare class Flext extends SimpleFlext {
|
|
|
70
43
|
setTitle(val: string): this;
|
|
71
44
|
setTimeZone(val: string): this;
|
|
72
45
|
setLineHeight(val: number): this;
|
|
73
|
-
setAssets(val: Obj<Blob>): this;
|
|
46
|
+
setAssets(val: types.Obj<Blob>): this;
|
|
74
47
|
addAsset(name: string, val: Blob): this;
|
|
75
|
-
setFields(val: Field[]): this;
|
|
48
|
+
setFields(val: types.Field[]): this;
|
|
76
49
|
addModule(name: string, val: any): this;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
50
|
+
setOnGetTitle(val: types.GetTemplateTitleHandler): this;
|
|
51
|
+
setOnGetMacro(val: types.GetTemplateMacroHandler): this;
|
|
52
|
+
getDataModel(depth?: number): types.MetadataModelNode[];
|
|
53
|
+
getValidationErrors(data?: types.Obj | null, depth?: number): errors.TemplateDataValidationError[];
|
|
54
|
+
getIsValid(data?: types.Obj | null, depth?: number): boolean;
|
|
55
|
+
get model(): types.MetadataModelNode[];
|
|
56
|
+
get validationErrors(): errors.TemplateDataValidationError[];
|
|
57
|
+
get errors(): errors.BaseError[];
|
|
80
58
|
get isValid(): boolean;
|
|
81
59
|
}
|
|
82
|
-
export declare function
|
|
83
|
-
export declare function ensureFieldValue(val: any): FieldValue;
|
|
84
|
-
export declare function macroToModuleNames(val: Macro): string[];
|
|
85
|
-
export declare function macroToField(val: Macro): Field;
|
|
86
|
-
export declare function macroToFieldValueOption(val: Macro): FieldValueOption;
|
|
87
|
-
export declare function applyValueOptionsToFields(options: FieldValueOption[], fields: Field[]): void;
|
|
88
|
-
export declare function applyAbsoluteOrderToFields(fields: Field[]): void;
|
|
60
|
+
export declare function defaultGetProcessed(val: string): string;
|
|
89
61
|
export default Flext;
|
|
62
|
+
export { Obj, Macro, Field, FieldType, FieldValue, FieldValueOption, DataModel, DataModelNode, MetadataModelNode, CollectorFilterHandler, GetTemplateAstHandler, GetTemplateTitleHandler, GetTemplateMacroHandler, BaseThrowable, BaseWarning, BaseError, PotentialLoopError, TemplateError, TemplateSyntaxError, TemplateDataValidationError, types, lib, errors, modules, };
|