wcs-core 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +59 -90
- package/dist/cjs/accessibility-e99b032d.js +68 -0
- package/dist/cjs/accessibility-e99b032d.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/wcs-checkbox.cjs.entry.js +1 -0
- package/dist/cjs/wcs-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-counter.cjs.entry.js +1 -0
- package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-dropdown.cjs.entry.js +3 -5
- package/dist/cjs/wcs-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-grid.cjs.entry.js +1 -1
- package/dist/cjs/wcs-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-input.cjs.entry.js +1 -3
- package/dist/cjs/wcs-input.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-modal.cjs.entry.js +68 -6
- package/dist/cjs/wcs-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-native-select.cjs.entry.js +19 -0
- package/dist/cjs/wcs-native-select.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-radio-group.cjs.entry.js +48 -4
- package/dist/cjs/wcs-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-radio.cjs.entry.js +17 -4
- package/dist/cjs/wcs-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tab.cjs.entry.js +1 -1
- package/dist/cjs/wcs-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-tabs.cjs.entry.js +37 -1
- package/dist/cjs/wcs-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-textarea.cjs.entry.js +3 -2
- package/dist/cjs/wcs-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/checkbox/checkbox.js +1 -0
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/counter/counter.js +1 -0
- package/dist/collection/components/counter/counter.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.js +1 -0
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/input/input.js +2 -4
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/modal/modal.js +71 -6
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/native-select/{native-select.component.js → native-select.js} +58 -7
- package/dist/collection/components/native-select/native-select.js.map +1 -0
- package/dist/collection/components/radio/radio.css +13 -1
- package/dist/collection/components/radio/{radio.component.js → radio.js} +37 -4
- package/dist/collection/components/radio/radio.js.map +1 -0
- package/dist/collection/components/radio-group/radio-group.js +60 -4
- package/dist/collection/components/radio-group/radio-group.js.map +1 -1
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tab/tab.js.map +1 -1
- package/dist/collection/components/tabs/tabs.js +54 -1
- package/dist/collection/components/tabs/tabs.js.map +1 -1
- package/dist/collection/components/textarea/textarea.js +8 -4
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/utils/accessibility.js +58 -0
- package/dist/collection/utils/accessibility.js.map +1 -1
- package/dist/esm/accessibility-ffa12842.js +65 -0
- package/dist/esm/accessibility-ffa12842.js.map +1 -0
- package/dist/esm/{helpers-1f7170dd.js → helpers-1d55b67f.js} +2 -2
- package/dist/esm/{helpers-1f7170dd.js.map → helpers-1d55b67f.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/wcs-button.entry.js +1 -1
- package/dist/esm/wcs-checkbox.entry.js +1 -0
- package/dist/esm/wcs-checkbox.entry.js.map +1 -1
- package/dist/esm/wcs-com-nav-category.entry.js +1 -1
- package/dist/esm/wcs-com-nav-submenu.entry.js +1 -1
- package/dist/esm/wcs-com-nav.entry.js +1 -1
- package/dist/esm/wcs-counter.entry.js +2 -1
- package/dist/esm/wcs-counter.entry.js.map +1 -1
- package/dist/esm/wcs-dropdown-item.entry.js +1 -1
- package/dist/esm/wcs-dropdown.entry.js +3 -5
- package/dist/esm/wcs-dropdown.entry.js.map +1 -1
- package/dist/esm/wcs-galactic-menu.entry.js +1 -1
- package/dist/esm/wcs-grid.entry.js +1 -1
- package/dist/esm/wcs-grid.entry.js.map +1 -1
- package/dist/esm/wcs-input.entry.js +2 -4
- package/dist/esm/wcs-input.entry.js.map +1 -1
- package/dist/esm/wcs-modal.entry.js +69 -7
- package/dist/esm/wcs-modal.entry.js.map +1 -1
- package/dist/esm/wcs-native-select.entry.js +19 -0
- package/dist/esm/wcs-native-select.entry.js.map +1 -1
- package/dist/esm/wcs-nav-item.entry.js +1 -1
- package/dist/esm/wcs-radio-group.entry.js +48 -4
- package/dist/esm/wcs-radio-group.entry.js.map +1 -1
- package/dist/esm/wcs-radio.entry.js +18 -5
- package/dist/esm/wcs-radio.entry.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +1 -1
- package/dist/esm/wcs-tab.entry.js +1 -1
- package/dist/esm/wcs-tab.entry.js.map +1 -1
- package/dist/esm/wcs-tabs.entry.js +37 -1
- package/dist/esm/wcs-tabs.entry.js.map +1 -1
- package/dist/esm/wcs-textarea.entry.js +4 -3
- package/dist/esm/wcs-textarea.entry.js.map +1 -1
- package/dist/esm/wcs.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -3
- package/dist/types/components/modal/modal.d.ts +25 -5
- package/dist/types/components/native-select/{native-select.component.d.ts → native-select.d.ts} +22 -5
- package/dist/types/components/radio/{radio.component.d.ts → radio.d.ts} +2 -0
- package/dist/types/components/radio-group/radio-group.d.ts +3 -0
- package/dist/types/components/tabs/tabs.d.ts +13 -0
- package/dist/types/components/textarea/textarea.d.ts +2 -2
- package/dist/types/components.d.ts +74 -24
- package/dist/types/utils/accessibility.d.ts +2 -0
- package/dist/wcs/p-0f8db386.js +2 -0
- package/dist/wcs/p-0f8db386.js.map +1 -0
- package/dist/wcs/{p-4b4d53e2.entry.js → p-1f8c73eb.entry.js} +2 -2
- package/dist/wcs/{p-554ca93c.entry.js → p-2185bf8b.entry.js} +2 -2
- package/dist/wcs/{p-22480bd8.entry.js → p-2f63d6c5.entry.js} +2 -2
- package/dist/wcs/p-2f63d6c5.entry.js.map +1 -0
- package/dist/wcs/p-39821dd2.entry.js +2 -0
- package/dist/wcs/p-39821dd2.entry.js.map +1 -0
- package/dist/wcs/{p-84afb8af.entry.js → p-3b1fc676.entry.js} +2 -2
- package/dist/wcs/{p-12ac2547.js → p-3dc6b507.js} +2 -2
- package/dist/wcs/p-4ffe4539.entry.js +2 -0
- package/dist/wcs/p-4ffe4539.entry.js.map +1 -0
- package/dist/wcs/p-61cab06f.entry.js +2 -0
- package/dist/wcs/p-61cab06f.entry.js.map +1 -0
- package/dist/wcs/{p-15058c29.entry.js → p-6de70331.entry.js} +2 -2
- package/dist/wcs/p-6de70331.entry.js.map +1 -0
- package/dist/wcs/{p-b6cd196d.entry.js → p-7269272f.entry.js} +2 -2
- package/dist/wcs/{p-966a241e.entry.js → p-7519a270.entry.js} +2 -2
- package/dist/wcs/{p-6b66ce85.entry.js → p-8c4ed883.entry.js} +2 -2
- package/dist/wcs/p-8c4ed883.entry.js.map +1 -0
- package/dist/wcs/p-8fed8b1c.entry.js +2 -0
- package/dist/wcs/p-8fed8b1c.entry.js.map +1 -0
- package/dist/wcs/{p-d2da0c9f.entry.js → p-ac106663.entry.js} +2 -2
- package/dist/wcs/{p-d2da0c9f.entry.js.map → p-ac106663.entry.js.map} +1 -1
- package/dist/wcs/{p-b229a91c.entry.js → p-cb90bc3a.entry.js} +2 -2
- package/dist/wcs/{p-f82e7a61.entry.js → p-e348058b.entry.js} +2 -2
- package/dist/wcs/{p-405140f9.entry.js → p-ec84d6fd.entry.js} +2 -2
- package/dist/wcs/{p-26c4c983.entry.js → p-ed3132be.entry.js} +2 -2
- package/dist/wcs/p-ed3132be.entry.js.map +1 -0
- package/dist/wcs/p-f06f48f3.entry.js +2 -0
- package/dist/wcs/{p-6acbf38a.entry.js.map → p-f06f48f3.entry.js.map} +1 -1
- package/dist/wcs/p-f20b9024.entry.js +2 -0
- package/dist/wcs/p-f20b9024.entry.js.map +1 -0
- package/dist/wcs/p-f489793d.entry.js +2 -0
- package/dist/wcs/p-f489793d.entry.js.map +1 -0
- package/dist/wcs/wcs.esm.js +1 -1
- package/dist/wcs/wcs.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/collection/components/native-select/native-select.component.js.map +0 -1
- package/dist/collection/components/radio/radio.component.js.map +0 -1
- package/dist/wcs/p-069555a1.entry.js +0 -2
- package/dist/wcs/p-069555a1.entry.js.map +0 -1
- package/dist/wcs/p-07b8cd36.entry.js +0 -2
- package/dist/wcs/p-07b8cd36.entry.js.map +0 -1
- package/dist/wcs/p-15058c29.entry.js.map +0 -1
- package/dist/wcs/p-22480bd8.entry.js.map +0 -1
- package/dist/wcs/p-26c4c983.entry.js.map +0 -1
- package/dist/wcs/p-64dd7356.entry.js +0 -2
- package/dist/wcs/p-64dd7356.entry.js.map +0 -1
- package/dist/wcs/p-6acbf38a.entry.js +0 -2
- package/dist/wcs/p-6b66ce85.entry.js.map +0 -1
- package/dist/wcs/p-732b2faa.entry.js +0 -2
- package/dist/wcs/p-732b2faa.entry.js.map +0 -1
- package/dist/wcs/p-94d95b99.entry.js +0 -2
- package/dist/wcs/p-94d95b99.entry.js.map +0 -1
- package/dist/wcs/p-b856f2f6.entry.js +0 -2
- package/dist/wcs/p-b856f2f6.entry.js.map +0 -1
- /package/dist/wcs/{p-4b4d53e2.entry.js.map → p-1f8c73eb.entry.js.map} +0 -0
- /package/dist/wcs/{p-554ca93c.entry.js.map → p-2185bf8b.entry.js.map} +0 -0
- /package/dist/wcs/{p-84afb8af.entry.js.map → p-3b1fc676.entry.js.map} +0 -0
- /package/dist/wcs/{p-12ac2547.js.map → p-3dc6b507.js.map} +0 -0
- /package/dist/wcs/{p-b6cd196d.entry.js.map → p-7269272f.entry.js.map} +0 -0
- /package/dist/wcs/{p-966a241e.entry.js.map → p-7519a270.entry.js.map} +0 -0
- /package/dist/wcs/{p-b229a91c.entry.js.map → p-cb90bc3a.entry.js.map} +0 -0
- /package/dist/wcs/{p-f82e7a61.entry.js.map → p-e348058b.entry.js.map} +0 -0
- /package/dist/wcs/{p-405140f9.entry.js.map → p-ec84d6fd.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getSortOrderInteger","sortOrder","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","Error","REGEX","validate","uuid","test","byteToHex","i","push","toString","substr","stringify","arr","offset","arguments","length","undefined","toLowerCase","TypeError","v4","options","buf","rnds","random","symbolTag","isSymbol","value","isObjectLike","baseGetTag","arrayMap","array","iteratee","index","result","Array","INFINITY","symbolProto","Symbol","prototype","symbolToString","baseToString","isArray","call","objectCreate","Object","create","baseCreate","object","proto","isObject","copyArray","source","defineProperty","func","getNative","e","arrayEach","baseAssignValue","key","configurable","enumerable","writable","objectProto","hasOwnProperty","assignValue","objValue","eq","copyObject","props","customizer","isNew","newValue","nativeKeysIn","baseKeysIn","isProto","isPrototype","keysIn","isArrayLike","arrayLikeKeys","reIsDeepProp","reIsPlainProp","isKey","type","FUNC_ERROR_TEXT","memoize","resolver","memoized","args","apply","this","cache","has","get","set","Cache","MapCache","MAX_MEMOIZE_SIZE","memoizeCapped","size","clear","rePropName","reEscapeChar","stringToPath","string","charCodeAt","replace","match","number","quote","subString","castPath","toKey","baseGet","path","defaultValue","getPrototype","overArg","getPrototypeOf","baseAssign","keys","baseAssignIn","freeExports","exports","nodeType","freeModule","module","moduleExports","Buffer","root","allocUnsafe","cloneBuffer","buffer","isDeep","slice","constructor","copy","copySymbols","getSymbols","nativeGetSymbols","getOwnPropertySymbols","getSymbolsIn","stubArray","arrayPush","copySymbolsIn","getAllKeysIn","baseGetAllKeys","initCloneArray","input","cloneArrayBuffer","arrayBuffer","byteLength","cloneDataView","dataView","byteOffset","reFlags","cloneRegExp","regexp","exec","lastIndex","symbolValueOf","valueOf","cloneSymbol","symbol","cloneTypedArray","typedArray","boolTag","dateTag","mapTag","numberTag","regexpTag","setTag","stringTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","tag","Ctor","initCloneObject","baseIsMap","getTag","nodeIsMap","nodeUtil","isMap","baseUnary","baseIsSet","nodeIsSet","isSet","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","argsTag","arrayTag","errorTag","funcTag","genTag","objectTag","weakMapTag","cloneableTags","baseClone","bitmask","stack","isFlat","isFull","isArr","isFunc","isBuffer","Stack","stacked","forEach","subValue","add","keysFunc","getAllKeys","cloneDeep","gridCss","Grid","onDataChange","updateGridRows","refreshSort","onSelectedItemsPropertyChange","updateSelectionWithValues","onHiddenColumnChange","forceUpdate","values","selectionConfig","rows","map","r","selected","row","isEqual","data","find","x","wcsGridRowToWcsGridRowData","page","columns","cells","column","content","formatter","updatePageIndex","componentDidLoad","getGridColumnsFromTemplate","paginationEl","wcsGridPaginationId","document","getElementById","getGridPaginationsFromTemplate","selectedItems","refreshOthersColmumnsSortOrderState","first","other","filter","c","serverMode","sortBy","disableSortOrderForColumns","slotted","el","shadowRoot","querySelector","assignedElements","sortChangeEventHandler","event","detail","order","colmun","sortFn","sort","a","b","itemsCount","pageCount","Math","ceil","pageSize","currentPage","GridPagination","INDEX_FIRST_PAGE","floor","paginationChangeEventHandler","onPaginationChange","paginationChangeEventHandlerOutside","target","id","onRowSelection","wcsGridSelectionChange","emit","selectAllRows","getRowsForCurrentPage","allRowsAreSelected","wcsGridAllSelectionChange","renderSelectionColumn","h","checked","onWcsRadioClick","onWcsChange","getCellContent","cell","totalColumnCount","render","Host","class","name","loading","colSpan","_a","renderRow","hidden","customCells","rowIdPath","part"],"sources":["./src/components/grid/grid-interface.ts","./node_modules/uuid/dist/esm-browser/rng.js","./node_modules/uuid/dist/esm-browser/regex.js","./node_modules/uuid/dist/esm-browser/validate.js","./node_modules/uuid/dist/esm-browser/stringify.js","./node_modules/uuid/dist/esm-browser/v4.js","./node_modules/lodash-es/isSymbol.js","./node_modules/lodash-es/_arrayMap.js","./node_modules/lodash-es/_baseToString.js","./node_modules/lodash-es/_baseCreate.js","./node_modules/lodash-es/_copyArray.js","./node_modules/lodash-es/_defineProperty.js","./node_modules/lodash-es/_arrayEach.js","./node_modules/lodash-es/_baseAssignValue.js","./node_modules/lodash-es/_assignValue.js","./node_modules/lodash-es/_copyObject.js","./node_modules/lodash-es/_nativeKeysIn.js","./node_modules/lodash-es/_baseKeysIn.js","./node_modules/lodash-es/keysIn.js","./node_modules/lodash-es/_isKey.js","./node_modules/lodash-es/memoize.js","./node_modules/lodash-es/_memoizeCapped.js","./node_modules/lodash-es/_stringToPath.js","./node_modules/lodash-es/toString.js","./node_modules/lodash-es/_castPath.js","./node_modules/lodash-es/_toKey.js","./node_modules/lodash-es/_baseGet.js","./node_modules/lodash-es/get.js","./node_modules/lodash-es/_getPrototype.js","./node_modules/lodash-es/_baseAssign.js","./node_modules/lodash-es/_baseAssignIn.js","./node_modules/lodash-es/_cloneBuffer.js","./node_modules/lodash-es/_copySymbols.js","./node_modules/lodash-es/_getSymbolsIn.js","./node_modules/lodash-es/_copySymbolsIn.js","./node_modules/lodash-es/_getAllKeysIn.js","./node_modules/lodash-es/_initCloneArray.js","./node_modules/lodash-es/_cloneArrayBuffer.js","./node_modules/lodash-es/_cloneDataView.js","./node_modules/lodash-es/_cloneRegExp.js","./node_modules/lodash-es/_cloneSymbol.js","./node_modules/lodash-es/_cloneTypedArray.js","./node_modules/lodash-es/_initCloneByTag.js","./node_modules/lodash-es/_initCloneObject.js","./node_modules/lodash-es/_baseIsMap.js","./node_modules/lodash-es/isMap.js","./node_modules/lodash-es/_baseIsSet.js","./node_modules/lodash-es/isSet.js","./node_modules/lodash-es/_baseClone.js","./node_modules/lodash-es/cloneDeep.js","./src/components/grid/grid.scss?tag=wcs-grid&encapsulation=shadow","./src/components/grid/grid.tsx"],"sourcesContent":["import { VNode } from '@stencil/core';\n\nexport type WcsGridSelectionConfig = 'none' | 'single' | 'multiple';\n\nexport type WcsSortFn = (a: any, b: any, column: HTMLWcsGridColumnElement) => -1 | 0 | 1;\n\nexport type WcsCellFormatter = (_h: HyperFunc<VNode>, column: HTMLWcsGridColumnElement, rowData: WcsGridRowData) => HTMLElement | HTMLElement[];\n\nexport interface WcsGridColumnSortChangeEventDetails {\n sortFn: WcsSortFn;\n order: WcsSortOrder;\n column: HTMLWcsGridColumnElement;\n}\n\nexport interface WcsGridRowSelectedEventDetails {\n row: WcsGridRowData;\n}\n\nexport interface WcsGridAllRowSelectedEventDetails {\n rows: WcsGridRowData[];\n}\n\nexport type WcsGridPaginationConfig = {\n currentPage: number;\n pageSize: number;\n itemsCount: number;\n pageCount: number;\n};\n\nexport interface WcsGridPaginationChangeEventDetails {\n pagination: WcsGridPaginationConfig;\n}\n\nexport type WcsSortOrder = 'asc' | 'desc' | 'none';\n\nexport function getSortOrderInteger(sortOrder: WcsSortOrder) {\n switch (sortOrder) {\n case 'asc':\n return 1;\n case 'desc':\n return -1;\n case 'none':\n break;\n }\n}\n\nexport interface WcsGridRow {\n uuid: string;\n page?: number;\n selected?: boolean;\n data?: any;\n cells?: WcsGridCell[];\n}\n\nexport interface WcsGridCell {\n content: string | void;\n column: HTMLWcsGridColumnElement;\n formatter: (_h: HyperFunc<VNode>, column: HTMLWcsGridColumnElement, rowData: WcsGridRowData) => HTMLElement | HTMLElement[];\n}\n\nexport interface WcsGridRowData {\n page: number;\n selected: boolean;\n data: any;\n}\n\nexport interface HyperFunc<T> {\n (tag: any): T;\n}\n\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\nexport interface HyperFunc<T> {\n (sel: any, children: (T | undefined | null)[]): T;\n}\n\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: (T | undefined | null)[]): T;\n}\n\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n",":host {\n display: block;\n --wcs-grid-highlight-color: var(--wcs-light);\n\n th {\n background-color: var(--wcs-light);\n }\n\n th:not(:first-child) {\n border-left: solid 1px var(--wcs-text-light);\n }\n\n // Remove the border for the first column\n ::slotted([slot=grid-column]:first-child) {\n --wcs-grid-column-border-left: none;\n }\n\n table {\n width: 100%;\n border-spacing: 0;\n }\n\n td {\n color: var(--wcs-gray-light);\n margin: 0;\n padding: calc(var(--wcs-padding) / 2) var(--wcs-padding);\n }\n\n tr:not(:last-child) td {\n border-bottom: solid 1px var(--wcs-text-light);\n }\n\n .wcs-grid-selection-column {\n padding: calc(var(--wcs-padding) / 2) var(--wcs-padding);\n width: 40px;\n }\n\n tr.selected {\n background-color: var(--wcs-grid-highlight-color);\n }\n\n .loading {\n text-align: center;\n }\n}\n\n// If the grid displays a selection column, we set the border on the\n// first data column (which has been disabled in :host)\n:host([selection]) {\n ::slotted([slot=grid-column]:first-child) {\n --wcs-grid-column-border-left: solid 1px var(--wcs-text-light) !important;\n }\n}\n","import {\n Component,\n ComponentDidLoad,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Listen,\n Prop,\n State,\n VNode,\n Watch\n} from '@stencil/core';\nimport {\n getSortOrderInteger,\n HyperFunc,\n WcsGridAllRowSelectedEventDetails,\n WcsGridCell,\n WcsGridColumnSortChangeEventDetails,\n WcsGridPaginationChangeEventDetails,\n WcsGridRow,\n WcsGridRowData,\n WcsGridRowSelectedEventDetails,\n WcsGridSelectionConfig\n} from './grid-interface';\nimport { v4 as uuid } from 'uuid';\nimport { cloneDeep, isEqual, get } from 'lodash-es';\nimport { GridPagination } from '../grid-pagination/grid-pagination';\n\n/**\n * The grid component is a complex component used as an HTML table to display collections of data.\n *\n * @cssprop --wcs-grid-highlight-color - Color for selected rows\n * @cssprop --wcs-grid-column-border-left - Left border of all grid headers\n * @slot grid-column - The slot containing the column of the grid in the `<thead>`\n * @slot grid-pagination - The slot containing the pagination of the grid below the `<table>`\n */\n@Component({\n tag: 'wcs-grid',\n styleUrl: 'grid.scss',\n shadow: true\n})\nexport class Grid implements ComponentInterface, ComponentDidLoad {\n @Element() private el!: HTMLWcsGridElement;\n /**\n * Manage sort and pagination with a backend server when set to `true`\n */\n @Prop() serverMode: boolean = false;\n /**\n * Contains the data to display in the table from a js object\n */\n @Prop() data: any[];\n /**\n * Flag to display a spinner during data loading\n */\n @Prop() loading: boolean;\n /**\n * Used to manage grid's row selection. \n * \"none\": no row can be selected. \n * \"multiple\": several rows can be selected. \n * \"single\": one row only can be selected. \n */\n @Prop() selectionConfig: WcsGridSelectionConfig = 'none';\n /**\n * Set the selected items (rows)\n */\n @Prop() selectedItems: any | any[] = [];\n /**\n * Automatically set by the component to reference the wcs-grid-pagination HTML element by its id.\n */\n @Prop() wcsGridPaginationId: string;\n /**\n * Name of the object's key that will be used to display the cells whose `keyValue` attribute matches to the\n * object's value for this key.\n */\n @Prop() rowIdPath: string;\n @State() private columns: HTMLWcsGridColumnElement[];\n @State() private paginationEl: HTMLWcsGridPaginationElement;\n /**\n * Rows to display, contains user data and meta data\n */\n @State() private rows: WcsGridRow[] = [];\n /**\n * Event emitted when a row is selected or unselected\n */\n @Event() wcsGridSelectionChange!: EventEmitter<WcsGridRowSelectedEventDetails>;\n /**\n * Event emitted when all rows are selected or unselected\n */\n @Event() wcsGridAllSelectionChange!: EventEmitter<WcsGridAllRowSelectedEventDetails>;\n\n @Watch('data')\n onDataChange(newValue: any[]): void {\n this.updateGridRows(newValue);\n this.refreshSort(false);\n }\n\n @Watch('selectedItems')\n onSelectedItemsPropertyChange(newValue: any | any[]) {\n this.updateSelectionWithValues(newValue);\n }\n\n @Listen('wcsHiddenChange')\n onHiddenColumnChange(): void {\n // We use forceUpdate because the fact of hiding a column or not does not modify the internal structure of the grid (WcsGridRow).\n // Hide a column only impacts the way it is rendered but the grid-column remains in the dom and in our internal model.\n forceUpdate(this);\n }\n\n private updateSelectionWithValues(values: any | any[]) {\n if (this.selectionConfig === 'single') {\n this.rows.map(r => r.selected = false);\n for (const row of this.rows) {\n if (isEqual(row.data, values)) {\n row.selected = true;\n break; // only one line can be selected\n }\n }\n } else if (this.selectionConfig === 'multiple') {\n this.rows.map(r => r.selected = false);\n for (const row of this.rows) {\n if (values.find(x => isEqual(x, row.data))) {\n row.selected = true;\n }\n }\n }\n this.rows = cloneDeep(this.rows);\n }\n\n private wcsGridRowToWcsGridRowData(row: WcsGridRow): WcsGridRowData {\n return {selected: row.selected, page: row.page, data: row.data};\n }\n\n private updateGridRows(data: any[]): void {\n const rows: WcsGridRow[] = [];\n if (data && this.columns) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < data.length; i++) {\n const row: WcsGridRow = {\n uuid: uuid(),\n data: data[i],\n selected: false,\n cells: []\n };\n for (const column of this.columns) {\n row.cells.push({\n content: get(data[i], column.path),\n column,\n formatter: column.formatter\n })\n }\n rows.push(row);\n }\n this.rows = rows;\n this.updatePageIndex();\n }\n }\n\n componentDidLoad(): void {\n this.columns = this.getGridColumnsFromTemplate();\n this.paginationEl = this.wcsGridPaginationId\n ? document.getElementById(this.wcsGridPaginationId) as HTMLWcsGridPaginationElement\n : this.getGridPaginationsFromTemplate()[0];\n this.updateGridRows(this.data);\n if (this.selectedItems) {\n this.updateSelectionWithValues(this.selectedItems);\n }\n this.refreshSort(true);\n }\n\n /**\n * Handle existing column's filters (defined before the grid is instantiated)\n * @private\n */\n private refreshSort(refreshOthersColmumnsSortOrderState: boolean) {\n //fixme: why the column property can be null or undefined?\n if (this.columns) {\n const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');\n if (first && !this.serverMode) {\n this.sortBy(first);\n }\n refreshOthersColmumnsSortOrderState && this.disableSortOrderForColumns(other);\n }\n }\n\n private disableSortOrderForColumns(columns: HTMLWcsGridColumnElement[] | null | undefined): void {\n columns?.forEach(c => c.sortOrder = 'none');\n }\n\n private getGridColumnsFromTemplate(): HTMLWcsGridColumnElement[] {\n const slotted = this.el.shadowRoot.querySelector('slot[name=\"grid-column\"]') as HTMLSlotElement;\n return slotted.assignedElements() as any as HTMLWcsGridColumnElement[];\n }\n\n private getGridPaginationsFromTemplate(): HTMLWcsGridPaginationElement[] {\n const slotted = this.el.shadowRoot.querySelector('slot[name=\"grid-pagination\"]') as HTMLSlotElement;\n return slotted.assignedElements() as any as HTMLWcsGridPaginationElement[];\n }\n\n @Listen('wcsSortChange')\n sortChangeEventHandler(event: CustomEvent<WcsGridColumnSortChangeEventDetails>): void {\n if (event.detail.order === 'none') return;\n // We keep only one active sort column\n this.disableSortOrderForColumns(this.columns.filter(c => c !== event.detail.column));\n if (this.serverMode) return;\n this.sortBy(event.detail.column);\n this.updatePageIndex();\n }\n\n /**\n * Sorts the grid rows according to the given column's configuration\n * @param colmun Column from which to extract the sorting configuration\n * @private\n */\n private sortBy(colmun: HTMLWcsGridColumnElement) {\n if (colmun.sortFn) {\n this.rows = cloneDeep(this.rows)\n .sort((a: any, b: any) => colmun.sortFn(a.data, b.data, colmun) * getSortOrderInteger(colmun.sortOrder));\n } else {\n this.rows = cloneDeep(this.rows)\n .sort((a: any, b: any) => {\n const path = colmun.path;\n return ((get(a.data, path) < get(b.data, path)) ? -1 : (get(a.data, path) > get(b.data, path)) ? 1 : 0) * getSortOrderInteger(colmun.sortOrder);\n });\n }\n }\n\n /**\n * Update the page's number of all rows\n */\n private updatePageIndex(): void {\n if (!this.serverMode && this.paginationEl) {\n this.paginationEl.itemsCount = this.data.length;\n this.paginationEl.pageCount = Math.ceil(this.data.length / this.paginationEl.pageSize);\n\n if (this.paginationEl.pageCount <= 1) {\n this.paginationEl.currentPage = GridPagination.INDEX_FIRST_PAGE;\n } else if (this.paginationEl.pageCount > 0 && this.paginationEl.currentPage + 1 > this.paginationEl.pageCount) {\n this.paginationEl.currentPage = this.paginationEl.pageCount - 1;\n }\n\n const rows = cloneDeep(this.rows);\n rows.forEach((row: WcsGridRow, index: number) =>\n row.page = Math.floor(index / this.paginationEl.pageSize)\n );\n this.rows = [...rows];\n }\n }\n\n @Listen('wcsGridPaginationChange')\n paginationChangeEventHandler(): void {\n this.onPaginationChange();\n }\n\n @Listen('wcsGridPaginationChange', {target: 'window'})\n paginationChangeEventHandlerOutside(event: CustomEvent<WcsGridPaginationChangeEventDetails>): void {\n if (this.wcsGridPaginationId && this.wcsGridPaginationId === (event.target as HTMLElement).id) {\n this.onPaginationChange();\n }\n }\n\n private onPaginationChange(): void {\n if (this.serverMode) return;\n this.updatePageIndex();\n }\n\n private onRowSelection(row: WcsGridRow): void {\n if (this.selectionConfig === 'single') {\n this.rows.filter(r => r.uuid !== row.uuid).map(r => r.selected = false);\n }\n row.selected = !row.selected;\n if (this.selectionConfig !== 'single' || row.selected) {\n this.wcsGridSelectionChange.emit({row: this.wcsGridRowToWcsGridRowData(row)});\n }\n this.rows = cloneDeep(this.rows);\n }\n\n private selectAllRows(): void {\n const rows = this.getRowsForCurrentPage();\n const selected = !this.allRowsAreSelected();\n rows.map(r => r.selected = selected);\n this.wcsGridAllSelectionChange.emit({rows: selected ? rows.map(row => this.wcsGridRowToWcsGridRowData(row)) : []});\n this.rows = cloneDeep(this.rows);\n }\n\n private allRowsAreSelected(): boolean {\n const rows = this.getRowsForCurrentPage();\n return rows.length > 0 && rows.filter(row => row.selected).length === rows.length;\n }\n\n private getRowsForCurrentPage(): WcsGridRow[] {\n if (this.paginationEl) {\n return this.rows.filter(row => row.page === this.paginationEl.currentPage);\n }\n return this.rows;\n }\n\n renderSelectionColumn(row: WcsGridRow): any {\n switch (this.selectionConfig) {\n case 'none':\n return;\n case 'single':\n return <td>\n <wcs-radio checked={row.selected} onWcsRadioClick={this.onRowSelection.bind(this, row)}/>\n </td>;\n case 'multiple':\n return <td>\n <wcs-checkbox checked={row.selected} onWcsChange={this.onRowSelection.bind(this, row)}/>\n </td>;\n }\n }\n\n private getCellContent(row: WcsGridRow, cell: WcsGridCell): HTMLElement | HTMLElement[] | string | void {\n if (cell.formatter) {\n return cell.formatter(\n (h as unknown) as HyperFunc<VNode>,\n cell.column,\n this.wcsGridRowToWcsGridRowData(row)\n );\n }\n return cell.content;\n }\n\n private totalColumnCount() {\n if (!this.columns) {\n return 0;\n }\n return this.columns.length + (this.selectionConfig === 'none' ? 0 : 1);\n }\n\n render(): any {\n return (\n <Host>\n {\n <table>\n <thead>\n {\n this.selectionConfig === 'none' ? ''\n : <th class=\"wcs-grid-selection-column\">\n {\n this.selectionConfig === 'single' ? '' :\n <wcs-checkbox checked={this.allRowsAreSelected()}\n onWcsChange={this.selectAllRows.bind(this)}/>\n }\n </th>\n }\n <slot name=\"grid-column\"></slot>\n </thead>\n <tbody>\n {\n this.loading\n ? <tr>\n <td colSpan={this.totalColumnCount()} class=\"loading\">\n <wcs-spinner></wcs-spinner>\n </td>\n </tr>\n : this.rows\n ?.filter(row => this.serverMode || !this.paginationEl || row.page === this.paginationEl.currentPage)\n .map(row =>\n this.renderRow(row)\n )\n }\n </tbody>\n </table>\n }\n <slot name=\"grid-pagination\"></slot>\n </Host>\n );\n }\n\n private renderRow(row: WcsGridRow) {\n return <tr class={row.selected ? 'selected' : ''}>\n {this.renderSelectionColumn(row)}\n {row.cells?.map(cell => {\n if (cell.column.hidden) {\n return;\n }\n return cell.column.customCells\n ? (<td>\n <slot name={cell.column.id + '-' + row.data[this.rowIdPath]}/>\n </td>)\n : (<td part={cell.column.path + '-column'}>{this.getCellContent(row, cell)}</td>)\n }\n )}\n </tr>;\n }\n}\n\n/**\n * Pour resize le tableau\n * https://www.brainbell.com/javascript/making-resizable-table-js.htmls\n *\n */\n"],"mappings":"uU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O,KAAK4N,mBAAoBG,MAAM,WACxCT,EAAA,uBAGNa,EAAAnO,KAAKiJ,QAAI,MAAAkF,SAAA,SAAAA,EACLtD,QAAOxB,GAAOrJ,KAAK+K,aAAe/K,KAAKoK,cAAgBf,EAAIM,OAAS3J,KAAKoK,aAAaiC,cACvFnD,KAAIG,GACDrJ,KAAKoO,UAAU/E,OAMvCiE,EAAA,QAAMU,KAAK,oB,CAKfI,UAAU/E,G,MACd,OAAOiE,EAAA,MAAIS,MAAO1E,EAAID,SAAW,WAAa,IACzCpJ,KAAKqN,sBAAsBhE,IAC3B8E,EAAA9E,EAAIQ,SAAK,MAAAsE,SAAA,S,EAAEjF,KAAIyE,IACR,GAAIA,EAAK7D,OAAOuE,OAAQ,CACpB,M,CAEJ,OAAOV,EAAK7D,OAAOwE,YACZhB,EAAA,UACCA,EAAA,QAAMU,KAAML,EAAK7D,OAAO+C,GAAK,IAAMxD,EAAIE,KAAKvJ,KAAKuO,cAElDjB,EAAA,MAAIkB,KAAMb,EAAK7D,OAAOtI,KAAO,WAAYxB,KAAK0N,eAAerE,EAAKsE,GAAY,I"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as o,g as i}from"./p-a2df3a49.js";import{b as n,i as a,a as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as s,H as o,g as i}from"./p-a2df3a49.js";import{b as n,i as a,a as r}from"./p-3dc6b507.js";import{r as d}from"./p-1a170e8d.js";const l=':host{display:block;padding-bottom:var(--wcs-padding)}:host .menu-button{display:block;font-weight:500;padding-left:calc(3 * var(--wcs-base-margin))}:host .arrow-icon{display:none}:host .arrow-container{display:none}:host .label{text-transform:uppercase;font-size:16px;cursor:unset;font-weight:500;color:var(--wcs-gray);text-decoration:none}:host .drawer{display:contents}:host .drawer-container{display:contents}:host .drawer-description{display:none}:host .menu-items{}:host .menu-items ::slotted(a):after{font-family:icons;padding-left:var(--wcs-base-margin);font-size:0.6rem;content:"\\f107";line-height:1;box-sizing:border-box}:host .menu-items ::slotted(a){user-select:none;cursor:pointer;text-decoration:none;font-size:16px;color:var(--wcs-gray);font-weight:500;display:block;padding-top:calc(1.5 * var(--wcs-base-margin));padding-bottom:calc(1.5 * var(--wcs-base-margin));padding-left:calc(6 * var(--wcs-base-margin))}:host .menu-items ::slotted(a:focus-visible){outline:2px dashed var(--wcs-primary);outline-offset:0.1rem;border-radius:2px}@supports not selector(::slotted(a:focus-visible)){:host .menu-items ::slotted(a:focus-within){outline:2px dashed var(--wcs-primary);outline-offset:0.1rem;border-radius:2px}}@media screen and (min-width: 576px){:host{height:100%;padding-bottom:unset}:host .menu-button{display:flex;align-items:center;height:100%;cursor:pointer;user-select:none;font-weight:unset;padding-left:unset}:host .menu-button:focus-visible{outline:2px dashed var(--wcs-primary);outline-offset:0.1rem;border-radius:2px}@supports not selector(.menu-button:focus-visible){:host{outline:2px dashed var(--wcs-primary);outline-offset:0.1rem;border-radius:2px}}:host .label{text-transform:unset;cursor:pointer}:host .arrow-icon{display:inline-block;font-family:icons;font-size:0.6rem;line-height:1;box-sizing:border-box}:host .arrow-container{display:unset;margin-left:var(--wcs-base-margin)}:host .arrow-icon:not([data-open]){transform:rotate(90deg)}:host .arrow-icon[data-open]{transform:rotate(-90deg)}:host .drawer{display:none;position:absolute;top:75px;z-index:8888;left:0;width:100%;box-sizing:border-box;padding:50px;background-color:var(--wcs-primary);color:var(--wcs-white)}:host .drawer-content{display:flex;justify-content:space-between;max-width:62.5%;flex:1}:host .drawer-content div:first-child{flex:0.8}:host .drawer-content div{max-width:260px}:host .menu-items{padding:0 80px 0 50px;display:flex;flex-direction:column;align-items:flex-end}:host .menu-items ::slotted(*:not(:first-child)){margin-top:24px}:host .menu-items ::slotted(a){color:var(--wcs-white);font-weight:400;display:unset;padding-top:unset;padding-bottom:unset;padding-left:unset}:host .menu-items ::slotted(a:focus-visible){outline:2px dashed var(--wcs-white);outline-offset:0.1rem;border-radius:2px}@supports not selector(::slotted(a:focus-visible)){:host .menu-items ::slotted(a:focus-within){outline:2px dashed var(--wcs-white);outline-offset:0.1rem;border-radius:2px}}:host .drawer-container{display:flex;max-width:var(--wcs-com-content-max-width);margin:0 auto}:host .drawer-container h3{margin:0 0 24px 0;font-size:1.5rem;line-height:1.25;font-weight:400}:host .drawer-container p{margin-top:0;margin-bottom:1rem;font-weight:500;font-size:1rem;line-height:1.375}:host .drawer[data-open]{display:block}:host .drawer-description{display:block}}';const c="WCS-COM-NAV-CATEGORY";const h=class{constructor(s){t(this,s);this.wcsSubmenuOpened=e(this,"wcsSubmenuOpened",7);this.wcsClickOnFinalAction=e(this,"wcsClickOnFinalAction",7);this.label=undefined;this.panelTitle=undefined;this.panelDescription=undefined;this.menuOpen=false}componentWillLoad(){const t=this.el.querySelectorAll(":scope > wcs-com-nav-category:not([slot])");d(t,c)}onWindowClickEvent(t){if(this.menuOpen)this.menuOpen=false}onSubmenuOpened(t){if(t.detail.menuElement!==this.el){this.menuOpen=false}}onEscapeKeyDown(t){if(n(t)&&this.menuOpen){this.menuOpen=false}}async close(){this.menuOpen=false}async open(){this.menuOpen=true}onClick(t){t.stopPropagation();this.wcsSubmenuOpened.emit({menuElement:this.el})}handleMenuItemsKeyDown(t){if(a(t)||r(t)){this.handleMenuItemsClick(t)}}handleMenuKeyDown(t){if(a(t)||r(t)){this.menuOpen=!this.menuOpen}}handleMenuItemsClick(t){if(t.target.tagName==="A"){this.close();this.wcsClickOnFinalAction.emit()}}wcsCategoryItemClickedHandler(t){this.close()}render(){return s(o,{onClick:t=>this.onClick(t)},s("div",{tabindex:screen.width<576?"-1":"0",onClick:t=>this.menuOpen=!this.menuOpen,onKeyDown:t=>this.handleMenuKeyDown(t),class:"menu-button"},s("span",{class:"label"},this.label),s("span",{class:"arrow-container"},s("span",{class:"arrow-icon","data-open":this.menuOpen},""))),s("div",{class:"drawer","data-open":this.menuOpen,tabIndex:-1},s("div",{class:"drawer-container"},s("div",{class:"drawer-content"},s("div",{class:"drawer-description"},s("h3",null,this.panelTitle),s("p",null,this.panelDescription)),s("div",{class:"menu-items",onClick:t=>this.handleMenuItemsClick(t),onKeyDown:t=>this.handleMenuItemsKeyDown(t)},s("slot",null))))))}get el(){return i(this)}};h.style=l;export{h as wcs_com_nav_submenu};
|
|
2
|
+
//# sourceMappingURL=p-7269272f.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as e,H as o,g as i}from"./p-a2df3a49.js";import{h as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,H as o,g as i}from"./p-a2df3a49.js";import{h as r}from"./p-3dc6b507.js";import{c as n}from"./p-314d3097.js";const a='#menu{background-color:var(--wcs-gray);color:white;display:none;padding:var(--wcs-padding)}#menu[data-show]{display:block;z-index:9999}#menu[data-popper-placement^=top]>#arrow{bottom:-4px}#menu[data-popper-placement^=bottom]>#arrow{top:-4px}#menu[data-popper-placement^=left]>#arrow{right:-4px}#menu[data-popper-placement^=right]>#arrow{left:-4px}:host{display:flex;align-items:center;height:32px;padding-left:var(--wcs-padding);background-color:var(--wcs-gray-light)}#toggle-menu-icon{cursor:pointer;padding:0 var(--wcs-padding);user-select:none}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit}#arrow{visibility:hidden}#arrow::before{visibility:visible;content:"";transform:rotate(45deg)}';const s=class{constructor(e){t(this,e);this.showPopoverMenu=false;this.text=undefined}componentDidLoad(){this.menu=this.el.shadowRoot.getElementById("toggle-menu-icon");this.tooltip=this.el.shadowRoot.getElementById("menu");this.popper=n(this.menu,this.tooltip,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,8]}}]})}onWindowClickEvent(t){if(r(t,this.tooltip)||r(t,this.menu)){return}else{if(this.showPopoverMenu){this.toogleMenu()}}}toogleMenu(){this.showPopoverMenu=!this.showPopoverMenu}componentDidRender(){if(this.popper){this.popper.update()}}render(){return e(o,null,e("span",null,this.text),e("wcs-mat-icon",{id:"toggle-menu-icon",icon:"more_horiz",size:"m",onClick:t=>{this.toogleMenu()}}),e("span",{id:"menu","data-show":this.showPopoverMenu},e("div",{id:"arrow","data-popper-arrow":true}),e("slot",null)))}get el(){return i(this)}};s.style=a;export{s as wcs_galactic_menu};
|
|
2
|
+
//# sourceMappingURL=p-7519a270.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as e,g as n}from"./p-a2df3a49.js";import{c as a,d as r,e as o,f as h}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as s,H as e,g as n}from"./p-a2df3a49.js";import{c as a,d as r,e as o,f as h}from"./p-3dc6b507.js";const c=["m","l"];function u(i){return c.includes(i)}const d="@keyframes spin-animation-up{0%{transform:translateY(0);transform-origin:center;opacity:1}50%{opacity:0.5}100%{transform:translateY(30px);transform-origin:center;opacity:1}}@keyframes spin-animation-down{0%{transform:translateY(0);transform-origin:center;opacity:1}50%{opacity:0.5}100%{transform:translateY(-30px);transform-origin:center;opacity:1}}:host{box-sizing:border-box;height:var(--wcs-counter-host-height);--wcs-input-icon-color:var(--wcs-text-medium);--wcs-internal-input-border-radius:calc(var(--wcs-border-radius) * 10);--wcs-internal-input-border-width:2px;font-family:var(--wcs-font-sans-serif);font-size:var(--wcs-counter-font-size);font-weight:bold;display:flex;align-items:center;padding:var(--wcs-counter-host-padding);width:fit-content;overflow:hidden;border-radius:var(--wcs-internal-input-border-radius);background-color:var(--wcs-light);border:var(--wcs-internal-input-border-width) solid var(--wcs-light);background-clip:padding-box}:host .counter-container{height:var(--wcs-counter-host-height);display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0 calc(2 * var(--wcs-base-margin));position:relative}:host .outliers{position:absolute}:host #outlier-down{top:calc(var(--wcs-counter-host-height) / 2 * -1)}:host #outlier-up{bottom:calc(var(--wcs-counter-host-height) / 2 * -1)}:host span.current-value:focus-visible{outline:2px dashed var(--wcs-primary);outline-offset:4px;border-radius:0.1rem}:host .animate-up{animation:spin-animation-up 0.175s ease-in-out}:host .animate-down{animation:spin-animation-down 0.175s ease-in-out}:host .hidden{opacity:0}:host([size=m]){--wcs-counter-host-padding:4px;--wcs-counter-host-height:var(--wcs-size-m);--wcs-counter-font-size:1rem}:host([size=l]){--wcs-counter-host-padding:8px;--wcs-counter-host-height:var(--wcs-size-l);--wcs-counter-font-size:1.0625rem}";const l=.175;const f=class{constructor(s){i(this,s);this.wcsChange=t(this,"wcsChange",7);this.wcsBlur=t(this,"wcsBlur",7);this.animateRunning=false;this.getCounterContainer=()=>Array.from(this.el.shadowRoot.children).find((i=>i.tagName==="DIV"));this.handleDecrement=()=>{if(this.min===undefined||this.value>this.min){this.animateRunning=true;this.value-=this.step;this.notifyChange();this.animate("up")}};this.handleIncrement=()=>{if(this.max===undefined||this.value<this.max){this.animateRunning=true;this.value+=this.step;this.notifyChange();this.animate("down")}};this.animate=i=>{this.animateRunning=true;const t=this.getCounterContainer();const s=Array.from(t.children).filter((i=>i.classList.contains("outliers")));t.classList.add("animate-"+i);s.forEach((i=>{i.classList.remove("hidden")}));setTimeout((()=>{t.classList.remove("animate-"+i);s.forEach((i=>{i.classList.add("hidden")}));this.displayedValue=this.value;this.animateRunning=false}),1e3*l-20)};this.size="m";this.label=undefined;this.min=undefined;this.max=undefined;this.step=1;this.value=undefined;this.displayedValue=undefined}componentWillLoad(){this.handleValueChange();if(!u(this.size)){console.error(`Invalid size value for wcs-counter : "${this.size}". Must be one of "${c.join(", ")}"`);this.size="m"}}valueChange(i,t){if(t===i)return;this.handleValueChange()}handleValueChange(){this.setMinimumIfValueIsUndefinedOrNull();this.ensureValueIsNotOutOfMinMax();this.updateDisplayValueIfNoAnimationRunning()}updateDisplayValueIfNoAnimationRunning(){if(!this.animateRunning){this.displayedValue=this.value}}ensureValueIsNotOutOfMinMax(){if(this.max!==undefined&&this.value>this.max){this.value=this.max}else if(this.min!==undefined&&this.value<this.min){this.value=this.min}}setMinimumIfValueIsUndefinedOrNull(){var i;if(this.value===undefined||this.value===null){this.value=(i=this.min)!==null&&i!==void 0?i:0}}onKeyDown(i){if(a(i)){i.preventDefault();this.handleIncrement()}if(r(i)){i.preventDefault();this.handleDecrement()}if(o(i)){i.preventDefault();if(this.min!=null){this.value=this.min;this.displayedValue=this.value;this.notifyChange()}}if(h(i)){i.preventDefault();if(this.max!=null){this.value=this.max;this.displayedValue=this.value;this.notifyChange()}}}notifyChange(){this.wcsChange.emit({value:this.value})}render(){return s(e,null,s("wcs-button",{class:"wcs-primary",shape:"round",size:"s",tabindex:-1,onClick:()=>this.handleDecrement(),onBlur:i=>this.wcsBlur.emit(i),disabled:this.value===this.min},s("wcs-mat-icon",{icon:"remove",size:"s"})),s("div",{class:"counter-container"},s("span",{id:"outlier-down",class:"outliers hidden","aria-hidden":"true"},this.displayedValue-this.step),s("span",{tabindex:"0",role:"spinbutton",class:"current-value",onBlur:i=>this.wcsBlur.emit(i),onKeyDown:i=>this.onKeyDown(i),"aria-valuenow":this.value,"aria-valuetext":this.value,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-label":this.label},this.displayedValue),s("span",{id:"outlier-up",class:"outliers hidden","aria-hidden":"true"},this.displayedValue+this.step)),s("wcs-button",{class:"wcs-primary",shape:"round",size:"s",tabindex:-1,onClick:()=>this.handleIncrement(),onBlur:i=>this.wcsBlur.emit(i),disabled:this.value===this.max},s("wcs-mat-icon",{icon:"add",size:"s"})))}static get delegatesFocus(){return true}get el(){return n(this)}static get watchers(){return{value:["valueChange"]}}};f.style=d;export{f as wcs_counter};
|
|
2
|
+
//# sourceMappingURL=p-8c4ed883.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WcsCounterSizeValues","isWcsCounterSize","size","includes","counterCss","ANIMATION_DURATION","Counter","this","animateRunning","getCounterContainer","Array","from","el","shadowRoot","children","find","tagName","handleDecrement","min","undefined","value","step","notifyChange","animate","handleIncrement","max","direction","counterContainer","outliers","filter","span","classList","contains","add","forEach","remove","setTimeout","displayedValue","componentWillLoad","handleValueChange","console","error","join","valueChange","newVal","oldVal","setMinimumIfValueIsUndefinedOrNull","ensureValueIsNotOutOfMinMax","updateDisplayValueIfNoAnimationRunning","_a","onKeyDown","_event","isKeyup","preventDefault","isKeydown","isHomeKey","isEndKey","wcsChange","emit","render","h","Host","class","shape","tabindex","onClick","onBlur","event","wcsBlur","disabled","icon","id","role","label"],"sources":["./src/components/counter/counter-interface.ts","./src/components/counter/counter.scss?tag=wcs-counter&encapsulation=shadow","./src/components/counter/counter.tsx"],"sourcesContent":["import { WcsSize } from \"../../shared-types\";\n\nexport interface CounterChangeEventDetail {\n value: number;\n}\n\nexport const WcsCounterSizeValues = ['m', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object.\n\nexport type WcsCounterSize = Extract<WcsSize, typeof WcsCounterSizeValues[number]>;\n\nexport function isWcsCounterSize(size: string): size is WcsCounterSize {\n // @ts-ignore : ignore size type, as it is checked with WcsInputSizeValues\n return WcsCounterSizeValues.includes(size);\n}\n","@import '../../style/focus-outline.scss';\n\n@keyframes spin-animation-up {\n 0% {\n transform: translateY(0);\n transform-origin: center;\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n 100% {\n transform: translateY(30px);\n transform-origin: center;\n opacity: 1;\n }\n}\n\n@keyframes spin-animation-down {\n 0% {\n transform: translateY(0);\n transform-origin: center;\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n 100% {\n transform: translateY(-30px);\n transform-origin: center;\n opacity: 1;\n }\n}\n\n:host {\n box-sizing: border-box;\n height: var(--wcs-counter-host-height);\n --wcs-input-icon-color: var(--wcs-text-medium);\n --wcs-internal-input-border-radius: calc(var(--wcs-border-radius) * 10); // 80 px\n --wcs-internal-input-border-width: 2px;\n font-family: var(--wcs-font-sans-serif);\n font-size: var(--wcs-counter-font-size);\n font-weight: bold;\n display: flex;\n align-items: center;\n padding: var(--wcs-counter-host-padding);\n width: fit-content;\n overflow: hidden;\n border-radius: var(--wcs-internal-input-border-radius);\n background-color: var(--wcs-light);\n border: var(--wcs-internal-input-border-width) solid var(--wcs-light);\n background-clip: padding-box;\n\n .counter-container {\n height: var(--wcs-counter-host-height);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n margin: 0 calc(2* var(--wcs-base-margin));\n position: relative;\n }\n\n .outliers {\n position: absolute;\n }\n\n #outlier-down {\n top: calc((var(--wcs-counter-host-height) / 2) * -1);\n }\n\n #outlier-up {\n bottom: calc((var(--wcs-counter-host-height) / 2) * -1);\n }\n\n span.current-value {\n &:focus-visible {\n @include focus-outline;\n }\n }\n\n .animate-up {\n animation: spin-animation-up 0.175s ease-in-out;\n }\n\n .animate-down {\n animation: spin-animation-down 0.175s ease-in-out;\n }\n\n .hidden {\n opacity: 0;\n }\n}\n\n:host([size='m']) { // Default\n --wcs-counter-host-padding: 4px;\n --wcs-counter-host-height: var(--wcs-size-m);\n --wcs-counter-font-size: 1rem;\n}\n\n:host([size='l']) {\n --wcs-counter-host-padding: 8px;\n --wcs-counter-host-height: var(--wcs-size-l);\n --wcs-counter-font-size: 1.0625rem;\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport { isEndKey, isHomeKey, isKeydown, isKeyup } from '../../utils/helpers';\nimport { CounterChangeEventDetail, isWcsCounterSize, WcsCounterSize, WcsCounterSizeValues } from './counter-interface';\n\nconst ANIMATION_DURATION = 0.175 // seconds\n\n/**\n * Counter component, meant to be used for small range of values (e.g : 0 - 5).<br>\n * For larger or specific ranges, please use [wcs-input (type number)](.?path=/docs/components-input--documentation)\n */\n@Component({\n tag: 'wcs-counter',\n styleUrl: 'counter.scss',\n shadow: {\n delegatesFocus: true\n },\n})\nexport class Counter implements ComponentInterface {\n @Element() private el!: HTMLElement;\n\n /**\n * Specify the size (height) of the counter.\n */\n @Prop({reflect: true}) size: WcsCounterSize = 'm';\n\n /**\n * The label of the counter.<br/>\n * e.g. Number of passengers, train carriages, railroad tracks...\n */\n @Prop({mutable: false}) label!: string;\n\n /**\n * The minimum value of the counter.\n * If the value of the min attribute isn't set, then the element has no minimum value.\n */\n @Prop({mutable: true}) min?: number;\n\n /**\n * The maximum value of the counter.\n * If the value of the max attribute isn't set, then the element has no maximum value.\n */\n @Prop({mutable: true}) max?: number;\n\n /**\n * Defines by how much the counter will be incremented or decremented.\n */\n @Prop({mutable: true}) step: number = 1;\n\n /**\n * Emitted when the value of the counter has changed.\n */\n @Event() wcsChange!: EventEmitter<CounterChangeEventDetail>;\n\n /**\n * The current value of the counter.\n */\n @Prop({mutable: true}) value!: number;\n\n /**\n * Only for animation and display purpose\n */\n @State() private displayedValue: number;\n\n private animateRunning = false;\n\n /**\n * Emitted when the counter loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.handleValueChange();\n\n if (!isWcsCounterSize(this.size)) {\n console.error(`Invalid size value for wcs-counter : \"${this.size}\". Must be one of \"${WcsCounterSizeValues.join(', ')}\"`);\n this.size = \"m\"; // Default fallback value\n }\n }\n\n /**\n * Current value change => handle event and interval\n */\n @Watch('value')\n valueChange(newVal: any, oldVal: any) {\n if(oldVal === newVal) return;\n\n this.handleValueChange();\n }\n\n private handleValueChange() {\n this.setMinimumIfValueIsUndefinedOrNull();\n this.ensureValueIsNotOutOfMinMax();\n this.updateDisplayValueIfNoAnimationRunning();\n }\n\n private updateDisplayValueIfNoAnimationRunning() {\n if (!this.animateRunning) {\n this.displayedValue = this.value;\n }\n }\n\n private ensureValueIsNotOutOfMinMax() {\n if (this.max !== undefined && this.value > this.max) {\n this.value = this.max;\n } else if (this.min !== undefined && this.value < this.min) {\n this.value = this.min;\n }\n }\n\n private setMinimumIfValueIsUndefinedOrNull() {\n if (this.value === undefined || this.value === null) {\n this.value = this.min ?? 0;\n }\n }\n\n onKeyDown(_event: KeyboardEvent) {\n if (isKeyup(_event)) {\n _event.preventDefault();\n this.handleIncrement()\n }\n if (isKeydown(_event)) {\n _event.preventDefault();\n this.handleDecrement()\n }\n if (isHomeKey(_event)) {\n _event.preventDefault();\n if (this.min != null) {\n this.value = this.min;\n this.displayedValue = this.value;\n this.notifyChange();\n }\n }\n if (isEndKey(_event)) {\n _event.preventDefault();\n if (this.max != null) {\n this.value = this.max;\n this.displayedValue = this.value;\n this.notifyChange();\n }\n }\n }\n\n private notifyChange() {\n this.wcsChange.emit({\n value: this.value\n });\n }\n \n private getCounterContainer = (): HTMLDivElement => {\n return Array.from(this.el.shadowRoot.children)\n .find(el => el.tagName === 'DIV') as HTMLDivElement;\n }\n\n private handleDecrement = () => {\n if (this.min === undefined || this.value > this.min) {\n // we set animateRunning here to prevent the watch method on value prop from affecting the displayed value\n // before the animation runs.\n this.animateRunning = true; \n this.value -= this.step;\n this.notifyChange();\n this.animate('up');\n }\n };\n\n private handleIncrement = () => {\n if (this.max === undefined || this.value < this.max) {\n // we set animateRunning here to prevent the watch method on value prop from affecting the displayed value\n // before the animation runs.\n this.animateRunning = true; \n this.value += this.step;\n this.notifyChange();\n this.animate('down');\n }\n };\n\n private animate = (direction: 'up' | 'down'): void => {\n // In case someone call animate function, we want ensured that animateRunning is set to true to prevent other \n // method to mutate the displayedValue.\n this.animateRunning = true; \n\n const counterContainer = this.getCounterContainer();\n const outliers = Array.from(counterContainer.children)\n .filter((span: HTMLSpanElement) => span.classList.contains('outliers'));\n\n counterContainer.classList.add('animate-' + direction);\n outliers.forEach((span: HTMLSpanElement) => {\n span.classList.remove('hidden')\n });\n setTimeout(() => {\n counterContainer.classList.remove('animate-' + direction);\n outliers.forEach((span: HTMLSpanElement) => {\n span.classList.add('hidden')\n });\n this.displayedValue = this.value;\n\n this.animateRunning = false;\n }, 1000 * ANIMATION_DURATION - 20);\n }\n\n render() {\n return (\n <Host>\n <wcs-button class=\"wcs-primary\"\n shape=\"round\"\n size=\"s\"\n tabindex={-1}\n onClick={() => this.handleDecrement()}\n onBlur={(event) => this.wcsBlur.emit(event)}\n disabled={this.value === this.min}>\n <wcs-mat-icon icon=\"remove\" size=\"s\"></wcs-mat-icon>\n </wcs-button>\n <div class=\"counter-container\">\n <span id=\"outlier-down\" class=\"outliers hidden\"\n aria-hidden=\"true\">{this.displayedValue - this.step}</span>\n <span tabindex=\"0\"\n role=\"spinbutton\"\n class=\"current-value\"\n onBlur={(event) => this.wcsBlur.emit(event)}\n onKeyDown={(event) => this.onKeyDown(event)}\n aria-valuenow={this.value}\n aria-valuetext={this.value}\n aria-valuemin={this.min}\n aria-valuemax={this.max}\n aria-label={this.label}>{this.displayedValue}</span>\n <span id=\"outlier-up\" class=\"outliers hidden\"\n aria-hidden=\"true\">{this.displayedValue + this.step}</span>\n </div>\n <wcs-button class=\"wcs-primary\"\n shape=\"round\"\n size=\"s\"\n tabindex={-1}\n onClick={() => this.handleIncrement()}\n onBlur={(event) => this.wcsBlur.emit(event)}\n disabled={this.value === this.max}>\n <wcs-mat-icon icon=\"add\" size=\"s\"></wcs-mat-icon>\n </wcs-button>\n </Host>\n );\n }\n}\n"],"mappings":"yHAMO,MAAMA,EAAuB,CAAC,IAAK,K,SAI1BC,EAAiBC,GAE7B,OAAOF,EAAqBG,SAASD,EACzC,CCbA,MAAME,EAAa,8zDCenB,MAAMC,EAAqB,K,MAadC,EAAO,M,+FA8CRC,KAAAC,eAAiB,MAqFjBD,KAAAE,oBAAsB,IACnBC,MAAMC,KAAKJ,KAAKK,GAAGC,WAAWC,UAChCC,MAAKH,GAAMA,EAAGI,UAAY,QAG3BT,KAAAU,gBAAkB,KACtB,GAAIV,KAAKW,MAAQC,WAAaZ,KAAKa,MAAQb,KAAKW,IAAK,CAGjDX,KAAKC,eAAiB,KACtBD,KAAKa,OAASb,KAAKc,KACnBd,KAAKe,eACLf,KAAKgB,QAAQ,K,GAIbhB,KAAAiB,gBAAkB,KACtB,GAAIjB,KAAKkB,MAAQN,WAAaZ,KAAKa,MAAQb,KAAKkB,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AG,aAAaT,MAAM,kBAAiB,cAC3B,QAAQvD,KAAK8B,eAAiB9B,KAAKc,OAEzDuC,EAAA,cAAYE,MAAM,cACNC,MAAM,QACN7D,KAAK,IACL8D,UAAW,EACXC,QAAS,IAAM1D,KAAKiB,kBACpB0C,OAASC,GAAU5D,KAAK6D,QAAQV,KAAKS,GACrCE,SAAU9D,KAAKa,QAAUb,KAAKkB,KACtCmC,EAAA,gBAAcU,KAAK,MAAMpE,KAAK,O"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,c as e,h as t,H as i,g as r}from"./p-a2df3a49.js";import{i as a,a as s}from"./p-3dc6b507.js";const n=':host{width:fit-content}:host([mode=radio]:focus-within){transition:none;outline:2px dashed var(--wcs-primary);outline-offset:0;border-radius:0.5rem}:host([mode=horizontal]:focus-within){transition:none;outline:2px dashed var(--wcs-primary);outline-offset:2px;border-radius:0.5rem}:host([mode=radio]) input,:host([mode=horizontal]) input{position:absolute;opacity:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([mode=radio]) label,:host([mode=horizontal]) label{margin-bottom:0;color:var(--wcs-text-medium);background-color:transparent;font-weight:500 !important;display:inline-block}:host([mode=radio]) label:before,:host([mode=horizontal]) label:before{border-radius:50%;border:2px solid var(--wcs-text-disabled);position:relative;width:1.125rem;height:1.125rem;pointer-events:none;content:"";background-color:var(--wcs-white)}:host([mode=radio]) label:after,:host([mode=horizontal]) label:after{transition:0.175s ease-in-out;position:relative;width:1.125rem;height:1.125rem;content:"";background:no-repeat 50%/50% 50%}:host([disabled]) label{color:var(--wcs-text-disabled);cursor:not-allowed}:host(:not([disabled])) label{cursor:pointer}:host([mode=radio][checked]) label,:host([mode=horizontal][checked]) label{color:var(--wcs-primary)}:host([mode=radio][checked]) label:before,:host([mode=horizontal][checked]) label:before{border-color:var(--wcs-primary);background-color:var(--wcs-primary);outline:solid 2px var(--wcs-white);outline-offset:-4px}:host([mode=radio]:hover):not([disabled]) label,:host([mode=horizontal]:hover):not([disabled]) label{color:var(--wcs-primary)}:host([mode=radio]:hover):not([disabled]) label:before,:host([mode=horizontal]:hover):not([disabled]) label:before{border-color:var(--wcs-primary)}:host([mode=radio]) label{padding:0.125rem;border:none;transition:0.175s ease-in-out}:host([mode=radio]) label:before{transition:0.175s ease-in-out;margin-right:var(--wcs-base-margin);display:inline-block;top:3px;box-sizing:border-box}:host([mode=radio]) label:empty::before{margin-right:0}:host([mode=horizontal]){height:fit-content}:host([mode=horizontal]) label:before{transition:background-color 0.175s ease-in-out;margin:auto auto var(--wcs-base-margin);display:block}:host([mode=horizontal]) label:empty::before{margin-bottom:0}:host([mode=option]){padding:var(--wcs-base-margin) calc(var(--wcs-base-margin) / 2);font-weight:500 !important}:host([mode=option]) input{position:absolute;z-index:-1;opacity:0;box-sizing:border-box;padding:0}:host([mode=option]) label{padding:5px calc(2 * var(--wcs-base-margin));margin-bottom:0;color:var(--wcs-white);white-space:nowrap;border-radius:0.4375rem;transition:0.175s ease-in-out}:host([mode=option]:focus-within) label{outline:2px dashed var(--wcs-white);outline-offset:0.1rem;border-radius:0.4375rem}:host([mode=option][checked]) label{font-weight:500 !important;color:var(--wcs-primary);background-color:var(--wcs-white)}';const d=class{constructor(t){o(this,t);this.wcsRadioClick=e(this,"wcsRadioClick",7);this.inputId=`wcs-rb-${h++}`;this.mode="radio";this.value=undefined;this.label=undefined;this.checked=false;this.disabled=false;this.name=undefined}onKeyDown(o){if((a(o)||s(o))&&!this.el.checked){this.checked=true;this.inputEl.click()}}checkedChanged(o){if(o){this.inputEl.click()}else{this.inputEl.click()}}componentWillLoad(){if(this.value===undefined){this.value=this.el.innerText||""}}componentDidLoad(){this.inputEl=this.el.shadowRoot.querySelector("input");this.inputEl.addEventListener("change",(o=>{this.emitRadioChangeEvent();this.checked=true}))}emitRadioChangeEvent(){this.wcsRadioClick.emit({label:this.label,source:this.el,value:this.value})}render(){return t(i,Object.assign({slot:"option"},this.disabled?{tabIndex:-1}:{}),t("input",{id:this.inputId,type:"radio",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled,"aria-disabled":this.disabled?"true":null,"aria-checked":`${this.checked}`}),t("label",{htmlFor:`${this.inputId}`},this.label))}static get delegatesFocus(){return true}get el(){return r(this)}static get watchers(){return{checked:["checkedChanged"]}}};let h=0;d.style=n;export{d as wcs_radio};
|
|
2
|
+
//# sourceMappingURL=p-8fed8b1c.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["radioCss","Radio","this","inputId","radioButtonIds","onKeyDown","_event","isSpaceKey","isEnterKey","el","checked","inputEl","click","checkedChanged","newValue","componentWillLoad","value","undefined","innerText","componentDidLoad","shadowRoot","querySelector","addEventListener","_","emitRadioChangeEvent","wcsRadioClick","emit","label","source","render","h","Host","Object","assign","slot","disabled","tabIndex","id","type","name","htmlFor"],"sources":["./src/components/radio/radio.scss?tag=wcs-radio&encapsulation=shadow","./src/components/radio/radio.tsx"],"sourcesContent":["@import '../../style/focus-outline.scss';\n\n:host {\n width: fit-content;\n}\n\n:host([mode=radio]:focus-within) {\n transition: none;\n @include focus-outline($border-radius: 0.5rem, $outline-offset: 0);\n}\n\n:host([mode=horizontal]:focus-within) {\n transition: none;\n @include focus-outline($border-radius: 0.5rem, $outline-offset: 2px);\n}\n\n:host([mode=radio]),\n:host([mode=horizontal]) {\n input {\n position: absolute;\n opacity: 0;\n height: 1px;\n width: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n\n label {\n margin-bottom: 0;\n color: var(--wcs-text-medium);\n background-color: transparent;\n font-weight: 500 !important;\n display: inline-block;\n\n &:before {\n border-radius: 50%;\n border: 2px solid var(--wcs-text-disabled);\n position: relative;\n width: 1.125rem;\n height: 1.125rem;\n pointer-events: none;\n content: \"\";\n background-color: var(--wcs-white);\n }\n\n &:after {\n transition: 0.175s ease-in-out;\n position: relative;\n width: 1.125rem;\n height: 1.125rem;\n content: \"\";\n background: no-repeat 50% / 50% 50%;\n }\n }\n}\n\n:host([disabled]) {\n label {\n color: var(--wcs-text-disabled);\n cursor: not-allowed;\n }\n}\n\n:host(:not([disabled])) {\n label {\n cursor: pointer;\n }\n}\n\n:host([mode=radio][checked]),\n:host([mode=horizontal][checked]) {\n label {\n color: var(--wcs-primary);\n\n &:before {\n border-color: var(--wcs-primary);\n background-color: var(--wcs-primary);\n outline: solid 2px var(--wcs-white);\n outline-offset: -4px;\n }\n }\n}\n\n:host([mode=radio]:hover):not([disabled]),\n:host([mode=horizontal]:hover):not([disabled]) {\n label {\n color: var(--wcs-primary);\n\n &:before {\n border-color: var(--wcs-primary);\n }\n }\n}\n\n:host([mode=radio]) {\n label {\n padding: 0.125rem;\n border: none;\n transition: 0.175s ease-in-out;\n\n &:before {\n transition: 0.175s ease-in-out;\n margin-right: var(--wcs-base-margin);\n display: inline-block;\n top: 3px;\n box-sizing: border-box;\n }\n\n &:empty::before {\n margin-right: 0;\n }\n }\n}\n\n:host([mode=horizontal]) {\n height: fit-content;\n label {\n &:before {\n transition: background-color 0.175s ease-in-out;\n margin: auto auto var(--wcs-base-margin);\n display: block;\n }\n\n &:empty::before {\n margin-bottom: 0;\n }\n }\n}\n\n:host([mode=option]) {\n padding: var(--wcs-base-margin) calc(var(--wcs-base-margin) / 2);\n font-weight: 500 !important;\n\n input {\n position: absolute;\n z-index: -1;\n opacity: 0;\n box-sizing: border-box;\n padding: 0;\n }\n\n label {\n padding: 5px calc(2 * var(--wcs-base-margin));\n margin-bottom: 0;\n color: var(--wcs-white);\n white-space: nowrap;\n border-radius: 0.4375rem;\n transition: 0.175s ease-in-out;\n }\n}\n\n:host([mode=option]:focus-within) {\n label {\n @include focus-outline(var(--wcs-white), 0.4375rem, 0.1rem);\n }\n}\n\n:host([mode=option][checked]) {\n label {\n font-weight: 500 !important;\n color: var(--wcs-primary);\n background-color: var(--wcs-white);\n }\n}\n","import {\n Component,\n ComponentInterface,\n h,\n Host,\n Prop,\n Element,\n Event,\n EventEmitter,\n Listen,\n Watch\n} from '@stencil/core';\nimport { RadioChosedEvent } from './radio-interface';\nimport { RadioGroupMode } from '../radio-group/radio-group-interface';\nimport { isEnterKey, isSpaceKey } from '../../utils/helpers';\n\n@Component({\n tag: 'wcs-radio',\n styleUrl: 'radio.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class Radio implements ComponentInterface {\n private inputId = `wcs-rb-${radioButtonIds++}`;\n private inputEl: HTMLInputElement;\n @Element() private el!: HTMLWcsRadioElement;\n @Prop({ reflect: true, mutable: false }) mode: RadioGroupMode = 'radio';\n\n @Prop({ mutable: true, reflect: true }) value: any | any[] | undefined | null;\n @Prop({ mutable: true, reflect: true }) label: string;\n /**\n * If `true`, the radio is selected. \n */\n @Prop({mutable: true, reflect: true}) checked = false;\n /**\n * If `true`, the user cannot interact with the radio.\n */\n @Prop({ mutable: true }) disabled = false;\n // FIXME renommer l'évènement c'est pas un onclick mais un onchange\n @Event({eventName: 'wcsRadioClick' }) wcsRadioClick: EventEmitter<RadioChosedEvent>\n \n @Prop() name: string;\n\n @Listen('keydown')\n onKeyDown(_event: KeyboardEvent) {\n if ((isSpaceKey(_event) || isEnterKey(_event)) && !this.el.checked) {\n this.checked = true;\n this.inputEl.click(); // input[radio].checked = true does not trigger any event => input[radio].click() emit a change event\n }\n }\n \n @Watch(\"checked\")\n checkedChanged(newValue: boolean) {\n if(newValue) {\n this.inputEl.click();\n } else {\n this.inputEl.click();\n }\n }\n\n componentWillLoad(): Promise<void> | void {\n if (this.value === undefined) {\n // If no value was given we use the text content instead.\n this.value = this.el.innerText || '';\n }\n }\n\n componentDidLoad() {\n this.inputEl = this.el.shadowRoot.querySelector('input');\n this.inputEl.addEventListener('change', _ => {\n this.emitRadioChangeEvent();\n this.checked = true;\n })\n }\n\n emitRadioChangeEvent() {\n this.wcsRadioClick.emit({\n label: this.label,\n source: this.el,\n value: this.value\n });\n }\n\n render() {\n \n return (\n <Host slot=\"option\" {...(this.disabled ? {tabIndex: -1} : {})}>\n <input\n id={this.inputId}\n type=\"radio\"\n name={this.name}\n value={this.value}\n checked={this.checked} // Initial checked state of native input\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-checked={`${this.checked}`}\n />\n <label htmlFor={`${this.inputId}`}>{this.label}</label>\n </Host>\n );\n }\n}\n\nlet radioButtonIds = 0;\n"],"mappings":"2GAAA,MAAMA,EAAW,03F,MCuBJC,EAAK,M,sEACNC,KAAAC,QAAU,UAAUC,M,UAGoC,Q,uDAOhB,M,cAIZ,M,oBAOpCC,UAAUC,GACN,IAAKC,EAAWD,IAAWE,EAAWF,MAAaJ,KAAKO,GAAGC,QAAS,CAChER,KAAKQ,QAAU,KACfR,KAAKS,QAAQC,O,EAKrBC,eAAeC,GACX,GAAGA,EAAU,CACTZ,KAAKS,QAAQC,O,KACV,CACHV,KAAKS,QAAQC,O,EAIrBG,oBACI,GAAIb,KAAKc,QAAUC,UAAW,CAE1Bf,KAAKc,MAAQd,KAAKO,GAAGS,WAAa,E,EAI1CC,mBACIjB,KAAKS,QAAUT,KAAKO,GAAGW,WAAWC,cAAc,SAChDnB,KAAKS,QAAQW,iBAAiB,UAAUC,IACpCrB,KAAKsB,uBACLtB,KAAKQ,QAAU,IAAI,G,CAI3Bc,uBACItB,KAAKuB,cAAcC,KAAK,CACpBC,MAAOzB,KAAKyB,MACZC,OAAQ1B,KAAKO,GACbO,MAAOd,KAAKc,O,CAIpBa,SAEI,OACIC,EAACC,EAAIC,OAAAC,OAAA,CAACC,KAAK,UAAchC,KAAKiC,SAAW,CAACC,UAAW,GAAK,IACtDN,EAAA,SACIO,GAAInC,KAAKC,QACTmC,KAAK,QACLC,KAAMrC,KAAKqC,KACXvB,MAAOd,KAAKc,MACZN,QAASR,KAAKQ,QACdyB,SAAUjC,KAAKiC,SAAQ,gBACRjC,KAAKiC,SAAW,OAAS,KAAI,eAC9B,GAAGjC,KAAKQ,YAE1BoB,EAAA,SAAOU,QAAS,GAAGtC,KAAKC,WAAYD,KAAKyB,O,4HAMzD,IAAIvB,EAAiB,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as r,g as e}from"./p-a2df3a49.js";import{j as n,k as a,l as h}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as s,H as r,g as e}from"./p-a2df3a49.js";import{j as n,k as a,l as h}from"./p-3dc6b507.js";const o=["s","m","l"];function d(t){return o.includes(t)}const c=":host{--wcs-input-icon-color:var(--wcs-text-medium);--wcs-internal-input-border-radius-left:var(--wcs-input-border-radius-left, var(--wcs-border-radius));--wcs-internal-input-border-radius-right:var(--wcs-input-border-radius-right, var(--wcs-border-radius));--wcs-internal-input-border-width:2px;display:flex;width:100%;height:var(--wcs-input-host-height);box-sizing:border-box;border-radius:var(--wcs-internal-input-border-radius-left) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-left);background-color:var(--wcs-light);border:var(--wcs-internal-input-border-width) solid var(--wcs-light);background-clip:padding-box}:host ::placeholder{font-weight:400;font-style:italic}:host input{overflow:hidden;min-height:var(--wcs-size-xs);width:100%;background-color:transparent;font-family:var(--wcs-font-sans-serif);color:var(--wcs-primary);font-weight:var(--wcs-font-weight-form-value) !important;border:none;padding:0 calc(var(--wcs-padding) - var(--wcs-internal-input-border-width));font-size:var(--wcs-input-font-size, 1rem);line-height:1.5}:host input:focus{box-shadow:none;outline:0}:host wcs-mat-icon{position:relative;margin-left:8px;margin-right:-8px}:host .toggle_password{cursor:pointer;margin-left:-8px;margin-right:8px}:host .prefix,:host .suffix{color:var(--wcs-white);display:flex;white-space:nowrap;align-items:center;font-size:var(--wcs-input-font-size, 1rem);padding:0 calc(var(--wcs-padding) / 2);font-weight:var(--wcs-font-weight-form-value) !important;background-color:var(--wcs-text-disabled)}:host .prefix{border-radius:var(--wcs-internal-input-border-radius-left) 0 0 var(--wcs-internal-input-border-radius-left);margin:calc(-1 * var(--wcs-internal-input-border-width)) 0 calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width));border-left:solid var(--wcs-internal-input-border-width) transparent;border-top:solid var(--wcs-internal-input-border-width) transparent;border-bottom:solid var(--wcs-internal-input-border-width) transparent}:host .suffix{border-radius:0 var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) 0;margin:calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) 0px;border-right:solid var(--wcs-internal-input-border-width) transparent;border-top:solid var(--wcs-internal-input-border-width) transparent;border-bottom:solid var(--wcs-internal-input-border-width) transparent}:host([size=l]){--wcs-input-host-height:var(--wcs-size-l);--wcs-input-font-size:1.0625rem}:host([size=m]){--wcs-input-host-height:var(--wcs-size-m);--wcs-input-font-size:1rem}:host([size=s]){--wcs-input-host-height:var(--wcs-size-s);--wcs-input-font-size:0.9375rem}:host([state=error]){border-color:var(--wcs-red) !important}:host([data-has-prefix]) input{padding-left:calc(var(--wcs-padding) / 2)}:host([data-has-suffix]) input{padding-left:calc(var(--wcs-padding) / 2)}:host([disabled]) input{color:var(--wcs-text-disabled);cursor:not-allowed}:host([disabled]) .prefix,:host([disabled]) .suffix{color:var(--wcs-light)}:host(:focus-within){border:dashed var(--wcs-internal-input-border-width) var(--wcs-primary)}:host(:focus-within) .prefix{border-left:dashed var(--wcs-internal-input-border-width) var(--wcs-primary);border-top:dashed var(--wcs-internal-input-border-width) var(--wcs-primary);border-bottom:dashed var(--wcs-internal-input-border-width) var(--wcs-primary)}:host(:focus-within) .suffix{border-right:dashed var(--wcs-internal-input-border-width) var(--wcs-primary);border-top:dashed var(--wcs-internal-input-border-width) var(--wcs-primary);border-bottom:dashed var(--wcs-internal-input-border-width) var(--wcs-primary)}:host(:focus-within) wcs-mat-icon{color:var(--wcs-primary)}";const l=class{constructor(s){t(this,s);this.wcsInput=i(this,"wcsInput",7);this.wcsChange=i(this,"wcsChange",7);this.wcsBlur=i(this,"wcsBlur",7);this.wcsFocus=i(this,"wcsFocus",7);this.inputId=`wcs-input-${u++}`;this.didBlurAfterEdit=false;this.inheritedAttributes={};this.iconPassword="visibility";this.onInput=t=>{const i=t.target;if(i){this.value=i.value||""}this.wcsInput.emit(t)};this.onBlur=t=>{this.hasFocus=false;this.focusChanged();if(this.fireFocusEvents){this.wcsBlur.emit(t)}};this.onFocus=t=>{this.hasFocus=true;this.focusChanged();if(this.fireFocusEvents){this.wcsFocus.emit(t)}};this.onKeydown=t=>{if(this.shouldClearOnEdit()){if(this.didBlurAfterEdit&&this.hasValue()&&t.key!=="Enter"){this.clearTextInput()}this.didBlurAfterEdit=false}};this.clearTextInput=t=>{if(this.clearInput&&!this.readonly&&!this.disabled&&t){t.preventDefault();t.stopPropagation();this.setFocus()}this.value="";if(this.nativeInput){this.nativeInput.value=""}};this.fireFocusEvents=true;this.hasFocus=false;this.passwordReveal=false;this.accept=undefined;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autofocus=false;this.clearInput=false;this.clearOnEdit=undefined;this.debounce=0;this.prefixLabel=undefined;this.suffixLabel=undefined;this.disabled=false;this.enterkeyhint=undefined;this.size="m";this.icon=undefined;this.inputmode=undefined;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.multiple=undefined;this.name=this.inputId;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.spellcheck=false;this.state="initial";this.step=undefined;this.type="text";this.value=""}debounceChanged(){this.wcsChange=n(this.wcsChange,this.debounce)}valueChanged(){var t;this.wcsChange.emit({value:(t=this.value)===null||t===void 0?void 0:t.toString()})}componentWillLoad(){this.inheritedAttributes=a(this.el,["aria-label","tabindex","title"]);if(!d(this.size)){console.error(`Invalid size value for wcs-input : "${this.size}". Must be one of "${o.join(", ")}"`);this.size="m"}}connectedCallback(){this.debounceChanged();{document.dispatchEvent(new CustomEvent("wcsInputDidLoad",{detail:this.el}))}}disconnectedCallback(){{document.dispatchEvent(new CustomEvent("wcsInputDidUnload",{detail:this.el}))}}async setFocus(){if(this.nativeInput){this.nativeInput.focus()}}async setBlur(){if(this.nativeInput){this.nativeInput.blur()}}getInputElement(){return Promise.resolve(this.nativeInput)}shouldClearOnEdit(){const{type:t,clearOnEdit:i}=this;return i===undefined?t==="password":i}getValue(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()}focusChanged(){if(!this.hasFocus&&this.shouldClearOnEdit()&&this.hasValue()){this.didBlurAfterEdit=true}}hasValue(){return this.getValue().length>0}passwordRevealIconClick(){this.passwordReveal=!this.passwordReveal}onPasswordRevealChange(){this.iconPassword=this.passwordReveal?"visibility_off":"visibility"}render(){const t=this.getValue();const i=this.inputId+"-lbl";const e=h(this.el);if(e){e.id=i}return s(r,{"aria-disabled":this.disabled?"true":null,"data-has-prefix":!!this.prefixLabel,"data-has-suffix":!!this.suffixLabel},this.prefixLabel?s("span",{class:"prefix",part:"prefix"},this.prefixLabel):null,this.icon?s("wcs-mat-icon",{icon:this.icon,size:"m"}):null,s("input",Object.assign({class:"native-input",ref:t=>this.nativeInput=t,"aria-labelledby":e?i:null,disabled:this.disabled,accept:this.accept,autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,min:this.min,max:this.max,minLength:this.minlength,maxLength:this.maxlength,multiple:this.multiple,name:this.name,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,step:this.step,type:this.passwordReveal?"text":this.type,value:t,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeydown},this.inheritedAttributes)),this.type==="password"?s("wcs-mat-icon",{class:"toggle_password",icon:this.iconPassword,size:"m",onClick:()=>this.passwordRevealIconClick()}):null,this.suffixLabel?s("span",{class:"suffix",part:"suffix"},this.suffixLabel):null)}static get delegatesFocus(){return true}get el(){return e(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"],passwordReveal:["onPasswordRevealChange"]}}};let u=0;l.style=c;export{l as wcs_input};
|
|
2
|
+
//# sourceMappingURL=p-ac106663.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WcsInputSizeValues","isWcsInputSize","size","includes","inputCss","Input","this","inputId","inputIds","didBlurAfterEdit","inheritedAttributes","iconPassword","onInput","ev","input","target","value","wcsInput","emit","onBlur","hasFocus","focusChanged","fireFocusEvents","wcsBlur","onFocus","wcsFocus","onKeydown","shouldClearOnEdit","hasValue","key","clearTextInput","clearInput","readonly","disabled","preventDefault","stopPropagation","setFocus","nativeInput","debounceChanged","wcsChange","debounceEvent","debounce","valueChanged","_a","toString","componentWillLoad","inheritAttributes","el","console","error","join","connectedCallback","document","dispatchEvent","CustomEvent","detail","disconnectedCallback","async","focus","blur","getInputElement","Promise","resolve","type","clearOnEdit","undefined","getValue","length","passwordRevealIconClick","passwordReveal","onPasswordRevealChange","render","labelId","label","findItemLabel","id","h","Host","prefixLabel","suffixLabel","class","part","icon","Object","assign","ref","accept","autoCapitalize","autocapitalize","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","autofocus","enterKeyHint","enterkeyhint","inputMode","inputmode","min","max","minLength","minlength","maxLength","maxlength","multiple","name","pattern","placeholder","readOnly","required","spellcheck","step","onKeyDown","onClick"],"sources":["./src/components/input/input-interface.ts","./src/components/input/input.scss?tag=wcs-input&encapsulation=shadow","./src/components/input/input.tsx"],"sourcesContent":["// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nimport { WcsSize } from '../../shared-types';\n\nexport type AutocompleteTypes = (\n | 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix'\n | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization'\n | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2'\n | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name'\n | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount'\n | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local'\n | 'tel-extension' | 'impp' | 'url' | 'photo');\n\nexport type TextFieldTypes = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'time' | 'week' | 'month' | 'datetime-local' | 'file';\n\n\nexport const WcsInputSizeValues = ['s', 'm', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object.\n\nexport type WcsInputSize = Extract<WcsSize, typeof WcsInputSizeValues[number]>;\n\nexport function isWcsInputSize(size: string): size is WcsInputSize {\n // @ts-ignore : ignore size type, as it is checked with WcsInputSizeValues\n return WcsInputSizeValues.includes(size);\n}\n\nexport interface InputChangeEventDetail {\n value: string | undefined | null;\n}\n","@import '../../style/focus-outline.scss';\n\n:host {\n --wcs-input-icon-color: var(--wcs-text-medium);\n --wcs-internal-input-border-radius-left: var(--wcs-input-border-radius-left, var(--wcs-border-radius));\n --wcs-internal-input-border-radius-right: var(--wcs-input-border-radius-right, var(--wcs-border-radius));\n --wcs-internal-input-border-width: 2px;\n display: flex;\n width: 100%;\n height: var(--wcs-input-host-height);\n box-sizing: border-box;\n border-radius: var(--wcs-internal-input-border-radius-left) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-left);\n background-color: var(--wcs-light);\n border: var(--wcs-internal-input-border-width) solid var(--wcs-light);\n background-clip: padding-box;\n\n ::placeholder {\n font-weight: 400;\n font-style: italic;\n }\n\n input {\n overflow: hidden;\n min-height: var(--wcs-size-xs);\n width: 100%;\n background-color: transparent;\n font-family: var(--wcs-font-sans-serif);\n color: var(--wcs-primary);\n font-weight: var(--wcs-font-weight-form-value) !important;\n border: none;\n padding: 0 calc(var(--wcs-padding) - var(--wcs-internal-input-border-width));\n font-size: var(--wcs-input-font-size, 1rem);\n line-height: 1.5;\n }\n\n input:focus {\n box-shadow: none;\n outline: 0;\n }\n\n wcs-mat-icon {\n position: relative;\n margin-left: 8px;\n margin-right: -8px;\n }\n\n .toggle_password {\n cursor: pointer;\n margin-left: -8px;\n margin-right: 8px;\n }\n\n\n .prefix, .suffix {\n color: var(--wcs-white);\n display: flex;\n white-space: nowrap;\n align-items: center;\n font-size: var(--wcs-input-font-size, 1rem);\n padding: 0 calc(var(--wcs-padding) / 2);\n font-weight: var(--wcs-font-weight-form-value) !important;\n background-color: var(--wcs-text-disabled);\n }\n\n .prefix {\n border-radius: var(--wcs-internal-input-border-radius-left) 0 0 var(--wcs-internal-input-border-radius-left);\n margin: calc(-1 * var(--wcs-internal-input-border-width)) 0 calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width));\n border-left: solid var(--wcs-internal-input-border-width) transparent;\n border-top: solid var(--wcs-internal-input-border-width) transparent;\n border-bottom: solid var(--wcs-internal-input-border-width) transparent;\n }\n\n .suffix {\n border-radius: 0 var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) 0;\n margin: calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) 0px;\n border-right: solid var(--wcs-internal-input-border-width) transparent;\n border-top: solid var(--wcs-internal-input-border-width) transparent;\n border-bottom: solid var(--wcs-internal-input-border-width) transparent;\n }\n}\n\n:host([size=l]) {\n --wcs-input-host-height: var(--wcs-size-l);\n --wcs-input-font-size: 1.0625rem;\n}\n\n:host([size=m]) { // Default\n --wcs-input-host-height: var(--wcs-size-m);\n --wcs-input-font-size: 1rem;\n}\n\n:host([size=s]) {\n --wcs-input-host-height: var(--wcs-size-s);\n --wcs-input-font-size: 0.9375rem;\n}\n\n:host([state=error]) {\n border-color: var(--wcs-red) !important;\n}\n\n:host([data-has-prefix]) {\n input {\n padding-left: calc(var(--wcs-padding) / 2);\n }\n}\n\n:host([data-has-suffix]) {\n input {\n padding-left: calc(var(--wcs-padding) / 2);\n }\n}\n\n:host([disabled]) {\n input {\n color: var(--wcs-text-disabled);\n cursor: not-allowed;\n }\n\n .prefix, .suffix {\n color: var(--wcs-light);\n }\n}\n\n:host(:focus-within) {\n border: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n\n .prefix {\n border-left: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-top: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-bottom: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n }\n\n .suffix {\n border-right: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-top: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-bottom: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n }\n\n wcs-mat-icon {\n color: var(--wcs-primary);\n }\n}\n","import {\n Build, Component,\n ComponentInterface, Element, Event, EventEmitter, h, Host, Method, Prop,\n State, Watch\n} from '@stencil/core';\nimport { debounceEvent, findItemLabel, inheritAttributes } from '../../utils/helpers';\nimport {\n AutocompleteTypes, InputChangeEventDetail, isWcsInputSize, TextFieldTypes, WcsInputSize, WcsInputSizeValues\n} from './input-interface';\n\n/**\n * Mainly inspired from Ionic Input Component\n */\n@Component({\n tag: 'wcs-input',\n styleUrl: 'input.scss',\n shadow: {delegatesFocus: true},\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement;\n private inputId = `wcs-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private inheritedAttributes: { [k: string]: any } = {};\n private iconPassword = \"visibility\";\n\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents = true;\n\n @State() private hasFocus = false;\n\n @State() private passwordReveal = false;\n\n @Element() private el!: HTMLElement;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n /**\n * Prefix displayed before the text field contents. This is not included in the value.\n */\n @Prop() prefixLabel: string;\n\n /**\n * Suffix displayed after the text field contents. This is not included in the value.\n */\n @Prop() suffixLabel: string;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsChange = debounceEvent(this.wcsChange, this.debounce);\n }\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Specify the size (height) of the input.\n */\n @Prop({reflect: true}) size: WcsInputSize = 'm';\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Specifies the state of the input. By default the input is in an normal state but you can to set it to 'error' state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: 'initial' | 'error' = 'initial';\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() wcsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.wcsChange.emit({value: this.value?.toString()});\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);\n\n if (!isWcsInputSize(this.size)) {\n console.error(`Invalid size value for wcs-input : \"${this.size}\". Must be one of \"${WcsInputSizeValues.join(', ')}\"`);\n this.size = \"m\"; // Default fallback value\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n /**\n * @deprecated use the native focus method instead\n *\n * Sets focus on the native `input` in `wcs-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n }\n }\n\n /**\n * Sets blur on the native `input` in `wcs-input`. Use this method instead of the global\n * `input.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement> {\n return Promise.resolve(this.nativeInput!);\n }\n\n private shouldClearOnEdit() {\n const {type, clearOnEdit} = this;\n return (clearOnEdit === undefined)\n ? type === 'password'\n : clearOnEdit;\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() :\n (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n this.focusChanged();\n\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusChanged();\n\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private onKeydown = (ev: KeyboardEvent) => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n // Do not clear if user is hitting Enter to submit form\n if (this.didBlurAfterEdit && this.hasValue() && ev.key !== 'Enter') {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n }\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n // Attempt to focus input again after pressing clear button\n this.setFocus();\n }\n\n this.value = '';\n\n /**\n * This is needed for clearOnEdit\n * Otherwise the value will not be cleared\n * if user is inside the input\n */\n if (this.nativeInput) {\n this.nativeInput.value = '';\n }\n }\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private passwordRevealIconClick(): void {\n this.passwordReveal = !this.passwordReveal;\n }\n\n @Watch('passwordReveal')\n onPasswordRevealChange(): void {\n this.iconPassword = this.passwordReveal ? 'visibility_off' : 'visibility';\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const label = findItemLabel(this.el);\n if (label) {\n label.id = labelId;\n }\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n data-has-prefix={!!this.prefixLabel}\n data-has-suffix={!!this.suffixLabel}\n >\n {this.prefixLabel ? (<span class=\"prefix\" part=\"prefix\">{this.prefixLabel}</span>) : null}\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <input\n class=\"native-input\"\n ref={input => this.nativeInput = input}\n aria-labelledby={label ? labelId : null}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n type={this.passwordReveal ? 'text' : this.type}\n value={value}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n {...this.inheritedAttributes}\n />\n {this.type === \"password\" ? (<wcs-mat-icon class=\"toggle_password\" icon={this.iconPassword} size=\"m\" onClick={() => this.passwordRevealIconClick()}></wcs-mat-icon>) : null}\n {this.suffixLabel ? (<span class=\"suffix\" part=\"suffix\">{this.suffixLabel}</span>) : null}\n </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IAAKgH,QAAS,IAAM5G,KAAK8D,4BAA8C,KACvK9D,KAAKyE,YAAeH,EAAA,QAAMI,MAAM,SAASC,KAAK,UAAU3E,KAAKyE,aAAuB,K,+LAMrG,IAAIvE,EAAW,E"}
|
|
1
|
+
{"version":3,"names":["WcsInputSizeValues","isWcsInputSize","size","includes","inputCss","Input","this","inputId","inputIds","didBlurAfterEdit","inheritedAttributes","iconPassword","onInput","ev","input","target","value","wcsInput","emit","onBlur","hasFocus","focusChanged","fireFocusEvents","wcsBlur","onFocus","wcsFocus","onKeydown","shouldClearOnEdit","hasValue","key","clearTextInput","clearInput","readonly","disabled","preventDefault","stopPropagation","setFocus","nativeInput","debounceChanged","wcsChange","debounceEvent","debounce","valueChanged","_a","toString","componentWillLoad","inheritAttributes","el","console","error","join","connectedCallback","document","dispatchEvent","CustomEvent","detail","disconnectedCallback","async","focus","blur","getInputElement","Promise","resolve","type","clearOnEdit","undefined","getValue","length","passwordRevealIconClick","passwordReveal","onPasswordRevealChange","render","labelId","label","findItemLabel","id","h","Host","prefixLabel","suffixLabel","class","part","icon","Object","assign","ref","accept","autoCapitalize","autocapitalize","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","autofocus","enterKeyHint","enterkeyhint","inputMode","inputmode","min","max","minLength","minlength","maxLength","maxlength","multiple","name","pattern","placeholder","readOnly","required","spellcheck","step","onKeyDown","onClick"],"sources":["./src/components/input/input-interface.ts","./src/components/input/input.scss?tag=wcs-input&encapsulation=shadow","./src/components/input/input.tsx"],"sourcesContent":["// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nimport { WcsSize } from '../../shared-types';\n\nexport type AutocompleteTypes = (\n | 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix'\n | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization'\n | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2'\n | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name'\n | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount'\n | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local'\n | 'tel-extension' | 'impp' | 'url' | 'photo');\n\nexport type TextFieldTypes = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'time' | 'week' | 'month' | 'datetime-local' | 'file';\n\n\nexport const WcsInputSizeValues = ['s', 'm', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object.\n\nexport type WcsInputSize = Extract<WcsSize, typeof WcsInputSizeValues[number]>;\n\nexport function isWcsInputSize(size: string): size is WcsInputSize {\n // @ts-ignore : ignore size type, as it is checked with WcsInputSizeValues\n return WcsInputSizeValues.includes(size);\n}\n\nexport interface InputChangeEventDetail {\n value: string | undefined | null;\n}\n","@import '../../style/focus-outline.scss';\n\n:host {\n --wcs-input-icon-color: var(--wcs-text-medium);\n --wcs-internal-input-border-radius-left: var(--wcs-input-border-radius-left, var(--wcs-border-radius));\n --wcs-internal-input-border-radius-right: var(--wcs-input-border-radius-right, var(--wcs-border-radius));\n --wcs-internal-input-border-width: 2px;\n display: flex;\n width: 100%;\n height: var(--wcs-input-host-height);\n box-sizing: border-box;\n border-radius: var(--wcs-internal-input-border-radius-left) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-left);\n background-color: var(--wcs-light);\n border: var(--wcs-internal-input-border-width) solid var(--wcs-light);\n background-clip: padding-box;\n\n ::placeholder {\n font-weight: 400;\n font-style: italic;\n }\n\n input {\n overflow: hidden;\n min-height: var(--wcs-size-xs);\n width: 100%;\n background-color: transparent;\n font-family: var(--wcs-font-sans-serif);\n color: var(--wcs-primary);\n font-weight: var(--wcs-font-weight-form-value) !important;\n border: none;\n padding: 0 calc(var(--wcs-padding) - var(--wcs-internal-input-border-width));\n font-size: var(--wcs-input-font-size, 1rem);\n line-height: 1.5;\n }\n\n input:focus {\n box-shadow: none;\n outline: 0;\n }\n\n wcs-mat-icon {\n position: relative;\n margin-left: 8px;\n margin-right: -8px;\n }\n\n .toggle_password {\n cursor: pointer;\n margin-left: -8px;\n margin-right: 8px;\n }\n\n\n .prefix, .suffix {\n color: var(--wcs-white);\n display: flex;\n white-space: nowrap;\n align-items: center;\n font-size: var(--wcs-input-font-size, 1rem);\n padding: 0 calc(var(--wcs-padding) / 2);\n font-weight: var(--wcs-font-weight-form-value) !important;\n background-color: var(--wcs-text-disabled);\n }\n\n .prefix {\n border-radius: var(--wcs-internal-input-border-radius-left) 0 0 var(--wcs-internal-input-border-radius-left);\n margin: calc(-1 * var(--wcs-internal-input-border-width)) 0 calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width));\n border-left: solid var(--wcs-internal-input-border-width) transparent;\n border-top: solid var(--wcs-internal-input-border-width) transparent;\n border-bottom: solid var(--wcs-internal-input-border-width) transparent;\n }\n\n .suffix {\n border-radius: 0 var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) 0;\n margin: calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) calc(-1 * var(--wcs-internal-input-border-width)) 0px;\n border-right: solid var(--wcs-internal-input-border-width) transparent;\n border-top: solid var(--wcs-internal-input-border-width) transparent;\n border-bottom: solid var(--wcs-internal-input-border-width) transparent;\n }\n}\n\n:host([size=l]) {\n --wcs-input-host-height: var(--wcs-size-l);\n --wcs-input-font-size: 1.0625rem;\n}\n\n:host([size=m]) { // Default\n --wcs-input-host-height: var(--wcs-size-m);\n --wcs-input-font-size: 1rem;\n}\n\n:host([size=s]) {\n --wcs-input-host-height: var(--wcs-size-s);\n --wcs-input-font-size: 0.9375rem;\n}\n\n:host([state=error]) {\n border-color: var(--wcs-red) !important;\n}\n\n:host([data-has-prefix]) {\n input {\n padding-left: calc(var(--wcs-padding) / 2);\n }\n}\n\n:host([data-has-suffix]) {\n input {\n padding-left: calc(var(--wcs-padding) / 2);\n }\n}\n\n:host([disabled]) {\n input {\n color: var(--wcs-text-disabled);\n cursor: not-allowed;\n }\n\n .prefix, .suffix {\n color: var(--wcs-light);\n }\n}\n\n:host(:focus-within) {\n border: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n\n .prefix {\n border-left: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-top: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-bottom: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n }\n\n .suffix {\n border-right: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-top: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n border-bottom: dashed var(--wcs-internal-input-border-width) var(--wcs-primary);\n }\n\n wcs-mat-icon {\n color: var(--wcs-primary);\n }\n}\n","import {\n Build, Component,\n ComponentInterface, Element, Event, EventEmitter, h, Host, Method, Prop,\n State, Watch\n} from '@stencil/core';\nimport { debounceEvent, findItemLabel, inheritAttributes } from '../../utils/helpers';\nimport {\n AutocompleteTypes, InputChangeEventDetail, isWcsInputSize, TextFieldTypes, WcsInputSize, WcsInputSizeValues\n} from './input-interface';\n\n/**\n * Mainly inspired from Ionic Input Component\n */\n@Component({\n tag: 'wcs-input',\n styleUrl: 'input.scss',\n shadow: {delegatesFocus: true},\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement;\n private inputId = `wcs-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private inheritedAttributes: { [k: string]: any } = {};\n private iconPassword = \"visibility\";\n\n\n /**\n * This is required for a WebKit bug which requires us to\n * blur and focus an input to properly focus the input in\n * an item with delegatesFocus. It will no longer be needed\n * with iOS 14.\n *\n * @internal\n */\n @Prop() fireFocusEvents = true;\n\n @State() private hasFocus = false;\n\n @State() private passwordReveal = false;\n\n @Element() private el!: HTMLElement;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `wcsChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.\n */\n @Prop() debounce = 0;\n\n /**\n * Prefix displayed before the text field contents. This is not included in the value.\n */\n @Prop() prefixLabel: string;\n\n /**\n * Suffix displayed after the text field contents. This is not included in the value.\n */\n @Prop() suffixLabel: string;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.wcsChange = debounceEvent(this.wcsChange, this.debounce);\n }\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Specify the size (height) of the input.\n */\n @Prop({reflect: true}) size: WcsInputSize = 'm';\n\n /**\n * Name of the material icon to add to the input\n */\n @Prop() icon: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Specifies the state of the input. By default the input is in an normal state but you can to set it to 'error' state if the data given by the user is not valid.\n */\n @Prop({reflect: true}) state: 'initial' | 'error' = 'initial';\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() wcsInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() wcsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() wcsBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() wcsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.wcsChange.emit({value: this.value?.toString()});\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);\n\n if (!isWcsInputSize(this.size)) {\n console.error(`Invalid size value for wcs-input : \"${this.size}\". Must be one of \"${WcsInputSizeValues.join(', ')}\"`);\n this.size = \"m\"; // Default fallback value\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidLoad', {\n detail: this.el\n }));\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(new CustomEvent('wcsInputDidUnload', {\n detail: this.el\n }));\n }\n }\n\n /**\n * @deprecated use the native focus method instead \n * Sets focus on the native `input` in `wcs-input`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n }\n }\n\n /**\n * Sets blur on the native `input` in `wcs-input`. Use this method instead of the global\n * `input.blur()`.\n * @internal\n */\n @Method()\n async setBlur() {\n if (this.nativeInput) {\n this.nativeInput.blur();\n }\n }\n\n /**\n * Returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement> {\n return Promise.resolve(this.nativeInput!);\n }\n\n private shouldClearOnEdit() {\n const {type, clearOnEdit} = this;\n return (clearOnEdit === undefined)\n ? type === 'password'\n : clearOnEdit;\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() :\n (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.wcsInput.emit(ev as KeyboardEvent);\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n this.focusChanged();\n\n if (this.fireFocusEvents) {\n this.wcsBlur.emit(ev);\n }\n }\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusChanged();\n\n if (this.fireFocusEvents) {\n this.wcsFocus.emit(ev);\n }\n }\n\n private onKeydown = (ev: KeyboardEvent) => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n // Do not clear if user is hitting Enter to submit form\n if (this.didBlurAfterEdit && this.hasValue() && ev.key !== 'Enter') {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n }\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n // Attempt to focus input again after pressing clear button\n this.setFocus();\n }\n\n this.value = '';\n\n /**\n * This is needed for clearOnEdit\n * Otherwise the value will not be cleared\n * if user is inside the input\n */\n if (this.nativeInput) {\n this.nativeInput.value = '';\n }\n }\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private passwordRevealIconClick(): void {\n this.passwordReveal = !this.passwordReveal;\n }\n\n @Watch('passwordReveal')\n onPasswordRevealChange(): void {\n this.iconPassword = this.passwordReveal ? 'visibility_off' : 'visibility';\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const label = findItemLabel(this.el);\n if (label) {\n label.id = labelId;\n }\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n data-has-prefix={!!this.prefixLabel}\n data-has-suffix={!!this.suffixLabel}\n >\n {this.prefixLabel ? (<span class=\"prefix\" part=\"prefix\">{this.prefixLabel}</span>) : null}\n {this.icon ? (<wcs-mat-icon icon={this.icon} size=\"m\"></wcs-mat-icon>) : null}\n <input\n class=\"native-input\"\n ref={input => this.nativeInput = input}\n aria-labelledby={label ? labelId : null}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n type={this.passwordReveal ? 'text' : this.type}\n value={value}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n {...this.inheritedAttributes}\n />\n {this.type === \"password\" ? (<wcs-mat-icon class=\"toggle_password\" icon={this.iconPassword} size=\"m\" onClick={() => this.passwordRevealIconClick()}></wcs-mat-icon>) : null}\n {this.suffixLabel ? (<span class=\"suffix\" part=\"suffix\">{this.suffixLabel}</span>) : null}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"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