Skip to content

Commit

Permalink
fix(ui-web): deprecate ui-web package in favor of new html-tag pa…
Browse files Browse the repository at this point in the history
…ckage
  • Loading branch information
gund committed Jan 12, 2022
1 parent 8843f90 commit 0b171f7
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 7 deletions.
5 changes: 5 additions & 0 deletions libs/ui-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
![@orchestrator/ui-web](https://img.shields.io/npm/v/@orchestrator/ui-web)

**DEPRECATED!**

> Please use [`@orchestrator/html-tag`](/libs/html-tag) package instead
> which has more streamlined API and allows to render any HTML tags available in the Web.
## Registration

```ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Injectable } from '@angular/core';
import { Option, OptionInteger, OptionRequired } from '@orchestrator/core';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebButtonConfig {
@OptionRequired()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebButtonConfig } from './ui-web-button-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-button-host',
templateUrl: './ui-web-button-host.component.html',
Expand All @@ -14,6 +18,7 @@ import { UiWebButtonConfig } from './ui-web-button-config';
})
@DynamicComponent({ config: UiWebButtonConfig })
export class UiWebButtonHostComponent
implements OrchestratorDynamicComponent<UiWebButtonConfig> {
implements OrchestratorDynamicComponent<UiWebButtonConfig>
{
@Input() config: UiWebButtonConfig;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Injectable } from '@angular/core';
import { OptionRange, OptionRequired } from '@orchestrator/core';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export enum UiWebHeadingLevel {
One = 1,
Two,
Expand All @@ -10,6 +13,9 @@ export enum UiWebHeadingLevel {
Six,
}

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebHeadingConfig {
@OptionRequired()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebHeadingConfig, UiWebHeadingLevel } from './ui-web-heading-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-heading-host',
templateUrl: './ui-web-heading-host.component.html',
Expand All @@ -14,7 +18,8 @@ import { UiWebHeadingConfig, UiWebHeadingLevel } from './ui-web-heading-config';
})
@DynamicComponent({ config: UiWebHeadingConfig })
export class UiWebHeadingHostComponent
implements OrchestratorDynamicComponent<UiWebHeadingConfig> {
implements OrchestratorDynamicComponent<UiWebHeadingConfig>
{
@Input() config: UiWebHeadingConfig;

level = UiWebHeadingLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
Option,
} from '@orchestrator/core';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebImageConfig {
@OptionRequired()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebImageConfig } from './ui-web-image-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-image-host',
templateUrl: './ui-web-image-host.component.html',
Expand All @@ -14,7 +18,8 @@ import { UiWebImageConfig } from './ui-web-image-config';
})
@DynamicComponent({ config: UiWebImageConfig })
export class UiWebImageHostComponent
implements OrchestratorDynamicComponent<UiWebImageConfig> {
implements OrchestratorDynamicComponent<UiWebImageConfig>
{
@Input() config: UiWebImageConfig;

get width() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Option } from '@orchestrator/core';

import { FormAttributesConfig } from '../../form-attributes-config';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebInputConfig extends FormAttributesConfig {
@Option()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebInputConfig } from './ui-web-input-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-input-host',
templateUrl: './ui-web-input-host.component.html',
Expand All @@ -14,6 +18,7 @@ import { UiWebInputConfig } from './ui-web-input-config';
})
@DynamicComponent({ config: UiWebInputConfig })
export class UiWebInputHostComponent
implements OrchestratorDynamicComponent<UiWebInputConfig> {
implements OrchestratorDynamicComponent<UiWebInputConfig>
{
@Input() config: UiWebInputConfig;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export function uiWebSelectOptionFactory() {
);
}

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebSelectConfig extends FormAttributesConfig {
@OptionTypeFactory(uiWebSelectOptionFactory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebSelectConfig } from './ui-web-select-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-select-host',
templateUrl: './ui-web-select-host.component.html',
Expand All @@ -14,6 +18,7 @@ import { UiWebSelectConfig } from './ui-web-select-config';
})
@DynamicComponent({ config: UiWebSelectConfig })
export class UiWebSelectHostComponent
implements OrchestratorDynamicComponent<UiWebSelectConfig> {
implements OrchestratorDynamicComponent<UiWebSelectConfig>
{
@Input() config: UiWebSelectConfig;
}
15 changes: 15 additions & 0 deletions libs/ui-web/src/lib/components/ui-web-select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
} from '@orchestrator/core';
import { array, string, union } from 'io-ts';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export class UiWebSelectOptionPair {
@OptionRequired()
label: string;
Expand All @@ -24,6 +27,9 @@ export class UiWebSelectOptionPair {
children?: null | undefined;
}

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export const UiWebSelectOptionPairType = classToType(UiWebSelectOptionPair);

/**
Expand All @@ -33,6 +39,9 @@ export function uiWebSelectOptionGroupFactory() {
return array(union([string, UiWebSelectOptionPairType]));
}

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export class UiWebSelectOptionGroup {
@OptionRequired()
@OptionTypeFactory(uiWebSelectOptionGroupFactory)
Expand All @@ -45,8 +54,14 @@ export class UiWebSelectOptionGroup {
disabled?: boolean;
}

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export const UiWebSelectOptionGroupType = classToType(UiWebSelectOptionGroup);

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export type UiWebSelectOption =
| string
| UiWebSelectOptionPair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {
UiWebSelectOptionPair,
} from './types';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-select',
templateUrl: './ui-web-select.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { FunctionWithArg, Option, OptionFunction } from '@orchestrator/core';

export type UiWebTextFn<C> = FunctionWithArg<C, string>;

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebTextConfig<C = any> {
@Option()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {

import { UiWebTextConfig, UiWebTextFn } from './ui-web-text-config';

/**
* @deprecated Use `orc-html-text` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-text-host',
templateUrl: './ui-web-text-host.component.html',
Expand All @@ -21,7 +25,8 @@ import { UiWebTextConfig, UiWebTextFn } from './ui-web-text-config';
})
@DynamicComponent({ config: UiWebTextConfig })
export class UiWebTextHostComponent
implements OrchestratorDynamicComponent<UiWebTextConfig>, OnInit, OnChanges {
implements OrchestratorDynamicComponent<UiWebTextConfig>, OnInit, OnChanges
{
@Input() config: UiWebTextConfig;
@Input() context: any;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {

import { FormAttributesConfig } from '../../form-attributes-config';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@Injectable()
export class UiWebTextAreaConfig extends FormAttributesConfig {
@Option()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import { UiWebTextAreaConfig } from './ui-web-textarea-config';

/**
* @deprecated Use `orc-html-tag` component
* from `@orchestrator/html-tag` package instead.
*/
@Component({
selector: 'orc-ui-web-textarea-host',
templateUrl: './ui-web-textarea-host.component.html',
Expand All @@ -14,6 +18,7 @@ import { UiWebTextAreaConfig } from './ui-web-textarea-config';
})
@DynamicComponent({ config: UiWebTextAreaConfig })
export class UiWebTextareaHostComponent
implements OrchestratorDynamicComponent<UiWebTextAreaConfig> {
implements OrchestratorDynamicComponent<UiWebTextAreaConfig>
{
@Input() config: UiWebTextAreaConfig;
}
3 changes: 3 additions & 0 deletions libs/ui-web/src/lib/form-attributes-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Option, OptionInteger } from '@orchestrator/core';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
export class FormAttributesConfig {
@Option()
name?: string;
Expand Down
3 changes: 3 additions & 0 deletions libs/ui-web/src/lib/ui-web.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
} from './components';
import { UiWebButtonHostModule } from './components/ui-web-button-host';

/**
* @deprecated Use `@orchestrator/html-tag` package instead.
*/
@NgModule({
exports: [
UiWebButtonHostModule,
Expand Down

0 comments on commit 0b171f7

Please sign in to comment.