-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
267 additions
and
32,935 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
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, [email protected] */ | ||
/* w2ui 2.0.0 (4/26/2023, 10:40:17 AM) (c) http://w2ui.com, [email protected] */ | ||
/** | ||
* TODO: | ||
* - remove default styling, only keep w2ui-* styles | ||
|
This file contains 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
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, [email protected] */ | ||
/* w2ui 2.0.0 (4/26/2023, 10:40:17 AM) (c) http://w2ui.com, [email protected] */ | ||
/** | ||
* Part of w2ui 2.0 library | ||
* - Dependencies: w2utils | ||
|
@@ -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 | ||
|
@@ -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 }) | ||
|
@@ -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 | ||
} | ||
|
@@ -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 | ||
|
@@ -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 | ||
} | ||
}) | ||
|
@@ -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, | ||
}) | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.