bromcom-ui 3.0.0-alpha.4 → 3.0.0-alpha.5

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.
Files changed (63) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/p-01eaca9a.entry.js +5 -0
  4. package/dist/bromcom-ui/p-3ddd3c83.entry.js +5 -0
  5. package/dist/bromcom-ui/p-aa67918a.entry.js +5 -0
  6. package/dist/bromcom-ui/p-d5464577.entry.js +16 -0
  7. package/dist/cjs/bcm-accordion_69.cjs.entry.js +704 -31
  8. package/dist/cjs/bcm-file-upload.cjs.entry.js +578 -0
  9. package/dist/cjs/bcm-form-2.cjs.entry.js +1 -0
  10. package/dist/cjs/bcm-number-input.cjs.entry.js +8 -2
  11. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/collection-manifest.json +1 -0
  14. package/dist/collection/components/atoms/button/button.js +1 -1
  15. package/dist/collection/components/atoms/button/types.js +7 -0
  16. package/dist/collection/components/molecules/dropdown/dropdown.js +36 -1
  17. package/dist/collection/components/molecules/linked/linked-focus-manager.js +86 -0
  18. package/dist/collection/components/molecules/linked/linked.js +43 -1
  19. package/dist/collection/components/molecules/number-input/number-input.js +8 -2
  20. package/dist/collection/components/molecules/number-input/react-input.js +1 -1
  21. package/dist/collection/components/molecules/upload/file-upload.component.js +1060 -0
  22. package/dist/collection/components/molecules/upload/file-upload.style.js +201 -0
  23. package/dist/collection/components/organism/form/form.js +1 -0
  24. package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
  25. package/dist/collection/components/organism/list/list-focus-manager.js +344 -0
  26. package/dist/collection/components/organism/list/list-key-control.js +9 -4
  27. package/dist/collection/components/organism/list/list.css +8 -3
  28. package/dist/collection/components/organism/list/list.js +226 -26
  29. package/dist/collection/components/other_deprecated/old-tag/old-tag.js +1 -1
  30. package/dist/collection/components/other_deprecated/tag/tag.js +1 -1
  31. package/dist/collection/templates/list-item-template.js +2 -1
  32. package/dist/components/bcm-dropdown.js +35 -0
  33. package/dist/components/bcm-file-upload.d.ts +11 -0
  34. package/dist/components/bcm-file-upload.js +625 -0
  35. package/dist/components/bcm-form-2.js +1 -0
  36. package/dist/components/bcm-number-input.js +8 -2
  37. package/dist/components/button.js +7 -0
  38. package/dist/components/form.js +1 -0
  39. package/dist/components/index.d.ts +1 -0
  40. package/dist/components/index.js +1 -0
  41. package/dist/components/linked.js +105 -2
  42. package/dist/components/list.js +559 -31
  43. package/dist/esm/bcm-accordion_69.entry.js +704 -31
  44. package/dist/esm/bcm-file-upload.entry.js +574 -0
  45. package/dist/esm/bcm-form-2.entry.js +1 -0
  46. package/dist/esm/bcm-number-input.entry.js +8 -2
  47. package/dist/esm/bromcom-ui.js +1 -1
  48. package/dist/esm/loader.js +1 -1
  49. package/dist/types/components/atoms/button/types.d.ts +8 -1
  50. package/dist/types/components/molecules/dropdown/dropdown.d.ts +7 -0
  51. package/dist/types/components/molecules/linked/linked-focus-manager.d.ts +13 -0
  52. package/dist/types/components/molecules/linked/linked.d.ts +3 -0
  53. package/dist/types/components/molecules/number-input/number-input.d.ts +1 -0
  54. package/dist/types/components/molecules/upload/file-upload.component.d.ts +233 -0
  55. package/dist/types/components/molecules/upload/file-upload.style.d.ts +548 -0
  56. package/dist/types/components/organism/list/list-focus-manager.d.ts +53 -0
  57. package/dist/types/components/organism/list/list-key-control.d.ts +1 -0
  58. package/dist/types/components/organism/list/list.d.ts +18 -1
  59. package/dist/types/components.d.ts +417 -1
  60. package/package.json +1 -1
  61. package/dist/bromcom-ui/p-8e7274e4.entry.js +0 -5
  62. package/dist/bromcom-ui/p-9e0dd503.entry.js +0 -16
  63. package/dist/bromcom-ui/p-a320cde8.entry.js +0 -5
