@tstdl/base 0.91.24 → 0.91.26
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/form/form-button.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import type { PartialProperty, ReactiveValue, TypedOmit } from '../types.js';
|
|
|
2
2
|
import type { FormDialog } from './form-dialog.js';
|
|
3
3
|
import { FormHeaderFooterElement, type FormHeaderFooterElementOptions } from './form-header-footer-element.js';
|
|
4
4
|
import type { DynamicTextOption } from './types.js';
|
|
5
|
+
export type FormButtonSize = 'normal' | 'small';
|
|
6
|
+
export type FormButtonColor = 'transparent' | 'white' | 'accent' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose';
|
|
5
7
|
export type FormButtonType = 'button' | 'submit' | 'reset';
|
|
6
|
-
export type
|
|
7
|
-
export type FormButtonColor = 'primary' | 'basic' | 'secondary' | 'warn';
|
|
8
|
+
export type FormButtonDesign = 'flat' | 'outline' | 'icon' | 'icon-outline' | 'none';
|
|
8
9
|
export type IconLocation = 'before' | 'after';
|
|
9
10
|
export type IconSize = 'small' | 'normal';
|
|
10
11
|
export type FormButtonHandler = () => any;
|
|
@@ -13,7 +14,7 @@ export type FormButtonOptions = FormHeaderFooterElementOptions & {
|
|
|
13
14
|
label?: ReactiveValue<DynamicTextOption>;
|
|
14
15
|
type?: ReactiveValue<FormButtonType | null>;
|
|
15
16
|
disabled?: ReactiveValue<boolean | null>;
|
|
16
|
-
|
|
17
|
+
design?: ReactiveValue<FormButtonDesign | null>;
|
|
17
18
|
color?: ReactiveValue<FormButtonColor | null>;
|
|
18
19
|
icon?: ReactiveValue<string | null>;
|
|
19
20
|
iconLocation?: ReactiveValue<IconLocation | null>;
|
|
@@ -25,7 +26,7 @@ export declare class FormButton extends FormHeaderFooterElement {
|
|
|
25
26
|
readonly label: import("../signals/api.js").Signal<DynamicTextOption>;
|
|
26
27
|
readonly type: import("../signals/api.js").Signal<FormButtonType>;
|
|
27
28
|
readonly disabled: import("../signals/api.js").Signal<boolean>;
|
|
28
|
-
readonly style: import("../signals/api.js").Signal<
|
|
29
|
+
readonly style: import("../signals/api.js").Signal<FormButtonDesign>;
|
|
29
30
|
readonly color: import("../signals/api.js").Signal<FormButtonColor>;
|
|
30
31
|
readonly icon: import("../signals/api.js").Signal<string | null>;
|
|
31
32
|
readonly iconLocation: import("../signals/api.js").Signal<IconLocation>;
|
package/form/form-button.js
CHANGED
|
@@ -5,8 +5,8 @@ export class FormButton extends FormHeaderFooterElement {
|
|
|
5
5
|
#label = signal(null);
|
|
6
6
|
#type = signal('button');
|
|
7
7
|
#disabled = signal(false);
|
|
8
|
-
#
|
|
9
|
-
#color = signal('
|
|
8
|
+
#design = signal('flat');
|
|
9
|
+
#color = signal('accent');
|
|
10
10
|
#icon = signal(null);
|
|
11
11
|
#iconLocation = signal('before');
|
|
12
12
|
#iconSize = signal('normal');
|
|
@@ -14,7 +14,7 @@ export class FormButton extends FormHeaderFooterElement {
|
|
|
14
14
|
label = this.#label.asReadonly();
|
|
15
15
|
type = this.#type.asReadonly();
|
|
16
16
|
disabled = this.#disabled.asReadonly();
|
|
17
|
-
style = this.#
|
|
17
|
+
style = this.#design.asReadonly();
|
|
18
18
|
color = this.#color.asReadonly();
|
|
19
19
|
icon = this.#icon.asReadonly();
|
|
20
20
|
iconLocation = this.#iconLocation.asReadonly();
|
|
@@ -25,8 +25,8 @@ export class FormButton extends FormHeaderFooterElement {
|
|
|
25
25
|
bindReactiveOption(options.label, this.#label, { defaultValue: null });
|
|
26
26
|
bindReactiveOption(options.type, this.#type, { defaultValue: 'button' });
|
|
27
27
|
bindReactiveOption(options.disabled, this.#disabled, { defaultValue: false });
|
|
28
|
-
bindReactiveOption(options.
|
|
29
|
-
bindReactiveOption(options.color, this.#color, { defaultValue: '
|
|
28
|
+
bindReactiveOption(options.design, this.#design, { defaultValue: 'flat' });
|
|
29
|
+
bindReactiveOption(options.color, this.#color, { defaultValue: 'accent' });
|
|
30
30
|
bindReactiveOption(options.icon, this.#icon, { defaultValue: null });
|
|
31
31
|
bindReactiveOption(options.iconLocation, this.#iconLocation, { defaultValue: 'before' });
|
|
32
32
|
bindReactiveOption(options.iconSize, this.#iconSize, { defaultValue: 'normal' });
|
|
@@ -41,7 +41,7 @@ export function dialogFormButton(options) {
|
|
|
41
41
|
handler: () => options.dialog.openDialog(),
|
|
42
42
|
...options,
|
|
43
43
|
icon: computed(() => (showError() ? 'warning' : null)),
|
|
44
|
-
color: computed(() => (showError() ? '
|
|
44
|
+
color: computed(() => (showError() ? 'red' : null))
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
export function isFormButton(value) {
|
package/orm/repository.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ export type EntityMetadataUpdate = {
|
|
|
19
19
|
export type EntityUpdate<T extends Entity> = Partial<TypedOmit<T, 'metadata'>> & EntityMetadataUpdate;
|
|
20
20
|
export declare abstract class EntityRepository<T extends Entity = Entity> {
|
|
21
21
|
readonly type: Type<T>;
|
|
22
|
-
readonly database: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never
|
|
22
|
+
readonly database: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never>> & {
|
|
23
|
+
$client: null;
|
|
24
|
+
};
|
|
23
25
|
load(_id: string): Promise<T>;
|
|
24
26
|
abstract tryLoad(id: string): Promise<T | undefined>;
|
|
25
27
|
abstract loadByFilter(query: Query<T>, options?: LoadOptions<T>): Promise<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.91.
|
|
3
|
+
"version": "0.91.26",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@mxssfd/typedoc-theme": "1.1",
|
|
120
|
-
"@stylistic/eslint-plugin": "2.
|
|
120
|
+
"@stylistic/eslint-plugin": "2.9",
|
|
121
121
|
"@types/chroma-js": "2.4",
|
|
122
122
|
"@types/koa__router": "12.0",
|
|
123
123
|
"@types/luxon": "3.4",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"concurrently": "9.0",
|
|
130
130
|
"eslint": "8.57",
|
|
131
131
|
"eslint-import-resolver-typescript": "3.6",
|
|
132
|
-
"eslint-plugin-import": "2.
|
|
132
|
+
"eslint-plugin-import": "2.31",
|
|
133
133
|
"tsc-alias": "1.8",
|
|
134
134
|
"typedoc": "0.26",
|
|
135
135
|
"typedoc-plugin-missing-exports": "3.0",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"@zxcvbn-ts/language-de": "^3.0",
|
|
145
145
|
"@zxcvbn-ts/language-en": "^3.0",
|
|
146
146
|
"chroma-js": "^2.6",
|
|
147
|
-
"drizzle-orm": "^0.
|
|
147
|
+
"drizzle-orm": "^0.34",
|
|
148
148
|
"handlebars": "^4.7",
|
|
149
149
|
"koa": "^2.15",
|
|
150
150
|
"minio": "^8.0",
|
|
@@ -152,10 +152,10 @@
|
|
|
152
152
|
"mongodb": "^6.9",
|
|
153
153
|
"nodemailer": "^6.9",
|
|
154
154
|
"pg": "^8.13",
|
|
155
|
-
"playwright": "^1.
|
|
155
|
+
"playwright": "^1.48",
|
|
156
156
|
"preact": "^10.24",
|
|
157
157
|
"preact-render-to-string": "^6.5",
|
|
158
|
-
"undici": "^6.
|
|
158
|
+
"undici": "^6.20",
|
|
159
159
|
"urlpattern-polyfill": "^10.0"
|
|
160
160
|
},
|
|
161
161
|
"peerDependenciesMeta": {
|
package/utils/type-guards.d.ts
CHANGED
|
@@ -35,12 +35,12 @@ export declare const assertNull: AssertFunction<null>;
|
|
|
35
35
|
export declare const assertNotNull: AssertNotFunction<null>;
|
|
36
36
|
export declare const assertNullPass: AssertPassFunction<null>;
|
|
37
37
|
export declare const assertNotNullPass: AssertNotPassFunction<null>;
|
|
38
|
-
export declare const isNullOrUndefined:
|
|
39
|
-
export declare const isNotNullOrUndefined: IsNotFunction<null | undefined>;
|
|
40
|
-
export declare const assertNullOrUndefined:
|
|
41
|
-
export declare const assertNotNullOrUndefined: AssertNotFunction<null | undefined>;
|
|
42
|
-
export declare const assertNullOrUndefinedPass:
|
|
43
|
-
export declare const assertNotNullOrUndefinedPass: AssertNotPassFunction<null | undefined>;
|
|
38
|
+
export declare const isNullOrUndefined: (value: any) => value is null | undefined;
|
|
39
|
+
export declare const isNotNullOrUndefined: IsNotFunction<null | undefined | void>;
|
|
40
|
+
export declare const assertNullOrUndefined: (value: any, message?: AssertionMessage) => asserts value is null | undefined;
|
|
41
|
+
export declare const assertNotNullOrUndefined: AssertNotFunction<null | undefined | void>;
|
|
42
|
+
export declare const assertNullOrUndefinedPass: (value: any, message?: AssertionMessage) => null | undefined;
|
|
43
|
+
export declare const assertNotNullOrUndefinedPass: AssertNotPassFunction<null | undefined | void>;
|
|
44
44
|
export declare const isNumber: IsFunction<number>;
|
|
45
45
|
export declare const isNotNumber: IsNotFunction<number>;
|
|
46
46
|
export declare const assertNumber: AssertFunction<number>;
|
package/utils/type-guards.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */
|
|
2
5
|
import { supportsBlob, supportsReadableStream } from '../supports.js';
|
|
3
6
|
import { AssertionError } from '../errors/assertion.error.js';
|
|
4
7
|
export function assert(condition, message = 'assertion failed') {
|
|
@@ -104,14 +107,14 @@ export const assertSymbol = symbolGuards.assertSymbol;
|
|
|
104
107
|
export const assertNotSymbol = symbolGuards.assertNotSymbol;
|
|
105
108
|
export const assertSymbolPass = symbolGuards.assertSymbolPass;
|
|
106
109
|
export const assertNotSymbolPass = symbolGuards.assertNotSymbolPass;
|
|
107
|
-
const literalObjectGuards = createGuards('literal object', (value) => (typeof value == 'object') && (value
|
|
110
|
+
const literalObjectGuards = createGuards('literal object', (value) => (typeof value == 'object') && (value !== null) && (Reflect.getPrototypeOf(value) == Object.prototype) && (Reflect.getPrototypeOf(value).constructor == Object));
|
|
108
111
|
export const isLiteralObject = literalObjectGuards.isLiteralObject;
|
|
109
112
|
export const isNotLiteralObject = literalObjectGuards.isNotLiteralObject;
|
|
110
113
|
export const assertLiteralObject = literalObjectGuards.assertLiteralObject;
|
|
111
114
|
export const assertNotLiteralObject = literalObjectGuards.assertNotLiteralObject;
|
|
112
115
|
export const assertLiteralObjectPass = literalObjectGuards.assertLiteralObjectPass;
|
|
113
116
|
export const assertNotLiteralObjectPass = literalObjectGuards.assertNotLiteralObjectPass;
|
|
114
|
-
const objectGuards = createGuards('object', (value) => (typeof value == 'object') && (value
|
|
117
|
+
const objectGuards = createGuards('object', (value) => (typeof value == 'object') && (value !== null));
|
|
115
118
|
export const isObject = objectGuards.isObject;
|
|
116
119
|
export const isNotObject = objectGuards.isNotObject;
|
|
117
120
|
export const assertObject = objectGuards.assertObject;
|
|
@@ -313,7 +316,7 @@ export const assertPromise = promiseGuards.assertPromise;
|
|
|
313
316
|
export const assertNotPromise = promiseGuards.assertNotPromise;
|
|
314
317
|
export const assertPromisePass = promiseGuards.assertPromisePass;
|
|
315
318
|
export const assertNotPromisePass = promiseGuards.assertNotPromisePass;
|
|
316
|
-
const promiseLikeGuards = createGuards('PromiseLike', (value) => isPromise(value) || ((((typeof value == 'object') && (value
|
|
319
|
+
const promiseLikeGuards = createGuards('PromiseLike', (value) => isPromise(value) || ((((typeof value == 'object') && (value !== null)) || isFunction(value)) && ((typeof value.then) == 'function')));
|
|
317
320
|
export const isPromiseLike = promiseLikeGuards.isPromiseLike;
|
|
318
321
|
export const isNotPromiseLike = promiseLikeGuards.isNotPromiseLike;
|
|
319
322
|
export const assertPromiseLike = promiseLikeGuards.assertPromiseLike;
|