Skip to content

Commit

Permalink
feat(kit)!: InputRange remove all deprecated API (#2215)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov authored and splincode committed Aug 9, 2022
1 parent 7c11bee commit a676c95
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 540 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<tui-input-range
new
[min]="min"
[max]="max"
[quantum]="quantum"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<tui-input-range
new
[min]="min"
[max]="max"
[formControl]="control"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="wrapper">
<tui-input-range
new
[min]="0"
[max]="100"
[segments]="5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div class="wrapper">
<tui-input-range
id="input-range-with-key-steps"
new
[min]="min"
[max]="max"
[steps]="totalSteps"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {FormControl} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiContextWithImplicit} from '@taiga-ui/cdk';
import {TuiPluralize, TuiSizeL} from '@taiga-ui/core';
import {TuiSizeL} from '@taiga-ui/core';
import {TuiKeySteps} from '@taiga-ui/kit';

import {AbstractExampleTuiControl} from '../abstract/control';
Expand Down Expand Up @@ -61,7 +61,7 @@ export class ExampleTuiInputRangeComponent extends AbstractExampleTuiControl {

max = this.maxVariants[0];

segments = 0;
segments = 1;

steps = 0;

Expand All @@ -73,26 +73,15 @@ export class ExampleTuiInputRangeComponent extends AbstractExampleTuiControl {

size = this.sizeVariants[1];

readonly pluralizeVariants: ReadonlyArray<TuiPluralize | Record<string, string>> = [
['year', 'years', 'years'],
readonly pluralizeVariants: ReadonlyArray<Record<string, string>> = [
{one: 'thing', few: 'things', many: 'things', other: 'things'},
{
one: 'year',
other: 'years',
},
];

pluralize: TuiPluralize | Record<string, string> | null = null;

segmentsPluralize: Record<string, string> | TuiPluralize | null = null;

minLabelVariants: readonly string[] = ['', 'Nothing'];

minLabel = this.minLabelVariants[0];

maxLabelVariants: readonly string[] = ['', 'Everything'];

maxLabel = this.maxLabelVariants[0];
pluralize: Record<string, string> | null = null;

keyStepsVariants: readonly TuiKeySteps[] = [[[50, 1000]]];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@
</a>
</p>

<tui-notification status="warning">
<p
i18n
class="tui-space_top-0"
>
This component is being refactored. Soon&nbsp;(next&nbsp;major&nbsp;release) you will see the fresh
version of it!
</p>
<p i18n>
Of course, we keep backward compatibility in mind (for 2.x.x). You can still use old version of
<code>InputRange</code>
.
</p>

<p i18n>
However, if you are going to use this component, we recommend to use new version. To enable the "new
version"-mode, add
<code>new</code>
directive. Example:&nbsp;
<code>&lt;tui&#8209;input&#8209;range&nbsp;new&nbsp;...&gt;</code>
</p>
</tui-notification>

<tui-doc-example
id="base"
i18n-heading
Expand Down Expand Up @@ -141,7 +118,6 @@
<tui-doc-demo [control]="control">
<ng-template>
<tui-input-range
new
[formControl]="control"
[min]="min"
[max]="max"
Expand All @@ -155,10 +131,6 @@
[tuiTextfieldLabelOutside]="labelOutside"
[tuiTextfieldSize]="size"
[readOnly]="readOnly"
[size]="size"
[minLabel]="minLabel"
[maxLabel]="maxLabel"
[segmentsPluralize]="segmentsPluralize"
>
Just a very long label. Don't afraid it does not overflow the wrapper, the label is just cut off
with ellipsis when it does not fit the wrapper.
Expand Down Expand Up @@ -258,18 +230,22 @@
i18n
documentationPropertyName="pluralize"
documentationPropertyMode="input"
documentationPropertyType="TuiPluralize | Record<string, string>"
documentationPropertyType="Record<string, string>"
[documentationPropertyValues]="pluralizeVariants"
[(documentationPropertyValue)]="pluralize"
>
Plural forms for labels. TuiPluralize array is deprecated. Use object that mimics the
<a
tuiLink
href="https://unicode-org.github.io/icu/userguide/format_parse/messages/"
>
ICU format
</a>
for i18nPlural
Plural forms for labels.

<p>
Use object that mimics the
<a
tuiLink
href="https://unicode-org.github.io/icu/userguide/format_parse/messages/"
>
ICU format
</a>
for i18nPlural
</p>
</ng-template>
<ng-template
i18n
Expand All @@ -280,73 +256,6 @@
>
Component is read only
</ng-template>
<ng-template
i18n
documentationPropertyName="size"
documentationPropertyMode="input"
documentationPropertyType="TuiSizeL"
[documentationPropertyDeprecated]="true"
[documentationPropertyValues]="sizeVariants"
[(documentationPropertyValue)]="size"
>
Size

<p>
Use
<code>tuiTextfieldSize</code>
instead.
</p>
</ng-template>
<ng-template
i18n
documentationPropertyName="minLabel"
documentationPropertyMode="input"
documentationPropertyType="string"
[documentationPropertyDeprecated]="true"
[documentationPropertyValues]="minLabelVariants"
[(documentationPropertyValue)]="minLabel"
>
Label for min value

<p>
Use
<code>leftValueContent</code>
instead.
</p>
</ng-template>
<ng-template
i18n
documentationPropertyName="maxLabel"
documentationPropertyMode="input"
documentationPropertyType="string"
[documentationPropertyDeprecated]="true"
[documentationPropertyValues]="maxLabelVariants"
[(documentationPropertyValue)]="maxLabel"
>
Label for max value

<p>
Use
<code>rightValueContent</code>
instead.
</p>
</ng-template>
<ng-template
i18n
documentationPropertyName="segmentsPluralize"
documentationPropertyMode="input"
documentationPropertyType="TuiPluralize"
[documentationPropertyDeprecated]="true"
[documentationPropertyValues]="pluralizeVariants"
[(documentationPropertyValue)]="segmentsPluralize"
>
Plural forms for
<code>segments</code>

<p>
<strong>See examples how to create ticks without this property (outside of the component).</strong>
</p>
</ng-template>
</tui-doc-documentation>

<h6
Expand Down
1 change: 0 additions & 1 deletion projects/kit/abstract/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './input-slider';
export * from './slider/slider';
166 changes: 0 additions & 166 deletions projects/kit/abstract/input-slider.ts

This file was deleted.

Loading

0 comments on commit a676c95

Please sign in to comment.