@mescius/wijmo.react.input 5.20241.10-nightly.d20240618.t020407 → 5.20241.10-nightly.d20240621.t020220
Sign up to get free protection for your applications and to get access to all the features.
- package/es2015-commonjs.js +2 -2
- package/es2015-esm.js +2 -2
- package/es5-esm.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +4 -4
package/es2015-commonjs.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
*
|
3
|
-
* Wijmo Library 5.20241.10-nightly.
|
3
|
+
* Wijmo Library 5.20241.10-nightly.d20240621.t020220
|
4
4
|
* https://developer.mescius.com/wijmo
|
5
5
|
*
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
@@ -11,4 +11,4 @@
|
|
11
11
|
*
|
12
12
|
*/
|
13
13
|
|
14
|
-
"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=require("react"),wijmo_react_base_1=require("@mescius/wijmo.react.base"),React=__importStar(require("react")),ReactDOM=__importStar(require("react-dom")),wjcCore=__importStar(require("@mescius/wijmo")),wjcInput=__importStar(require("@mescius/wijmo.input")),wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){const t=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;t._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}exports.ListBoxMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"]};exports.ListBox=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ListBoxMeta.inputs,events:exports.ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiSelectListBoxMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"checkedItemsChanged","selectedIndexChanged"]};exports.MultiSelectListBox=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectListBoxMeta.inputs,events:exports.MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));exports.DropDownMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"isDroppedDownChanged","isDroppedDownChanging","textChanged"]};exports.ComboBoxMeta={inputs:[...exports.DropDownMeta.inputs,"displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"],events:[...exports.DropDownMeta.events,"formatItem","itemsSourceChanged","selectedIndexChanged"]};exports.ComboBox=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ComboBoxMeta.inputs,events:exports.ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.AutoCompleteMeta={inputs:[...exports.ComboBoxMeta.inputs,"beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"],events:[...exports.ComboBoxMeta.events]};exports.AutoComplete=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.AutoCompleteMeta.inputs,events:exports.AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.CalendarMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"]};exports.Calendar=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CalendarMeta.inputs,events:exports.CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));exports.ColorPickerMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"palette","showAlphaChannel","showColorString","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"valueChanged"]};exports.ColorPicker=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ColorPickerMeta.inputs,events:exports.ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));exports.InputMaskMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"valueChanged"]};exports.InputMask=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputMaskMeta.inputs,events:exports.InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));exports.InputColorMeta={inputs:[...exports.DropDownMeta.inputs,"palette","showAlphaChannel","showColorString","text","value"],events:[...exports.DropDownMeta.events,"valueChanged"]};exports.InputColor=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputColorMeta.inputs,events:exports.InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));exports.MultiSelectMeta={inputs:[...exports.ComboBoxMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"],events:[...exports.ComboBoxMeta.events,"checkedItemsChanged"]};exports.MultiSelect=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectMeta.inputs,events:exports.MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiAutoCompleteMeta={inputs:[...exports.AutoCompleteMeta.inputs,"maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"],events:[...exports.AutoCompleteMeta.events,"selectedItemsChanged"]};exports.MultiAutoComplete=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiAutoCompleteMeta.inputs,events:exports.MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));exports.InputNumberMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"textChanged","valueChanged"]};exports.InputNumber=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputNumberMeta.inputs,events:exports.InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));exports.InputDateMeta={inputs:[...exports.DropDownMeta.inputs,"alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"],events:[...exports.DropDownMeta.events,"rangeChanged","rangeEndChanged","valueChanged"]};exports.InputDate=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateMeta.inputs,events:exports.InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));exports.InputTimeMeta={inputs:[...exports.ComboBoxMeta.inputs,"format","inputType","mask","max","min","step","text","value"],events:[...exports.ComboBoxMeta.events,"valueChanged"]};exports.InputTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputTimeMeta.inputs,events:exports.InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));exports.InputDateTimeMeta={inputs:[...exports.InputDateMeta.inputs,"timeFormat","timeMax","timeMin","timeStep"],events:[...exports.InputDateMeta.events]};exports.InputDateTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateTimeMeta.inputs,events:exports.InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));exports.InputDateRangeMeta={inputs:[...exports.InputDateMeta.inputs],events:[...exports.InputDateMeta.events]};exports.InputDateRange=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateRangeMeta.inputs,events:exports.InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));exports.MenuMeta={inputs:[...exports.ComboBoxMeta.inputs,"closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"],events:[...exports.ComboBoxMeta.events,"itemClicked"]};function _getContextMenuElements(e){const t=[];(wjcCore.isArray(e)?e:[e]).forEach(e=>{if(e){let o=null;if("string"==typeof e)o=document.getElementById(e);else if("object"==typeof e){const t=e.hostElement?e.hostElement:e.current;t&&(o=t instanceof HTMLElement?t:t instanceof wjcCore.Control?t.hostElement:t.control&&t.control instanceof wjcCore.Control?t.control.hostElement:ReactDOM.findDOMNode(t))}o&&t.push(o)}});return t}exports.Menu=react_1.forwardRef((function(e,t){const o=React.useRef({}),r=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MenuMeta.inputs,events:exports.MenuMeta.events,props:e,constructor:wjcInput.Menu,initControl:t=>{updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.listBox.formatItem.addHandler((e,t)=>{if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}});t.textChanged.addHandler(()=>{t.header=t._definedHeader||"";const e=t.selectedItem;if(null!=t.selectedValue&&e&&t.displayMemberPath){let o=null;if(e instanceof _MenuItem){const r=e.itemRoot;o=r?r.innerHTML:e[t.displayMemberPath]}null!=o&&(t.header+=": <b>"+o+"</b>")}})},customProps:{contextMenuOf:(e,t)=>{o.current.contextMenuOf||(o.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";const r=o.current.contextMenuOf;for(let e of r)e.el.removeEventListener("contextmenu",e.handler);o.current.contextMenuOf=[];if(!t)return;const n=_getContextMenuElements(t);for(let t of n){const listener=o=>{if(wjcCore.closest(o.target,"[disabled]"))return;const r=e;if(r&&r.dropDown){o.preventDefault();o.stopPropagation();r.owner=t;r.show(o)}};t.addEventListener("contextmenu",listener);o.current.contextMenuOf.push({el:t,handler:listener})}},value:(e,t)=>{e.selectedValue=t}}});r.wjControl&&(r.wjControl._definedHeader=e.header);updateWjItemTemplateProp(r.wjControl,e);if(r.wjControl&&r.wjControl.itemsSource)for(let e of r.wjControl.itemsSource)if(e instanceof _MenuItem){r.wjControl.listBox.loadList();break}return r.renderResult}));exports.MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};class _MenuItem{constructor(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_init(e){1==this._parent.itemsSource.length&&this._parent.selectedIndex<0&&(this._parent.selectedIndex=0);this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")}updateItem(e){wijmo_react_base_1.selectiveDomUnmount(e);wijmo_react_base_1.selectiveDomRender(this.children,e);this.itemRoot=e}}exports.MenuItem=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:exports.MenuItemMeta.inputs,events:exports.MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},o)}));exports.MenuSeparator=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},o)}));class _MenuSeparator{constructor(e,t){}updateItem(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)}}exports.PopupMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"]};function updatePopupContent(e,t){wijmo_react_base_1.selectiveDomRender(t,e.hostElement)}exports.Popup=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.PopupMeta.inputs,events:exports.PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:t=>{t.removeOnHide=!1;updatePopupContent(t,e.children)}});o.wjControl&&updatePopupContent(o.wjControl,e.children);return o.renderResult}));exports.CollectionViewNavigatorMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"byPage","cv","headerFormat","repeatButtons"],events:[...wijmo_react_base_1.ControlBaseMeta.events]};exports.CollectionViewNavigator=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CollectionViewNavigatorMeta.inputs,events:exports.CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));class ItemTemplate{constructor(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}_updateTemplateItems(){this._templateItems.forEach(e=>{wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(e),e.itemEl)})}_attachToControl(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()}_detachFromControl(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()}_fmtItem(e,t){const o=t.item,r={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(Object.assign({},r,{itemEl:o}));if(wjcCore.isFunction(this.wjItemTemplate)){wijmo_react_base_1.selectiveDomUnmount(o);wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(r),o)}}_getListBox(e){return e instanceof wjcInput.ListBox?e:e.listBox}_destroyTemplateItems(){this._templateItems.forEach(e=>{wijmo_react_base_1.selectiveDomUnmount(e.itemEl)});this._templateItems=[]}_createItemElTpl(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))}}
|
14
|
+
"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=require("react"),wijmo_react_base_1=require("@mescius/wijmo.react.base"),React=__importStar(require("react")),ReactDOM=__importStar(require("react-dom")),wjcCore=__importStar(require("@mescius/wijmo")),wjcInput=__importStar(require("@mescius/wijmo.input")),wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){const t=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;t._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}exports.ListBoxMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"]};exports.ListBox=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ListBoxMeta.inputs,events:exports.ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiSelectListBoxMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"checkedItemsChanged","selectedIndexChanged"]};exports.MultiSelectListBox=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectListBoxMeta.inputs,events:exports.MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));exports.DropDownMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"isDroppedDownChanged","isDroppedDownChanging","textChanged"]};exports.ComboBoxMeta={inputs:[...exports.DropDownMeta.inputs,"caseSensitiveSearch","displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"],events:[...exports.DropDownMeta.events,"formatItem","itemsSourceChanged","selectedIndexChanged"]};exports.ComboBox=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ComboBoxMeta.inputs,events:exports.ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.AutoCompleteMeta={inputs:[...exports.ComboBoxMeta.inputs,"beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"],events:[...exports.ComboBoxMeta.events]};exports.AutoComplete=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.AutoCompleteMeta.inputs,events:exports.AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.CalendarMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"]};exports.Calendar=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CalendarMeta.inputs,events:exports.CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));exports.ColorPickerMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"palette","showAlphaChannel","showColorString","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"valueChanged"]};exports.ColorPicker=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ColorPickerMeta.inputs,events:exports.ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));exports.InputMaskMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"valueChanged"]};exports.InputMask=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputMaskMeta.inputs,events:exports.InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));exports.InputColorMeta={inputs:[...exports.DropDownMeta.inputs,"palette","showAlphaChannel","showColorString","text","value"],events:[...exports.DropDownMeta.events,"valueChanged"]};exports.InputColor=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputColorMeta.inputs,events:exports.InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));exports.MultiSelectMeta={inputs:[...exports.ComboBoxMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"],events:[...exports.ComboBoxMeta.events,"checkedItemsChanged"]};exports.MultiSelect=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectMeta.inputs,events:exports.MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiAutoCompleteMeta={inputs:[...exports.AutoCompleteMeta.inputs,"maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"],events:[...exports.AutoCompleteMeta.events,"selectedItemsChanged"]};exports.MultiAutoComplete=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiAutoCompleteMeta.inputs,events:exports.MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));exports.InputNumberMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"textChanged","valueChanged"]};exports.InputNumber=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputNumberMeta.inputs,events:exports.InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));exports.InputDateMeta={inputs:[...exports.DropDownMeta.inputs,"alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"],events:[...exports.DropDownMeta.events,"rangeChanged","rangeEndChanged","valueChanged"]};exports.InputDate=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateMeta.inputs,events:exports.InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));exports.InputTimeMeta={inputs:[...exports.ComboBoxMeta.inputs,"format","inputType","mask","max","min","step","text","value"],events:[...exports.ComboBoxMeta.events,"valueChanged"]};exports.InputTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputTimeMeta.inputs,events:exports.InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));exports.InputDateTimeMeta={inputs:[...exports.InputDateMeta.inputs,"timeFormat","timeMax","timeMin","timeStep"],events:[...exports.InputDateMeta.events]};exports.InputDateTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateTimeMeta.inputs,events:exports.InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));exports.InputDateRangeMeta={inputs:[...exports.InputDateMeta.inputs],events:[...exports.InputDateMeta.events]};exports.InputDateRange=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateRangeMeta.inputs,events:exports.InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));exports.MenuMeta={inputs:[...exports.ComboBoxMeta.inputs,"closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"],events:[...exports.ComboBoxMeta.events,"itemClicked"]};function _getContextMenuElements(e){const t=[];(wjcCore.isArray(e)?e:[e]).forEach(e=>{if(e){let o=null;if("string"==typeof e)o=document.getElementById(e);else if("object"==typeof e){const t=e.hostElement?e.hostElement:e.current;t&&(o=t instanceof HTMLElement?t:t instanceof wjcCore.Control?t.hostElement:t.control&&t.control instanceof wjcCore.Control?t.control.hostElement:ReactDOM.findDOMNode(t))}o&&t.push(o)}});return t}exports.Menu=react_1.forwardRef((function(e,t){const o=React.useRef({}),updateHeader=e=>{e.header=e._definedHeader||"";const t=e.selectedItem;if(null!=e.selectedValue&&t&&e.displayMemberPath){let o=null;if(t instanceof _MenuItem){const r=t.itemRoot;o=r?r.innerHTML:t[e.displayMemberPath]}null!=o&&(e.header+=": <b>"+o+"</b>")}},r=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MenuMeta.inputs,events:exports.MenuMeta.events,props:e,constructor:wjcInput.Menu,prePropsInit:t=>{t._definedHeader=e.header;t.listBox.formatItem.addHandler((e,t)=>{if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}});queueMicrotask(()=>updateHeader(t))},initControl:t=>{updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.selectedIndexChanged.addHandler(()=>{updateHeader(t)});if(t.itemsSource&&t.itemsSource.length){Array.from(t.itemsSource).find(e=>e instanceof _MenuItem);t.itemsSource[0]instanceof _MenuItem&&1==t.itemsSource.length&&t.selectedIndex<0&&(t.selectedIndex=0)}},customProps:{header:(e,t)=>{if(e._definedHeader!=t){e._definedHeader=t;e.header=t;updateHeader(e)}},contextMenuOf:(e,t)=>{o.current.contextMenuOf||(o.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";const r=o.current.contextMenuOf;for(let e of r)e.el.removeEventListener("contextmenu",e.handler);o.current.contextMenuOf=[];if(!t)return;const n=_getContextMenuElements(t);for(let t of n){const listener=o=>{if(wjcCore.closest(o.target,"[disabled]"))return;const r=e;if(r&&r.dropDown){o.preventDefault();o.stopPropagation();r.owner=t;r.show(o)}};t.addEventListener("contextmenu",listener);o.current.contextMenuOf.push({el:t,handler:listener})}},value:(e,t)=>{e.selectedValue=t;updateHeader(e)}}});r.wjControl&&(r.wjControl._definedHeader=e.header);updateWjItemTemplateProp(r.wjControl,e);if(r.wjControl&&r.wjControl.itemsSource)for(let e of r.wjControl.itemsSource)if(e instanceof _MenuItem){r.wjControl.listBox.loadList();break}return r.renderResult}));exports.MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};class _MenuItem{constructor(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_init(e){this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")}updateItem(e){wijmo_react_base_1.selectiveDomUnmount(e);wijmo_react_base_1.selectiveDomRender(this.children,e);this.itemRoot=e}}exports.MenuItem=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:exports.MenuItemMeta.inputs,events:exports.MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},o)}));exports.MenuSeparator=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},o)}));class _MenuSeparator{constructor(e,t){}updateItem(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)}}exports.PopupMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"],events:[...wijmo_react_base_1.ControlBaseMeta.events,"dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"]};function updatePopupContent(e,t){wijmo_react_base_1.selectiveDomRender(t,e.hostElement)}exports.Popup=react_1.forwardRef((function(e,t){const o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.PopupMeta.inputs,events:exports.PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:t=>{t.removeOnHide=!1;updatePopupContent(t,e.children)}});o.wjControl&&updatePopupContent(o.wjControl,e.children);return o.renderResult}));exports.CollectionViewNavigatorMeta={inputs:[...wijmo_react_base_1.ControlBaseMeta.inputs,"byPage","cv","headerFormat","repeatButtons"],events:[...wijmo_react_base_1.ControlBaseMeta.events]};exports.CollectionViewNavigator=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CollectionViewNavigatorMeta.inputs,events:exports.CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));class ItemTemplate{constructor(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}_updateTemplateItems(){this._templateItems.forEach(e=>{wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(e),e.itemEl)})}_attachToControl(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()}_detachFromControl(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()}_fmtItem(e,t){const o=t.item,r={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(Object.assign({},r,{itemEl:o}));if(wjcCore.isFunction(this.wjItemTemplate)){wijmo_react_base_1.selectiveDomUnmount(o);wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(r),o)}}_getListBox(e){return e instanceof wjcInput.ListBox?e:e.listBox}_destroyTemplateItems(){this._templateItems.forEach(e=>{wijmo_react_base_1.selectiveDomUnmount(e.itemEl)});this._templateItems=[]}_createItemElTpl(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))}}
|
package/es2015-esm.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
*
|
3
|
-
* Wijmo Library 5.20241.10-nightly.
|
3
|
+
* Wijmo Library 5.20241.10-nightly.d20240621.t020220
|
4
4
|
* https://developer.mescius.com/wijmo
|
5
5
|
*
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
@@ -11,4 +11,4 @@
|
|
11
11
|
*
|
12
12
|
*/
|
13
13
|
|
14
|
-
import{forwardRef}from"react";import{ControlBaseMeta,selectiveDomRender,selectiveDomUnmount,useWjComponentBase,useWjComponentChildBase}from"@mescius/wijmo.react.base";import*as React from"react";import*as ReactDOM from"react-dom";import*as wjcCore from"@mescius/wijmo";import*as wjcInput from"@mescius/wijmo.input";const wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){const t=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;t._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}export const ListBoxMeta={inputs:[...ControlBaseMeta.inputs,"caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"],events:[...ControlBaseMeta.events,"checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"]};export const ListBox=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:ListBoxMeta.inputs,events:ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const MultiSelectListBoxMeta={inputs:[...ControlBaseMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"],events:[...ControlBaseMeta.events,"checkedItemsChanged","selectedIndexChanged"]};export const MultiSelectListBox=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiSelectListBoxMeta.inputs,events:MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));export const DropDownMeta={inputs:[...ControlBaseMeta.inputs,"autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"],events:[...ControlBaseMeta.events,"isDroppedDownChanged","isDroppedDownChanging","textChanged"]};export const ComboBoxMeta={inputs:[...DropDownMeta.inputs,"displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"],events:[...DropDownMeta.events,"formatItem","itemsSourceChanged","selectedIndexChanged"]};export const ComboBox=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:ComboBoxMeta.inputs,events:ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const AutoCompleteMeta={inputs:[...ComboBoxMeta.inputs,"beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"],events:[...ComboBoxMeta.events]};export const AutoComplete=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:AutoCompleteMeta.inputs,events:AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const CalendarMeta={inputs:[...ControlBaseMeta.inputs,"displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"],events:[...ControlBaseMeta.events,"displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"]};export const Calendar=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CalendarMeta.inputs,events:CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));export const ColorPickerMeta={inputs:[...ControlBaseMeta.inputs,"palette","showAlphaChannel","showColorString","value"],events:[...ControlBaseMeta.events,"valueChanged"]};export const ColorPicker=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:ColorPickerMeta.inputs,events:ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));export const InputMaskMeta={inputs:[...ControlBaseMeta.inputs,"inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"],events:[...ControlBaseMeta.events,"valueChanged"]};export const InputMask=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputMaskMeta.inputs,events:InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));export const InputColorMeta={inputs:[...DropDownMeta.inputs,"palette","showAlphaChannel","showColorString","text","value"],events:[...DropDownMeta.events,"valueChanged"]};export const InputColor=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputColorMeta.inputs,events:InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));export const MultiSelectMeta={inputs:[...ComboBoxMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"],events:[...ComboBoxMeta.events,"checkedItemsChanged"]};export const MultiSelect=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:MultiSelectMeta.inputs,events:MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const MultiAutoCompleteMeta={inputs:[...AutoCompleteMeta.inputs,"maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"],events:[...AutoCompleteMeta.events,"selectedItemsChanged"]};export const MultiAutoComplete=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiAutoCompleteMeta.inputs,events:MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));export const InputNumberMeta={inputs:[...ControlBaseMeta.inputs,"format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"],events:[...ControlBaseMeta.events,"textChanged","valueChanged"]};export const InputNumber=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputNumberMeta.inputs,events:InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));export const InputDateMeta={inputs:[...DropDownMeta.inputs,"alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"],events:[...DropDownMeta.events,"rangeChanged","rangeEndChanged","valueChanged"]};export const InputDate=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateMeta.inputs,events:InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));export const InputTimeMeta={inputs:[...ComboBoxMeta.inputs,"format","inputType","mask","max","min","step","text","value"],events:[...ComboBoxMeta.events,"valueChanged"]};export const InputTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputTimeMeta.inputs,events:InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));export const InputDateTimeMeta={inputs:[...InputDateMeta.inputs,"timeFormat","timeMax","timeMin","timeStep"],events:[...InputDateMeta.events]};export const InputDateTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateTimeMeta.inputs,events:InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));export const InputDateRangeMeta={inputs:[...InputDateMeta.inputs],events:[...InputDateMeta.events]};export const InputDateRange=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateRangeMeta.inputs,events:InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));export const MenuMeta={inputs:[...ComboBoxMeta.inputs,"closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"],events:[...ComboBoxMeta.events,"itemClicked"]};function _getContextMenuElements(e){const t=[];(wjcCore.isArray(e)?e:[e]).forEach(e=>{if(e){let n=null;if("string"==typeof e)n=document.getElementById(e);else if("object"==typeof e){const t=e.hostElement?e.hostElement:e.current;t&&(n=t instanceof HTMLElement?t:t instanceof wjcCore.Control?t.hostElement:t.control&&t.control instanceof wjcCore.Control?t.control.hostElement:ReactDOM.findDOMNode(t))}n&&t.push(n)}});return t}export const Menu=forwardRef((function(e,t){const n=React.useRef({}),o=useWjComponentBase({ref:t,properties:MenuMeta.inputs,events:MenuMeta.events,props:e,constructor:wjcInput.Menu,initControl:t=>{updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.listBox.formatItem.addHandler((e,t)=>{if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}});t.textChanged.addHandler(()=>{t.header=t._definedHeader||"";const e=t.selectedItem;if(null!=t.selectedValue&&e&&t.displayMemberPath){let n=null;if(e instanceof _MenuItem){const o=e.itemRoot;n=o?o.innerHTML:e[t.displayMemberPath]}null!=n&&(t.header+=": <b>"+n+"</b>")}})},customProps:{contextMenuOf:(e,t)=>{n.current.contextMenuOf||(n.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";const o=n.current.contextMenuOf;for(let e of o)e.el.removeEventListener("contextmenu",e.handler);n.current.contextMenuOf=[];if(!t)return;const r=_getContextMenuElements(t);for(let t of r){const listener=n=>{if(wjcCore.closest(n.target,"[disabled]"))return;const o=e;if(o&&o.dropDown){n.preventDefault();n.stopPropagation();o.owner=t;o.show(n)}};t.addEventListener("contextmenu",listener);n.current.contextMenuOf.push({el:t,handler:listener})}},value:(e,t)=>{e.selectedValue=t}}});o.wjControl&&(o.wjControl._definedHeader=e.header);updateWjItemTemplateProp(o.wjControl,e);if(o.wjControl&&o.wjControl.itemsSource)for(let e of o.wjControl.itemsSource)if(e instanceof _MenuItem){o.wjControl.listBox.loadList();break}return o.renderResult}));export const MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};class _MenuItem{constructor(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_init(e){1==this._parent.itemsSource.length&&this._parent.selectedIndex<0&&(this._parent.selectedIndex=0);this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")}updateItem(e){selectiveDomUnmount(e);selectiveDomRender(this.children,e);this.itemRoot=e}}export const MenuItem=forwardRef((function(e,t){const n=useWjComponentChildBase({ref:t,properties:MenuItemMeta.inputs,events:MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},n)}));export const MenuSeparator=forwardRef((function(e,t){const n=useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},n)}));class _MenuSeparator{constructor(e,t){}updateItem(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)}}export const PopupMeta={inputs:[...ControlBaseMeta.inputs,"content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"],events:[...ControlBaseMeta.events,"dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"]};function updatePopupContent(e,t){selectiveDomRender(t,e.hostElement)}export const Popup=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:PopupMeta.inputs,events:PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:t=>{t.removeOnHide=!1;updatePopupContent(t,e.children)}});n.wjControl&&updatePopupContent(n.wjControl,e.children);return n.renderResult}));export const CollectionViewNavigatorMeta={inputs:[...ControlBaseMeta.inputs,"byPage","cv","headerFormat","repeatButtons"],events:[...ControlBaseMeta.events]};export const CollectionViewNavigator=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CollectionViewNavigatorMeta.inputs,events:CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));class ItemTemplate{constructor(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}_updateTemplateItems(){this._templateItems.forEach(e=>{selectiveDomRender(this._createItemElTpl(e),e.itemEl)})}_attachToControl(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()}_detachFromControl(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()}_fmtItem(e,t){const n=t.item,o={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(Object.assign({},o,{itemEl:n}));if(wjcCore.isFunction(this.wjItemTemplate)){selectiveDomUnmount(n);selectiveDomRender(this._createItemElTpl(o),n)}}_getListBox(e){return e instanceof wjcInput.ListBox?e:e.listBox}_destroyTemplateItems(){this._templateItems.forEach(e=>{selectiveDomUnmount(e.itemEl)});this._templateItems=[]}_createItemElTpl(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))}}
|
14
|
+
import{forwardRef}from"react";import{ControlBaseMeta,selectiveDomRender,selectiveDomUnmount,useWjComponentBase,useWjComponentChildBase}from"@mescius/wijmo.react.base";import*as React from"react";import*as ReactDOM from"react-dom";import*as wjcCore from"@mescius/wijmo";import*as wjcInput from"@mescius/wijmo.input";const wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){const t=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;t._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}export const ListBoxMeta={inputs:[...ControlBaseMeta.inputs,"caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"],events:[...ControlBaseMeta.events,"checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"]};export const ListBox=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:ListBoxMeta.inputs,events:ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const MultiSelectListBoxMeta={inputs:[...ControlBaseMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"],events:[...ControlBaseMeta.events,"checkedItemsChanged","selectedIndexChanged"]};export const MultiSelectListBox=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiSelectListBoxMeta.inputs,events:MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));export const DropDownMeta={inputs:[...ControlBaseMeta.inputs,"autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"],events:[...ControlBaseMeta.events,"isDroppedDownChanged","isDroppedDownChanging","textChanged"]};export const ComboBoxMeta={inputs:[...DropDownMeta.inputs,"caseSensitiveSearch","displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"],events:[...DropDownMeta.events,"formatItem","itemsSourceChanged","selectedIndexChanged"]};export const ComboBox=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:ComboBoxMeta.inputs,events:ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const AutoCompleteMeta={inputs:[...ComboBoxMeta.inputs,"beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"],events:[...ComboBoxMeta.events]};export const AutoComplete=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:AutoCompleteMeta.inputs,events:AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const CalendarMeta={inputs:[...ControlBaseMeta.inputs,"displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"],events:[...ControlBaseMeta.events,"displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"]};export const Calendar=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CalendarMeta.inputs,events:CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));export const ColorPickerMeta={inputs:[...ControlBaseMeta.inputs,"palette","showAlphaChannel","showColorString","value"],events:[...ControlBaseMeta.events,"valueChanged"]};export const ColorPicker=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:ColorPickerMeta.inputs,events:ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));export const InputMaskMeta={inputs:[...ControlBaseMeta.inputs,"inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"],events:[...ControlBaseMeta.events,"valueChanged"]};export const InputMask=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputMaskMeta.inputs,events:InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));export const InputColorMeta={inputs:[...DropDownMeta.inputs,"palette","showAlphaChannel","showColorString","text","value"],events:[...DropDownMeta.events,"valueChanged"]};export const InputColor=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputColorMeta.inputs,events:InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));export const MultiSelectMeta={inputs:[...ComboBoxMeta.inputs,"caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"],events:[...ComboBoxMeta.events,"checkedItemsChanged"]};export const MultiSelect=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:MultiSelectMeta.inputs,events:MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:t=>{updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export const MultiAutoCompleteMeta={inputs:[...AutoCompleteMeta.inputs,"maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"],events:[...AutoCompleteMeta.events,"selectedItemsChanged"]};export const MultiAutoComplete=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiAutoCompleteMeta.inputs,events:MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));export const InputNumberMeta={inputs:[...ControlBaseMeta.inputs,"format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"],events:[...ControlBaseMeta.events,"textChanged","valueChanged"]};export const InputNumber=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputNumberMeta.inputs,events:InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));export const InputDateMeta={inputs:[...DropDownMeta.inputs,"alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"],events:[...DropDownMeta.events,"rangeChanged","rangeEndChanged","valueChanged"]};export const InputDate=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateMeta.inputs,events:InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));export const InputTimeMeta={inputs:[...ComboBoxMeta.inputs,"format","inputType","mask","max","min","step","text","value"],events:[...ComboBoxMeta.events,"valueChanged"]};export const InputTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputTimeMeta.inputs,events:InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));export const InputDateTimeMeta={inputs:[...InputDateMeta.inputs,"timeFormat","timeMax","timeMin","timeStep"],events:[...InputDateMeta.events]};export const InputDateTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateTimeMeta.inputs,events:InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));export const InputDateRangeMeta={inputs:[...InputDateMeta.inputs],events:[...InputDateMeta.events]};export const InputDateRange=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateRangeMeta.inputs,events:InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));export const MenuMeta={inputs:[...ComboBoxMeta.inputs,"closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"],events:[...ComboBoxMeta.events,"itemClicked"]};function _getContextMenuElements(e){const t=[];(wjcCore.isArray(e)?e:[e]).forEach(e=>{if(e){let n=null;if("string"==typeof e)n=document.getElementById(e);else if("object"==typeof e){const t=e.hostElement?e.hostElement:e.current;t&&(n=t instanceof HTMLElement?t:t instanceof wjcCore.Control?t.hostElement:t.control&&t.control instanceof wjcCore.Control?t.control.hostElement:ReactDOM.findDOMNode(t))}n&&t.push(n)}});return t}export const Menu=forwardRef((function(e,t){const n=React.useRef({}),updateHeader=e=>{e.header=e._definedHeader||"";const t=e.selectedItem;if(null!=e.selectedValue&&t&&e.displayMemberPath){let n=null;if(t instanceof _MenuItem){const o=t.itemRoot;n=o?o.innerHTML:t[e.displayMemberPath]}null!=n&&(e.header+=": <b>"+n+"</b>")}},o=useWjComponentBase({ref:t,properties:MenuMeta.inputs,events:MenuMeta.events,props:e,constructor:wjcInput.Menu,prePropsInit:t=>{t._definedHeader=e.header;t.listBox.formatItem.addHandler((e,t)=>{if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}});queueMicrotask(()=>updateHeader(t))},initControl:t=>{updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.selectedIndexChanged.addHandler(()=>{updateHeader(t)});if(t.itemsSource&&t.itemsSource.length){Array.from(t.itemsSource).find(e=>e instanceof _MenuItem);t.itemsSource[0]instanceof _MenuItem&&1==t.itemsSource.length&&t.selectedIndex<0&&(t.selectedIndex=0)}},customProps:{header:(e,t)=>{if(e._definedHeader!=t){e._definedHeader=t;e.header=t;updateHeader(e)}},contextMenuOf:(e,t)=>{n.current.contextMenuOf||(n.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";const o=n.current.contextMenuOf;for(let e of o)e.el.removeEventListener("contextmenu",e.handler);n.current.contextMenuOf=[];if(!t)return;const r=_getContextMenuElements(t);for(let t of r){const listener=n=>{if(wjcCore.closest(n.target,"[disabled]"))return;const o=e;if(o&&o.dropDown){n.preventDefault();n.stopPropagation();o.owner=t;o.show(n)}};t.addEventListener("contextmenu",listener);n.current.contextMenuOf.push({el:t,handler:listener})}},value:(e,t)=>{e.selectedValue=t;updateHeader(e)}}});o.wjControl&&(o.wjControl._definedHeader=e.header);updateWjItemTemplateProp(o.wjControl,e);if(o.wjControl&&o.wjControl.itemsSource)for(let e of o.wjControl.itemsSource)if(e instanceof _MenuItem){o.wjControl.listBox.loadList();break}return o.renderResult}));export const MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};class _MenuItem{constructor(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_init(e){this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")}updateItem(e){selectiveDomUnmount(e);selectiveDomRender(this.children,e);this.itemRoot=e}}export const MenuItem=forwardRef((function(e,t){const n=useWjComponentChildBase({ref:t,properties:MenuItemMeta.inputs,events:MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},n)}));export const MenuSeparator=forwardRef((function(e,t){const n=useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return Object.assign({$_wjComponent:!0},n)}));class _MenuSeparator{constructor(e,t){}updateItem(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)}}export const PopupMeta={inputs:[...ControlBaseMeta.inputs,"content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"],events:[...ControlBaseMeta.events,"dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"]};function updatePopupContent(e,t){selectiveDomRender(t,e.hostElement)}export const Popup=forwardRef((function(e,t){const n=useWjComponentBase({ref:t,properties:PopupMeta.inputs,events:PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:t=>{t.removeOnHide=!1;updatePopupContent(t,e.children)}});n.wjControl&&updatePopupContent(n.wjControl,e.children);return n.renderResult}));export const CollectionViewNavigatorMeta={inputs:[...ControlBaseMeta.inputs,"byPage","cv","headerFormat","repeatButtons"],events:[...ControlBaseMeta.events]};export const CollectionViewNavigator=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CollectionViewNavigatorMeta.inputs,events:CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));class ItemTemplate{constructor(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}_updateTemplateItems(){this._templateItems.forEach(e=>{selectiveDomRender(this._createItemElTpl(e),e.itemEl)})}_attachToControl(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()}_detachFromControl(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()}_fmtItem(e,t){const n=t.item,o={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(Object.assign({},o,{itemEl:n}));if(wjcCore.isFunction(this.wjItemTemplate)){selectiveDomUnmount(n);selectiveDomRender(this._createItemElTpl(o),n)}}_getListBox(e){return e instanceof wjcInput.ListBox?e:e.listBox}_destroyTemplateItems(){this._templateItems.forEach(e=>{selectiveDomUnmount(e.itemEl)});this._templateItems=[]}_createItemElTpl(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))}}
|
package/es5-esm.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
*
|
3
|
-
* Wijmo Library 5.20241.10-nightly.
|
3
|
+
* Wijmo Library 5.20241.10-nightly.d20240621.t020220
|
4
4
|
* https://developer.mescius.com/wijmo
|
5
5
|
*
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
@@ -11,4 +11,4 @@
|
|
11
11
|
*
|
12
12
|
*/
|
13
13
|
|
14
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)};import{forwardRef}from"react";import{ControlBaseMeta,selectiveDomRender,selectiveDomUnmount,useWjComponentBase,useWjComponentChildBase}from"@mescius/wijmo.react.base";import*as React from"react";import*as ReactDOM from"react-dom";import*as wjcCore from"@mescius/wijmo";import*as wjcInput from"@mescius/wijmo.input";var wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){var n=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;n._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}export var ListBoxMeta={inputs:ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"]),events:ControlBaseMeta.events.concat(["checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"])};export var ListBox=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:ListBoxMeta.inputs,events:ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var MultiSelectListBoxMeta={inputs:ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"]),events:ControlBaseMeta.events.concat(["checkedItemsChanged","selectedIndexChanged"])};export var MultiSelectListBox=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiSelectListBoxMeta.inputs,events:MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));export var DropDownMeta={inputs:ControlBaseMeta.inputs.concat(["autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"]),events:ControlBaseMeta.events.concat(["isDroppedDownChanged","isDroppedDownChanging","textChanged"])};export var ComboBoxMeta={inputs:DropDownMeta.inputs.concat(["displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"]),events:DropDownMeta.events.concat(["formatItem","itemsSourceChanged","selectedIndexChanged"])};export var ComboBox=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:ComboBoxMeta.inputs,events:ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var AutoCompleteMeta={inputs:ComboBoxMeta.inputs.concat(["beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"]),events:ComboBoxMeta.events.slice()};export var AutoComplete=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:AutoCompleteMeta.inputs,events:AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var CalendarMeta={inputs:ControlBaseMeta.inputs.concat(["displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"]),events:ControlBaseMeta.events.concat(["displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"])};export var Calendar=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CalendarMeta.inputs,events:CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));export var ColorPickerMeta={inputs:ControlBaseMeta.inputs.concat(["palette","showAlphaChannel","showColorString","value"]),events:ControlBaseMeta.events.concat(["valueChanged"])};export var ColorPicker=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:ColorPickerMeta.inputs,events:ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));export var InputMaskMeta={inputs:ControlBaseMeta.inputs.concat(["inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"]),events:ControlBaseMeta.events.concat(["valueChanged"])};export var InputMask=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputMaskMeta.inputs,events:InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));export var InputColorMeta={inputs:DropDownMeta.inputs.concat(["palette","showAlphaChannel","showColorString","text","value"]),events:DropDownMeta.events.concat(["valueChanged"])};export var InputColor=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputColorMeta.inputs,events:InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));export var MultiSelectMeta={inputs:ComboBoxMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"]),events:ComboBoxMeta.events.concat(["checkedItemsChanged"])};export var MultiSelect=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:MultiSelectMeta.inputs,events:MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var MultiAutoCompleteMeta={inputs:AutoCompleteMeta.inputs.concat(["maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"]),events:AutoCompleteMeta.events.concat(["selectedItemsChanged"])};export var MultiAutoComplete=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiAutoCompleteMeta.inputs,events:MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));export var InputNumberMeta={inputs:ControlBaseMeta.inputs.concat(["format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"]),events:ControlBaseMeta.events.concat(["textChanged","valueChanged"])};export var InputNumber=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputNumberMeta.inputs,events:InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));export var InputDateMeta={inputs:DropDownMeta.inputs.concat(["alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"]),events:DropDownMeta.events.concat(["rangeChanged","rangeEndChanged","valueChanged"])};export var InputDate=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateMeta.inputs,events:InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));export var InputTimeMeta={inputs:ComboBoxMeta.inputs.concat(["format","inputType","mask","max","min","step","text","value"]),events:ComboBoxMeta.events.concat(["valueChanged"])};export var InputTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputTimeMeta.inputs,events:InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));export var InputDateTimeMeta={inputs:InputDateMeta.inputs.concat(["timeFormat","timeMax","timeMin","timeStep"]),events:InputDateMeta.events.slice()};export var InputDateTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateTimeMeta.inputs,events:InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));export var InputDateRangeMeta={inputs:InputDateMeta.inputs.slice(),events:InputDateMeta.events.slice()};export var InputDateRange=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateRangeMeta.inputs,events:InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));export var MenuMeta={inputs:ComboBoxMeta.inputs.concat(["closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"]),events:ComboBoxMeta.events.concat(["itemClicked"])};function _getContextMenuElements(e){var t=[];(wjcCore.isArray(e)?e:[e]).forEach((function(e){if(e){var n=null;if("string"==typeof e)n=document.getElementById(e);else if("object"==typeof e){var o=e.hostElement?e.hostElement:e.current;o&&(n=o instanceof HTMLElement?o:o instanceof wjcCore.Control?o.hostElement:o.control&&o.control instanceof wjcCore.Control?o.control.hostElement:ReactDOM.findDOMNode(o))}n&&t.push(n)}}));return t}export var Menu=forwardRef((function(e,t){var n=React.useRef({}),o=useWjComponentBase({ref:t,properties:MenuMeta.inputs,events:MenuMeta.events,props:e,constructor:wjcInput.Menu,initControl:function(t){updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.listBox.formatItem.addHandler((function(e,t){if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}}));t.textChanged.addHandler((function(){t.header=t._definedHeader||"";var e=t.selectedItem;if(null!=t.selectedValue&&e&&t.displayMemberPath){var n=null;if(e instanceof _MenuItem){var o=e.itemRoot;n=o?o.innerHTML:e[t.displayMemberPath]}null!=n&&(t.header+=": <b>"+n+"</b>")}}))},customProps:{contextMenuOf:function(e,t){n.current.contextMenuOf||(n.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";for(var o=0,r=n.current.contextMenuOf;o<r.length;o++){var a=r[o];a.el.removeEventListener("contextmenu",a.handler)}n.current.contextMenuOf=[];if(t)for(var _loop_1=function(t){var listener=function(n){if(!wjcCore.closest(n.target,"[disabled]")){var o=e;if(o&&o.dropDown){n.preventDefault();n.stopPropagation();o.owner=t;o.show(n)}}};t.addEventListener("contextmenu",listener);n.current.contextMenuOf.push({el:t,handler:listener})},s=0,p=_getContextMenuElements(t);s<p.length;s++){_loop_1(p[s])}},value:function(e,t){e.selectedValue=t}}});o.wjControl&&(o.wjControl._definedHeader=e.header);updateWjItemTemplateProp(o.wjControl,e);if(o.wjControl&&o.wjControl.itemsSource)for(var r=0,a=o.wjControl.itemsSource;r<a.length;r++){if(a[r]instanceof _MenuItem){o.wjControl.listBox.loadList();break}}return o.renderResult}));export var MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};var _MenuItem=function(){function _MenuItem(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_MenuItem.prototype._init=function(e){1==this._parent.itemsSource.length&&this._parent.selectedIndex<0&&(this._parent.selectedIndex=0);this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")};_MenuItem.prototype.updateItem=function(e){selectiveDomUnmount(e);selectiveDomRender(this.children,e);this.itemRoot=e};return _MenuItem}();export var MenuItem=forwardRef((function(e,t){var n=useWjComponentChildBase({ref:t,properties:MenuItemMeta.inputs,events:MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},n)}));export var MenuSeparator=forwardRef((function(e,t){var n=useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},n)}));var _MenuSeparator=function(){function _MenuSeparator(e,t){}_MenuSeparator.prototype.updateItem=function(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)};return _MenuSeparator}();export var PopupMeta={inputs:ControlBaseMeta.inputs.concat(["content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"]),events:ControlBaseMeta.events.concat(["dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"])};function updatePopupContent(e,t){selectiveDomRender(t,e.hostElement)}export var Popup=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:PopupMeta.inputs,events:PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:function(t){t.removeOnHide=!1;updatePopupContent(t,e.children)}});n.wjControl&&updatePopupContent(n.wjControl,e.children);return n.renderResult}));export var CollectionViewNavigatorMeta={inputs:ControlBaseMeta.inputs.concat(["byPage","cv","headerFormat","repeatButtons"]),events:ControlBaseMeta.events.slice()};export var CollectionViewNavigator=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CollectionViewNavigatorMeta.inputs,events:CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));var ItemTemplate=function(){function ItemTemplate(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}ItemTemplate.prototype._updateTemplateItems=function(){var e=this;this._templateItems.forEach((function(t){selectiveDomRender(e._createItemElTpl(t),t.itemEl)}))};ItemTemplate.prototype._attachToControl=function(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()};ItemTemplate.prototype._detachFromControl=function(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()};ItemTemplate.prototype._fmtItem=function(e,t){var n=t.item,o={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(__assign({},o,{itemEl:n}));if(wjcCore.isFunction(this.wjItemTemplate)){selectiveDomUnmount(n);selectiveDomRender(this._createItemElTpl(o),n)}};ItemTemplate.prototype._getListBox=function(e){return e instanceof wjcInput.ListBox?e:e.listBox};ItemTemplate.prototype._destroyTemplateItems=function(){this._templateItems.forEach((function(e){selectiveDomUnmount(e.itemEl)}));this._templateItems=[]};ItemTemplate.prototype._createItemElTpl=function(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))};return ItemTemplate}();
|
14
|
+
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)};import{forwardRef}from"react";import{ControlBaseMeta,selectiveDomRender,selectiveDomUnmount,useWjComponentBase,useWjComponentChildBase}from"@mescius/wijmo.react.base";import*as React from"react";import*as ReactDOM from"react-dom";import*as wjcCore from"@mescius/wijmo";import*as wjcInput from"@mescius/wijmo.input";var wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){var n=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;n._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}export var ListBoxMeta={inputs:ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"]),events:ControlBaseMeta.events.concat(["checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"])};export var ListBox=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:ListBoxMeta.inputs,events:ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var MultiSelectListBoxMeta={inputs:ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"]),events:ControlBaseMeta.events.concat(["checkedItemsChanged","selectedIndexChanged"])};export var MultiSelectListBox=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiSelectListBoxMeta.inputs,events:MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));export var DropDownMeta={inputs:ControlBaseMeta.inputs.concat(["autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"]),events:ControlBaseMeta.events.concat(["isDroppedDownChanged","isDroppedDownChanging","textChanged"])};export var ComboBoxMeta={inputs:DropDownMeta.inputs.concat(["caseSensitiveSearch","displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"]),events:DropDownMeta.events.concat(["formatItem","itemsSourceChanged","selectedIndexChanged"])};export var ComboBox=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:ComboBoxMeta.inputs,events:ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var AutoCompleteMeta={inputs:ComboBoxMeta.inputs.concat(["beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"]),events:ComboBoxMeta.events.slice()};export var AutoComplete=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:AutoCompleteMeta.inputs,events:AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var CalendarMeta={inputs:ControlBaseMeta.inputs.concat(["displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"]),events:ControlBaseMeta.events.concat(["displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"])};export var Calendar=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CalendarMeta.inputs,events:CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));export var ColorPickerMeta={inputs:ControlBaseMeta.inputs.concat(["palette","showAlphaChannel","showColorString","value"]),events:ControlBaseMeta.events.concat(["valueChanged"])};export var ColorPicker=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:ColorPickerMeta.inputs,events:ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));export var InputMaskMeta={inputs:ControlBaseMeta.inputs.concat(["inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"]),events:ControlBaseMeta.events.concat(["valueChanged"])};export var InputMask=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputMaskMeta.inputs,events:InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));export var InputColorMeta={inputs:DropDownMeta.inputs.concat(["palette","showAlphaChannel","showColorString","text","value"]),events:DropDownMeta.events.concat(["valueChanged"])};export var InputColor=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputColorMeta.inputs,events:InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));export var MultiSelectMeta={inputs:ComboBoxMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"]),events:ComboBoxMeta.events.concat(["checkedItemsChanged"])};export var MultiSelect=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:MultiSelectMeta.inputs,events:MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(n.wjControl,e);return n.renderResult}));export var MultiAutoCompleteMeta={inputs:AutoCompleteMeta.inputs.concat(["maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"]),events:AutoCompleteMeta.events.concat(["selectedItemsChanged"])};export var MultiAutoComplete=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:MultiAutoCompleteMeta.inputs,events:MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));export var InputNumberMeta={inputs:ControlBaseMeta.inputs.concat(["format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"]),events:ControlBaseMeta.events.concat(["textChanged","valueChanged"])};export var InputNumber=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputNumberMeta.inputs,events:InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));export var InputDateMeta={inputs:DropDownMeta.inputs.concat(["alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"]),events:DropDownMeta.events.concat(["rangeChanged","rangeEndChanged","valueChanged"])};export var InputDate=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateMeta.inputs,events:InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));export var InputTimeMeta={inputs:ComboBoxMeta.inputs.concat(["format","inputType","mask","max","min","step","text","value"]),events:ComboBoxMeta.events.concat(["valueChanged"])};export var InputTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputTimeMeta.inputs,events:InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));export var InputDateTimeMeta={inputs:InputDateMeta.inputs.concat(["timeFormat","timeMax","timeMin","timeStep"]),events:InputDateMeta.events.slice()};export var InputDateTime=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateTimeMeta.inputs,events:InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));export var InputDateRangeMeta={inputs:InputDateMeta.inputs.slice(),events:InputDateMeta.events.slice()};export var InputDateRange=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:InputDateRangeMeta.inputs,events:InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));export var MenuMeta={inputs:ComboBoxMeta.inputs.concat(["closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"]),events:ComboBoxMeta.events.concat(["itemClicked"])};function _getContextMenuElements(e){var t=[];(wjcCore.isArray(e)?e:[e]).forEach((function(e){if(e){var n=null;if("string"==typeof e)n=document.getElementById(e);else if("object"==typeof e){var o=e.hostElement?e.hostElement:e.current;o&&(n=o instanceof HTMLElement?o:o instanceof wjcCore.Control?o.hostElement:o.control&&o.control instanceof wjcCore.Control?o.control.hostElement:ReactDOM.findDOMNode(o))}n&&t.push(n)}}));return t}export var Menu=forwardRef((function(e,t){var n=React.useRef({}),updateHeader=function(e){e.header=e._definedHeader||"";var t=e.selectedItem;if(null!=e.selectedValue&&t&&e.displayMemberPath){var n=null;if(t instanceof _MenuItem){var o=t.itemRoot;n=o?o.innerHTML:t[e.displayMemberPath]}null!=n&&(e.header+=": <b>"+n+"</b>")}},o=useWjComponentBase({ref:t,properties:MenuMeta.inputs,events:MenuMeta.events,props:e,constructor:wjcInput.Menu,prePropsInit:function(t){t._definedHeader=e.header;t.listBox.formatItem.addHandler((function(e,t){if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}}));queueMicrotask((function(){return updateHeader(t)}))},initControl:function(t){updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.selectedIndexChanged.addHandler((function(){updateHeader(t)}));if(t.itemsSource&&t.itemsSource.length){Array.from(t.itemsSource).find((function(e){return e instanceof _MenuItem}));t.itemsSource[0]instanceof _MenuItem&&1==t.itemsSource.length&&t.selectedIndex<0&&(t.selectedIndex=0)}},customProps:{header:function(e,t){if(e._definedHeader!=t){e._definedHeader=t;e.header=t;updateHeader(e)}},contextMenuOf:function(e,t){n.current.contextMenuOf||(n.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";for(var o=0,r=n.current.contextMenuOf;o<r.length;o++){var a=r[o];a.el.removeEventListener("contextmenu",a.handler)}n.current.contextMenuOf=[];if(t)for(var _loop_1=function(t){var listener=function(n){if(!wjcCore.closest(n.target,"[disabled]")){var o=e;if(o&&o.dropDown){n.preventDefault();n.stopPropagation();o.owner=t;o.show(n)}}};t.addEventListener("contextmenu",listener);n.current.contextMenuOf.push({el:t,handler:listener})},s=0,i=_getContextMenuElements(t);s<i.length;s++){_loop_1(i[s])}},value:function(e,t){e.selectedValue=t;updateHeader(e)}}});o.wjControl&&(o.wjControl._definedHeader=e.header);updateWjItemTemplateProp(o.wjControl,e);if(o.wjControl&&o.wjControl.itemsSource)for(var r=0,a=o.wjControl.itemsSource;r<a.length;r++){if(a[r]instanceof _MenuItem){o.wjControl.listBox.loadList();break}}return o.renderResult}));export var MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};var _MenuItem=function(){function _MenuItem(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_MenuItem.prototype._init=function(e){this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")};_MenuItem.prototype.updateItem=function(e){selectiveDomUnmount(e);selectiveDomRender(this.children,e);this.itemRoot=e};return _MenuItem}();export var MenuItem=forwardRef((function(e,t){var n=useWjComponentChildBase({ref:t,properties:MenuItemMeta.inputs,events:MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},n)}));export var MenuSeparator=forwardRef((function(e,t){var n=useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},n)}));var _MenuSeparator=function(){function _MenuSeparator(e,t){}_MenuSeparator.prototype.updateItem=function(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)};return _MenuSeparator}();export var PopupMeta={inputs:ControlBaseMeta.inputs.concat(["content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"]),events:ControlBaseMeta.events.concat(["dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"])};function updatePopupContent(e,t){selectiveDomRender(t,e.hostElement)}export var Popup=forwardRef((function(e,t){var n=useWjComponentBase({ref:t,properties:PopupMeta.inputs,events:PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:function(t){t.removeOnHide=!1;updatePopupContent(t,e.children)}});n.wjControl&&updatePopupContent(n.wjControl,e.children);return n.renderResult}));export var CollectionViewNavigatorMeta={inputs:ControlBaseMeta.inputs.concat(["byPage","cv","headerFormat","repeatButtons"]),events:ControlBaseMeta.events.slice()};export var CollectionViewNavigator=forwardRef((function(e,t){return useWjComponentBase({ref:t,properties:CollectionViewNavigatorMeta.inputs,events:CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));var ItemTemplate=function(){function ItemTemplate(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}ItemTemplate.prototype._updateTemplateItems=function(){var e=this;this._templateItems.forEach((function(t){selectiveDomRender(e._createItemElTpl(t),t.itemEl)}))};ItemTemplate.prototype._attachToControl=function(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()};ItemTemplate.prototype._detachFromControl=function(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()};ItemTemplate.prototype._fmtItem=function(e,t){var n=t.item,o={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(__assign({},o,{itemEl:n}));if(wjcCore.isFunction(this.wjItemTemplate)){selectiveDomUnmount(n);selectiveDomRender(this._createItemElTpl(o),n)}};ItemTemplate.prototype._getListBox=function(e){return e instanceof wjcInput.ListBox?e:e.listBox};ItemTemplate.prototype._destroyTemplateItems=function(){this._templateItems.forEach((function(e){selectiveDomUnmount(e.itemEl)}));this._templateItems=[]};ItemTemplate.prototype._createItemElTpl=function(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))};return ItemTemplate}();
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
*
|
3
|
-
* Wijmo Library 5.20241.10-nightly.
|
3
|
+
* Wijmo Library 5.20241.10-nightly.d20240621.t020220
|
4
4
|
* https://developer.mescius.com/wijmo
|
5
5
|
*
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
@@ -11,4 +11,4 @@
|
|
11
11
|
*
|
12
12
|
*/
|
13
13
|
|
14
|
-
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var react_1=require("react"),wijmo_react_base_1=require("@mescius/wijmo.react.base"),React=__importStar(require("react")),ReactDOM=__importStar(require("react-dom")),wjcCore=__importStar(require("@mescius/wijmo")),wjcInput=__importStar(require("@mescius/wijmo.input")),wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){var o=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;o._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}exports.ListBoxMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"])};exports.ListBox=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ListBoxMeta.inputs,events:exports.ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiSelectListBoxMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["checkedItemsChanged","selectedIndexChanged"])};exports.MultiSelectListBox=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectListBoxMeta.inputs,events:exports.MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));exports.DropDownMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["isDroppedDownChanged","isDroppedDownChanging","textChanged"])};exports.ComboBoxMeta={inputs:exports.DropDownMeta.inputs.concat(["displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"]),events:exports.DropDownMeta.events.concat(["formatItem","itemsSourceChanged","selectedIndexChanged"])};exports.ComboBox=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ComboBoxMeta.inputs,events:exports.ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.AutoCompleteMeta={inputs:exports.ComboBoxMeta.inputs.concat(["beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"]),events:exports.ComboBoxMeta.events.slice()};exports.AutoComplete=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.AutoCompleteMeta.inputs,events:exports.AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.CalendarMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"])};exports.Calendar=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CalendarMeta.inputs,events:exports.CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));exports.ColorPickerMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["palette","showAlphaChannel","showColorString","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["valueChanged"])};exports.ColorPicker=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ColorPickerMeta.inputs,events:exports.ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));exports.InputMaskMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["valueChanged"])};exports.InputMask=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputMaskMeta.inputs,events:exports.InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));exports.InputColorMeta={inputs:exports.DropDownMeta.inputs.concat(["palette","showAlphaChannel","showColorString","text","value"]),events:exports.DropDownMeta.events.concat(["valueChanged"])};exports.InputColor=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputColorMeta.inputs,events:exports.InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));exports.MultiSelectMeta={inputs:exports.ComboBoxMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"]),events:exports.ComboBoxMeta.events.concat(["checkedItemsChanged"])};exports.MultiSelect=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectMeta.inputs,events:exports.MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiAutoCompleteMeta={inputs:exports.AutoCompleteMeta.inputs.concat(["maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"]),events:exports.AutoCompleteMeta.events.concat(["selectedItemsChanged"])};exports.MultiAutoComplete=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiAutoCompleteMeta.inputs,events:exports.MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));exports.InputNumberMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["textChanged","valueChanged"])};exports.InputNumber=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputNumberMeta.inputs,events:exports.InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));exports.InputDateMeta={inputs:exports.DropDownMeta.inputs.concat(["alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"]),events:exports.DropDownMeta.events.concat(["rangeChanged","rangeEndChanged","valueChanged"])};exports.InputDate=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateMeta.inputs,events:exports.InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));exports.InputTimeMeta={inputs:exports.ComboBoxMeta.inputs.concat(["format","inputType","mask","max","min","step","text","value"]),events:exports.ComboBoxMeta.events.concat(["valueChanged"])};exports.InputTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputTimeMeta.inputs,events:exports.InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));exports.InputDateTimeMeta={inputs:exports.InputDateMeta.inputs.concat(["timeFormat","timeMax","timeMin","timeStep"]),events:exports.InputDateMeta.events.slice()};exports.InputDateTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateTimeMeta.inputs,events:exports.InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));exports.InputDateRangeMeta={inputs:exports.InputDateMeta.inputs.slice(),events:exports.InputDateMeta.events.slice()};exports.InputDateRange=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateRangeMeta.inputs,events:exports.InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));exports.MenuMeta={inputs:exports.ComboBoxMeta.inputs.concat(["closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"]),events:exports.ComboBoxMeta.events.concat(["itemClicked"])};function _getContextMenuElements(e){var t=[];(wjcCore.isArray(e)?e:[e]).forEach((function(e){if(e){var o=null;if("string"==typeof e)o=document.getElementById(e);else if("object"==typeof e){var r=e.hostElement?e.hostElement:e.current;r&&(o=r instanceof HTMLElement?r:r instanceof wjcCore.Control?r.hostElement:r.control&&r.control instanceof wjcCore.Control?r.control.hostElement:ReactDOM.findDOMNode(r))}o&&t.push(o)}}));return t}exports.Menu=react_1.forwardRef((function(e,t){var o=React.useRef({}),r=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MenuMeta.inputs,events:exports.MenuMeta.events,props:e,constructor:wjcInput.Menu,initControl:function(t){updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.listBox.formatItem.addHandler((function(e,t){if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}}));t.textChanged.addHandler((function(){t.header=t._definedHeader||"";var e=t.selectedItem;if(null!=t.selectedValue&&e&&t.displayMemberPath){var o=null;if(e instanceof _MenuItem){var r=e.itemRoot;o=r?r.innerHTML:e[t.displayMemberPath]}null!=o&&(t.header+=": <b>"+o+"</b>")}}))},customProps:{contextMenuOf:function(e,t){o.current.contextMenuOf||(o.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";for(var r=0,n=o.current.contextMenuOf;r<n.length;r++){var a=n[r];a.el.removeEventListener("contextmenu",a.handler)}o.current.contextMenuOf=[];if(t)for(var _loop_1=function(t){var listener=function(o){if(!wjcCore.closest(o.target,"[disabled]")){var r=e;if(r&&r.dropDown){o.preventDefault();o.stopPropagation();r.owner=t;r.show(o)}}};t.addEventListener("contextmenu",listener);o.current.contextMenuOf.push({el:t,handler:listener})},s=0,p=_getContextMenuElements(t);s<p.length;s++){_loop_1(p[s])}},value:function(e,t){e.selectedValue=t}}});r.wjControl&&(r.wjControl._definedHeader=e.header);updateWjItemTemplateProp(r.wjControl,e);if(r.wjControl&&r.wjControl.itemsSource)for(var n=0,a=r.wjControl.itemsSource;n<a.length;n++){if(a[n]instanceof _MenuItem){r.wjControl.listBox.loadList();break}}return r.renderResult}));exports.MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};var _MenuItem=function(){function _MenuItem(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_MenuItem.prototype._init=function(e){1==this._parent.itemsSource.length&&this._parent.selectedIndex<0&&(this._parent.selectedIndex=0);this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")};_MenuItem.prototype.updateItem=function(e){wijmo_react_base_1.selectiveDomUnmount(e);wijmo_react_base_1.selectiveDomRender(this.children,e);this.itemRoot=e};return _MenuItem}();exports.MenuItem=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:exports.MenuItemMeta.inputs,events:exports.MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},o)}));exports.MenuSeparator=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},o)}));var _MenuSeparator=function(){function _MenuSeparator(e,t){}_MenuSeparator.prototype.updateItem=function(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)};return _MenuSeparator}();exports.PopupMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"])};function updatePopupContent(e,t){wijmo_react_base_1.selectiveDomRender(t,e.hostElement)}exports.Popup=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.PopupMeta.inputs,events:exports.PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:function(t){t.removeOnHide=!1;updatePopupContent(t,e.children)}});o.wjControl&&updatePopupContent(o.wjControl,e.children);return o.renderResult}));exports.CollectionViewNavigatorMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["byPage","cv","headerFormat","repeatButtons"]),events:wijmo_react_base_1.ControlBaseMeta.events.slice()};exports.CollectionViewNavigator=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CollectionViewNavigatorMeta.inputs,events:exports.CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));var ItemTemplate=function(){function ItemTemplate(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}ItemTemplate.prototype._updateTemplateItems=function(){var e=this;this._templateItems.forEach((function(t){wijmo_react_base_1.selectiveDomRender(e._createItemElTpl(t),t.itemEl)}))};ItemTemplate.prototype._attachToControl=function(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()};ItemTemplate.prototype._detachFromControl=function(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()};ItemTemplate.prototype._fmtItem=function(e,t){var o=t.item,r={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(__assign({},r,{itemEl:o}));if(wjcCore.isFunction(this.wjItemTemplate)){wijmo_react_base_1.selectiveDomUnmount(o);wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(r),o)}};ItemTemplate.prototype._getListBox=function(e){return e instanceof wjcInput.ListBox?e:e.listBox};ItemTemplate.prototype._destroyTemplateItems=function(){this._templateItems.forEach((function(e){wijmo_react_base_1.selectiveDomUnmount(e.itemEl)}));this._templateItems=[]};ItemTemplate.prototype._createItemElTpl=function(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))};return ItemTemplate}();
|
14
|
+
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var react_1=require("react"),wijmo_react_base_1=require("@mescius/wijmo.react.base"),React=__importStar(require("react")),ReactDOM=__importStar(require("react-dom")),wjcCore=__importStar(require("@mescius/wijmo")),wjcInput=__importStar(require("@mescius/wijmo.input")),wjItemTemplatePropertyKey="$__wjItemTemplate",wjItemTemplateProperty="wjItemTemplate";function updateWjItemTemplateProp(e,t){if(e){if(!e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey]=new ItemTemplate(e);e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty])}else if(e[wjItemTemplatePropertyKey]&&!t[wjItemTemplateProperty]){var o=e[wjItemTemplatePropertyKey];e[wjItemTemplatePropertyKey]=null;o._detachFromControl()}if(e[wjItemTemplatePropertyKey]&&t[wjItemTemplateProperty]){e[wjItemTemplatePropertyKey].wjItemTemplate=wjcCore.asFunction(t[wjItemTemplateProperty]);e[wjItemTemplatePropertyKey]._updateTemplateItems()}}}exports.ListBoxMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkedItems","checkedMemberPath","displayMemberPath","isContentHtml","itemFormatter","itemRole","itemsSource","maxHeight","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","virtualizationThreshold"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["checkedItemsChanged","formatItem","itemChecked","itemsChanged","loadedItems","loadingItems","selectedIndexChanged"])};exports.ListBox=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ListBoxMeta.inputs,events:exports.ListBoxMeta.events,props:e,constructor:wjcInput.ListBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiSelectListBoxMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","displayMemberPath","filterInputPlaceholder","isContentHtml","itemsSource","selectAllLabel","selectedIndex","showFilterInput","showGroups","showSelectAllCheckbox","virtualizationThreshold"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["checkedItemsChanged","selectedIndexChanged"])};exports.MultiSelectListBox=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectListBoxMeta.inputs,events:exports.MultiSelectListBoxMeta.events,props:e,constructor:wjcInput.MultiSelectListBox}).renderResult}));exports.DropDownMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["autoExpandSelection","clickAction","dropDownCssClass","inputType","isAnimated","isDroppedDown","isReadOnly","isRequired","placeholder","showDropDownButton","text"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["isDroppedDownChanged","isDroppedDownChanging","textChanged"])};exports.ComboBoxMeta={inputs:exports.DropDownMeta.inputs.concat(["caseSensitiveSearch","displayMemberPath","handleWheel","headerPath","isContentHtml","isEditable","itemFormatter","itemsSource","maxDropDownHeight","maxDropDownWidth","selectedIndex","selectedItem","selectedValue","selectedValuePath","showGroups","trimText","virtualizationThreshold"]),events:exports.DropDownMeta.events.concat(["formatItem","itemsSourceChanged","selectedIndexChanged"])};exports.ComboBox=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ComboBoxMeta.inputs,events:exports.ComboBoxMeta.events,props:e,constructor:wjcInput.ComboBox,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.AutoCompleteMeta={inputs:exports.ComboBoxMeta.inputs.concat(["beginsWithSearch","cssMatch","delay","itemsSourceFunction","maxItems","minLength","searchMemberPath"]),events:exports.ComboBoxMeta.events.slice()};exports.AutoComplete=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.AutoCompleteMeta.inputs,events:exports.AutoCompleteMeta.events,props:e,constructor:wjcInput.AutoComplete,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.CalendarMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["displayMonth","firstDayOfWeek","formatDayHeaders","formatDays","formatMonths","formatYear","formatYearMonth","handleWheel","isReadOnly","itemFormatter","itemValidator","max","min","monthCount","monthView","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","showHeader","showMonthPicker","showYearPicker","value","weeksAfter","weeksBefore"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["displayMonthChanged","formatItem","rangeChanged","rangeEndChanged","valueChanged"])};exports.Calendar=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CalendarMeta.inputs,events:exports.CalendarMeta.events,props:e,constructor:wjcInput.Calendar}).renderResult}));exports.ColorPickerMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["palette","showAlphaChannel","showColorString","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["valueChanged"])};exports.ColorPicker=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.ColorPickerMeta.inputs,events:exports.ColorPickerMeta.events,props:e,constructor:wjcInput.ColorPicker}).renderResult}));exports.InputMaskMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["inputType","isReadOnly","isRequired","mask","overwriteMode","placeholder","promptChar","rawValue","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["valueChanged"])};exports.InputMask=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputMaskMeta.inputs,events:exports.InputMaskMeta.events,props:e,constructor:wjcInput.InputMask}).renderResult}));exports.InputColorMeta={inputs:exports.DropDownMeta.inputs.concat(["palette","showAlphaChannel","showColorString","text","value"]),events:exports.DropDownMeta.events.concat(["valueChanged"])};exports.InputColor=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputColorMeta.inputs,events:exports.InputColorMeta.events,props:e,constructor:wjcInput.InputColor}).renderResult}));exports.MultiSelectMeta={inputs:exports.ComboBoxMeta.inputs.concat(["caseSensitiveSearch","checkOnFilter","checkedItems","checkedMemberPath","delay","filterInputPlaceholder","headerFormat","headerFormatter","maxHeaderItems","selectAllLabel","showFilterInput","showSelectAllCheckbox"]),events:exports.ComboBoxMeta.events.concat(["checkedItemsChanged"])};exports.MultiSelect=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiSelectMeta.inputs,events:exports.MultiSelectMeta.events,props:e,constructor:wjcInput.MultiSelect,initControl:function(t){updateWjItemTemplateProp(t,e)}});updateWjItemTemplateProp(o.wjControl,e);return o.renderResult}));exports.MultiAutoCompleteMeta={inputs:exports.AutoCompleteMeta.inputs.concat(["maxSelectedItems","selectedItems","selectedMemberPath","showDropDownButton"]),events:exports.AutoCompleteMeta.events.concat(["selectedItemsChanged"])};exports.MultiAutoComplete=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MultiAutoCompleteMeta.inputs,events:exports.MultiAutoCompleteMeta.events,props:e,constructor:wjcInput.MultiAutoComplete}).renderResult}));exports.InputNumberMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["format","handleWheel","inputType","isReadOnly","isRequired","max","min","placeholder","repeatButtons","showSpinner","step","text","value"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["textChanged","valueChanged"])};exports.InputNumber=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputNumberMeta.inputs,events:exports.InputNumberMeta.events,props:e,constructor:wjcInput.InputNumber}).renderResult}));exports.InputDateMeta={inputs:exports.DropDownMeta.inputs.concat(["alwaysShowCalendar","closeOnSelection","format","handleWheel","inputType","itemFormatter","itemValidator","mask","max","min","monthCount","predefinedRanges","rangeEnd","rangeMax","rangeMin","repeatButtons","selectionMode","separator","showHeader","showMonthPicker","showYearPicker","text","value","weeksAfter","weeksBefore"]),events:exports.DropDownMeta.events.concat(["rangeChanged","rangeEndChanged","valueChanged"])};exports.InputDate=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateMeta.inputs,events:exports.InputDateMeta.events,props:e,constructor:wjcInput.InputDate}).renderResult}));exports.InputTimeMeta={inputs:exports.ComboBoxMeta.inputs.concat(["format","inputType","mask","max","min","step","text","value"]),events:exports.ComboBoxMeta.events.concat(["valueChanged"])};exports.InputTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputTimeMeta.inputs,events:exports.InputTimeMeta.events,props:e,constructor:wjcInput.InputTime}).renderResult}));exports.InputDateTimeMeta={inputs:exports.InputDateMeta.inputs.concat(["timeFormat","timeMax","timeMin","timeStep"]),events:exports.InputDateMeta.events.slice()};exports.InputDateTime=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateTimeMeta.inputs,events:exports.InputDateTimeMeta.events,props:e,constructor:wjcInput.InputDateTime}).renderResult}));exports.InputDateRangeMeta={inputs:exports.InputDateMeta.inputs.slice(),events:exports.InputDateMeta.events.slice()};exports.InputDateRange=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.InputDateRangeMeta.inputs,events:exports.InputDateRangeMeta.events,props:e,constructor:wjcInput.InputDateRange}).renderResult}));exports.MenuMeta={inputs:exports.ComboBoxMeta.inputs.concat(["closeOnLeave","command","commandParameterPath","commandPath","header","isButton","openOnHover","owner","subItemsPath","ariaLabel","autoSelectOnFocus"]),events:exports.ComboBoxMeta.events.concat(["itemClicked"])};function _getContextMenuElements(e){var t=[];(wjcCore.isArray(e)?e:[e]).forEach((function(e){if(e){var o=null;if("string"==typeof e)o=document.getElementById(e);else if("object"==typeof e){var r=e.hostElement?e.hostElement:e.current;r&&(o=r instanceof HTMLElement?r:r instanceof wjcCore.Control?r.hostElement:r.control&&r.control instanceof wjcCore.Control?r.control.hostElement:ReactDOM.findDOMNode(r))}o&&t.push(o)}}));return t}exports.Menu=react_1.forwardRef((function(e,t){var o=React.useRef({}),updateHeader=function(e){e.header=e._definedHeader||"";var t=e.selectedItem;if(null!=e.selectedValue&&t&&e.displayMemberPath){var o=null;if(t instanceof _MenuItem){var r=t.itemRoot;o=r?r.innerHTML:t[e.displayMemberPath]}null!=o&&(e.header+=": <b>"+o+"</b>")}},r=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.MenuMeta.inputs,events:exports.MenuMeta.events,props:e,constructor:wjcInput.Menu,prePropsInit:function(t){t._definedHeader=e.header;t.listBox.formatItem.addHandler((function(e,t){if(t.data instanceof _MenuItem||t.data instanceof _MenuSeparator){t.item.textContent="";t.data.updateItem(t.item)}}));queueMicrotask((function(){return updateHeader(t)}))},initControl:function(t){updateWjItemTemplateProp(t,e);t._definedHeader=e.header;t.selectedIndexChanged.addHandler((function(){updateHeader(t)}));if(t.itemsSource&&t.itemsSource.length){Array.from(t.itemsSource).find((function(e){return e instanceof _MenuItem}));t.itemsSource[0]instanceof _MenuItem&&1==t.itemsSource.length&&t.selectedIndex<0&&(t.selectedIndex=0)}},customProps:{header:function(e,t){if(e._definedHeader!=t){e._definedHeader=t;e.header=t;updateHeader(e)}},contextMenuOf:function(e,t){o.current.contextMenuOf||(o.current.contextMenuOf=[]);e.hostElement.style.display=t?"none":"inline-table";for(var r=0,n=o.current.contextMenuOf;r<n.length;r++){var a=n[r];a.el.removeEventListener("contextmenu",a.handler)}o.current.contextMenuOf=[];if(t)for(var _loop_1=function(t){var listener=function(o){if(!wjcCore.closest(o.target,"[disabled]")){var r=e;if(r&&r.dropDown){o.preventDefault();o.stopPropagation();r.owner=t;r.show(o)}}};t.addEventListener("contextmenu",listener);o.current.contextMenuOf.push({el:t,handler:listener})},s=0,i=_getContextMenuElements(t);s<i.length;s++){_loop_1(i[s])}},value:function(e,t){e.selectedValue=t;updateHeader(e)}}});r.wjControl&&(r.wjControl._definedHeader=e.header);updateWjItemTemplateProp(r.wjControl,e);if(r.wjControl&&r.wjControl.itemsSource)for(var n=0,a=r.wjControl.itemsSource;n<a.length;n++){if(a[n]instanceof _MenuItem){r.wjControl.listBox.loadList();break}}return r.renderResult}));exports.MenuItemMeta={inputs:["children","cmd","cmdParam","value"],events:[]};var _MenuItem=function(){function _MenuItem(e,t){this.children=[];this.value=null;this.cmd=null;this.cmdParam=null;this._parent=e;wjcCore.copy(this,t);this._init(t)}_MenuItem.prototype._init=function(e){this._parent.displayMemberPath||(this._parent.displayMemberPath="header");this._parent.selectedValuePath||(this._parent.selectedValuePath="value");this._parent.commandPath||(this._parent.commandPath="cmd");this._parent.commandParameterPath||(this._parent.commandParameterPath="cmdParam")};_MenuItem.prototype.updateItem=function(e){wijmo_react_base_1.selectiveDomUnmount(e);wijmo_react_base_1.selectiveDomRender(this.children,e);this.itemRoot=e};return _MenuItem}();exports.MenuItem=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:exports.MenuItemMeta.inputs,events:exports.MenuItemMeta.events,props:e,constructor:_MenuItem,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},o)}));exports.MenuSeparator=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentChildBase({ref:t,properties:[],events:[],props:e,constructor:_MenuSeparator,needParentInstance:!0,parentProp:"itemsSource",isParentPropArray:!0,assignedToParent:!0});return __assign({$_wjComponent:!0},o)}));var _MenuSeparator=function(){function _MenuSeparator(e,t){}_MenuSeparator.prototype.updateItem=function(e){wjcCore.createElement("<div></div>",e,{width:"100%",height:"1px",backgroundColor:"lightgray"});wjcCore.addClass(e,"wj-state-disabled");wjcCore.setAttribute(e,"role","separator",!1)};return _MenuSeparator}();exports.PopupMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["content","dialogResult","dialogResultEnter","dialogResultSubmit","fadeIn","fadeOut","hideTrigger","isDraggable","isResizable","isVisible","modal","owner","position","removeOnHide","showTrigger"]),events:wijmo_react_base_1.ControlBaseMeta.events.concat(["dragged","dragging","hidden","hiding","positionChanged","positionChanging","resized","resizing","showing","shown","sizeChanged","sizeChanging"])};function updatePopupContent(e,t){wijmo_react_base_1.selectiveDomRender(t,e.hostElement)}exports.Popup=react_1.forwardRef((function(e,t){var o=wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.PopupMeta.inputs,events:exports.PopupMeta.events,props:e,constructor:wjcInput.Popup,initControl:function(t){t.removeOnHide=!1;updatePopupContent(t,e.children)}});o.wjControl&&updatePopupContent(o.wjControl,e.children);return o.renderResult}));exports.CollectionViewNavigatorMeta={inputs:wijmo_react_base_1.ControlBaseMeta.inputs.concat(["byPage","cv","headerFormat","repeatButtons"]),events:wijmo_react_base_1.ControlBaseMeta.events.slice()};exports.CollectionViewNavigator=react_1.forwardRef((function(e,t){return wijmo_react_base_1.useWjComponentBase({ref:t,properties:exports.CollectionViewNavigatorMeta.inputs,events:exports.CollectionViewNavigatorMeta.events,props:e,constructor:wjcInput.CollectionViewNavigator}).renderResult}));var ItemTemplate=function(){function ItemTemplate(e){this._templateItems=[];this.ownerControl=e;this.listBox=this._getListBox(this.ownerControl);this._attachToControl()}ItemTemplate.prototype._updateTemplateItems=function(){var e=this;this._templateItems.forEach((function(t){wijmo_react_base_1.selectiveDomRender(e._createItemElTpl(t),t.itemEl)}))};ItemTemplate.prototype._attachToControl=function(){this.listBox.formatItem.addHandler(this._fmtItem,this);this.listBox.loadingItems.addHandler(this._destroyTemplateItems,this);this.ownerControl.invalidate()};ItemTemplate.prototype._detachFromControl=function(){this.listBox.formatItem.removeHandler(this._fmtItem,this);this._destroyTemplateItems()};ItemTemplate.prototype._fmtItem=function(e,t){var o=t.item,r={control:e,item:t.data,itemIndex:t.index};this._templateItems.push(__assign({},r,{itemEl:o}));if(wjcCore.isFunction(this.wjItemTemplate)){wijmo_react_base_1.selectiveDomUnmount(o);wijmo_react_base_1.selectiveDomRender(this._createItemElTpl(r),o)}};ItemTemplate.prototype._getListBox=function(e){return e instanceof wjcInput.ListBox?e:e.listBox};ItemTemplate.prototype._destroyTemplateItems=function(){this._templateItems.forEach((function(e){wijmo_react_base_1.selectiveDomUnmount(e.itemEl)}));this._templateItems=[]};ItemTemplate.prototype._createItemElTpl=function(e){return React.createElement("div",{},this.wjItemTemplate({control:e.control,item:e.item,itemIndex:e.itemIndex}))};return ItemTemplate}();
|
package/package.json
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mescius/wijmo.react.input",
|
3
|
-
"version": "5.20241.10-nightly.
|
3
|
+
"version": "5.20241.10-nightly.d20240621.t020220",
|
4
4
|
"description": "UI library for pure JS, Angular, React, Vue and more...",
|
5
5
|
"author": "MESCIUS inc",
|
6
6
|
"license": "Commercial",
|
7
7
|
"main": "./index.js",
|
8
8
|
"types": "./index.d.ts",
|
9
9
|
"dependencies": {
|
10
|
-
"@mescius/wijmo": "5.20241.10-nightly.
|
11
|
-
"@mescius/wijmo.input": "5.20241.10-nightly.
|
12
|
-
"@mescius/wijmo.react.base": "5.20241.10-nightly.
|
10
|
+
"@mescius/wijmo": "5.20241.10-nightly.d20240621.t020220",
|
11
|
+
"@mescius/wijmo.input": "5.20241.10-nightly.d20240621.t020220",
|
12
|
+
"@mescius/wijmo.react.base": "5.20241.10-nightly.d20240621.t020220"
|
13
13
|
},
|
14
14
|
"homepage": "https://developer.mescius.com/wijmo",
|
15
15
|
"bugs": {
|