@@ -1,5 +0,0 @@
1
- /*!
2
- * Built with Stencil
3
- * Copyright (c) Bromcom.
4
- */
5
- import{r as t,c as e,f as i,h as s,H as a,g as o}from"./p-e037ee2b.js";import{I as n}from"./p-8e5e362a.js";import{G as r,s as h}from"./p-6ce02d0a.js";import{S as p}from"./p-d65bc842.js";import{a as c}from"./p-a313fba6.js";import"./p-fc29c94d.js";import"./p-a2df6c19.js";import"./p-85eedabc.js";const l=["BCM-INPUT","BCM-TEXTAREA","BCM-SWITCH","BCM-CHECKBOX","BCM-RADIO-GROUP","BCM-CHECKBOX-GROUP","BCM-RANGE","BCM-FORM","BCM-FORM-GROUP","BCM-LIST","BCM-COLORPICKER","BCM-DATE","BCM-DATE-PICKER","BCM-TIME-PICKER","BCM-DATETIME-PICKER","BCM-SELECT","BCM-LISTBOX","BCM-CHIP-GROUP","BCM-INPUT-DROPDOWN","BCM-NUMBER-INPUT"];const m=class{constructor(i){t(this,i),this.bcmForm=e(this,"bcm-form",7),this.isLoad=!1,this.formData={},this.formObj=new Map,this._id=r.UID(),this.validation=!1}componentDidLoad(){this.isLoad=!0,i(this)}componentIsValid(t){if(!t.hidden){this.checkIsGroup(t);const e=["bcm-checkbox","bcm-switch"].includes(p.lowercase(t.tagName))?0==t.value:p.isNullOrEmpty(t.value);t.required&&(e?(t.captionError=c.FormErrorMessages.required,t.captionType="error",this.formObj.set(t.id,{name:t.name,valid:!1,errorDetails:t.captionError})):(t.captionError=null,t.captionType="default",this.formObj.delete(t.id)))}}isGroup(t){return["bcm-checkbox-group"].includes(p.lowercase(t.tagName))}checkIsGroup(t){if(this.isGroup(t))for(let e of Array.from(t.querySelectorAll("bcm-checkbox")))e&&this.componentIsValid(e)}changeCheckboxGroup(t){const e=t.target,{changed:i}=t.detail,s=Array.from(e.querySelectorAll("bcm-checkbox"));for(let t of s)t.id==i.element.id&&(t.value=i.event.value,this.componentIsValid(t))}bcmComponentList(){return h((()=>Array.from(this.el.querySelectorAll("*")).filter((t=>l.includes(t.tagName)&&(!t["s-hn"]||"BCM-FORM-2"==t["s-hn"]))).filter(Boolean)),[])}formResponse(){const t={formData:this.formData,isValid:0==this.formObj.size,errorDetails:Object.assign({},this.formObj.size>0&&Array.from(this.formObj).map((([t,e])=>({[e.name]:e.errorDetails})))),message:0==this.formObj.size?"":"Please fill in all inputs"};return this.bcmForm.emit(t),t}async setMethodType(t){const{isLoad:e,validation:i}=this;if(e)for(const e of this.bcmComponentList())try{await e[t](),"setClear"==t&&i&&this.componentIsValid(e)}catch(i){console.error(e.nodeName,t,i)}return Promise.resolve()}async submit(){const{isLoad:t,validation:e}=this;if(t)for(const t of this.bcmComponentList()){const{name:i,value:s}=t;this.formData[i]=p.isNullOrEmpty(s)?null:s,e&&this.componentIsValid(t)}return Promise.resolve(this.formResponse())}async set(t){var e,i,s;if(this.isLoad&&t&&(null===(e=this.bcmComponentList())||void 0===e?void 0:e.length)>0)for(let e of Object.keys(t)){const a=null!==(s=null===(i=this.bcmComponentList())||void 0===i?void 0:i.find((t=>t.name==e)))&&void 0!==s?s:{};if(a)try{await a.set(t[e]),this.componentIsValid(a)}catch(t){console.warn("set: ",e,a.nodeName)}}}async get(){var t;let e={};if((null===(t=this.bcmComponentList())||void 0===t?void 0:t.length)>0)for(let t of this.bcmComponentList()){const i=await t.get();e=Object.assign(Object.assign({},e),{[t.name]:p.isNullOrEmpty(i)?null:i})}return Promise.resolve(e)}async resetCaption(){return Promise.resolve(await this.setMethodType("resetCaption"))}async setClear(){return this.formData={},this.formObj=new Map,Promise.resolve(await this.setMethodType("setClear"))}onChange(t){const{isLoad:e,validation:i}=this;if(e){const e=t.target,s=e&&e.tagName.toLowerCase().startsWith("bcm-");if(i&&s){if(this.isGroup(e))return this.changeCheckboxGroup(t);this.componentIsValid(e)}}}render(){return s(a,null,s("slot",null))}get el(){return o(this)}};(function(t,e,i,s){var a,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(o<3?a(n):o>3?a(e,i,n):a(e,i))||n);o>3&&n&&Object.defineProperty(e,i,n)})([n()],m.prototype,"el",void 0),m.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block}';export{m as bcm_form_2}