viscreation / vis-ui.js
基于jQuery UI和一些其他元素的JavaScript UI生成器框架
0.2.84
2021-02-24 11:35 UTC
Requires
- components/bootstrap: 3.*
- components/font-awesome: ^3.0 || ^4.0 || ^5.0
- components/jquery: 1.* || 2.*
- components/jqueryui: 1.*
- components/underscore: 1.8.*
- datatables/datatables: ^1.10.16
- debugteam/bootstrap-colorpicker: 1.*
- medialize/jquery-context-menu: 1.*
- robloach/component-installer: 0.2.*
- select2/select2: ^4.0
- wheregroup/jquerydialogextendjs: 2.x
Conflicts
- mapbender/digitizer: <1.1.67
- 0.2.84
- 0.1.2
- 0.1.1
- 0.1.0
- dev-master / 0.0.x-dev
- 0.0.70
- 0.0.69
- 0.0.68
- 0.0.67
- 0.0.66
- 0.0.65
- 0.0.64
- 0.0.63
- 0.0.62
- 0.0.61
- 0.0.60
- 0.0.59
- 0.0.58
- 0.0.57
- 0.0.56
- 0.0.55
- 0.0.54
- 0.0.53
- 0.0.52
- 0.0.51
- 0.0.50
- 0.0.49
- 0.0.48
- 0.0.47
- 0.0.46
- 0.0.45
- 0.0.44
- 0.0.43
- 0.0.42
- 0.0.41
- 0.0.40
- 0.0.39
- 0.0.38
- 0.0.37
- 0.0.36
- 0.0.35
- 0.0.34
- 0.0.33
- 0.0.32
- 0.0.31
- 0.0.30
- 0.0.29
- 0.0.28
- 0.0.27
- 0.0.26
- 0.0.25
- 0.0.24
- 0.0.23
- 0.0.22
- 0.0.21
- 0.0.20
- 0.0.19
- 0.0.18
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-bugfix/tabCreationWithAnchor
- dev-release/0.1
- dev-feature/composerupdate
- dev-feature/accordion-view
This package is not auto-updated.
Last update: 2024-09-15 19:18:24 UTC
README
本包提供基于 Bootstrap 和 jQuery UI 的JavaScript UI生成器。
特性
- 生成表单和输入元素
- 检查和填写表单
- 标签导航
示例
元素
描述如何使用元素生成器。
输入
$("<div/>").generateElements({ type: "input", name: "name", title: "Input", placeholder: "Enter the name", mandatory: true, cssClass: "input-css", css: {width: "80%"} })
选项
- name: 字段名称
- title: 标题字符串
- placeholder: 输入字段中的占位符
- mandatory: 必填字段:true, false 或 ReExpr ("/^\d+$/g" - 仅允许小数)
- cssClass: CSS类名称
- css: 自定义CSS样式对象。例如:{width: "80%"}
- value: 默认值
文本区域
$("<div/>").generateElements({ type: "textArea", name: "description" , title: "Description", placeholder: "Enter the description", })
选项
- name: 字段名称
- title: 标题字符串
- placeholder: 输入字段中的占位符
- mandatory: 必填字段:true, false 或 ReExpr ("/^\d+$/g" - 仅允许小数)
- cssClass: CSS类名称
- css: 自定义CSS样式对象。例如:{width: "80%"}
- value: 默认值
复选框
$("<div/>").generateElements({ type: "checkbox", name: "check1", title: "Checkbox", mandatory: true, cssClass: "input-css", css: {width: "80%"} })
选项
- name: 字段名称
- title: 标题字符串
- placeholder: 输入字段中的占位符
- mandatory: 必填字段:true, false 或 ReExpr ("/^\d+$/g" - 仅允许小数)
- cssClass: CSS类名称
- css: 自定义CSS样式对象。例如:{width: "80%"}
- value: 默认值
单选按钮
$("<div/>").generateElements({children:[{ type: "radio", name: "yesNo", title: "Yes", css: {width: 50%} },{ type: "radio", name: "yesNo", title: "no", css: {width: 50%} }]})
选项
- name: 字段名称
- title: 标题字符串
- placeholder: 输入字段中的占位符
- mandatory: 必填字段:true, false 或 ReExpr ("/^\d+$/g" - 仅允许小数)
- cssClass: CSS类名称
- css: 自定义CSS样式对象。例如:{width: "80%"}
- value: 默认值
选择框
$("<div/>").generateElements({type: "select", value: "de", options: {en:"English", de: "German"} })
选项
- name: 字段名称
- title: 标题字符串
- mandatory: 必填字段:true, false 或 ReExpr ("/^\d+$/g" - 仅允许小数)
- cssClass: CSS类名称
- css: 自定义CSS样式对象。例如:{width: "80%"}
- value: 默认值
- options: 键/值对象或数组
- multiply: 多选。默认false
基本用法示例
var $div = $("<div/>"); $div.generateElements({children:[{ type: 'input', title: "Input", placeholder: "placeholder value", mandatory: true },{ type: 'input', name: "input2", title: "Input #2", placeholder: "placeholder value #2" }]}); $div.popupDialog({ title: "Demo", maximizable: true, buttons: [{ text: "OK", click: function(e) { var div = $(e.currentTarget).closest(".ui-dialog").find(".popup-dialog"); div.popupDialog('close'); } }] });
集成
通过 eslider/vis-ui.js 扩展composer依赖项并更新composer。
composer update
将JS库加载到HTML中。
<script src="web/assets/vis-ui.js/vis-ui.js-built.js"></script>
添加CSS样式。
<link media="all" type="text/css" rel="stylesheet" href="web/assets/require.css">
包管理器
- Composer:
viscreation/vis-ui.js