openstack-uicore-foundation 5.0.2 → 5.0.3
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={692:e=>{e.exports=require("@mui/icons-material/Clear")},8619:e=>{e.exports=require("@mui/material")},2015:e=>{e.exports=require("react")}},t={};function o
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3209:(e,t,r)=>{r.d(t,{wU:()=>o});const o=500},692:e=>{e.exports=require("@mui/icons-material/Clear")},8619:e=>{e.exports=require("@mui/material")},7825:e=>{e.exports=require("lodash")},2015:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>f});var n=r(2015),a=r.n(n),u=r(8619);const c=require("@mui/icons-material/Search");var i=r.n(c),l=r(692),s=r.n(l),d=r(7825),p=r(3209);const f=({term:e,onSearch:t,placeholder:r="Search...",debounced:o})=>{const[c,l]=(0,n.useState)(e),f=(0,n.useRef)(t);(0,n.useEffect)((()=>{f.current=t}),[t]);const m=(0,n.useRef)((0,d.debounce)((e=>f.current(e)),p.wU));(0,n.useEffect)((()=>{l(e||"")}),[e]),(0,n.useEffect)((()=>()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.cancel()}),[]);return a().createElement(u.TextField,{variant:"outlined",value:c,placeholder:r,slotProps:{input:{startAdornment:o&&a().createElement(u.InputAdornment,{position:"start"},a().createElement(i(),{sx:{color:"#0000008F"}})),endAdornment:a().createElement(u.InputAdornment,{position:"end"},c?a().createElement(u.IconButton,{size:"small",onClick:()=>{var e;null===(e=m.current)||void 0===e||e.cancel(),l(""),t("")}},a().createElement(s(),{fontSize:"small",sx:{color:"#0000008F"}})):!o&&a().createElement(i(),{sx:{mr:1,color:"#0000008F",position:"absolute",right:0}}))}},onChange:e=>(e=>{var t;l(e),o&&(null===(t=m.current)||void 0===t||t.call(m,e))})(e.target.value),onKeyDown:e=>{o||"Enter"!==e.key||t(c)},fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{height:"36px"}}})};return o})()));
|
|
2
2
|
//# sourceMappingURL=search-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/search-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,kCCTTH,EAAOD,QAAUK,QAAQ,4B,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAA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,MAAO,IAEnC,kBAAC,IAAD,CAAWF,GAAI,CAAEG,MAAO,gBAG1B,kBAAC,IAAD,CACEH,GAAI,CAAEI,GAAI,EAAGD,MAAO,YAAaF,SAAU,WAAYC,MAAO,OAKtEG,SAAWC,GAAUjB,EAAciB,EAAMC,OAAOvB,OAChDwB,UAlCkBC,IACL,UAAXA,EAAGvC,KACLgB,EAASE,EACV,EAgCCsB,WAAS,EACTV,GAAI,CACF,2BAA4B,CAC1BW,OAAQ,UA3BhB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Clear\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Search\"","webpack://openstack-uicore-foundation/./src/components/mui/search-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@mui/icons-material/Clear\");","module.exports = require(\"@mui/material\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Search\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React, { useEffect, useState } from \"react\";\nimport { TextField, IconButton } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\n\nconst SearchInput = ({ term, onSearch, placeholder = \"Search...\" }) => {\n const [searchTerm, setSearchTerm] = useState(term);\n\n useEffect(() => {\n setSearchTerm(term || \"\");\n }, [term]);\n\n const handleSearch = (ev) => {\n if (ev.key === \"Enter\") {\n onSearch(searchTerm);\n }\n };\n\n const handleClear = () => {\n setSearchTerm(\"\");\n onSearch(\"\");\n };\n\n return (\n <TextField\n variant=\"outlined\"\n value={searchTerm}\n placeholder={placeholder}\n slotProps={{\n input: {\n endAdornment: term ? (\n <IconButton\n size=\"small\"\n onClick={handleClear}\n sx={{ position: \"absolute\", right: 0 }}\n >\n <ClearIcon sx={{ color: \"#0000008F\" }} />\n </IconButton>\n ) : (\n <SearchIcon\n sx={{ mr: 1, color: \"#0000008F\", position: \"absolute\", right: 0 }}\n />\n )\n }\n }}\n onChange={(event) => setSearchTerm(event.target.value)}\n onKeyDown={handleSearch}\n fullWidth\n sx={{\n \"& .MuiOutlinedInput-root\": {\n height: \"36px\"\n }\n }}\n />\n );\n};\n\nexport default SearchInput;\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","term","onSearch","placeholder","searchTerm","setSearchTerm","useState","useEffect","TextField","variant","slotProps","input","endAdornment","IconButton","size","onClick","sx","position","right","color","mr","onChange","event","target","onKeyDown","ev","fullWidth","height"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/search-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,2DCTF,MASMC,EAAgB,G,UCT7BJ,EAAOD,QAAUM,QAAQ,4B,WCAzBL,EAAOD,QAAU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A,SAC3BI,EAAAA,EAAAA,WAAUb,GAAUQ,EAAYG,QAAQX,IAAQ5B,EAAAA,MAGlDsC,EAAAA,EAAAA,YAAU,KACRJ,EAAcL,GAAQ,GAAtB,GACC,CAACA,KAEJS,EAAAA,EAAAA,YAAU,IAAM,4BAAME,EAAqBD,eAA3B,aAAM,EAA8BG,QAApC,GAA8C,IAmB9D,OACE,kBAAC,EAAAC,UAAD,CACEC,QAAQ,WACRhB,MAAOK,EACPF,YAAaA,EACbc,UAAW,CACTC,MAAO,CACLC,eAAgBf,GACd,kBAAC,EAAAgB,eAAD,CAAgBC,SAAS,SACvB,kBAAC,IAAD,CAAYC,GAAI,CAAEC,MAAO,gBAG7BC,aACE,kBAAC,EAAAJ,eAAD,CAAgBC,SAAS,OACtBhB,EACC,kBAAC,EAAAoB,WAAD,CAAYC,KAAK,QAAQC,QAhCnB,KAAM,MACxB,UAAAf,EAAqBD,eAArB,SAA8BG,SAC9BR,EAAc,IACdJ,EAAS,GAAT,GA8Bc,kBAAC,IAAD,CAAW0B,SAAS,QAAQN,GAAI,CAAEC,MAAO,iBAI1CnB,GAAa,kBAAC,IAAD,CACZkB,GAAI,CAAEO,GAAI,EAAGN,MAAO,YAAaF,SAAU,WAAYS,MAAO,QAO1EC,SAAWC,GAvCOhC,KAAU,MAC9BM,EAAcN,GACVI,IAAW,UAAAQ,EAAqBD,eAArB,cAAAC,EAA+BZ,GAA/B,EAqCKiC,CAAaD,EAAGE,OAAOlC,OACzCmC,UAnCmBH,IAChB5B,GAAwB,UAAX4B,EAAG9C,KACnBgB,EAASG,EACV,EAiCC+B,WAAS,EACTd,GAAI,CACF,2BAA4B,CAC1Be,OAAQ,UAjChB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Clear\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"lodash\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Search\"","webpack://openstack-uicore-foundation/./src/components/mui/search-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","module.exports = require(\"@mui/icons-material/Clear\");","module.exports = require(\"@mui/material\");","module.exports = require(\"lodash\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Search\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React, { useEffect, useState, useRef } from \"react\";\nimport { TextField, IconButton, InputAdornment } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\nimport { debounce } from \"lodash\";\nimport { DEBOUNCE_WAIT } from \"../../utils/constants\";\n\nconst SearchInput = ({ term, onSearch, placeholder = \"Search...\", debounced }) => {\n const [searchTerm, setSearchTerm] = useState(term);\n\n const onSearchRef = useRef(onSearch);\n useEffect(() => {\n onSearchRef.current = onSearch;\n }, [onSearch]);\n\n const onSearchDebouncedRef = useRef(\n debounce((value) => onSearchRef.current(value), DEBOUNCE_WAIT)\n );\n\n useEffect(() => {\n setSearchTerm(term || \"\");\n }, [term]);\n\n useEffect(() => () => onSearchDebouncedRef.current?.cancel(), []);\n\n const handleClear = () => {\n onSearchDebouncedRef.current?.cancel();\n setSearchTerm(\"\");\n onSearch(\"\");\n };\n\n const handleChange = (value) => {\n setSearchTerm(value);\n if (debounced) onSearchDebouncedRef.current?.(value);\n };\n\n const handleKeyDown = (ev) => {\n if (!debounced && ev.key === \"Enter\") {\n onSearch(searchTerm);\n }\n };\n\n return (\n <TextField\n variant=\"outlined\"\n value={searchTerm}\n placeholder={placeholder}\n slotProps={{\n input: { \n startAdornment: debounced && (\n <InputAdornment position=\"start\">\n <SearchIcon sx={{ color: \"#0000008F\" }} />\n </InputAdornment>\n ),\n endAdornment: (\n <InputAdornment position=\"end\">\n {searchTerm ? (\n <IconButton size=\"small\" onClick={handleClear}>\n <ClearIcon fontSize=\"small\" sx={{ color: \"#0000008F\" }} />\n </IconButton>\n ) : \n (\n !debounced && <SearchIcon\n sx={{ mr: 1, color: \"#0000008F\", position: \"absolute\", right: 0 }}\n />\n )}\n </InputAdornment>\n )\n }\n }}\n onChange={(ev) => handleChange(ev.target.value)}\n onKeyDown={handleKeyDown}\n fullWidth\n sx={{\n \"& .MuiOutlinedInput-root\": {\n height: \"36px\"\n }\n }}\n />\n );\n};\n\nexport default SearchInput;\n"],"names":["root","factory","exports","module","define","amd","this","DEBOUNCE_WAIT","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","term","onSearch","placeholder","debounced","searchTerm","setSearchTerm","useState","onSearchRef","useRef","useEffect","current","onSearchDebouncedRef","debounce","cancel","TextField","variant","slotProps","input","startAdornment","InputAdornment","position","sx","color","endAdornment","IconButton","size","onClick","fontSize","mr","right","onChange","ev","handleChange","target","onKeyDown","fullWidth","height"],"sourceRoot":""}
|