GithubHelp home page GithubHelp logo

rdkmaster / jigsaw Goto Github PK

View Code? Open in Web Editor NEW
477.0 27.0 72.0 72.77 MB

Jigsaw七巧板 provides a set of web components based on Angular5/8/9+. The main purpose of Jigsaw is to help the application developers to construct complex & intensive interacting & user friendly web pages. Jigsaw is supporting the development of all applications of Big Data Product of ZTE.

Home Page: https://jigsaw-zte.gitee.io

License: MIT License

HTML 48.28% TypeScript 22.23% CSS 15.88% JavaScript 10.69% Shell 0.06% AutoIt 0.04% SCSS 2.83%
webui component bigdata typescript jigsaw jigsaw-seed angular zte

jigsaw's Introduction

Jigsaw-七巧板

  • For the desktop: @rdkmaster/jigsaw      npm version Jigsaw
  • For mobile: @rdkmaster/jigsaw-mobile npm version Build Status
  • Font Icons: @rdkmaster/icon-font          npm version Amount
  • Online IDE: Edit Jigsaw in one click          Gitpod Ready-to-Code

README中文版

Why Jigsaw?

Jigsaw is a complete and powerful Web components set. The current version contains 56 components, 7 containers, 7 services, and 9 directives, basically covering all aspects of Web applications. Simply put, Jigsaw has almost all the functions of other component sets, and Jigsaw is more powerful and has better performance. Therefore, there is no need to worry about the lack of functionality with Jigsaw.

Jigsaw has an ability that other component sets do not have: Jigsaw’s application can support multiple Ux specifications at the same time in one development. Click here to learn more about it.

List of Availables

Components

# Name Description Link
1 Alert A simple dialog that usually used to tell the users something important, and it can also collect choice of the users. Demo
2 Alphabetical Index A list that can be indexed alphabetically. Demo
3 Alphabetical Index Select A drop-down list that can be indexed alphabetically. Demo
4 Auto Input A full-featured Input component with a drop-down list of suggested optional values. Demo
5 Breadcrumb A lightweight navigator which can automaticly trace while the users are browsing. Demo
6 Button A button with multiple states. Demo
7 Button Bar A button bar which supports selection status, single or multiple selection, it can be used as a form control or a navigator. Demo
8 Cascade A form control for collecting or presenting data with subordinate relationships. Demo
9 ChartIcon A componnet for rendering a small area into charts, supporting pie, line, and bar charts. Demo
10 Checkbox A form control for collecting multi choices. Demo
11 Color Select A form control that provides multiple ways to pick colors. Demo
12 Date Picker A form control used to collect dates. Demo
13 Date Time (Single) A form control for collecting date and time. Demo
14 Date Time (Select) A form control used to collect date and time, it provides choices in a drop-down manner. Demo
15 Date Time (Range) A form control used to collect the start and end value, including date and time. Demo
16 Date Time (Select) A form control used to collect the start and end value, including date and time, it provides choices in a drop-down manner. Demo
17 Fish Bone A Fishbone graph are often used to present some data with subordinate relationships in the form of fish bones. Demo
18 Graph Render any data graphically, including any graphics such as bar charts, line charts, pie charts, gauge, and more, powered by echarts. Demo
19 Header A simple component used to prompt the topic of a certain area on the UI. Demo
20 Icon A font icon, which can be used as a link button, supports Font-aweasome and Jigsaw's internal icon libraries. Demo
21 Input (Normal) A form control used to collect a single line of text. Demo
22 Input (Search) A search box for fuzzy matching according to text. Demo
23 List Lite A control for presenting a group of data in a text list, supports single selection and multiple selection, supports main title and subtitle, and supports icons. Demo
24 List An enhanced version of the List Lite control that supports the presentation of a set of data in any form. Demo
25 Loading Displays an animation to ease the user's anxiety during waiting for certain operations. Demo
26 Menu A multi-level menu control, which is often used for navigation. Demo
27 Notification Informs some unimportant message in the corner of the UI, or to collect some unimportant choice of the users. Demo
28 Numeric Input A form control for collecting numbers without typing, supports floats and integers. Demo
29 Pagination A control used to divide a large amount of data into multiple pages for display, not only can cooperate with the table component, but also can realize the paging operation of any data. Demo
30 Progress Bar A horizontal progress bar. Demo
31 Progress Circle A circular progress bar. Demo
32 Progress Status A process status component which can be used to display various states in the process. Demo
33 Radio A form control for collecting single choices. Demo
34 Rate A form control for the users to give his/her score of something. Demo
35 Scrollbar A custom scrollbar to any container, powered by perfect scrollbar. Demo
36 Select (Normal) A form control for collecting the choice(s) by dropping down a list. Demo
37 Select (Group) A form control used to collect options through a drop-down list, supports option grouping, and is often used in situations where options are more complex. Demo
38 Select (Collapse) A form control used to collect options through a drop-down list. It supports folding to group options. It is often used in situations where options are more complicated. Demo
39 Signaling Chart A signaling flow chart. Demo
40 Slider A form control for collecting numerical info by sliding. Demo
41 Steps Displays a series of custom steps which have some predefined states. Demo
42 Switch A form control for collection yes/no or on/off choices. Demo
43 Tab Bar A tab switcher for the Tabs container. Demo
44 Table A very very powerful data grid. Demo
45 Tag A tag control. Demo
46 Textarea A form control for collecting multi lines of text. Demo
47 Tile Lite A list that displays data by horizontal tiling, and the List component tiling data vertically. Demo
48 Tile An enhanced version of the Tile control. Demo
49 Time A time selector for selecting hours, minutes and seconds. Demo
50 Time Section A time rule selector, you can set the rule for matching time. Demo
51 Toast A component used to prompt timely messages without intrusion. Demo
52 Transfer A complex selector, used to select a large number of entries, supports paging. Demo
53 Tree Renders some data with subordinate relationships as a tree, powered by ztree. Demo
54 Upload Opens a file explorer to select one or more files and upload to the sever. Demo
55 Upload Result Opens a file explorer to select one or more files and upload to the sever. Demo
56 Viewport Represents part of an abstract view. Demo

Containers

# Name Description Link
1 Box A powerful view layout based on flex, which abstracts the view into horizontal and vertical boxes, and uses their mutual combination to quickly make the layout of complex views. Demo
2 Editable Box A data-driven box layout that makes it easier to achieve dynamic layout editing effects at runtime. Demo
3 Collapse A container which can fold or open the given view. Demo
4 Combo Select A container that can hide any given view, which the user can pull down to display this view. Demo
5 Dialog A dialog box component which is often used in conjunction with PopupService. Demo
6 Drawer A drawer, which is often used to show/hide complex views. Demo
7 Tabs A multi-view folding container with tabs, which can overlay multiple views together. Demo

Services

# Name Description Link
1 Theme System Jigsaw provides a very powerful theme system, which can support a variety of Ux specification theme, support online hot switching of dark and light skins, support the use of opposite color theme in local areas, and also provide a set of CSS Variables are used to help users create pages that support each of the above features. Demo
2 Data Jigsaw encapsulates many kinds of data objects to help applications more easily to feed data to all the controls. Demo
3 LoadingService Popups up and manages Loading component. Demo
4 PopupService Popups any given view to the top of the UI, very powerful. Demo
5 TimeService Translate time macros like now-1d to real values. --
6 Translation Used to create a view that supports multiple languages. Demo
7 ChartIcon Render simple data to tiny charts. --

Directives

# Name Description Link
1 Badge Add a badge to any view to grab the user's attention, and support multiple forms of badge. Demo
2 Menu Add multi-level menu function to any view, or popup a context menu. Demo
3 Download Graphs Add a function of downloading screenshots of all the graphics in the host container. Demo
4 Drag and Drop Makes the host draggable and droppable. Demo
5 Float Drop down any given view near the host, many positions supported. Demo
6 Movable The ability to add to any view so that the view can be dragged by the mouse and follow the movement of the mouse. Demo
7 Tooltip Add a context prompt to any view, support rich text, and support interaction. Demo
8 Trusted HTML Similar to Angular's innerHtml directive, without sanitizing the given trusted html, support interaction. Demo
9 Upload Adding the file upload function to any view, needs to be used in conjunction with the upload result control. Demo

Meaning Of Name

We name this suite of components from a puzzle game. The process of this game, during which the player combine the messy pieces into a picture in accordance with the established blueprint, is similar to the development process of modern web page. We use Jigsaw as this component set’s name, hoping to make web page developers to combine the messy pieces of functions into your web page, just like playing jigsaw puzzle.

The soul of Jigsaw is combination, and we are committed to develop combination to the extreme level.

When several components are sorted and arranged in a certain order, you can get an application page. This is a normal combination, which we definee as Level I combination. In this level, all the components are like atoms, which means they can only act what they were made.

But Jigsaw's components are no longer atoms, we made a secondary abstraction of the functionality of the components, while allowing parts of the components highly customizable, some component even fully customizable. Small to basic components like jigsaw-button, large to giant components such as jigsaw-table, almost every UI element you see can be combined with other components to change its default behavior, and therefor to enhance the capability of components. Atomic components are limited, but the combination can produce infinite possibilities. The customization mentioned here, in other words, is another form of combination, and we call this level of combination as Level II.

With Jigsaw, unleash your imagination!

Get Started

A brand new start with Jigsaw

We strongly recommend to use Jigsaw Seed as the seed of all new projects. The specific steps are:

  1. Install or update nodejs, node 6.x.x and npm 3.x.x or later is required;
  2. Download or clone the source of Jigsaw Seed, assumed being saved to d:\jigsaw-seed;
  3. Install all dependencies by excuting the following script:
cd d:\jigsaw-seed
npm config set registry=https://registry.npm.taobao.org/                 # for Chinese developers only
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass # for Chinese developers only
npm install -g @angular/cli                                              # optional, but strongly recommended
npm install
npm start
  • Attensions to the Chinese developers, do NOT use cnpm to install the dependencies because of this issue.
  • Attensions to all ZTErs, you can use the npm mirror inside of ZTE for faster speed of installing, check this link for more details.
  1. Open http://localhost:4200 in your browser, your development environment is completed set up if you can see the welcome page;
  2. Afterwards you can directly run npm start in the d:\jigsaw-seed directory to start the development environment;
  3. Jigsaw has specifically done code optimization for the modern IDE, so that IDE can accurately prompt more information, saving your time of reading api document. We recommend using WebStorm as IDE.

Use Jigsaw with your developing project

See the specific process here

A bible for the beginners

Jigsaw Tourist is a tutorial dedication to the beginners, which shows how to use Jigsaw from scratch to build a simple application page. Click here, bravely take your first step in Jigsaw.

If there is any difficulty in getting started, please add Jigsaw's official WeChat, where you can join the SOS group and have a dialogue with our developers directly.

A advanced guide

Any Badge is a best practice of using Jigsaw and RDK to create a full featured web application. It is a very good choice to read the source code of Any Badge, which helps your to learn more about Jigsaw and RDK, after you finish reading the Tour of Heroes and the Jigsaw Tourist.

One More Star Please!

This is the best encouragement for us.

Contribution

We believe that the following acts are doing contributions:

  • Quietly concern about Jigsaw;
  • Watch/star/fork it;
  • Reporting a bug or give us any suggestions by submitting an issue;
  • Write or translate the api documentation, or any articals about Jigsaw.
  • The more effective way to contribute is to push us PRs, all PRs are welcome and will be dealt with seriously;

jigsaw's People

Contributors

10222927 avatar 10229428 avatar angular-cli avatar damoqiongqiu avatar dependabot[bot] avatar firstimpression avatar gbin03 avatar gloryoftan avatar hanz6 avatar hpyou avatar imbnnn avatar jiiiin avatar mirror2tina avatar mrbaoicon avatar oicqcx avatar rdkmaster avatar yangxiaoyu13 avatar yueyueniao187 avatar yxxx0128 avatar zcg1991 avatar zhangchen915 avatar zhongzhong0505 avatar ztezyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jigsaw's Issues

表格baisc demo报错 http://rdk.zte.com.cn/demo/table/basic

core.es5.js:1020 ERROR Error: Uncaught (in promise): TypeError: Object.setPrototypeOf called on null or undefined
TypeError: Object.setPrototypeOf called on null or undefined
    at setPrototypeOf (<anonymous>)
    at webpackJsonp.628.__extends (table-service.ts:13)
    at table.ts:72
    at Object.628 (table.ts:883)
    at __webpack_require__ (bootstrap d812394…:52)
    at Object.429 (1.chunk.js:374)
    at __webpack_require__ (bootstrap d812394…:52)
    at src async:115
    at ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.es5.js:3933)
    at setPrototypeOf (<anonymous>)
    at webpackJsonp.628.__extends (table-service.ts:13)
    at table.ts:72
    at Object.628 (table.ts:883)
    at __webpack_require__ (bootstrap d812394…:52)
    at Object.429 (1.chunk.js:374)
    at __webpack_require__ (bootstrap d812394…:52)
    at src async:115
    at ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.es5.js:3933)
    at resolvePromise (zone.js:770)
    at resolvePromise (zone.js:741)
    at zone.js:818
    at ZoneDelegate.invokeTask (zone.js:424)
    at Object.onInvokeTask (core.es5.js:3924)
    at ZoneDelegate.invokeTask (zone.js:423)
    at Zone.runTask (zone.js:191)
    at drainMicroTaskQueue (zone.js:584)
    at <anonymous>

草拟了一个组件代码的编码规范,比较粗糙,后续慢慢细化

  • 代码中对所有东西的命名,一律采用驼峰命名法,例如checkProperty,而不要命名为 check_property
  • 关于类型的总体原则,包括变量、方法返回值、形参等,全部加上类型,并且类型越具体越好。any类型的变量尽可能的少用。
    • 作用域大于等于类时,必须严格遵守这个规范,不允许无类型。包括类的成员变量、成员方法(包括形参和返回值),包括全局变量、方法。
    • 对于函数的局部变量、代码块内的局部变量,在编译器能够精确推导得到其类型时,可以忽略类型。比如 const a = "a string";
  • 所有命名严禁以拼音来命名,必须以词义恰当的英语单词来命名。命名时,要注意单词的时态、单复数等情况。总体原则是让他人能够“顾名思义”,而不用去猜测其作用。
  • 命名时,尽量避免使用缩写(现在的IDE提示很强大,即使很长的变量名,也不需要手敲很多字符),不要出现类似checkPropStatus一半单词缩写一半全写的情形。
    • 尽量采用约定俗成的缩写,不要自己发明,比如property常常缩写为prop,就别自己发明一个prpt,pro,proper这样的奇怪的缩写。
  • 所有的类、接口、自定义类型、枚举类名,都以大写字母开头。其中接口一律以字母I开头,抽象类一律以Abstract开头,枚举项以小写字母开头。
  • 所有的方法、变量,都以小写字母开头。所有json对象的属性,也以小写字母开头
  • 对于方法命名
    • 命名时一般以动宾结构的方式,比如checkProperty,其中check是一个动词,property是一个宾语,而不要命名为propertyCheck
    • 对于一些类型是Function的变量的命名,建议也采用这个方式命名,比如 const removeClickEvent = window.listen('click', ...)
    • 对于一些回调函数,也可根据习惯命名为 xxxxHandler,但是应该尽量避免。
    • 类的private成员方法一律以下划线开头,public/protected成员方法不得以下划线开头
    • 必须在组件内的其他类调用,且不希望对应用开放的成员方法,也以下划线开头。尽量避免出现这个情形。
  • 对于类、变量、自定义类型、枚举类名的命名
    • 一般以名词或者形容词+名词的结构来命名,比如data,更具体的data可以命名为initialData,更具体且有时态的initializedData
    • 对于类的成员变量、成员方法,尽量避免使用单一的单词,应该尽可能的增加一些形容词、时态来修饰成员变量、成员方法,特别是public的成员变量、方法,更是需要描述的精确。比如光秃秃的一个data,鬼才知道这是啥data。
    • 类的private成员变量一律以下划线开头,public/protected成员变量不得以下划线开头
    • 必须在组件内的其他类调用,且不希望对应用开放的成员变量,也以下划线开头。尽量避免出现这个情形。
  • 在模板中用到的组件的变量和方法,都以 _$ 开头。因为这些变量必须定义成public的,否则在prod模式下编译会失败,而这些变量、方法往往都是私有的。

更多详细的规范请参考这里 http://wiki.zte.com.cn/pages/viewpage.action?pageId=38540246

http://gitlab.zte.com.cn/10045812/jigsaw/issues/266

RdkDialog、RdkAlert、RdkTooltipDialog、RdkMenu、RdkLoading等增加静态方法popup(),用于直接弹出自己

下面以RdkDialog为例,在RdkDialog上增加popup()静态方法,其定义如下:

public static popup(optionis?:PopupOptions, initData?: any)

应用使用 RdkDialog.popup() 看直接将一个对话框弹出来

实现上,非常简单:

PopupService.popup(RdkDialog, optionis, initData);

关于PopupService.popup,看这里 #139

http://gitlab.zte.com.cn/10045812/jigsaw/issues/140

使用Typescript 2.4.1版本编译时rxjs报错

报错信息如下:
image
该错误是rxjs在高版本typescript下的bug,rxjs/#issue2539
解决方案有2个:

  • 使用rxjs v6 alpha版本
  • 修改node_modules/rxjs/Subject.d.ts文件的第24行的Observable<T>为Observable<any>临时解决
    image
    image
    不知道是不是通用问题,我在使用的时候遇到了,在这里分享一下解决方法,希望能有所帮助。 : )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.