0.0.10 • Published 3 years ago

sv-config-item v0.0.10

Weekly downloads
204
License
-
Repository
-
Last release
3 years ago

Savis template configuration item

table of content

1. Getting started 2. Latest update 3. Installation 4. Implementation 5. API 6. Event 7. Sample

1. Getting started

sv-config-item là thư viện hỗ trợ config tọa độ các trường thông tin có trong file pdf để hỗ trợ cho việc fill thông tin vào file pdf.

2. Latest update

version @0.0.4

3. Installation

bước 1 : Cài đặt thư viện angular2-draggable

npm i angular2-draggable

bước 2 : Thêm đường dẫn bên dưới vào file angular.json

"styles": [
    "node_modules/angular2-draggable/css/resizable.min.css"
]

bước 3 : Cài đặt thư viện ant-design angular ( nếu chưa có theme )

ng add ng-zorro-antd

bước 4: Cài đặt tư viện sv-config-item

npm i sv-config-item

4. Implementation

Bước 1: Thêm module sv-config-item

import {SvConfigItemModule} from 'sv-config-item'

imports: [
   SvConfigItemModule
  ],

Bước 2: Sử dụng component sv-config-item

ví dụ:

<sv-config-item
    [bound]="con"
    *ngFor="let itemSetting of listItemSetting; let position = index"
    [setting]="itemSetting"
    [position]="position"
    (onRemove)="onItemRemove($event)"
    (onItemSettingUpdate)="onItemSettingUpdate($event)"
    (onItemClick)="onItemClick($event)"
  ></sv-config-item>

API

Directive

InputTypeDefaultDescription
boundHtmlElementnullPdf file container div
settingSettingModelnullSettingModel để config cho item trên template
positionnumbernullvị trí của item trong listItem của file template
BackgroundColorstring#ffb700Màu sắc của item config

SettingModel -> import {SettingModel} from 'sv-config-item' global -> import {global} from 'sv-config-item'

Event

Output$eventDescription
onItemDragBeginSettingModelemit khi item bắt đầu drag
onItemDragStopSettingModelemit khi item dừng drag
onItemResizeStopSettingModelemit khi item dừng resize
onItemSettingUpdateSettingModelemit khi item dừng drag, resize, setting trong popup xong
onItemMovingSettingModelemit khi item đang drag
onRemovepositionemit khi item bị xóa bằng nút delete
onItemClickSettingModelemit khi click vào item

3. Sample

source code github https://github.com/vyphanduy1234/savis-config-item

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago