This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PersistentUnorderedMap } from "near-sdk-as"; | |
// Создадим объект для хранения | |
export const products = new PersistentUnorderedMap<string, string>("PRODUCTS"); | |
// Реализуем функцию создания новых товаров | |
export function setProduct(id: string, productName: string): void { products.set(id, productName); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="dropdown"> | |
<div> | |
<app-button | |
[text]='"Dropdownmenu"' | |
[isActive]="isOpen" | |
(click)='changeOpenedState()'></app-button> | |
</div> | |
<div class="menu-wrapper" *ngIf='isOpen'> | |
<app-menu></app-menu> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin tree-select-theme($theme) { | |
.tree-select { | |
background-color: white; | |
} | |
.tree-node-indent { | |
display: inline-block; | |
width: 24px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'internal-tree-select', | |
template: ` | |
<ng-template | |
#overlay='cdkConnectedOverlay' | |
cdkConnectedOverlay | |
[cdkConnectedOverlayOrigin]='origin' | |
[cdkConnectedOverlayOpen]='visible' | |
[cdkConnectedOverlayPositions]='positions' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'tree-node', | |
template: ` | |
<div class='tree-node-wrapper'> | |
<tree-node-indent *ngIf='node' [level]='node.level'></tree-node-indent> | |
<span *ngIf='!node.isLeaf' class='arrow-wrapper'> | |
<span *ngIf='!isExpanded' class='arrow arrow-right' (click)='openClick($event)'> | |
<img src='https://raw.githubusercontent.com/ant-design/ant-design-icons/e4c3364e7a83fe581af634b1702fd3297fa104c4/packages/icons-svg/svg/outlined/caret-right.svg' /> | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'tree-node-indent', | |
template: ` | |
<span class='tree-node-indent' *ngFor="let i of list; let index = index"></span> | |
`, | |
}) | |
export class TreeNodeIndentComponent implements OnInit, OnChanges { | |
@Input() | |
level: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const TREE_SELECT_VALUE_ACCESSOR: ExistingProvider = { | |
provide: NG_VALUE_ACCESSOR, | |
useExisting: forwardRef(() => TreeSelectComponent), | |
multi: true | |
}; | |
@Component({ | |
selector: 'app-tree-select', | |
providers: [TREE_SELECT_VALUE_ACCESSOR], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<input-field [active]='active' > | |
<input sh-input [value]='displayWith(selectedNode)' (click)="onClick($event)" /> | |
</input-field> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="speak-wrapper"> | |
<div class="speak-btns"> | |
<button tuiButton type="button" (click)='pause()'>Start</button> | |
<button style="margin-left: 16px;" tuiButton type="button" (click)='pause()'>Stop</button> | |
</div> | |
<div #scrollRef class="speak-content"> | |
<div *ngFor='let item of texts; let i = index'> | |
<div #item class="speak-content__item"> | |
<div class="speak-content__item__speach" [waTextToSpeech]="text | waUtterance: options" | |
[waTextToSpeechPaused]='paused' (waTextToSpeechBoundary)="onWaTextToSpeechBoundary($event)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DOCUMENT } from '@angular/common'; | |
import { ChangeDetectorRef, Directive, ElementRef, Inject, Input, OnChanges, Renderer2, SimpleChanges } from '@angular/core'; | |
export interface CurrentCharPosition { | |
charIndex: number; | |
charLength: number; | |
} | |
@Directive({ | |
selector: '[highlight]', |