2.0.5 • Published 1 month ago

@ti-platform/aide-vue v2.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

@ti-platform/aide-vue

This package contains utility functions that can be used with Vue to enhance the development of Vue components.

Contents

API Docs

Type Aliases

ReactiveExecuteTasksRet\

ReactiveExecuteTasksRet<T>: Object

The return value for the function reactiveExecuteTasks.

Type parameters

Type parameterDescription
TThe type of the result.

Type declaration

MemberTypeDescription
activeWorkersReadonly<Ref<number>>The current active number of workers.
completedTasksReadonly<Ref<number>>The current number of completed tasks.
isAllTasksCompletedReadonly<Ref<boolean>>True if all the tasks have completed running, false otherwise.
resultsReadonly<Ref<T[]>>The array storing the results as it is returned. Note that this can be a sparsed array with missing indexes as itis filled with the results only when it is available. You should check for undefined before using it.
totalTasksReadonly<Ref<number>>The total number of tasks that was queued.

Source

queue.ts:10


ValueTypes

ValueTypes: string | number | string[] | number[]

Source

validators.ts:3

Functions

asComputed()

asComputed<T>(ref): ComputedRef<T>

Shorthand method to simply convert a Ref to a ComputedRef.

Type parameters

Type parameter
T

Parameters

ParameterTypeDescription
refRef<T>The Ref to convert.

Returns

ComputedRef<T>

The ComputedRef that simply returns the value of the given Ref.

Source

reactivity.ts:10


isRequiredField()

isRequiredField(invalidMessage): (value) => string | true

Given a field, make sure it is not empty. If it is, return a proper error message. This validator is meant to be used with QForm.

Parameters

ParameterTypeDefault valueDescription
invalidMessagestringDEFAULT_REQUIRED_INVALID_MESSAGEThe message to show when validation failed.

Returns

Function

Parameters
ParameterType
valueValueTypes
Returns

string | true

Source

validators.ts:14


isRequiredFieldWhen()

isRequiredFieldWhen(when, invalidMessage): (value) => string | true

Returns a function that before checking to see if a required field is filled out, validate against some other condition.

Parameters

ParameterTypeDefault valueDescription
when() => booleanundefinedFunction to execute to see if the required validation field is necessary. It should return true when the field is required, false otherwise.
invalidMessagestringDEFAULT_REQUIRED_INVALID_MESSAGEThe message to show when validation failed.

Returns

Function

Parameters
ParameterType
valueValueTypes
Returns

string | true

Source

validators.ts:26


isUniqueField()

isUniqueField(existingValues, invalidMessage): (value) => string | true

Given a reference to a list of values, check when a value is given that it isn't in the list twice.

Parameters

ParameterTypeDefault valueDescription
existingValuesRef<(stringnumber)[]>undefinedA reference to the list of existing values. The list should update when new values are added.
invalidMessagestringDEFAULT_UNIQUE_INVALID_MESSAGEThe message to show when validation failed.

Returns

Function

Parameters
ParameterType
valuestringnumber
Returns

string | true

Source

validators.ts:38


reactiveExecuteTasks()

reactiveExecuteTasks<T>(tasks, maxNumOfWorkers): ReactiveExecuteTasksRet<T>

Reactive version of @ti-platform/aidee#xecuteTasks.

Type parameters

Type parameterDescription
TThe type of the result of each task.

Parameters

ParameterTypeDefault valueDescription
tasksreadonly () => Promise<T>[]undefinedThe tasks to run.
maxNumOfWorkersnumber10The maximum number of tasks ot run at once.

Returns

ReactiveExecuteTasksRet<T>

Source

queue.ts:45

2.0.5

1 month ago

2.0.4

1 month ago

2.0.3

1 month ago

1.3.1

10 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

1.3.0

11 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago