Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vitmalina committed Apr 26, 2023
1 parent c8cba7a commit 17712de
Show file tree
Hide file tree
Showing 13 changed files with 267 additions and 32,935 deletions.
3,720 changes: 0 additions & 3,720 deletions dist/w2ui-1.5.css

This file was deleted.

21,491 changes: 0 additions & 21,491 deletions dist/w2ui-1.5.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/w2ui-1.5.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/w2ui-1.5.min.css

This file was deleted.

2 changes: 0 additions & 2 deletions dist/w2ui-1.5.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/w2ui.css → dist/w2ui-2.0.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* w2ui 2.0.x (nightly) (4/18/2023, 7:05:14 PM) (c) http://w2ui.com, vitmalina@gmail.com */
/* w2ui 2.0.0 (4/26/2023, 10:40:17 AM) (c) http://w2ui.com, vitmalina@gmail.com */
/**
* TODO:
* - remove default styling, only keep w2ui-* styles
Expand Down
184 changes: 96 additions & 88 deletions dist/w2ui.es6.js → dist/w2ui-2.0.es6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* w2ui 2.0.x (nightly) (4/20/2023, 8:03:53 AM) (c) http://w2ui.com, vitmalina@gmail.com */
/* w2ui 2.0.0 (4/26/2023, 10:40:17 AM) (c) http://w2ui.com, vitmalina@gmail.com */
/**
* Part of w2ui 2.0 library
* - Dependencies: w2utils
Expand Down Expand Up @@ -10510,55 +10510,56 @@ class w2grid extends w2base {
'toggle' : 'list'
}
// events
this.onAdd = null
this.onEdit = null
this.onRequest = null // called on any server event
this.onLoad = null
this.onDelete = null
this.onSave = null
this.onSelect = null
this.onClick = null
this.onDblClick = null
this.onContextMenu = null
this.onContextMenuClick = null // when context menu item selected
this.onColumnClick = null
this.onColumnDblClick = null
this.onColumnResize = null
this.onColumnAutoResize = null
this.onSort = null
this.onSearch = null
this.onSearchOpen = null
this.onChange = null // called when editable record is changed
this.onRestore = null // called when editable record is restored
this.onExpand = null
this.onCollapse = null
this.onError = null
this.onKeydown = null
this.onToolbar = null // all events from toolbar
this.onColumnOnOff = null
this.onCopy = null
this.onPaste = null
this.onSelectionExtend = null
this.onEditField = null
this.onRender = null
this.onRefresh = null
this.onReload = null
this.onResize = null
this.onDestroy = null
this.onStateSave = null
this.onStateRestore = null
this.onFocus = null
this.onBlur = null
this.onReorderRow = null
this.onSearchSave = null
this.onSearchRemove = null
this.onSearchSelect = null
this.onColumnSelect = null
this.onColumnDragStart = null
this.onColumnDragEnd = null
this.onResizerDblClick = null
this.onMouseEnter = null // mouse enter over record event
this.onMouseLeave = null
this.onAdd = null
this.onEdit = null
this.onRequest = null // called on any server event
this.onLoad = null
this.onDelete = null
this.onSave = null
this.onSelect = null
this.onClick = null
this.onDblClick = null
this.onContextMenu = null
this.onContextMenuClick = null // when context menu item selected
this.onColumnClick = null
this.onColumnDblClick = null
this.onColumnContextMenu = null
this.onColumnResize = null
this.onColumnAutoResize = null
this.onSort = null
this.onSearch = null
this.onSearchOpen = null
this.onChange = null // called when editable record is changed
this.onRestore = null // called when editable record is restored
this.onExpand = null
this.onCollapse = null
this.onError = null
this.onKeydown = null
this.onToolbar = null // all events from toolbar
this.onColumnOnOff = null
this.onCopy = null
this.onPaste = null
this.onSelectionExtend = null
this.onEditField = null
this.onRender = null
this.onRefresh = null
this.onReload = null
this.onResize = null
this.onDestroy = null
this.onStateSave = null
this.onStateRestore = null
this.onFocus = null
this.onBlur = null
this.onReorderRow = null
this.onSearchSave = null
this.onSearchRemove = null
this.onSearchSelect = null
this.onColumnSelect = null
this.onColumnDragStart = null
this.onColumnDragEnd = null
this.onResizerDblClick = null
this.onMouseEnter = null // mouse enter over record event
this.onMouseLeave = null
// need deep merge, should be extend, not objectAssign
w2utils.extend(this, options)
// check if there are records without recid
Expand Down Expand Up @@ -13807,6 +13808,45 @@ class w2grid extends w2base {
// event after
edata.finish()
}
columnContextMenu(field, event) {
let edata = this.trigger('columnContextMenu', {target: this.name, field: field, originalEvent: event })
if (edata.isCancelled === true) return
if (this.show.columnMenu) {
w2menu.show({
type: 'check',
anchor: document.body,
originalEvent: event,
items: this.initColumnOnOff()
})
.then(() => {
query('#w2overlay-context-menu .w2ui-grid-skip')
.off('.w2ui-grid')
.on('click.w2ui-grid', evt => {
evt.stopPropagation()
})
.on('keypress', evt => {
if (evt.keyCode == 13) {
this.skip(evt.target.value)
this.toolbar.click('w2ui-column-on-off') // close menu
}
})
})
.select((event) => {
let id = event.detail.item.id
if (['w2ui-stateSave', 'w2ui-stateReset'].includes(id)) {
this[id.substring(5)]()
} else if (id == 'w2ui-skip') {
// empty
} else {
this.columnOnOff(event, event.detail.item.id)
}
clearTimeout(this.last.kbd_timer) // keep grid in focus
})
clearTimeout(this.last.kbd_timer) // keep grid in focus
}
event.preventDefault()
edata.finish()
}
focus(event) {
// event before
let edata = this.trigger('focus', { target: this.name, originalEvent: event })
Expand Down Expand Up @@ -14385,7 +14425,7 @@ class w2grid extends w2base {
})
.select((event) => {
clearTimeout(this.last.kbd_timer) // keep grid in focus
this.contextMenuClick(recid, event)
this.contextMenuClick(recid, column, event)
})
clearTimeout(this.last.kbd_timer) // keep grid in focus
}
Expand All @@ -14394,9 +14434,10 @@ class w2grid extends w2base {
// event after
edata.finish()
}
contextMenuClick(recid, event) {
contextMenuClick(recid, column, event) {
// event before
let edata = this.trigger('contextMenuClick', { target: this.name, recid, originalEvent: event.detail.originalEvent,
let edata = this.trigger('contextMenuClick', {
target: this.name, recid, column, originalEvent: event.detail.originalEvent,
menuEvent: event, menuIndex: event.detail.index, menuItem: event.detail.item
})
if (edata.isCancelled === true) return
Expand Down Expand Up @@ -15247,40 +15288,7 @@ class w2grid extends w2base {
this.columnDblClick(col.field, event)
break
case 'contextmenu':
if (this.show.columnMenu) {
w2menu.show({
type: 'check',
anchor: document.body,
originalEvent: event,
items: this.initColumnOnOff()
})
.then(() => {
query('#w2overlay-context-menu .w2ui-grid-skip')
.off('.w2ui-grid')
.on('click.w2ui-grid', evt => {
evt.stopPropagation()
})
.on('keypress', evt => {
if (evt.keyCode == 13) {
this.skip(evt.target.value)
this.toolbar.click('w2ui-column-on-off') // close menu
}
})
})
.select((event) => {
let id = event.detail.item.id
if (['w2ui-stateSave', 'w2ui-stateReset'].includes(id)) {
this[id.substring(5)]()
} else if (id == 'w2ui-skip') {
// empty
} else {
this.columnOnOff(event, event.detail.item.id)
}
clearTimeout(this.last.kbd_timer) // keep grid in focus
})
clearTimeout(this.last.kbd_timer) // keep grid in focus
}
event.preventDefault()
this.columnContextMenu(col.field, event)
break
}
})
Expand Down Expand Up @@ -17215,7 +17223,7 @@ class w2grid extends w2base {
w2tooltip.show({
name: this.name + '-column-tooltip',
anchor: $el.get(0),
html: item.tooltip,
html: item?.tooltip,
position: pos,
})
}
Expand Down
10 changes: 5 additions & 5 deletions dist/w2ui.es6.min.js → dist/w2ui-2.0.es6.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 17712de

Please sign in to comment.