bromcom-ui 2.10.1-rc.2 → 2.10.1-rc.4
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/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-000670b6.js +5 -0
- package/dist/bromcom-ui/{p-7149c15e.entry.js → p-0c54af0a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b77e861c.entry.js → p-10661efa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-893ecfd7.entry.js → p-135056db.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7814999e.entry.js → p-1772657f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bc26bfcc.entry.js → p-182eccc7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9f67eec6.entry.js → p-1bd9d245.entry.js} +1 -1
- package/dist/bromcom-ui/{p-69eb7be7.entry.js → p-1d14255e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fcfc1a26.entry.js → p-2dd5f6ad.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c1834d9.entry.js → p-2dda9287.entry.js} +1 -1
- package/dist/bromcom-ui/{p-82caef35.entry.js → p-30618ac6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f4af4e66.entry.js → p-359d9ed7.entry.js} +1 -1
- package/dist/bromcom-ui/p-3b705d79.entry.js +5 -0
- package/dist/bromcom-ui/{p-f3133898.entry.js → p-412a472d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9c31bd27.js → p-4246ca4f.js} +1 -1
- package/dist/bromcom-ui/{p-95e3e645.entry.js → p-4d0046a0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-313f3908.entry.js → p-56212e24.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5b5f9b00.entry.js → p-5b05c344.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c8b1c1c6.entry.js → p-5f74a6c9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d9ecc3d8.entry.js → p-5ff2ae19.entry.js} +1 -1
- package/dist/bromcom-ui/{p-027e818d.entry.js → p-60e4f239.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bda74b16.entry.js → p-63963eca.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b193eb3a.entry.js → p-686e614c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f84d2e42.entry.js → p-7471cbf5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cae90479.entry.js → p-76556edf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4e5006b1.entry.js → p-78d95876.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9b9f36d5.entry.js → p-7908ee85.entry.js} +1 -1
- package/dist/bromcom-ui/{p-57c9904b.entry.js → p-7c6238b7.entry.js} +1 -1
- package/dist/bromcom-ui/p-7f7b3465.entry.js +7 -0
- package/dist/bromcom-ui/{p-1064895e.js → p-823a5d13.js} +1 -1
- package/dist/bromcom-ui/{p-3ec44b04.entry.js → p-89513231.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dc6e9205.entry.js → p-8b383614.entry.js} +1 -1
- package/dist/bromcom-ui/{p-06071e98.entry.js → p-8fa7df49.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f7dbd393.entry.js → p-96c18c4e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f909d419.entry.js → p-994bc0b5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b2687899.entry.js → p-99a9bebb.entry.js} +1 -1
- package/dist/bromcom-ui/p-9b7af3c4.js +5 -0
- package/dist/bromcom-ui/p-9c6676f2.entry.js +5 -0
- package/dist/bromcom-ui/{p-43a281a4.js → p-9d7ec4f0.js} +1 -1
- package/dist/bromcom-ui/{p-b27218ea.entry.js → p-9f6fd146.entry.js} +1 -1
- package/dist/bromcom-ui/p-a18f6d11.js +5 -0
- package/dist/bromcom-ui/{p-21d98283.entry.js → p-a2583501.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7f1681e2.entry.js → p-aa2f32bb.entry.js} +1 -1
- package/dist/bromcom-ui/p-abc44b58.entry.js +5 -0
- package/dist/bromcom-ui/{p-8cbae172.entry.js → p-acf307e1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-be778e45.entry.js → p-ad8af495.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4b8f90ef.js → p-b1f4ebad.js} +1 -1
- package/dist/bromcom-ui/{p-752057b7.entry.js → p-b36fe678.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2ee20f32.entry.js → p-b5c650c6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2565ccce.js → p-b82041d3.js} +1 -1
- package/dist/bromcom-ui/{p-d498d79b.entry.js → p-c761e694.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d685ffff.entry.js → p-ca106284.entry.js} +1 -1
- package/dist/bromcom-ui/p-cb66612c.entry.js +5 -0
- package/dist/bromcom-ui/{p-33f3295e.entry.js → p-ced26b93.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d2f9f353.entry.js → p-d0fba40e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d9331f0f.entry.js → p-d4b23073.entry.js} +1 -1
- package/dist/bromcom-ui/{p-55547a6e.entry.js → p-d4fb5ac0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-56ec6518.entry.js → p-d9bbea7b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ceafe408.entry.js → p-dad263b2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-84089734.entry.js → p-ea888f01.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e02e88fb.js → p-f0c03fb4.js} +1 -1
- package/dist/bromcom-ui/{p-cd567621.entry.js → p-f56a74bd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8846b944.entry.js → p-f667ee85.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5da0f9ef.entry.js → p-fda7b812.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fc1942c6.js → p-fe953a0b.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
- package/dist/cjs/{bcm-button_11.cjs.entry.js → bcm-button_12.cjs.entry.js} +172 -12
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +5 -5
- package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
- package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
- package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-list_3.cjs.entry.js +7 -7
- package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
- package/dist/cjs/bcm-number-input.cjs.entry.js +109 -0
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-shortcut.cjs.entry.js +4 -4
- package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
- package/dist/cjs/bcm-step.cjs.entry.js +3 -3
- package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
- package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -4
- package/dist/cjs/bcm-table.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
- package/dist/cjs/bcm-typography.cjs.entry.js +21 -0
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{generate-f0d6805e.js → generate-eb7fd62b.js} +1 -1
- package/dist/cjs/{global-c61c9656.js → global-1210b4ea.js} +1 -1
- package/dist/cjs/{input-template-38924cda.js → input-template-69fc22ac.js} +1 -1
- package/dist/cjs/{json-parse-decarator-a2024131.js → json-parse-decarator-2d4f7d88.js} +1 -1
- package/dist/cjs/{label-template-8dc10d0a.js → label-template-a6f51ef2.js} +6 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-7c3fefa2.js → number-helper-952bd974.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-a737bf36.js → package-c0fd1b3c.js} +1 -1
- package/dist/cjs/{stepper-states-3b876d4d.js → stepper-states-79ced0f7.js} +1 -1
- package/dist/cjs/{tooltip-helper-f98dd7a7.js → tooltip-helper-20502cd7.js} +3 -3
- package/dist/cjs/{validators-f2869ecb.js → validators-18074a6e.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/label/label.js +1 -1
- package/dist/collection/components/molecules/number-input/number-input.css +137 -0
- package/dist/collection/components/molecules/number-input/number-input.js +425 -0
- package/dist/collection/components/molecules/number-input/number-input.style.js +45 -0
- package/dist/collection/components/molecules/switch/switch.css +1 -0
- package/dist/collection/components/organism/list/list.css +2 -0
- package/dist/collection/templates/label-template.js +6 -6
- package/dist/components/bcm-number-input.d.ts +11 -0
- package/dist/components/bcm-number-input.js +157 -0
- package/dist/components/bcm-switch.js +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/label.js +7 -4
- package/dist/components/list.js +1 -1
- package/dist/esm/bcm-accordion.entry.js +2 -2
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance.entry.js +2 -2
- package/dist/esm/bcm-avatar_2.entry.js +4 -4
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/{bcm-button_11.entry.js → bcm-button_12.entry.js} +172 -13
- package/dist/esm/bcm-caption.entry.js +4 -4
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-checkbox-group.entry.js +3 -3
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +5 -5
- package/dist/esm/bcm-chip.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +2 -2
- package/dist/esm/bcm-color-input.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +3 -3
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-drawer.entry.js +4 -4
- package/dist/esm/bcm-dropdown.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +4 -4
- package/dist/esm/bcm-item.entry.js +2 -2
- package/dist/esm/bcm-items.entry.js +2 -2
- package/dist/esm/bcm-list_3.entry.js +7 -7
- package/dist/esm/bcm-menu.entry.js +5 -5
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
- package/dist/esm/bcm-modal-2-header.entry.js +4 -4
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-modal.entry.js +2 -2
- package/dist/esm/bcm-number-input.entry.js +105 -0
- package/dist/esm/bcm-popconfirm-box.entry.js +2 -2
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-progress.entry.js +2 -2
- package/dist/esm/bcm-radio-group.entry.js +4 -4
- package/dist/esm/bcm-radio.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-shortcut.entry.js +4 -4
- package/dist/esm/bcm-skeleton.entry.js +4 -4
- package/dist/esm/bcm-step.entry.js +3 -3
- package/dist/esm/bcm-stepper.entry.js +5 -5
- package/dist/esm/bcm-tab-group.entry.js +4 -4
- package/dist/esm/bcm-tab-item-header.entry.js +4 -4
- package/dist/esm/bcm-tab-item.entry.js +4 -4
- package/dist/esm/bcm-table.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-textarea.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +2 -2
- package/dist/esm/bcm-typography.entry.js +17 -0
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{generate-fff9c034.js → generate-aae94409.js} +1 -1
- package/dist/esm/{global-446a0022.js → global-8975e389.js} +1 -1
- package/dist/esm/{input-template-ff26f463.js → input-template-6b597dcd.js} +1 -1
- package/dist/esm/{json-parse-decarator-3e533274.js → json-parse-decarator-84d6e52c.js} +1 -1
- package/dist/esm/{label-template-989d1700.js → label-template-ad2e8119.js} +6 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-c1ee913b.js → number-helper-8dade9f3.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-7d8bb462.js → package-d5af5a81.js} +1 -1
- package/dist/esm/{stepper-states-500cb902.js → stepper-states-6923dc97.js} +1 -1
- package/dist/esm/{tooltip-helper-c22623e4.js → tooltip-helper-e0f7ed97.js} +3 -3
- package/dist/esm/{validators-93758ad4.js → validators-1e7b9d1d.js} +1 -1
- package/dist/types/components/molecules/number-input/number-input.d.ts +29 -0
- package/dist/types/components/molecules/number-input/number-input.style.d.ts +200 -0
- package/dist/types/components.d.ts +53 -0
- package/dist/types/templates/label-template.d.ts +2 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-0208acef.entry.js +0 -7
- package/dist/bromcom-ui/p-0e2cff0d.js +0 -5
- package/dist/bromcom-ui/p-84307b0c.entry.js +0 -5
- package/dist/bromcom-ui/p-8b202d9e.js +0 -5
- package/dist/bromcom-ui/p-c35c11a7.js +0 -5
- package/dist/bromcom-ui/p-d2fe5024.entry.js +0 -5
- package/dist/bromcom-ui/p-f9739222.entry.js +0 -5
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +0 -194
- package/dist/esm/bcm-checkbox_2.entry.js +0 -189
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as e,h as i,H as o,g as r}from"./p-170cf07d.js";import{G as n,s}from"./p-
|
|
5
|
+
import{r as t,c as e,h as i,H as o,g as r}from"./p-170cf07d.js";import{G as n,s}from"./p-9d7ec4f0.js";import{B as a}from"./p-6369b73b.js";import{c as p}from"./p-64fad38b.js";import{S as c}from"./p-157359d6.js";import"./p-823a5d13.js";import"./p-6edf985f.js";import"./p-85eedabc.js";const l=class{constructor(i){t(this,i),this.bcmChange=e(this,"bcm-change",7),this._id=n.UID(),this.size=a.Size.medium,this.type="button",this.color=void 0,this.disabled=void 0,this.direction=a.Direction.horizontal}componentWillLoad(){const{size:t,color:e}=this,i=this.getButtons();(null==i?void 0:i.length)&&i.forEach((i=>{let o=c.elementBooleanCheck(this.el.getAttribute("disabled"))||i.getAttribute("disabled");e&&i.setAttribute("color",e),t&&i.setAttribute("size",t),o&&(i.disabled=!0)}))}getButtons(){return s((()=>Array.from(this.el.querySelectorAll("bcm-button"))),[])}radioControl(t){const e=this.getButtons();(null==e?void 0:e.length)&&e.forEach((e=>{e.checked=e.id==t}))}checkboxControl(t){const e=this.getButtons();(null==e?void 0:e.length)&&e.forEach((e=>{e.checked=e.id==t?e.checked=!e.checked:e.checked}))}listenButton({target:t}){if(t.id){switch(this.type){case"radio":this.radioControl(t.id);break;case"checkbox":this.checkboxControl(t.id)}this.handleChange()}}handleChange(){const t=this.getButtons().filter(Boolean).map((t=>({id:t.id,checked:t.checked})));this.bcmChange.emit(t)}render(){const t=p("bcm-button-group",{"bcm-button-group__vertical":this.direction===a.Direction.vertical});return i(o,{class:t},i("slot",null))}get el(){return r(this)}};l.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .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}*{box-sizing:border-box}.bcm-button-group{font-family:"Inter", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:nowrap;width:fit-content;background-color:var(--bcm-new-ds-color-slate-300);border:1px solid var(--bcm-new-ds-color-slate-300);gap:1px;border-radius:4px}.bcm-button-group .bcm-button__container{border-radius:0;border:none}.bcm-button-group .bcm-button:first-child .bcm-button__container{border-top-left-radius:4px;border-bottom-left-radius:4px}.bcm-button-group .bcm-button:last-child .bcm-button__container{border-top-right-radius:4px;border-bottom-right-radius:4px}.bcm-button-group__vertical{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap}.bcm-button-group__vertical .bcm-button{width:100%}.bcm-button-group__vertical .bcm-button__container{width:100%;border-radius:0}.bcm-button-group__vertical .bcm-button:first-child .bcm-button__container{border-radius:4px 4px 0 0}.bcm-button-group__vertical .bcm-button:last-child .bcm-button__container{border-radius:0 0 4px 4px}';export{l as bcm_button_group}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{h as n}from"./p-170cf07d.js";import{d as e}from"./p-3fac58f7.js";import{B as s}from"./p-6369b73b.js";import{c as
|
|
5
|
+
import{h as n}from"./p-170cf07d.js";import{d as e}from"./p-3fac58f7.js";import{B as s}from"./p-6369b73b.js";import{c as t}from"./p-64fad38b.js";import{s as a}from"./p-9d7ec4f0.js";const i=({elementType:i,rows:o,id:c,internalId:r,type:l,placeholder:p,value:u,size:f,pattern:d,unit:b,unitPrefix:m,maxLength:x,disabled:w,clearable:h,focused:y,readonly:v,isPasswordVisible:C,passwordToggle:g,noDefaultIcon:j,inValid:_,captionType:k,resize:z,autocomplete:I,_suffix:T,_prefix:L,changePasswordVisibility:B,handleClear:D,steps:O,ref:P,handleBlur:V,handleFocus:F,handleInput:H,handleChange:M,isEyeDropperSupported:E,eyeDropper:S})=>{const q=s.HtmlElementType[i]||s.HtmlElementType.input;l="password"===l&&C?"text":l,u=a((()=>u),""),u=y?u:u+(u&&(null==b?void 0:b.length)>0?" "+b:"");const A="color"===(l=(null==b?void 0:b.length)>0&&!y?"text":l);l="color"===l?"text":l;var G=t("bcm-input__container",q===s.HtmlElementType.textarea&&t("bcm-input__textarea","textarea-size-"+s.Size[f],"resize-"+z,"textarea-"+f),q===s.HtmlElementType.input&&t("input-size-"+s.Size[f]),{focused:y,clearable:h,disabled:w,readonly:v,invalid:_,unit:(null==b?void 0:b.length)>0,error:"error"===k});const J=t("caret-container",{unit:(null==b?void 0:b.length)>0,disabled:w||v||_}),K="bcm-input__container--"+f,N=t(K,"unit-prefix");return n("div",{class:G,id:c+"-container"},n("span",{hidden:!0},n("slot",null)),n("span",{class:"input-prefix"},n("slot",{name:"prefix"}),L&&L.length>0&&n("span",{innerHTML:L}),m&&n("span",{class:N},m),A&&n("i",{class:"tw-flex tw-h-4 tw-w-4 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-slate-300",style:{backgroundColor:u}})),n(q,Object.assign({tabindex:"0",id:c+"-input","bcm-internal-id":r,class:"bcm-input-element "+K},q===s.HtmlElementType.input&&{type:l,autocomplete:I?"on":"off",pattern:d},q===s.HtmlElementType.textarea&&{rows:o,resize:z},{value:u,maxLength:x,placeholder:p,disabled:w,readOnly:v,ref:n=>P(n),onBlur:n=>(n=>{n.target.parentElement.classList.remove("focused"),V(n)})(n),onFocus:n=>(n=>{n.target.parentElement.classList.add("focused"),F(n)})(n),onInput:n=>H(n),onChange:n=>M(n)})),n("span",{class:"input-suffix-content"},h&&!w&&!v&&n("span",{class:"input-suffix input-suffix-button input-clear-button",onClick:n=>D(n)},n("bcm-icon",{icon:"far fa-times"}))),n("span",{class:"input-suffix-content"},("password"===l||"text"===l)&&g&&n("span",{class:"input-suffix input-suffix-button",onClick:()=>B()},n("bcm-icon",{icon:C?"far fa-eye-slash":"far fa-eye"}))),n("span",{class:"input-suffix-content"},Object.keys(e).includes(l)&&!j&&n("span",{class:"input-suffix"},n("bcm-icon",{icon:e[l]}))),n("span",{class:"input-suffix-content"},"number"===l&&n("div",{class:J},n("span",{class:"bcm-input-caret",onClick:()=>O("up")},n("bcm-icon",{icon:"fas fa-caret-up"})),n("span",{class:"bcm-input-caret",onClick:()=>O("down")},n("bcm-icon",{icon:"fas fa-caret-down"})))),n("span",{class:"input-suffix-content"},"number"!==l&&n("span",{class:"input-suffix"},n("slot",{name:"suffix"}),T&&T.length>0&&n("span",{innerHTML:T})),A&&E()&&n("span",{class:"input-suffix"},n("span",null,n("i",{class:"far fa-eye-dropper",onClick:()=>S()})))))};export{i as I}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as i,f as e,h as o,H as n,g as s,F as l}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-43a281a4.js";import"./p-c35c11a7.js";import"./p-157359d6.js";import"./p-0e2cff0d.js";import"./p-7e44e6b5.js";import{a}from"./p-6369b73b.js";import{C as d}from"./p-a25c8a55.js";import{c as u}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-1064895e.js";const h=p({slots:{base:"tw-font-sans tw-flex tw-flex-col tw-items-start tw-justify-start tw-gap-2",content:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-3",inputArea:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-1 tw-box-content tw-border tw-border-solid tw-max-w-[100px] tw-uppercase tw-font-medium tw-text-center tw-border-gray-300 tw-rounded",input:"tw-flex-1 tw-text-inherit tw-uppercase tw-font-semibold tw-text-center tw-border-none tw-bg-transparent tw-outline-none tw-w-full",button:["input-dropdown-button tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-1 tw-rounded tw-outline-none tw-bg-slate-100","tw-border tw-border-solid tw-border-slate-300 tw-font-medium tw-text-slate-600","hover:tw-border-slate-400 hover:tw-bg-slate-200","tw-min-w-[32px]","tw-cursor-pointer","disabled:tw-cursor-not-allowed disabled:tw-text-slate-400 disabled:tw-pointer-events-none","readonly:tw-text-slate-700 readonly:tw-cursor-text"],menu:"tw-mt-1 tw-flex tw-flex-col tw-items-start tw-justify-center tw-gap-2 tw-overflow-auto tw-bg-white tw-p-3 tw-font-sans tw-text-3 tw-text-slate-700",menuItem:"tw-flex tw-w-full tw-cursor-pointer tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 hover:tw-bg-blue-100",selectedItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 tw-bg-primary-200",disabledItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-cursor-not-allowed tw-text-slate-400 tw-bg-slate-100 hover:tw-bg-slate-100 tw-list-none",commentArea:"tw-flex tw-h-fit tw-w-full tw-min-w-[288px] tw-flex-col tw-items-start tw-rounded tw-p-4 tw-shadow-2"},variants:{size:{small:{button:"tw-h-[18px] tw-text-1 tw-leading-none"},medium:{button:"tw-h-[24px] tw-text-2",inputArea:"tw-p-0.5",input:"tw-text-4"},large:{button:"tw-h-[30px] tw-text-2",inputArea:"tw-p-1",input:"tw-text-6"}},invalid:{true:{inputArea:"tw-border-red-600 tw-bg-red-50",input:"tw-text-red-500"}},disabled:{true:{base:"tw-opacity-50 tw-cursor-not-allowed",input:"tw-cursor-not-allowed"}},hideComment:{true:{base:"tw-min-w-[98px]"},false:{base:"tw-min-w-[128px] "}},label:{true:""}},defaultVariants:{size:"medium",invalid:!1,hideComment:!1,disabled:!1}}),c=class{constructor(e){t(this,e),this.change=i(this,"bcm-change",7),this.onChangeDropdown=i(this,"bcm-input-dropdown-change",7),this.handleKeyPress=t=>{var i,e;(null===(e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value)||void 0===e?void 0:e.length)>=+this.maxCharacterLimit&&t.preventDefault()},this._id=r.UID(),this.value=void 0,this.defaultValue={},this.lateKeys="L",this.maxCharacterLimit=1,this.size=a.Size.medium,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.fullWidth=!1,this.hideComment=!1,this.hideCaption=!0,this.disabled=!1,this.required=!1,this.readonly=!1,this.data=[{key:"/",value:"Present",color:"#00b050"},{key:"B",value:"Educated off site (NOT dual registration)",color:"#ffc000"},{key:"C",value:"Other authorised circumstance",color:"#ffc000"},{key:"D",value:"Dual registration",color:"#0070c0"},{key:"E",value:"Excluded",color:"#ff0000"},{key:"F",value:"Free Study",color:"#ffc000"},{key:"I",value:"Illness",color:"#ff0000"},{key:"J",value:"Interview",color:"#ffc000"},{key:"L",value:"Late before reg. closed",color:"#ffc000"}],this.caption=void 0,this.noCaption=!1,this.captionType=a.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.isOpenMenu=!1,this.invalid=!1}get overlayContainer(){return document.getElementById("bcm-overlay-container")}get menuContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-menu-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-menu-${this._id}`)}get keys(){return this.lateKeys.toLocaleLowerCase().split(",")}get isLate(){var t,i,e,o,n,s;return this.keys.includes(null===(i=null===(t=this.value)||void 0===t?void 0:t.key)||void 0===i?void 0:i.toLocaleLowerCase())||(null===(o=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===o?void 0:o.isLate)||(null===(s=null===(n=this.data)||void 0===n?void 0:n.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===s?void 0:s.lateMin)>0}componentWillLoad(){var t,i;this.captionCache=this.caption,this.captionTypeCache=this.captionType,(null===(t=Object.keys(this.defaultValue))||void 0===t?void 0:t.length)>0?this.watchDefaultValueHandler(this.defaultValue):this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>t.selected))}get commentContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-comment-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-comment-${this._id}`)}clickListener(t){var i,e;const o=r.findEventPath(t,this.el),n=r.findEventPathWithNodeName(t,"BCM-LINKED");o||n||this.keys.includes(null===(i=this.value)||void 0===i?void 0:i.key)||null===(e=this.commentContent)||void 0===e||e.hide()}watchDefaultValueHandler(t){var i,o;t&&(this.value=null===(i=this.data)||void 0===i?void 0:i.find((i=>{var e,o;return(null===(e=null==i?void 0:i.key)||void 0===e?void 0:e.toLowerCase())===(null===(o=t.key)||void 0===o?void 0:o.toLowerCase())})),this.data=this.data.map((i=>(i.key===(null==t?void 0:t.key)?(i=t).selected=!0:i.selected=!1,i))),this.value=null===(o=this.data)||void 0===o?void 0:o.find((t=>null==t?void 0:t.selected)),e(this.el))}async set(t){this.data="string"==typeof t?JSON.parse(t):t}async get(){return this.value}async setClear(){return this.value=null,Promise.resolve()}async resetCaption(){return this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.invalid=!1,Promise.resolve()}onSelectItem(t){var i;this.invalid=!1,this.data=this.data.map((i=>Object.assign(Object.assign({},i),{selected:i.key===t.key}))),this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>null==t?void 0:t.selected)),this.onChangeDropdown.emit(this.value),this.change.emit()}async handleInput(t){var i,e,o,n,s,l,r;const a=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(this.isOpenMenu=!0,(null==a?void 0:a.length)>=+this.maxCharacterLimit){const i=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===a.toLowerCase()}));i?(await(null===(o=this.menuContent)||void 0===o?void 0:o.hide()),(null==i?void 0:i.hideComment)||null===(n=this.commentContent)||void 0===n||n.show(),this.onSelectItem(i)):(this.invalid=!0,this.value=t.target.value,await(null===(s=this.menuContent)||void 0===s?void 0:s.show()),this._input.style.color="#ff0000")}else null===(l=this.commentContent)||void 0===l||l.hide(),null===(r=this.menuContent)||void 0===r||r.hide(),this.value=null,this._input.style.color="#000000",this.invalid=!1;this.change.emit()}onClickSave(){var t;null===(t=this.commentContent)||void 0===t||t.hide(),this.data=this.data.map((t=>Object.assign(Object.assign({},t),t.key===this.value.key&&{lateMin:this.value.lateMin,comment:this.value.comment}))),e(this.el),this.onChangeDropdown.emit(this.value),this.change.emit()}async onClick(t){var i,e;(null==t?void 0:t.hideComment)||null===(i=this.commentContent)||void 0===i||i.show(),await(null===(e=this.menuContent)||void 0===e?void 0:e.hide()),this.onSelectItem(t)}render(){var t,i,e,s,r;const{size:a,label:p,placeholder:c,required:m,disabled:w,readonly:v,_id:x,invalid:g,hideComment:f,noCaption:b,customErrorMessage:y,caption:z,captionType:j,captionError:k,hideCaption:C}=this,{base:I,inputArea:E,input:L,button:O,menu:M,menuItem:$,commentArea:A,disabledItem:D,content:B,selectedItem:S}=h({size:a,invalid:g,hideComment:f,disabled:w});return o(n,{class:I()},p&&o("bcm-label",{htmlFor:x+"-dropdown-input",size:a,value:p,required:m}),o("div",{class:B()},o("div",{class:E()},o("input",{id:x+"-dropdown-input",class:L(),style:{color:null===(t=this.value)||void 0===t?void 0:t.color},type:"text",tabIndex:-1,placeholder:c,value:null===(i=this.value)||void 0===i?void 0:i.key,disabled:w,required:m,autoComplete:"off",readOnly:v,onKeyPress:t=>this.handleKeyPress(t),onInput:t=>this.handleInput(t),ref:t=>this._input=t}),o("button",{disabled:w,id:`i-dropdown-button-${x}`,class:O(),onClick:()=>this.isOpenMenu=!0},o("i",{class:"fas fa-chevron-down"})),o("bcm-linked",{"onBcm-open":({detail:t})=>{var i;return t&&(null===(i=this.commentContent)||void 0===i?void 0:i.hide())},class:"tw-mt-1",id:`i-dropdown-menu-${x}`,"target-id":`i-dropdown-button-${x}`,placement:"bottom-start"},o((()=>{var t;return o(l,null,this.isOpenMenu?o("div",{class:M()},this.invalid&&o("li",{class:$()+" tw-bg-red-100 hover:tw-bg-red-100"},o("span",{class:"tw-text-red-900"},o("i",{class:"far fa-exclamation-circle"})),o("span",null,"There is not mark you entered, please use")),null===(t=this.data)||void 0===t?void 0:t.map((t=>o(l,null,o("li",(null==t?void 0:t.disabled)?{class:D()}:{class:(null==t?void 0:t.selected)?S():$(),onClick:()=>this.onClick(t)},o("span",null,t.key)," - ",o("span",null,t.value)))))):null)}),null)),o("bcm-linked",{id:`i-dropdown-comment-${x}`,"target-id":x,trigger:"custom",placement:"left"},o((()=>{var t,i,e;return o(l,null,this.isOpenMenu?o("div",{class:A()},this.isLate?o(l,null,o("bcm-input",{label:"Minus Late",required:!0,id:this._id+"-input-dropdown-late-content-input",type:"number","full-width":!0,autocomplete:!1,min:0,max:200,value:null===(t=this.value)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late",customErrorMessage:"Max limit 200 mins","onBcm-change":({detail:t})=>this.value.lateMin=+t},o("i",{slot:"prefix",class:"far fa-clock"}))):null,o("bcm-textarea",{"full-width":!0,value:null!==(e=null===(i=this.value)||void 0===i?void 0:i.comment)&&void 0!==e?e:"","onBcm-change":({detail:t})=>this.value.comment=t,label:"Description","no-caption":!0,rows:4}),o("footer",{class:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2"},o("bcm-button",{icon:"fas fa-times",kind:"ghost","icon-position":"prefix",onClick:()=>{var t;return null===(t=this.commentContent)||void 0===t?void 0:t.hide()}},"Close"),o("bcm-button",{icon:"fas fa-save","icon-position":"prefix",onClick:()=>this.onClickSave()},"Save"))):null)}),null))),this.hideComment?null:o("span",{onClick:()=>{var t,i;(null===(t=this.value)||void 0===t?void 0:t.key)&&(this.isOpenMenu=!0,null===(i=this.commentContent)||void 0===i||i.show())},class:u((null===(e=this.value)||void 0===e?void 0:e.comment)||(null===(s=this.value)||void 0===s?void 0:s.lateMin)>0?"tw-text-slate-600":"tw-text-slate-400",{"tw-cursor-pointer":null===(r=this.value)||void 0===r?void 0:r.key})},o("i",{class:"fas fa-comment"}))),!C&&o(d,{noCaption:b,captionType:j,captionError:k,caption:z,customErrorMessage:y}))}get el(){return s(this)}static get watchers(){return{defaultValue:["watchDefaultValueHandler"]}}};c.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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}:host{display:flex;flex-direction:column;width:100%;position:relative}.input-dropdown-button i{transition:transform 0.2s ease-in-out}.input-dropdown-button[linked-is-open]>i{transform:rotate(-180deg);transition:transform 0.2s ease-in-out}';export{c as bcm_input_dropdown}
|
|
5
|
+
import{r as t,c as i,f as e,h as o,H as n,g as s,F as l}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-9d7ec4f0.js";import"./p-a18f6d11.js";import"./p-157359d6.js";import"./p-9b7af3c4.js";import"./p-7e44e6b5.js";import{a}from"./p-6369b73b.js";import{C as d}from"./p-a25c8a55.js";import{c as u}from"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as p}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-823a5d13.js";const h=p({slots:{base:"tw-font-sans tw-flex tw-flex-col tw-items-start tw-justify-start tw-gap-2",content:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-3",inputArea:"tw-flex tw-flex-row tw-items-center tw-justify-start tw-gap-1 tw-box-content tw-border tw-border-solid tw-max-w-[100px] tw-uppercase tw-font-medium tw-text-center tw-border-gray-300 tw-rounded",input:"tw-flex-1 tw-text-inherit tw-uppercase tw-font-semibold tw-text-center tw-border-none tw-bg-transparent tw-outline-none tw-w-full",button:["input-dropdown-button tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-1 tw-rounded tw-outline-none tw-bg-slate-100","tw-border tw-border-solid tw-border-slate-300 tw-font-medium tw-text-slate-600","hover:tw-border-slate-400 hover:tw-bg-slate-200","tw-min-w-[32px]","tw-cursor-pointer","disabled:tw-cursor-not-allowed disabled:tw-text-slate-400 disabled:tw-pointer-events-none","readonly:tw-text-slate-700 readonly:tw-cursor-text"],menu:"tw-mt-1 tw-flex tw-flex-col tw-items-start tw-justify-center tw-gap-2 tw-overflow-auto tw-bg-white tw-p-3 tw-font-sans tw-text-3 tw-text-slate-700",menuItem:"tw-flex tw-w-full tw-cursor-pointer tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 hover:tw-bg-blue-100",selectedItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-text-slate-700 tw-bg-primary-200",disabledItem:"tw-flex tw-w-full tw-flex-row tw-items-start tw-gap-1 tw-rounded tw-px-3 tw-py-1 tw-cursor-not-allowed tw-text-slate-400 tw-bg-slate-100 hover:tw-bg-slate-100 tw-list-none",commentArea:"tw-flex tw-h-fit tw-w-full tw-min-w-[288px] tw-flex-col tw-items-start tw-rounded tw-p-4 tw-shadow-2"},variants:{size:{small:{button:"tw-h-[18px] tw-text-1 tw-leading-none"},medium:{button:"tw-h-[24px] tw-text-2",inputArea:"tw-p-0.5",input:"tw-text-4"},large:{button:"tw-h-[30px] tw-text-2",inputArea:"tw-p-1",input:"tw-text-6"}},invalid:{true:{inputArea:"tw-border-red-600 tw-bg-red-50",input:"tw-text-red-500"}},disabled:{true:{base:"tw-opacity-50 tw-cursor-not-allowed",input:"tw-cursor-not-allowed"}},hideComment:{true:{base:"tw-min-w-[98px]"},false:{base:"tw-min-w-[128px] "}},label:{true:""}},defaultVariants:{size:"medium",invalid:!1,hideComment:!1,disabled:!1}}),c=class{constructor(e){t(this,e),this.change=i(this,"bcm-change",7),this.onChangeDropdown=i(this,"bcm-input-dropdown-change",7),this.handleKeyPress=t=>{var i,e;(null===(e=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value)||void 0===e?void 0:e.length)>=+this.maxCharacterLimit&&t.preventDefault()},this._id=r.UID(),this.value=void 0,this.defaultValue={},this.lateKeys="L",this.maxCharacterLimit=1,this.size=a.Size.medium,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.fullWidth=!1,this.hideComment=!1,this.hideCaption=!0,this.disabled=!1,this.required=!1,this.readonly=!1,this.data=[{key:"/",value:"Present",color:"#00b050"},{key:"B",value:"Educated off site (NOT dual registration)",color:"#ffc000"},{key:"C",value:"Other authorised circumstance",color:"#ffc000"},{key:"D",value:"Dual registration",color:"#0070c0"},{key:"E",value:"Excluded",color:"#ff0000"},{key:"F",value:"Free Study",color:"#ffc000"},{key:"I",value:"Illness",color:"#ff0000"},{key:"J",value:"Interview",color:"#ffc000"},{key:"L",value:"Late before reg. closed",color:"#ffc000"}],this.caption=void 0,this.noCaption=!1,this.captionType=a.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.captionCache=void 0,this.captionTypeCache=void 0,this.isOpenMenu=!1,this.invalid=!1}get overlayContainer(){return document.getElementById("bcm-overlay-container")}get menuContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-menu-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-menu-${this._id}`)}get keys(){return this.lateKeys.toLocaleLowerCase().split(",")}get isLate(){var t,i,e,o,n,s;return this.keys.includes(null===(i=null===(t=this.value)||void 0===t?void 0:t.key)||void 0===i?void 0:i.toLocaleLowerCase())||(null===(o=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===o?void 0:o.isLate)||(null===(s=null===(n=this.data)||void 0===n?void 0:n.find((t=>{var i,e,o;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===(null===(o=null===(e=this.value)||void 0===e?void 0:e.key)||void 0===o?void 0:o.toLowerCase())})))||void 0===s?void 0:s.lateMin)>0}componentWillLoad(){var t,i;this.captionCache=this.caption,this.captionTypeCache=this.captionType,(null===(t=Object.keys(this.defaultValue))||void 0===t?void 0:t.length)>0?this.watchDefaultValueHandler(this.defaultValue):this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>t.selected))}get commentContent(){var t,i;return null!==(i=null===(t=this.overlayContainer)||void 0===t?void 0:t.querySelector(`#i-dropdown-comment-${this._id}`))&&void 0!==i?i:this.el.querySelector(`#i-dropdown-comment-${this._id}`)}clickListener(t){var i,e;const o=r.findEventPath(t,this.el),n=r.findEventPathWithNodeName(t,"BCM-LINKED");o||n||this.keys.includes(null===(i=this.value)||void 0===i?void 0:i.key)||null===(e=this.commentContent)||void 0===e||e.hide()}watchDefaultValueHandler(t){var i,o;t&&(this.value=null===(i=this.data)||void 0===i?void 0:i.find((i=>{var e,o;return(null===(e=null==i?void 0:i.key)||void 0===e?void 0:e.toLowerCase())===(null===(o=t.key)||void 0===o?void 0:o.toLowerCase())})),this.data=this.data.map((i=>(i.key===(null==t?void 0:t.key)?(i=t).selected=!0:i.selected=!1,i))),this.value=null===(o=this.data)||void 0===o?void 0:o.find((t=>null==t?void 0:t.selected)),e(this.el))}async set(t){this.data="string"==typeof t?JSON.parse(t):t}async get(){return this.value}async setClear(){return this.value=null,Promise.resolve()}async resetCaption(){return this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null,this.invalid=!1,Promise.resolve()}onSelectItem(t){var i;this.invalid=!1,this.data=this.data.map((i=>Object.assign(Object.assign({},i),{selected:i.key===t.key}))),this.value=null===(i=this.data)||void 0===i?void 0:i.find((t=>null==t?void 0:t.selected)),this.onChangeDropdown.emit(this.value),this.change.emit()}async handleInput(t){var i,e,o,n,s,l,r;const a=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.value;if(this.isOpenMenu=!0,(null==a?void 0:a.length)>=+this.maxCharacterLimit){const i=null===(e=this.data)||void 0===e?void 0:e.find((t=>{var i;return(null===(i=null==t?void 0:t.key)||void 0===i?void 0:i.toLowerCase())===a.toLowerCase()}));i?(await(null===(o=this.menuContent)||void 0===o?void 0:o.hide()),(null==i?void 0:i.hideComment)||null===(n=this.commentContent)||void 0===n||n.show(),this.onSelectItem(i)):(this.invalid=!0,this.value=t.target.value,await(null===(s=this.menuContent)||void 0===s?void 0:s.show()),this._input.style.color="#ff0000")}else null===(l=this.commentContent)||void 0===l||l.hide(),null===(r=this.menuContent)||void 0===r||r.hide(),this.value=null,this._input.style.color="#000000",this.invalid=!1;this.change.emit()}onClickSave(){var t;null===(t=this.commentContent)||void 0===t||t.hide(),this.data=this.data.map((t=>Object.assign(Object.assign({},t),t.key===this.value.key&&{lateMin:this.value.lateMin,comment:this.value.comment}))),e(this.el),this.onChangeDropdown.emit(this.value),this.change.emit()}async onClick(t){var i,e;(null==t?void 0:t.hideComment)||null===(i=this.commentContent)||void 0===i||i.show(),await(null===(e=this.menuContent)||void 0===e?void 0:e.hide()),this.onSelectItem(t)}render(){var t,i,e,s,r;const{size:a,label:p,placeholder:c,required:m,disabled:w,readonly:v,_id:x,invalid:g,hideComment:f,noCaption:b,customErrorMessage:y,caption:z,captionType:j,captionError:k,hideCaption:C}=this,{base:I,inputArea:E,input:L,button:O,menu:M,menuItem:$,commentArea:A,disabledItem:D,content:B,selectedItem:S}=h({size:a,invalid:g,hideComment:f,disabled:w});return o(n,{class:I()},p&&o("bcm-label",{htmlFor:x+"-dropdown-input",size:a,value:p,required:m}),o("div",{class:B()},o("div",{class:E()},o("input",{id:x+"-dropdown-input",class:L(),style:{color:null===(t=this.value)||void 0===t?void 0:t.color},type:"text",tabIndex:-1,placeholder:c,value:null===(i=this.value)||void 0===i?void 0:i.key,disabled:w,required:m,autoComplete:"off",readOnly:v,onKeyPress:t=>this.handleKeyPress(t),onInput:t=>this.handleInput(t),ref:t=>this._input=t}),o("button",{disabled:w,id:`i-dropdown-button-${x}`,class:O(),onClick:()=>this.isOpenMenu=!0},o("i",{class:"fas fa-chevron-down"})),o("bcm-linked",{"onBcm-open":({detail:t})=>{var i;return t&&(null===(i=this.commentContent)||void 0===i?void 0:i.hide())},class:"tw-mt-1",id:`i-dropdown-menu-${x}`,"target-id":`i-dropdown-button-${x}`,placement:"bottom-start"},o((()=>{var t;return o(l,null,this.isOpenMenu?o("div",{class:M()},this.invalid&&o("li",{class:$()+" tw-bg-red-100 hover:tw-bg-red-100"},o("span",{class:"tw-text-red-900"},o("i",{class:"far fa-exclamation-circle"})),o("span",null,"There is not mark you entered, please use")),null===(t=this.data)||void 0===t?void 0:t.map((t=>o(l,null,o("li",(null==t?void 0:t.disabled)?{class:D()}:{class:(null==t?void 0:t.selected)?S():$(),onClick:()=>this.onClick(t)},o("span",null,t.key)," - ",o("span",null,t.value)))))):null)}),null)),o("bcm-linked",{id:`i-dropdown-comment-${x}`,"target-id":x,trigger:"custom",placement:"left"},o((()=>{var t,i,e;return o(l,null,this.isOpenMenu?o("div",{class:A()},this.isLate?o(l,null,o("bcm-input",{label:"Minus Late",required:!0,id:this._id+"-input-dropdown-late-content-input",type:"number","full-width":!0,autocomplete:!1,min:0,max:200,value:null===(t=this.value)||void 0===t?void 0:t.lateMin,placeholder:"Enter Minus Late",customErrorMessage:"Max limit 200 mins","onBcm-change":({detail:t})=>this.value.lateMin=+t},o("i",{slot:"prefix",class:"far fa-clock"}))):null,o("bcm-textarea",{"full-width":!0,value:null!==(e=null===(i=this.value)||void 0===i?void 0:i.comment)&&void 0!==e?e:"","onBcm-change":({detail:t})=>this.value.comment=t,label:"Description","no-caption":!0,rows:4}),o("footer",{class:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-end tw-gap-2"},o("bcm-button",{icon:"fas fa-times",kind:"ghost","icon-position":"prefix",onClick:()=>{var t;return null===(t=this.commentContent)||void 0===t?void 0:t.hide()}},"Close"),o("bcm-button",{icon:"fas fa-save","icon-position":"prefix",onClick:()=>this.onClickSave()},"Save"))):null)}),null))),this.hideComment?null:o("span",{onClick:()=>{var t,i;(null===(t=this.value)||void 0===t?void 0:t.key)&&(this.isOpenMenu=!0,null===(i=this.commentContent)||void 0===i||i.show())},class:u((null===(e=this.value)||void 0===e?void 0:e.comment)||(null===(s=this.value)||void 0===s?void 0:s.lateMin)>0?"tw-text-slate-600":"tw-text-slate-400",{"tw-cursor-pointer":null===(r=this.value)||void 0===r?void 0:r.key})},o("i",{class:"fas fa-comment"}))),!C&&o(d,{noCaption:b,captionType:j,captionError:k,caption:z,customErrorMessage:y}))}get el(){return s(this)}static get watchers(){return{defaultValue:["watchDefaultValueHandler"]}}};c.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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}:host{display:flex;flex-direction:column;width:100%;position:relative}.input-dropdown-button i{transition:transform 0.2s ease-in-out}.input-dropdown-button[linked-is-open]>i{transform:rotate(-180deg);transition:transform 0.2s ease-in-out}';export{c as bcm_input_dropdown}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as i,h as e,H as s,g as n}from"./p-170cf07d.js";import{c as o}from"./p-64fad38b.js";import{I as a}from"./p-9850cbce.js";import{J as p}from"./p-
|
|
5
|
+
import{r as t,c as i,h as e,H as s,g as n}from"./p-170cf07d.js";import{c as o}from"./p-64fad38b.js";import{I as a}from"./p-9850cbce.js";import{J as p}from"./p-f0c03fb4.js";import{G as h}from"./p-9d7ec4f0.js";import{B as r}from"./p-6369b73b.js";import"./p-85eedabc.js";import"./p-823a5d13.js";import"./p-6edf985f.js";var d=function(t,i,e,s){var n,o=arguments.length,a=o<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(n=t[p])&&(a=(o<3?n(a):o>3?n(i,e,a):n(i,e))||a);return o>3&&a&&Object.defineProperty(i,e,a),a};const l=class{constructor(e){t(this,e),this.bcmClick=i(this,"bcm-click",7),this.bcmDropdownChange=i(this,"bcm-dropdown-change",7),this.isOpen=void 0,this._id=h.UID(),this.menuId=h.UID(),this.hidden=!1,this.type="dropdown",this.size=r.Size.medium,this.disabled=!1,this.kind=r.Kind.solid,this.icon=void 0,this.href=void 0,this.target=void 0,this.value=void 0,this.noStyle=!1,this.dropdownIcon="fas fa-angle-down",this.linkedComponent=void 0,this.loading=!1,this.variant=void 0,this.dataDismiss=!1,this.fullWidth=!1,this.iconPosition=r.IconPosition.prefix,this.placement=void 0,this.height=void 0,this.maxHeight="500px",this.minHeight="50px",this.stopDeepClean=!1,this.selectable=!0,this.gap="4px",this.color=void 0,this.activeItem=null,this.data=[]}async dataChanged(t){t&&(this.data=t)}async setActive(t=null){var i,e;null===(e=null===(i=document.getElementById(`${this.menuId}`))||void 0===i?void 0:i.querySelectorAll("bcm-menu"))||void 0===e||e.forEach((i=>{i.setActive(t)}))}async getActive(){return this.activeItem}handleSlotItems({detail:t}){this.data=t}setActiveAttribute(t){t.detail&&(this.bcmDropdownChange.emit(t.detail),this.activeItem=t.detail)}render(){const{size:t,kind:i,disabled:n,icon:a,color:p,href:h,target:r,loading:d,type:l,variant:c,fullWidth:m,isOpen:b}=this,x=o("bcm-dropdown","bcm-dropdown__type-"+l,{"full-width":m,"no-style":this.noStyle,hidden:this.hidden||this.linkedComponent}),g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n&&{disabled:n}),d&&{loading:d}),i&&{kind:i}),t&&{size:t}),c&&{variant:c}),p&&{color:p}),this.menuId&&{"menu-id":this.menuId}),u=o("bcm-dropdown__icon",{"bcm-dropdown__icon--open":b}),f=e("span",{class:u},e("bcm-icon",{icon:this.dropdownIcon}));return e(s,{class:x},e("span",{hidden:!0},e("slot",null)),this.noStyle&&e("slot",null),!this.noStyle&&e("bcm-button",Object.assign({class:"main-button",id:`${this._id}-button`},g,a&&{icon:a},h&&"split"===l&&{href:h},r&&"split"===l&&{target:r},m&&{fullWidth:m}),e("slot",null),"dropdown"===l&&f),!this.noStyle&&"split"===l&&e("bcm-button",Object.assign({id:`${this._id}-button-split`,class:"split-button"},g),f),e("bcm-linked",{id:`${this.menuId}`,"target-id":`${this._id}-button${"split"===l?"-split":""}`,placement:this.placement||("dropdown"===l?"bottom-start":"bottom-end"),"max-height":this.maxHeight,"min-height":this.minHeight,height:this.height,"on-bcm-open":t=>{var i;return(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.id)==this.menuId&&(this.isOpen=t.detail)}},this.data&&this.data.length>0&&e("bcm-menu",{data:this.data,selectable:this.selectable,"on-bcm-click":t=>this.bcmClick.emit(t.detail),"onBcm-menu-change":t=>this.setActiveAttribute(t),gap:this.gap,dropdown:!0}),e("slot",{name:"content"})))}get el(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};d([a()],l.prototype,"el",void 0),d([p("data",!0)],l.prototype,"dataChanged",null),l.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .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}*{box-sizing:border-box}.bcm-dropdown{width:fit-content;display:inline-flex;flex-direction:row}.bcm-dropdown.hidden{display:none}.bcm-dropdown.no-style{cursor:pointer}.bcm-dropdown.full-width{width:100%}.bcm-dropdown.full-width .bcm-button__container-text{flex:1;justify-content:space-between}.bcm-dropdown__type-split .main-button .bcm-button__container{border-top-right-radius:0;border-bottom-right-radius:0}.bcm-dropdown__type-split .split-button .bcm-button__container{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:1px;min-width:auto}.bcm-dropdown__icon{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;transform:rotate(0deg);transition:transform 0.2s ease}.bcm-dropdown__icon--open{transform:rotate(180deg)}';export{l as bcm_dropdown}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{E as o}from"./p-170cf07d.js";import{v as s}from"./p-
|
|
5
|
+
import{E as o}from"./p-170cf07d.js";import{v as s}from"./p-823a5d13.js";import{L as t}from"./p-a9eb0321.js";window.bcm={version:s},function(o){const s=document.head,t=document.createElement("script");Object.keys(o).forEach((s=>{t[s]=o[s]})),s.appendChild(t)}({src:"https://kit.fontawesome.com/5e86bea963.js",crossOrigin:"anonymous"}),t.setLicenseKey(o.AG_GRID_LICENSE_KEY);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as i,H as e,g as s}from"./p-170cf07d.js";import{c as a}from"./p-64fad38b.js";import{I as n}from"./p-9850cbce.js";import{G as h}from"./p-
|
|
5
|
+
import{r as t,h as i,H as e,g as s}from"./p-170cf07d.js";import{c as a}from"./p-64fad38b.js";import{I as n}from"./p-9850cbce.js";import{G as h}from"./p-9d7ec4f0.js";import{B as p}from"./p-6369b73b.js";import{d as r}from"./p-8c018ae0.js";import"./p-85eedabc.js";import"./p-823a5d13.js";import"./p-6edf985f.js";const o=class{constructor(i){t(this,i),this._id=h.UID(),this.time=new Date,this.value=void 0,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.disabled=!1,this.noMargin=!1,this.noCaption=!1,this.caption="",this.captionError=void 0,this.captionType="default",this.alignment=void 0,this.placement=p.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1}componentWillLoad(){if("string"==typeof this.time){const t=!!/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(this.time)&&this.time.split(":");this.time=t?new Date((new Date).setHours(Number(t[0]),Number(t[1]))):new Date}}handlePickerLoad(){this.value=this.picker.value}handlePickerChange(t){this.value=t.detail}async set(t){return this.picker.set(t)}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setDisabled(t){this.disabled=t}async getInput(){return await this.picker.getInput()}async getValue(){return this.value}async isValid(){return await this.picker.isValid()}async setClear(){return await this.picker.setClear(),await r(10),Promise.resolve()}async resetCaption(){return await r(10),await this.picker.resetCaption(),this.captionType="default",this.captionError=null,await r(10),Promise.resolve()}async open(){return await this.picker.open()}render(){const t=a(this.hidden?"hidden":null,{"full-width":this.fullWidth});return i(e,{class:t},i("bcm-datetime-picker",{"linked-component":this.linkedComponent,id:this._id,fullWidth:this.fullWidth,required:this.required,label:this.label,name:this.name,placeholder:this.placeholder,type:"time",clearable:this.clearable,date:this.time,ref:t=>this.picker=t,disabled:this.disabled,"on-bcm-load":()=>this.handlePickerLoad(),"on-bcm-change":t=>this.handlePickerChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType,alignment:this.alignment,placement:this.placement,noMargin:this.noMargin}))}get el(){return s(this)}};(function(t,i,e,s){var a,n=arguments.length,h=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,i,e,s);else for(var p=t.length-1;p>=0;p--)(a=t[p])&&(h=(n<3?a(h):n>3?a(i,e,h):a(i,e))||h);n>3&&h&&Object.defineProperty(i,e,h)})([n()],o.prototype,"el",void 0),o.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:inline-flex;width:100%;max-width:256px}:host(.full-width){max-width:100%}:host(.hidden){display:none}:host(.linked-component){display:none}';export{o as bcm_time_picker}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,c as t,h as i,g as s}from"./p-170cf07d.js";import{G as c,s as d}from"./p-
|
|
5
|
+
import{r as e,c as t,h as i,g as s}from"./p-170cf07d.js";import{G as c,s as d}from"./p-9d7ec4f0.js";import{S as l}from"./p-157359d6.js";import"./p-823a5d13.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-6369b73b.js";const n=class{constructor(i){e(this,i),this.bcmItems=t(this,"bcm-items",7),this._id=c.UID()}connectedCallback(){if(this.el.children&&this.el.children.length>0){let e=this.nestedItems(this.el);this.bcmItems.emit(e),this.el.remove()}}mapItems(e){var t;const i=null===(t=null==e?void 0:e.innerHTML)||void 0===t?void 0:t.replace(/<bcm-item>.*<\/bcm-item>/g,"").replace(/<bcm-item .*>.*<\/bcm-item>/g,"").replace(/<!--(.|\s)*?-->/g,"").trim(),s=t=>l.elementBooleanCheck(e.getAttribute(t));return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({id:e.getAttribute("id")||c.UID(),text:e.getAttribute("text")||i},e.innerHTML.trim()&&{isHtmlContent:e.textContent.length>0?e.innerHTML.trim():null}),s("disabled")&&{disabled:s("disabled")}),s("selected")&&{selected:s("selected")}),s("hidden")&&{hidden:s("hidden")}),s("checked")&&{checked:s("checked")}),s("readonly")&&{readonly:s("readonly")}),s("active")&&{active:s("active")}),s("icon")&&{icon:e.getAttribute("icon")}),s("link")&&{link:e.getAttribute("link")})}nestedItems(e){return d((()=>Array.from(null==e?void 0:e.children).map((e=>{var t;return Object.assign(Object.assign({},"bcm-item"===(null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase())&&this.mapItems(e)),{items:this.nestedItems(e)})}))),[])}render(){return i("slot",null)}get el(){return s(this)}};export{n as bcm_items}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import{r as t,h as n,H as e}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as i}from"./p-9d7ec4f0.js";import"./p-a18f6d11.js";import"./p-157359d6.js";import"./p-9b7af3c4.js";import"./p-7e44e6b5.js";import{a as s}from"./p-6369b73b.js";import{C as p}from"./p-a25c8a55.js";import"./p-64fad38b.js";import"./p-3fac58f7.js";import"./p-2e73d572.js";import{c as a}from"./p-08c75801.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-823a5d13.js";const r=a({slots:{host:"bcm-number-input bcm-ui-element tw-flex tw-flex-col tw-items-start tw-justify-start tw-max-w-[256px] tw-w-full",container:"tw-flex tw-flex-row tw-items-center tw-justify-between tw-rounded tw-border tw-border-solid tw-border-slate-300 tw-w-full tw-min-h-full hover:tw-bg-slate-50",inputContainer:"tw-flex tw-min-h-fit tw-w-full tw-flex-row tw-items-center tw-justify-center tw-gap-2 tw-px-3",input:"tw-outline-none tw-appearance-none tw-flex-1 tw-bg-transparent tw-text-slate-400 tw-text-inherit tw-font-normal",caretContainer:"tw-flex tw-flex-col tw-min-h-full tw-border-l tw-items-stretch tw-self-stretch tw-justify-center tw-border-l-slate-300 tw-select-none tw-w-[30px]",caretIcon:"tw-flex tw-items-center tw-text-slate-500 tw-justify-center tw-h-full tw-cursor-pointer active:tw-bg-slate-400 last:tw-border-t last:tw-border-t-slate-300",slotIcon:"tw-text-slate-500"},variants:{size:{small:{host:"tw-gap-0.5 tw-text-xs",slotIcon:"tw-text-[10px]",inputContainer:"tw-py-[2px]",caretIcon:"tw-text-[10px]"},medium:{host:"tw-gap-1 tw-text-base",slotIcon:"tw-text-xs",inputContainer:"tw-py-[5px]"},large:{host:"tw-gap-2 tw-text-base",slotIcon:"tw-text-[14px]",inputContainer:"tw-py-2"}},focus:{true:{container:"tw-ring-1 tw-ring-blue-600",input:"tw-text-slate-700"}}},defaultVariants:{size:"medium"}}),o=class{constructor(n){t(this,n),this.blockInvalidChar=t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),this._id=i.UID(),this.size=s.Size.medium,this.min=0,this.max=100,this.step=1,this.placeholder=void 0,this.label=void 0,this.tooltip=void 0,this.value=0,this.disabled=!1,this.readonly=!1,this.required=!1,this.pattern=void 0,this.caption=void 0,this.noCaption=!1,this.captionType=s.Status.default,this.captionError=void 0,this.customErrorMessage=void 0,this.prefixIcon=void 0,this.suffixIcon=void 0,this.isFocus=!1,this.isError=!1}render(){const{_id:t,value:i,min:s,max:a,step:o,tooltip:l,disabled:c,size:x,label:m,caption:h,captionType:u,required:w,noCaption:f,captionError:d,customErrorMessage:g,prefixIcon:b,suffixIcon:z,pattern:j}=this,{host:v,input:y,container:C,inputContainer:I,caretContainer:E,caretIcon:k,slotIcon:_}=r({size:x,focus:this.isFocus});return n(e,{class:v(),onClick:()=>!c&&this.nativeInput.focus()},m&&n("bcm-label",{tooltip:l,"no-margin":!0,type:u,value:m,required:w,htmlFor:t}),n("div",{class:C()},n("div",{class:I()},b&&n("span",{class:_()},n("i",{class:b})),n("input",{type:"number",class:y(),min:s,max:a,step:o,value:i,inputmode:"numeric",pattern:j,ref:t=>this.nativeInput=t,onKeyPress:this.blockInvalidChar,onFocus:()=>this.isFocus=!0,onBlur:()=>this.isFocus=!1,onError:t=>console.log(t),onErrorCapture:t=>console.log(t)}),z&&n("span",{class:_()},n("i",{class:z}))),n("div",{class:E()},n("span",{class:k()},n("i",{class:"fas fa-caret-up"})),n("span",{class:k()},n("i",{class:"fas fa-caret-down"})))),n(p,{noCaption:f,captionType:u,captionError:d,caption:h,customErrorMessage:g}))}};o.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");\n.size-1 {\n font-size: 12px;\n line-height: 20px;\n}\n\n.size-2 {\n font-size: 14px;\n line-height: 22px;\n}\n\n.size-3 {\n font-size: 16px;\n line-height: 24px;\n}\n\n.size-4 {\n font-size: 20px;\n line-height: 28px;\n}\n\n.size-5 {\n font-size: 24px;\n line-height: 32px;\n}\n\n.size-6 {\n font-size: 30px;\n line-height: 38px;\n}\n\n.size-7 {\n font-size: 38px;\n line-height: 46px;\n}\n\n.size-8 {\n font-size: 46px;\n line-height: 54px;\n}\n\n.size-9 {\n font-size: 56px;\n line-height: 64px;\n}\n\n.weight-regular {\n font-weight: 400;\n}\n\n.weight-semibold {\n font-weight: 500;\n}\n\n/**\n * Generator\n */\n.input-size-large {\n height: 40px;\n}\n\n.input-size-medium {\n height: 32px;\n}\n\n.input-size-small {\n height: 24px;\n}\n\n.resize-none textarea {\n resize: none;\n}\n\n.resize-vertical textarea {\n resize: vertical;\n}\n\n.resize-auto textarea {\n height: auto;\n resize: none;\n}\n\n.textarea-size-large {\n padding: 4px 0 0 4px;\n min-height: 40px;\n}\n.textarea-size-large .bcm-input-element {\n min-height: calc((40px - 8px) + 2px);\n}\n.textarea-size-large .input-clear-button {\n height: calc( 40px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n.textarea-size-medium {\n padding: 4px 0 0 4px;\n min-height: 32px;\n}\n.textarea-size-medium .bcm-input-element {\n min-height: calc((32px - 8px) + 2px);\n}\n.textarea-size-medium .input-clear-button {\n height: calc( 32px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n.textarea-size-small {\n padding: 0px 0 0 4px;\n min-height: 24px;\n}\n.textarea-size-small .bcm-input-element {\n min-height: calc((24px - 8px) + 2px);\n}\n.textarea-size-small .input-clear-button {\n height: calc( 24px - 16px );\n top: 8px;\n padding: 0;\n margin-right: 8px;\n}\n\n@layer base {\n .bcm-number-input input[type=number]::-webkit-outer-spin-button,\n.bcm-number-input input[type=number]::-webkit-inner-spin-button,\n.bcm-number-input input[type=number] {\n -webkit-appearance: none;\n padding: 0px;\n margin: 0px;\n outline: none;\n border: 0px;\n vertical-align: baseline;\n -moz-appearance: textfield !important;\n }\n}';export{o as bcm_number_input}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as e,H as s}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-
|
|
5
|
+
import{r as t,h as e,H as s}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-9d7ec4f0.js";import"./p-a18f6d11.js";import"./p-157359d6.js";import"./p-9b7af3c4.js";import"./p-7e44e6b5.js";import{a as o}from"./p-6369b73b.js";import{c as i}from"./p-64fad38b.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-823a5d13.js";const p={ctrl:"⌘",alt:"⌥",shift:"⇧",del:"⌫",delete:"⌫",backspace:"⌦",enter:"⏎",return:"⏎"},c=class{constructor(e){t(this,e),this.isMac=/Mac/.test(window.navigator.userAgent),this.hotkey=void 0,this.color="slate",this.size=o.Size.small}getHotkey(t){return t?this.isMac&&(t.includes(" ")||t.includes("+"))?t.split(/[\s+]+/).map((t=>p[t]||t)).join(""):t:""}render(){const{size:t,color:p,hotkey:c}=this;return e(s,{class:i("bcm-ui-element bcm-ui-content-display","tw-block tw-h-fit tw-w-fit tw-rounded tw-border tw-border-solid tw-px-1","tw-border-default-300 tw-bg-default-100 tw-text-default-700","tw-text-center tw-font-medium tw-capitalize",{"tw-text-2":t===o.Size.small,"tw-text-3":t===o.Size.medium,"tw-text-4":t===o.Size.large}),style:Object.assign({},r.getTwColor({color:p}))},this.getHotkey(c))}};export{c as bcm_shortcut}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as e,h as i,H as t,g as p}from"./p-170cf07d.js";import{G as a}from"./p-
|
|
5
|
+
import{r as e,h as i,H as t,g as p}from"./p-170cf07d.js";import{G as a}from"./p-9d7ec4f0.js";import"./p-823a5d13.js";import"./p-6edf985f.js";import"./p-85eedabc.js";const s=class{constructor(i){e(this,i),this._id=a.UID()}render(){return i(t,null,i("bcm-skeleton",null,i("slot",null)))}get el(){return p(this)}};s.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{s as bcm_default}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as p,H as s,g as r}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as o}from"./p-
|
|
5
|
+
import{r as t,h as p,H as s,g as r}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as o}from"./p-9d7ec4f0.js";import"./p-a18f6d11.js";import"./p-157359d6.js";import"./p-9b7af3c4.js";import"./p-7e44e6b5.js";import"./p-6369b73b.js";import{c as e}from"./p-64fad38b.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-823a5d13.js";const i=class{constructor(p){t(this,p),this._id=o.UID(),this.el.slot="footer"}render(){return p(s,{class:e("tw-flex tw-flex-row tw-items-center tw-justify-end tw-gap-2 tw-px-6 tw-pb-6 tw-pt-2")},p("slot",null))}get el(){return r(this)}};export{i as bcm_modal_2_footer}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,h as i,H as e,g as s}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-
|
|
5
|
+
import{r as t,h as i,H as e,g as s}from"./p-170cf07d.js";import"./p-61db1f1f.js";import"./p-626a65e9.js";import{G as r}from"./p-9d7ec4f0.js";import"./p-a18f6d11.js";import"./p-157359d6.js";import"./p-9b7af3c4.js";import"./p-7e44e6b5.js";import"./p-6369b73b.js";import"./p-436364c8.js";import"./p-8c018ae0.js";import"./p-6edf985f.js";import"./p-85eedabc.js";import"./p-823a5d13.js";const o=class{constructor(i){t(this,i),this._id=r.UID(),this.active=!1,this.disabled=!1,this.index=void 0}componentWillLoad(){this.indexControl()}componentDidRender(){this.headerMove()}getHeaderItem(){const t=this.el.querySelector("bcm-tab-item-header");return t&&(t.setAttribute("index",`${this.index}`),t.setAttribute("active",`${this.active}`),t.setAttribute("disabled",`${this.disabled}`),t.setAttribute("tab-id",`${this._id}`),t.style.order=`${this.index}`),t}getParentTabGroup(){return r.findParentElement(this.el,"bcm-tab-group")}getFindHeaderItem(){var t,i;return null===(i=null===(t=this.getParentTabGroup())||void 0===t?void 0:t.querySelector("#tab-header"))||void 0===i?void 0:i.querySelector(`bcm-tab-item-header[tab-id="${this._id}"]`)}headerMove(){var t,i,e,s;this.getHeaderItem()&&(null===(t=this.getFindHeaderItem())||void 0===t||t.remove(),null===(e=null===(i=this.getParentTabGroup())||void 0===i?void 0:i.querySelector("#tab-header"))||void 0===e||e.appendChild(this.getHeaderItem()),null===(s=this.el.parentElement)||void 0===s||s.refresh())}indexControl(){var t;this.index||null===(t=r.findParentElement(this.el,"bcm-tab-group"))||void 0===t||t.querySelectorAll("bcm-tab-item").forEach(((t,i)=>{t===this.el&&t.setAttribute("index",`${i+1}`)}))}componentDidLoad(){new MutationObserver((()=>{this.headerMove()})).observe(this.el,{childList:!0,subtree:!0})}render(){return i(e,{id:this._id,role:"tabpanel","aria-labelledby":`tab-${this._id}`,"aria-hidden":`${!this.active}`,class:{"tw-block":this.active,"tw-hidden":!this.active,"tw-opacity-50":this.disabled,"tw-w-full":!0}},i("slot",null))}get el(){return s(this)}};export{o as bcm_tab_item}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as s,h as i,H as e,g as o}from"./p-170cf07d.js";import{c as w}from"./p-64fad38b.js";import{G as a}from"./p-
|
|
5
|
+
import{r as t,c as s,h as i,H as e,g as o}from"./p-170cf07d.js";import{c as w}from"./p-64fad38b.js";import{G as a}from"./p-9d7ec4f0.js";import{S as r}from"./p-157359d6.js";import{B as h}from"./p-6369b73b.js";import{d as n}from"./p-8c018ae0.js";import"./p-85eedabc.js";import"./p-823a5d13.js";import"./p-6edf985f.js";const c=class{constructor(i){t(this,i),this.bcmToastClose=s(this,"bcm-toast-close",7),this.bcmToastOpen=s(this,"bcm-toast-open",7),this.bcmToastView=s(this,"bcm-toast-view",7),this._id=a.UID(),this.status=void 0,this.message="",this.description="",this.duration=3e3,this.position=h.Placement.bottom,this.messageIcon=void 0,this.viewButton=!1,this.closeButton=!0,this.removeAfterClose=!0,this.visible=!1,this.visibleContainer=!1}async show(){const t=document.getElementById(this._id+"-container");return t&&this.createContainer(this.position).appendChild(t),this.visible=!0,await n(50),this.visibleContainer=!0,this.bcmToastOpen.emit(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>this.hide()),this.duration),this.el}async hide(){this.visibleContainer=!1,clearTimeout(this.timer),this.bcmToastClose.emit(),await n(100),this.visible=!1,this.removeAfterClose&&(await n(100),this.el.remove())}handleMouseEnter(){clearTimeout(this.timer)}handleMouseLeave(){this.visible&&(this.timer=setTimeout((()=>this.hide()),1e3))}createContainer(t){const s="bcm-toast-container-"+t;let i=document.getElementById(s);if(!i){i=document.createElement("div"),i.id=s;const t=w("tw-pointer-events-none tw-overflow-hidden tw-z-50","tw-fixed tw-flex","tw-p-4 tw-gap-4",{"tw-flex-col-reverse tw-inset-x-0 tw-top-4 tw-mx-auto":this.position===h.Placement.top,"tw-flex-col tw-inset-x-0 tw-bottom-4 tw-mx-auto":this.position===h.Placement.bottom,"tw-flex-col-reverse tw-top-4 tw-left-4":this.position===h.Placement["top-start"],"tw-flex-col-reverse tw-top-4 tw-right-4":this.position===h.Placement["top-end"],"tw-flex-col tw-bottom-4 tw-left-4":this.position===h.Placement["bottom-start"],"tw-flex-col tw-bottom-4 tw-right-4":this.position===h.Placement["bottom-end"]});i.classList.add(...t.split(" ")),document.body.appendChild(i)}return i}render(){return i(e,{class:"tw-hidden"},i("div",{class:w({"tw-hidden":!this.visible}),id:this._id+"-container",onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},i("div",{class:w("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out","tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2","tw-border-gray-300 tw-bg-white tw-text-slate-600",{"tw-p-4":!this.description,"tw-p-6":this.description},"tw-transform tw-transition tw-duration-300 tw-ease-in-out ",{"tw-translate-y-0 tw-opacity-100 ":this.visibleContainer,"tw-opacity-0":!this.visibleContainer,"tw-translate-y-[-100%]":!this.visibleContainer&&"top"===this.position.split("-")[0],"tw-translate-y-[100%]":!this.visibleContainer&&"bottom"===this.position.split("-")[0]})},i("div",{class:"tw-flex tw-items-center tw-justify-between tw-gap-5"},i("div",{class:"tw-flex tw-items-center tw-gap-3 "},this.status&&i("i",{class:w("tw-text-6",this.messageIcon?this.messageIcon:"far",{"tw-text-emerald-500":"success"===this.status,"tw-text-red-500":"error"===this.status,"tw-text-amber-500":"warning"===this.status,"tw-text-blue-500":"info"===this.status},{"fa-check-circle":!this.messageIcon&&"success"===this.status,"fa-exclamation-circle":!this.messageIcon&&"error"===this.status,"fa-exclamation-triangle":!this.messageIcon&&"warning"===this.status,"fa-info-circle":!this.messageIcon&&"info"===this.status})}),i("span",{class:w({"tw-text-4":!this.description,"tw-text-6 tw-font-medium":this.description})},!this.description&&this.status&&i("span",null,r.capitalize(this.status),": "),this.message)),i("div",{class:"tw-flex tw-items-baseline tw-gap-2"},this.viewButton&&i("button",{onClick:()=>this.bcmToastView.emit(),title:"View details",class:w("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit","hover:tw-bg-gray-100 hover:tw-text-slate-800","active:tw-bg-gray-200","tw-transition tw-duration-300 tw-ease-in-out",{"tw-font-medium":this.description})},"View"),this.closeButton&&i("button",{title:"Close",onClick:()=>this.hide(),class:w("tw-rounded tw-bg-transparent tw-p-0","tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit","hover:tw-bg-gray-100 hover:tw-text-slate-800","active:tw-bg-gray-200")},i("i",{class:"fal fa-times"})))),this.description&&i("div",{class:"tw-text-3 "},this.description),i("slot",null))))}get el(){return o(this)}};export{c as bcm_toast}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-170cf07d.js";import{D as h,E as r}from"./p-7e44e6b5.js";import{c as o}from"./p-64fad38b.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-8c018ae0.js";import{G as d}from"./p-43a281a4.js";import{B as m}from"./p-6369b73b.js";import{g as p,s as u}from"./p-125d6ed0.js";import{L as b}from"./p-8b202d9e.js";import{I as g}from"./p-9850cbce.js";import"./p-85eedabc.js";import"./p-1064895e.js";import"./p-6edf985f.js";import"./p-157359d6.js";var f,x,y;!function(t){t.january="january",t.february="february",t.march="march",t.april="april",t.may="may",t.june="june",t.july="july",t.august="august",t.september="september",t.october="october",t.november="november",t.december="december"}(f||(f={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(x||(x={})),function(t){t.datetime="datetime",t.range="range",t.date="date",t.time="time"}(y||(y={}));const v=JSON.stringify,w=class{constructor(i){t(this,i),this.load=e(this,"bcm-load",7),this.change=e(this,"bcm-change",7),this.bcmOpen=e(this,"bcm-open",7),this.inputId=null,this.emptyState=!1,this.initialized=!1,this.disabledDatesList={min:null,max:null,dates:[]},this.dayNumbers=[],this.valueText=null,this.dataIsValid=!1,this._id=d.UID(),this.date=new Date,this.endDate=null,this.type=y.datetime,this.disabled=!1,this.disabledDates="",this.value=null,this._open=!1,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.minYear=1900,this.maxYear=2200,this.noCaption=!1,this.noMargin=!1,this.captionError=void 0,this.caption="",this.captionType="default",this.alignment=void 0,this.placement=m.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1,this.years=[],this.hours=[],this.minutes=[],this.hasDateModule=!1,this.hasTimeModule=!1,this.renderDate=void 0,this.selectedDate=void 0,this.selectedEndDate=void 0,this.error=!1,this.errorText="",this.tick={}}markForCheck(){this.tick=d.UID()}openChanged(){this.bcmOpen.emit(this._open)}componentWillLoad(){if(this.inputId="picker-input-"+this._id,this.hasDateModule=this.type===y.datetime||this.type===y.date||this.type===y.range,this.hasTimeModule=this.type===y.datetime||this.type===y.time,this.prepareDisabledDates(),this.setData(),!this.initialized){for(let t=this.minYear;t<=this.maxYear;t++)this.years.push(t);for(let t=0;t<=23;t++)this.hours.push(t);for(let t=0;t<=59;t++)this.minutes.push(t);this.load.emit()}this.initialized=!0}componentDidRender(){this.hasDateModule&&!this.yearsDragger&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,h.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&!this.hoursDragger&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,h.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour)),this.hasTimeModule&&!this.minutesDragger&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,h.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute))}renderDateChange(){this.initialized&&(this.setData(),this.hasDateModule&&this.setDragSelection("years",this.currentDate.year))}openChange(t){t&&(this.calculateLocation(),this.hasDateModule&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,h.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,h.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour,!0)),this.hasTimeModule&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,h.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute,!0)),this.markForCheck(),i(this.el))}valueChange(t,e){const i={isValid:!1,value:this.valueText};if(t)if(this.type!==y.range&&this.error)this.change.emit({isValid:!1,value:this.inputElement.value});else try{if((e&&v(t.dateObject)!==v(e.dateObject)||!e&&t)&&(this.type!==y.date&&this.type!==y.datetime||this.change.emit(t),this.type===y.time&&this.change.emit(t),this.type===y.range)){const e=t.dateObject;e.start.date&&e.end.date?t.isValid&&this.change.emit({isValid:t.isValid,value:t.value,start:e.start,end:e.end}):this.change.emit(i)}}catch(t){}else this.change.emit()}disabledDatesChange(t){t&&this.prepareDisabledDates()}stringToDate(t){return t.getMonth?t:new Date(Date.parse(this.switchDDMM(t)))}dateToString(t){if(!(t instanceof Date))return!1}switchDDMM(t){if(!t)return;const e=t.split("/");return-1===t.indexOf("/")||3!==e.length?t:`${e[1]}/${e[0]}/${e[2]}`}setData(){this.date=this.stringToDate(this.date),this.initialized||this.renderDate||(this.renderDate=this.date&&this.date||new Date),!this.initialized&&this.endDate&&(this.selectedEndDate=this.stringToDate(this.endDate));const t=this.renderDate;if(this.currentDate=this.createDateObject(t),this.dayNumbers=this.getMonthDayNumbers(t).map((e=>({day:e,thisMonth:!0,isWeekend:this.getDayIsWeekend(t,e),today:this.getIsCurrentDate(t,e),date:this.getTargetDayDate(t,e)}))),this.currentDate.year>this.minYear){let e=new Date(new Date(t).setMonth(this.currentDate.month-1,1)),i=this.getMonthDayNumbers(e).reverse(),s=this.currentDate.monthFirstDay;for(let t=1;t<(0===s?7:s);t++){const s=i[t-1];this.dayNumbers.unshift({day:s,prevMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}if(this.currentDate.year<this.maxYear){let e=new Date(new Date(t).setMonth(this.currentDate.month+1)),i=this.getMonthDayNumbers(e),s=42-this.dayNumbers.length;for(let t=0;t<s;t++){const s=i[t];this.dayNumbers.push({day:s,nextMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}this.emptyState||(this.valueText=this.getValueText()),i(this.el)}prepareDisabledDates(){if(!this.disabledDates)return;let t=null;if("string"==typeof this.disabledDates)try{t=JSON.parse(this.disabledDates)}catch(t){return}else t=this.disabledDates;if(t.dates&&t.dates.length&&t.dates.length){const e=t.dates.map((t=>{const e=new Date(t);return"invalid date"===e.toString().toLowerCase()?null:e})).filter((t=>t));this.disabledDatesList.dates=e}if(t.min&&t.max&&(t.min.getTime()>t.max.getTime()||t.max.getTime()<t.min.getTime()))return;t.min&&t.min instanceof Date?this.disabledDatesList.min=new Date(t.min.toDateString()):delete this.disabledDatesList.min,t.max&&t.max instanceof Date?this.disabledDatesList.max=new Date(t.max.toDateString()):delete this.disabledDatesList.max;const e=this.inputElement&&this.inputElement.value;e&&this.setDataFromText(e)}createWheelChange(t,e,i){e.addEventListener("wheel",(e=>{const s=e.deltaY>0,a=this[t+"Dragger"].getOffset().top,n=this.getTargetChildByDragPosition({y:a},i);let h=s?n+1:n-1;h<0?h=0:void 0===this[t][h]&&(h=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][h],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new r({target:e,trigger:i,direction:a,useTransform:!0,limit:{y:{max:s.offsetTop-s.offsetHeight/2,min:-1*(e.offsetHeight-(s.offsetTop+s.offsetHeight/2))}}}),this[n].on("end",(e=>{const i=this.getTargetChildByDragPosition(e,s);this.selectTargetChildByDragIdx(i,s,this[n]),this.setDragSelection(t,this[t][i],!1)}))}getTargetChildByDragPosition({y:t},e){const i=e.offsetHeight,s=i/2;return Math.floor(-(t-(e.offsetTop-s)-s)/i)}selectTargetChildByDragIdx(t,e,i,s=!0){i.setPosition({y:e.offsetHeight/2+e.offsetTop-(t+1)*e.offsetHeight,anim:s})}setDragSelection(t,e,i=!0,s=!1){const a=this[t].findIndex((t=>t===e));switch(i&&this.selectTargetChildByDragIdx(a,this["years"===t?t+"StripElement":"timeStripElement"],this[t+"Dragger"],s),t){case"years":this.date.setFullYear(e);break;case"hours":this.date.setHours(e);break;case"minutes":this.date.setMinutes(e)}this.renderDate=this.date,this.setData(),this.selectedDate&&this.setValue()}getHours12(){const t=(this.date.getHours()+24)%12||12;return t>12?t-12:t}createDateObject(t,{excludeTime:e=!1,exactMonthNumber:i=!1}={}){const s=t.getFullYear();return Object.assign(Object.assign({year:s>=this.maxYear?this.maxYear:s<=this.minYear?this.minYear:s,day:t.getDate(),month:t.getMonth()+(i?1:0),dayOfWeek:t.getDay(),monthFirstDay:new Date(new Date(t).setDate(1)).getDay()},!e&&{hour:t.getHours()}),!e&&{minute:t.getMinutes()})}generateDaysArrayFromMax(t){return Array.from(Array(t+1).keys()).slice(1)}getMonthDayNumbers(t){const e=this.getDaysInMonth(t.getMonth(),t.getFullYear());return this.generateDaysArrayFromMax(e)}getTargetDayDate(t,e){return new Date(new Date(t).setDate(e))}getDayIsWeekend(t,e){const i=new Date(new Date(t).setDate(e)).getDay();return 6===i||0===i}getClock(t){return{hours:(t=t||new Date).getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milis:t.getMilliseconds()}}setValue(t){var e,i,s;const a=new Date(this.date.setHours(Number(this.currentDate.hour),Number(this.currentDate.minute)));if(t)this.value=null;else{if(this.dataIsValid=!0,this.type===y.datetime){const t=Object.assign({},this.currentDate);t.month+=1,(null===(e=this.value)||void 0===e?void 0:e.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.date){const t=Object.assign({},this.currentDate);delete t.hour,delete t.minute,t.month+=1,(null===(i=this.value)||void 0===i?void 0:i.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.time){const t=this.getTimeText(),e=Object.assign({},this.currentDate);e.month+=1,this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),time:t,dateObject:e,timeObject:{hours:this.currentDate.hour,minutes:this.currentDate.minute},value:t},this.inputElement.value=t}this.type===y.range&&(null===(s=this.value)||void 0===s?void 0:s.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,dateObject:{start:Object.assign({},this.selectedDate&&{date:this.selectedDate,timestamp:this.selectedDate.getTime(),detail:this.createDateObject(this.selectedDate,{excludeTime:!0,exactMonthNumber:!0})}),end:Object.assign({},this.selectedEndDate&&{date:this.selectedEndDate,timestamp:this.selectedEndDate.getTime(),detail:this.createDateObject(this.selectedEndDate,{excludeTime:!0,exactMonthNumber:!0})})},value:this.valueText})}}setMonth(t){this.renderDate.setDate(1),this.renderDate=new Date(this.renderDate.setMonth(t)),this.setDragSelection("years",this.currentDate.year)}checkRangeValidation({popupClosing:t=!1}={}){return this.type!==y.range||(t&&(!this.selectedDate||this.selectedDate&&!this.selectedEndDate)?(this.setError(!0,"date range invalid"),!1):(t||this.setError(!1),!0))}pad(t,e){return t<e?"0":""}isInputClearable(){return!(!this.inputElement||!this.inputElement.value)}isDisabledDate(t){if(this.disabledDatesList.dates.map((e=>this.isSameDate(e,t))).filter((t=>t)).length)return!0;if(this.disabledDatesList.min){const e=new Date(this.disabledDatesList.min);if(e&&e.getTime()>t.getTime())return!0}if(this.disabledDatesList.max){const e=new Date(this.disabledDatesList.max);if(e&&new Date(e.setDate(e.getDate()+1)).getTime()<t.getTime())return!0}}setDate(t,e,i=!1){const s=this.type===y.range,a=!!this.selectedEndDate;if((this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(t))&&(this.emptyState=!1,(!s||s&&!a)&&(this.date=new Date(t.setHours(this.currentDate.hour,this.currentDate.minute))),s&&this.checkRangeValidation(),s&&this.selectedDate&&this.selectedEndDate&&(this.selectedDate=null,this.selectedEndDate=null),e)){const e=new Date(t);s&&this.selectedDate?this.selectedDate.getTime()>e.getTime()?(this.selectedEndDate=this.selectedDate)&&(this.selectedDate=e):this.selectedEndDate=e:this.selectedDate=e,!s&&(this._open=i),this.renderDate=this.date,this.valueText=this.getValueText(),this.setValue();const a=this.valueText.split("/"),n=this.valueText?this.changeFormat(new Date(a[1]+"/"+a[0]+"/"+a[2])):"";this.inputElement.value=n}}setDataFromText(t,e=!1,i=!0){let s=!1,a="";const n=this.parse(t);if(this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(n.date)||(n.dateIsValid=!1,a="disabled-date"),this.type===y.datetime&&n.dateIsValid&&n.timeIsValid&&(e&&this.setDate(n.date,!0,i),e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.date&&n.dateIsValid&&(e&&this.setDate(n.date,!0,i),s=!0),this.type===y.time&&n.timeIsValid&&(e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.range&&(n.dateIsValid&&!this.selectedDate&&(e&&this.setDate(n.date,!0,i),s=!0),n.date2IsValid&&!this.selectedEndDate&&(e&&this.setDate(n.date2,!0,i),s=!0),this.selectedDate&&this.selectedEndDate&&n.rangeIsValid&&(this.isSameDate(n.date2,this.selectedEndDate)&&!this.isSameDate(n.date,this.selectedDate)&&(this.selectedDate=null,e&&this.setDate(n.date,!0,i),s=!0),this.isSameDate(n.date,this.selectedDate)&&!this.isSameDate(n.date2,this.selectedEndDate)&&(this.selectedEndDate=null,e&&this.setDate(n.date2,!0,i),s=!0)),this.selectedDate&&this.selectedEndDate&&!n.rangeIsValid&&e&&(this.selectedDate=null,this.selectedEndDate=null)),s)e&&(this.renderDate=this.date),this.setError(!1);else{this.type===y.range&&this.selectedDate&&this.selectedEndDate&&n.rangeIsValid?this.setError(!1):a?this.setError(!0,"disabled-date"===a&&"selected date is not allowed"):(t&&this.setError(!0,(this.type===y.datetime?"invalid date or time":this.type===y.range&&"invalid date range")||this.type===y.date&&"The selected date is not allowed."||this.type===y.time&&"invalid time"),this.setValue(!0));const e=t.split("/"),i=t&&!this.error?this.changeFormat(new Date(e[1]+"/"+e[0]+"/"+e[2])):"";this.inputElement.value=i}}setDateToday(){const t=new Date;this.type===y.range&&(this.selectedDate=null,this.selectedEndDate=null),this.setDate(t,!0,!1)}HourContentDblClick(t){const e=d.findEventPathWithNodeName(t,"SPAN");e&&e.classList.contains("selected")&&(this.setValue(),this._open=!1)}setTime(t,e){this.renderDate=new Date(this.date.setHours(Number(t||this.getClock().hours),Number(e||this.getClock().minutes))),this.type===y.time&&(this.selectedDate=this.date);const i=this.currentDate.hour||(new Date).getHours(),s=this.currentDate.minute||(new Date).getMinutes();this.setDragSelection("hours",i,!0,!0),this.setDragSelection("minutes",s,!0,!0)}setError(t=!1,e=""){this.error=t,this.errorText=t?e:""}getError(){const{error:t,errorText:e}=this;return{valid:!t,error:t,errorText:e}}getDaysInMonth(t,e){return new Date(e,t+1,0).getDate()}getIsCurrentDate(t,e){const i=new Date;return i.getDate()===e&&i.getMonth()===t.getMonth()&&i.getFullYear()===t.getFullYear()}isSameDate(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}getSelected(t,e=!1){const i=new Date(this["selected"+(e?"EndDate":"Date")]),s=i.getFullYear(),a=i.getMonth(),n=i.getDate();return t.getDate()===n&&t.getMonth()===a&&t.getFullYear()===s}getDateIsInRange(t){if(this.type!==y.range||!this.selectedDate||!this.selectedEndDate)return;const e=t.getTime(),i=this.selectedDate.getTime(),s=this.selectedEndDate.getTime();return e>i&&e<s}getMonthText(){return Object.values(f)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(x)[this.currentDate.dayOfWeek],e=Object.values(f)[this.currentDate.month];return`${t}, ${this.currentDate.day}th ${e} ${this.currentDate.year}`}getTimeText(){const{hour:t,minute:e}=this.currentDate;return`${t<10?"0"+t:t}:${e<10?"0"+e:e}`}getValueText(){if(!this.selectedDate)return"";const t=this.selectedDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;let a="";if(this.type!==y.date&&this.type!==y.datetime||(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.time&&(a=this.getTimeText()),this.type===y.datetime&&(a=`${a} ${this.getTimeText()}`),this.type===y.range&&(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.range&&this.selectedEndDate){const t=this.selectedEndDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;a+=`-${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`}return this.setDataFromText(a),a}parseDate(t){var e=t.split("/"),i=parseInt(e[0],10),s=parseInt(e[1],10)-1,a=parseInt(e[2],10);if(isNaN(i)||isNaN(s)||isNaN(a))return"invalid date";var n=new Date(a,s,i);return n.getDate()!==i||n.getMonth()!==s||n.getFullYear()!==a?"invalid date":n}parse(t){const e=t.split(this.type===y.range?"-":" "),i=this.switchDDMM(e[0]),s=this.switchDDMM(e[1]),a=this.type===y.datetime?e[1]:e[0],n=new Date(i),h=new Date(s),r="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==h.toString().toLowerCase(),c=/^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/,l=c.test(i),d=c.test(s),m=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),p=r&&l,u=o&&d;return{date:n,date2:h,timeSections:m?a.split(":"):"",dateIsValid:p,date2IsValid:u,rangeIsValid:p&&u,timeIsValid:m}}getPrevMonth(){this.setMonth(this.renderDate.getMonth()-1)}getNextMonth(){this.setMonth(this.renderDate.getMonth()+1)}yearClick(t){this.yearsDragger.busy||this.setDragSelection("years",this.years[t],!0,!0)}hourClick(t){this.hoursDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("hours",this.hours[t],!0,!0))}minuteClick(t){this.minutesDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("minutes",this.minutes[t],!0,!0))}openPicker(){this.disabled||!this._open&&(this._open=!0)}handleDayNumber(t){this.type===y.range&&this.selectedDate&&!this.selectedEndDate&&this.isSameDate(this.selectedDate,t)||this.setDate(t,!0)}handleInputInput(t){this.setDataFromText(t,!0)}handleInputChange(t){this.setDataFromText(this.inputElement.value,!0,!1),t.stopPropagation()}async handleInputClear(){return this.selectedDate=null,this.selectedEndDate=null,this.emptyState=!0,this.renderDate=new Date,this._open=!1,this.setValue(!0),this.setError(),this.getValueText(),await this.inputElement.setClear(),await l(10),Promise.resolve()}handleWheel(t){t.preventDefault()}handleWindowClick(t){if(this._open){const e=document.getElementById(`picker-vp-${this._id}`),i=d.findEventPath(t,this.el),s=!!e&&d.findEventPath(t,e);i||s||(this._open=!1)}}openToggle(){this.disabled||(this._open=!this._open)}async open(){await l(50),this.openToggle()}async close(){this._open=!1}async getValue(){return this.value}async setDisabled(t){this.disabled=t}changeFormat(t,e=!1){if(!t)return;const i=t=>t<10?`0${t}`:t,s=i(new Date(t).getDate()),a=i(new Date(t).getMonth()+1),n=new Date(t).getFullYear(),h=i(new Date(t).getHours()),r=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${h}:${r}`:`${s}/${a}/${n} ${h}:${r}`}isTime(t){return/^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(t)}getHHMM(t){if(!t)return;const e=t=>t<10?`0${t}`:t;return`${e(new Date(t).getHours())}:${e(new Date(t).getMinutes())}`}async set(t){if(t)if("number"==typeof t&&(t=new Date(t)),"time"==this.type){let e=t;this.isTime(t)||(e=this.getHHMM(t)),this.setDataFromText(e,!0,!1)}else{const i=t.toString().split("-"),s=Date.parse(i[0]);if(i[0]&&!isNaN(s)){var e=this.changeFormat(c.convertTimeStampToDate(new Date(i[0]).getTime()));i[1]&&!isNaN(Date.parse(i[1]))&&(e=e+"-"+this.changeFormat(c.convertTimeStampToDate(new Date(i[1]).getTime()))),this.setDataFromText(e,!0,!1)}else this.setDataFromText("",!0,!1)}else this.setClear()}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setClear(){return await this.handleInputClear(),Promise.resolve()}async getInput(){return this.inputElement}async isValid(){return this.getError()}async resetCaption(){return await l(10),await this.inputElement.resetCaption(),this.captionType="default",this.captionError=null,await l(10),Promise.resolve()}addZeroBefore(t){return(t<10?"0":"")+t}formatDate(t,e){const i={mm:this.addZeroBefore(t.getMonth()+1),dd:this.addZeroBefore(t.getDate()),yyyy:this.addZeroBefore(t.getFullYear()),hh:this.addZeroBefore(t.getHours()),mi:this.addZeroBefore(t.getMinutes())};return e.replace(/mm|dd|yyyy|hh|mi/gi,(t=>i[t]))}handleResize(){this.calculateLocation()}handleWheels(t){if(this._open){const e=document.querySelector(`#picker-vp-${this._id}`);e&&d.findEventPath(t,e)?this.calculateLocation():this._open=!1}}componentDidLoad(){const t=this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);t&&(document.body.appendChild(t),this.calculateLocation())}disconnectedCallback(){this.el.innerHTML="";const t=document.getElementById(`picker-vp-${this._id}`);t&&t.remove()}async calculateLocation(){const t=document.getElementById(`picker-vp-${this._id}`),e=this.placement.split("-");this.alignment&&(this.placement=e[0]+("right"==this.alignment?"-end":"-start"));var i=this.placement;const s=document.getElementById(this.linkedComponent?this.linkedComponent:this._id);if(s){const e=this.linkedComponent?s:s.shadowRoot.querySelector(`#picker-input-${this._id}`)||s.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);if(t&&e){p(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(p(t,e,i,(t=>i=t)),await l(10),s=u(i,e),t.style.top=this.linkedComponent?("top"==i.split("-")[0]?s[0]-t.offsetHeight:s[0])+"px":("top"==i.split("-")[0]?s[0]-t.offsetHeight+n:s[0]-a)+"px",i.split("-")[1]){case"start":t.style.left=s[1]+"px";break;case"center":t.style.left=s[1]-t.offsetWidth/2+"px";break;case"end":t.style.left=s[1]-t.offsetWidth+"px"}t.classList.toggle("bcm-list--top","top"==i.split("-")[0])}}}handleKeyDown(t){(t.keyCode||t.which)===m.KeyCode.escape&&this._open&&(this._open=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.markForCheck())}render(){const t=o("day-numbers"),e=o("datetime-picker","datetime-picker-wrapper",{open:this._open,"no-caption":this.noCaption}),i=o(this.hidden?"hidden":null,{"full-width":this.fullWidth,"linked-component":this.linkedComponent,"no-margin":this.noMargin}),n=o("toggle",{disabled:this.disabled}),h="time"==this.type?'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>':'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>';return s(a,{class:i,"bcm-internal-id":this.inputId},this.label&&s("div",{class:"picker-label",onClick:()=>this.openToggle()},s(b,{size:"medium",type:this.captionType,value:this.label,required:this.required,htmlFor:this._id})),s("bcm-old-input",{ref:t=>this.inputElement=t,placeholder:this.placeholder||"Select "+(this.type===y.datetime?"date and time":"")+(this.type===y.date?"date":"")+(this.type===y.time?"time":"")+(this.type===y.range?"date range":""),value:this.valueText,required:this.required,fullWidth:this.fullWidth,disabled:this.disabled,name:this.name,id:this.inputId,clearable:this.clearable,onClick:()=>this.openPicker(),"no-margin":!0,disableWatchValue:!0,"on-bcm-clear":()=>this.handleInputClear(),"on-bcm-change":t=>this.handleInputChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType},this.error&&s("span",{slot:"suffix"},s("span",{id:"error-icon",class:n,innerHTML:'<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>',title:this.errorText})),s("span",{slot:"suffix",onClick:()=>this.openPicker()},s("span",{id:"calender-icon",class:n,innerHTML:h}))),s("div",{id:"picker-vp-"+this._id,class:e,onWheel:t=>this.handleWheel(t)},s("div",{class:"modules"},this.hasDateModule&&s("div",{class:"date-container"},s("div",{class:"bcm-datetime-picker__header"},s("span",null),s("div",{class:"month-year"},s("button",{onClick:()=>this.getPrevMonth()},s("bcm-icon",{icon:"far fa-chevron-left"})),s("div",{class:"month-year-wrapper"},s("span",{class:"month"},this.getMonthText()),",",s("span",{class:"year"},this.date.getFullYear())),s("button",{onClick:()=>this.getNextMonth()},s("bcm-icon",{icon:"far fa-chevron-right"}))),s("span",{class:"today",onClick:()=>this.setDateToday()},"Today")),s("div",{class:"bcm-datetime-picker__content"},s("div",{class:"years",ref:t=>this.yearsWrapperElement=t},s("div",{class:"items",ref:t=>this.yearsElement=t},this.years.map(((t,e)=>s("span",{onClick:()=>this.yearClick(e)},t)))),s("div",{class:"select-strip",ref:t=>this.yearsStripElement=t})),s("div",{class:"days"},s("div",{class:"day-labels"},s("span",null,"Mo"),s("span",null,"Tu"),s("span",null,"We"),s("span",null,"Th"),s("span",null,"Fr"),s("span",null,"Sa"),s("span",null,"Su")),s("div",{class:t},this.dayNumbers.map((t=>s("span",{class:{"is-disabled-date":(this.type===y.date||this.type===y.datetime)&&this.isDisabledDate(t.date),"not-this-month":!t.thisMonth,"is-weekend":t.isWeekend,today:t.today,selected:this.getSelected(t.date),"selected-start":this.getSelected(t.date)&&this.selectedEndDate&&this.type===y.range,"selected-end":this.getSelected(t.date,!0)&&this.type===y.range,range:this.getDateIsInRange(t.date)&&this.type===y.range},onClick:()=>this.handleDayNumber(t.date)},s("span",{class:"number"},t.day)))))))),this.hasTimeModule&&s("div",{class:"time-container"},s("div",{class:"bcm-datetime-picker__header"},s("div",{class:"month-year"},s("span",{class:"month"},this.getTimeText())),s("span",{class:"now",onClick:()=>{this.setTime(),"time"==this.type&&(this._open=!1)}},"Now")),s("div",{class:"bcm-datetime-picker__content",onDblClick:t=>{this.HourContentDblClick(t)}},s("div",{class:"hours",ref:t=>this.hoursWrapperElement=t},s("div",{class:"items",ref:t=>this.hoursElement=t},this.hours.map(((t,e)=>s("span",{class:this.currentDate.hour===t?"selected":"",onClick:()=>this.hourClick(e)},(t<10&&"0")+t))))),s("div",{class:"minutes",ref:t=>this.minutesWrapperElement=t},s("div",{class:"items",ref:t=>this.minutesElement=t},this.minutes.map(((t,e)=>s("span",{class:this.currentDate.minute===t?"selected":"",onClick:()=>this.minuteClick(e)},(t<10&&"0")+t))))),s("div",{class:"select-strip",ref:t=>this.timeStripElement=t}))))))}get el(){return n(this)}static get watchers(){return{_open:["openChanged","openChange"],renderDate:["renderDateChange"],value:["valueChange"],disabledDates:["disabledDatesChange"]}}};(function(t,e,i,s){var a,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(h=(n<3?a(h):n>3?a(e,i,h):a(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)})([g()],w.prototype,"el",void 0),w.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:"";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}';export{w as bcm_datetime_picker}
|
|
5
|
+
import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-170cf07d.js";import{D as h,E as r}from"./p-7e44e6b5.js";import{c as o}from"./p-64fad38b.js";import{D as c}from"./p-626a65e9.js";import{d as l}from"./p-8c018ae0.js";import{G as d}from"./p-9d7ec4f0.js";import{B as m}from"./p-6369b73b.js";import{g as p,s as u}from"./p-125d6ed0.js";import{L as b}from"./p-000670b6.js";import{I as g}from"./p-9850cbce.js";import"./p-85eedabc.js";import"./p-823a5d13.js";import"./p-6edf985f.js";import"./p-157359d6.js";var f,x,y;!function(t){t.january="january",t.february="february",t.march="march",t.april="april",t.may="may",t.june="june",t.july="july",t.august="august",t.september="september",t.october="october",t.november="november",t.december="december"}(f||(f={})),function(t){t.sunday="sunday",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday"}(x||(x={})),function(t){t.datetime="datetime",t.range="range",t.date="date",t.time="time"}(y||(y={}));const v=JSON.stringify,w=class{constructor(i){t(this,i),this.load=e(this,"bcm-load",7),this.change=e(this,"bcm-change",7),this.bcmOpen=e(this,"bcm-open",7),this.inputId=null,this.emptyState=!1,this.initialized=!1,this.disabledDatesList={min:null,max:null,dates:[]},this.dayNumbers=[],this.valueText=null,this.dataIsValid=!1,this._id=d.UID(),this.date=new Date,this.endDate=null,this.type=y.datetime,this.disabled=!1,this.disabledDates="",this.value=null,this._open=!1,this.hidden=!1,this.name=void 0,this.fullWidth=!1,this.required=!1,this.label=void 0,this.placeholder=void 0,this.minYear=1900,this.maxYear=2200,this.noCaption=!1,this.noMargin=!1,this.captionError=void 0,this.caption="",this.captionType="default",this.alignment=void 0,this.placement=m.Placement["bottom-start"],this.linkedComponent=void 0,this.clearable=!1,this.years=[],this.hours=[],this.minutes=[],this.hasDateModule=!1,this.hasTimeModule=!1,this.renderDate=void 0,this.selectedDate=void 0,this.selectedEndDate=void 0,this.error=!1,this.errorText="",this.tick={}}markForCheck(){this.tick=d.UID()}openChanged(){this.bcmOpen.emit(this._open)}componentWillLoad(){if(this.inputId="picker-input-"+this._id,this.hasDateModule=this.type===y.datetime||this.type===y.date||this.type===y.range,this.hasTimeModule=this.type===y.datetime||this.type===y.time,this.prepareDisabledDates(),this.setData(),!this.initialized){for(let t=this.minYear;t<=this.maxYear;t++)this.years.push(t);for(let t=0;t<=23;t++)this.hours.push(t);for(let t=0;t<=59;t++)this.minutes.push(t);this.load.emit()}this.initialized=!0}componentDidRender(){this.hasDateModule&&!this.yearsDragger&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,h.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&!this.hoursDragger&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,h.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour)),this.hasTimeModule&&!this.minutesDragger&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,h.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute))}renderDateChange(){this.initialized&&(this.setData(),this.hasDateModule&&this.setDragSelection("years",this.currentDate.year))}openChange(t){t&&(this.calculateLocation(),this.hasDateModule&&(this.createDragSelection("years",this.yearsElement,this.yearsWrapperElement,this.yearsStripElement,h.y),this.createWheelChange("years",this.yearsWrapperElement,this.yearsStripElement),this.setDragSelection("years",this.currentDate.year)),this.hasTimeModule&&(this.createDragSelection("hours",this.hoursElement,this.hoursWrapperElement,this.timeStripElement,h.y),this.createWheelChange("hours",this.hoursWrapperElement,this.timeStripElement),this.setDragSelection("hours",this.currentDate.hour,!0)),this.hasTimeModule&&(this.createDragSelection("minutes",this.minutesElement,this.minutesWrapperElement,this.timeStripElement,h.y),this.createWheelChange("minutes",this.minutesWrapperElement,this.timeStripElement),this.setDragSelection("minutes",this.currentDate.minute,!0)),this.markForCheck(),i(this.el))}valueChange(t,e){const i={isValid:!1,value:this.valueText};if(t)if(this.type!==y.range&&this.error)this.change.emit({isValid:!1,value:this.inputElement.value});else try{if((e&&v(t.dateObject)!==v(e.dateObject)||!e&&t)&&(this.type!==y.date&&this.type!==y.datetime||this.change.emit(t),this.type===y.time&&this.change.emit(t),this.type===y.range)){const e=t.dateObject;e.start.date&&e.end.date?t.isValid&&this.change.emit({isValid:t.isValid,value:t.value,start:e.start,end:e.end}):this.change.emit(i)}}catch(t){}else this.change.emit()}disabledDatesChange(t){t&&this.prepareDisabledDates()}stringToDate(t){return t.getMonth?t:new Date(Date.parse(this.switchDDMM(t)))}dateToString(t){if(!(t instanceof Date))return!1}switchDDMM(t){if(!t)return;const e=t.split("/");return-1===t.indexOf("/")||3!==e.length?t:`${e[1]}/${e[0]}/${e[2]}`}setData(){this.date=this.stringToDate(this.date),this.initialized||this.renderDate||(this.renderDate=this.date&&this.date||new Date),!this.initialized&&this.endDate&&(this.selectedEndDate=this.stringToDate(this.endDate));const t=this.renderDate;if(this.currentDate=this.createDateObject(t),this.dayNumbers=this.getMonthDayNumbers(t).map((e=>({day:e,thisMonth:!0,isWeekend:this.getDayIsWeekend(t,e),today:this.getIsCurrentDate(t,e),date:this.getTargetDayDate(t,e)}))),this.currentDate.year>this.minYear){let e=new Date(new Date(t).setMonth(this.currentDate.month-1,1)),i=this.getMonthDayNumbers(e).reverse(),s=this.currentDate.monthFirstDay;for(let t=1;t<(0===s?7:s);t++){const s=i[t-1];this.dayNumbers.unshift({day:s,prevMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}if(this.currentDate.year<this.maxYear){let e=new Date(new Date(t).setMonth(this.currentDate.month+1)),i=this.getMonthDayNumbers(e),s=42-this.dayNumbers.length;for(let t=0;t<s;t++){const s=i[t];this.dayNumbers.push({day:s,nextMonth:!0,isWeekend:this.getDayIsWeekend(e,s),date:this.getTargetDayDate(e,s)})}}this.emptyState||(this.valueText=this.getValueText()),i(this.el)}prepareDisabledDates(){if(!this.disabledDates)return;let t=null;if("string"==typeof this.disabledDates)try{t=JSON.parse(this.disabledDates)}catch(t){return}else t=this.disabledDates;if(t.dates&&t.dates.length&&t.dates.length){const e=t.dates.map((t=>{const e=new Date(t);return"invalid date"===e.toString().toLowerCase()?null:e})).filter((t=>t));this.disabledDatesList.dates=e}if(t.min&&t.max&&(t.min.getTime()>t.max.getTime()||t.max.getTime()<t.min.getTime()))return;t.min&&t.min instanceof Date?this.disabledDatesList.min=new Date(t.min.toDateString()):delete this.disabledDatesList.min,t.max&&t.max instanceof Date?this.disabledDatesList.max=new Date(t.max.toDateString()):delete this.disabledDatesList.max;const e=this.inputElement&&this.inputElement.value;e&&this.setDataFromText(e)}createWheelChange(t,e,i){e.addEventListener("wheel",(e=>{const s=e.deltaY>0,a=this[t+"Dragger"].getOffset().top,n=this.getTargetChildByDragPosition({y:a},i);let h=s?n+1:n-1;h<0?h=0:void 0===this[t][h]&&(h=this[t].length-1),"time"!=this.type||this.selectedDate||this.setTime(),this.setDragSelection(t,this[t][h],!0,!0)}))}createDragSelection(t,e,i,s,a){const n=t+"Dragger";this[n]=new r({target:e,trigger:i,direction:a,useTransform:!0,limit:{y:{max:s.offsetTop-s.offsetHeight/2,min:-1*(e.offsetHeight-(s.offsetTop+s.offsetHeight/2))}}}),this[n].on("end",(e=>{const i=this.getTargetChildByDragPosition(e,s);this.selectTargetChildByDragIdx(i,s,this[n]),this.setDragSelection(t,this[t][i],!1)}))}getTargetChildByDragPosition({y:t},e){const i=e.offsetHeight,s=i/2;return Math.floor(-(t-(e.offsetTop-s)-s)/i)}selectTargetChildByDragIdx(t,e,i,s=!0){i.setPosition({y:e.offsetHeight/2+e.offsetTop-(t+1)*e.offsetHeight,anim:s})}setDragSelection(t,e,i=!0,s=!1){const a=this[t].findIndex((t=>t===e));switch(i&&this.selectTargetChildByDragIdx(a,this["years"===t?t+"StripElement":"timeStripElement"],this[t+"Dragger"],s),t){case"years":this.date.setFullYear(e);break;case"hours":this.date.setHours(e);break;case"minutes":this.date.setMinutes(e)}this.renderDate=this.date,this.setData(),this.selectedDate&&this.setValue()}getHours12(){const t=(this.date.getHours()+24)%12||12;return t>12?t-12:t}createDateObject(t,{excludeTime:e=!1,exactMonthNumber:i=!1}={}){const s=t.getFullYear();return Object.assign(Object.assign({year:s>=this.maxYear?this.maxYear:s<=this.minYear?this.minYear:s,day:t.getDate(),month:t.getMonth()+(i?1:0),dayOfWeek:t.getDay(),monthFirstDay:new Date(new Date(t).setDate(1)).getDay()},!e&&{hour:t.getHours()}),!e&&{minute:t.getMinutes()})}generateDaysArrayFromMax(t){return Array.from(Array(t+1).keys()).slice(1)}getMonthDayNumbers(t){const e=this.getDaysInMonth(t.getMonth(),t.getFullYear());return this.generateDaysArrayFromMax(e)}getTargetDayDate(t,e){return new Date(new Date(t).setDate(e))}getDayIsWeekend(t,e){const i=new Date(new Date(t).setDate(e)).getDay();return 6===i||0===i}getClock(t){return{hours:(t=t||new Date).getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milis:t.getMilliseconds()}}setValue(t){var e,i,s;const a=new Date(this.date.setHours(Number(this.currentDate.hour),Number(this.currentDate.minute)));if(t)this.value=null;else{if(this.dataIsValid=!0,this.type===y.datetime){const t=Object.assign({},this.currentDate);t.month+=1,(null===(e=this.value)||void 0===e?void 0:e.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.date){const t=Object.assign({},this.currentDate);delete t.hour,delete t.minute,t.month+=1,(null===(i=this.value)||void 0===i?void 0:i.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),dateObject:t,value:this.valueText})}if(this.type===y.time){const t=this.getTimeText(),e=Object.assign({},this.currentDate);e.month+=1,this.value={isValid:this.dataIsValid,date:a,timestamp:a.getTime(),time:t,dateObject:e,timeObject:{hours:this.currentDate.hour,minutes:this.currentDate.minute},value:t},this.inputElement.value=t}this.type===y.range&&(null===(s=this.value)||void 0===s?void 0:s.value)!=this.valueText&&(this.value={isValid:this.dataIsValid,dateObject:{start:Object.assign({},this.selectedDate&&{date:this.selectedDate,timestamp:this.selectedDate.getTime(),detail:this.createDateObject(this.selectedDate,{excludeTime:!0,exactMonthNumber:!0})}),end:Object.assign({},this.selectedEndDate&&{date:this.selectedEndDate,timestamp:this.selectedEndDate.getTime(),detail:this.createDateObject(this.selectedEndDate,{excludeTime:!0,exactMonthNumber:!0})})},value:this.valueText})}}setMonth(t){this.renderDate.setDate(1),this.renderDate=new Date(this.renderDate.setMonth(t)),this.setDragSelection("years",this.currentDate.year)}checkRangeValidation({popupClosing:t=!1}={}){return this.type!==y.range||(t&&(!this.selectedDate||this.selectedDate&&!this.selectedEndDate)?(this.setError(!0,"date range invalid"),!1):(t||this.setError(!1),!0))}pad(t,e){return t<e?"0":""}isInputClearable(){return!(!this.inputElement||!this.inputElement.value)}isDisabledDate(t){if(this.disabledDatesList.dates.map((e=>this.isSameDate(e,t))).filter((t=>t)).length)return!0;if(this.disabledDatesList.min){const e=new Date(this.disabledDatesList.min);if(e&&e.getTime()>t.getTime())return!0}if(this.disabledDatesList.max){const e=new Date(this.disabledDatesList.max);if(e&&new Date(e.setDate(e.getDate()+1)).getTime()<t.getTime())return!0}}setDate(t,e,i=!1){const s=this.type===y.range,a=!!this.selectedEndDate;if((this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(t))&&(this.emptyState=!1,(!s||s&&!a)&&(this.date=new Date(t.setHours(this.currentDate.hour,this.currentDate.minute))),s&&this.checkRangeValidation(),s&&this.selectedDate&&this.selectedEndDate&&(this.selectedDate=null,this.selectedEndDate=null),e)){const e=new Date(t);s&&this.selectedDate?this.selectedDate.getTime()>e.getTime()?(this.selectedEndDate=this.selectedDate)&&(this.selectedDate=e):this.selectedEndDate=e:this.selectedDate=e,!s&&(this._open=i),this.renderDate=this.date,this.valueText=this.getValueText(),this.setValue();const a=this.valueText.split("/"),n=this.valueText?this.changeFormat(new Date(a[1]+"/"+a[0]+"/"+a[2])):"";this.inputElement.value=n}}setDataFromText(t,e=!1,i=!0){let s=!1,a="";const n=this.parse(t);if(this.type!==y.date&&this.type!==y.datetime||!this.isDisabledDate(n.date)||(n.dateIsValid=!1,a="disabled-date"),this.type===y.datetime&&n.dateIsValid&&n.timeIsValid&&(e&&this.setDate(n.date,!0,i),e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.date&&n.dateIsValid&&(e&&this.setDate(n.date,!0,i),s=!0),this.type===y.time&&n.timeIsValid&&(e&&this.setTime(n.timeSections[0],n.timeSections[1]),s=!0),this.type===y.range&&(n.dateIsValid&&!this.selectedDate&&(e&&this.setDate(n.date,!0,i),s=!0),n.date2IsValid&&!this.selectedEndDate&&(e&&this.setDate(n.date2,!0,i),s=!0),this.selectedDate&&this.selectedEndDate&&n.rangeIsValid&&(this.isSameDate(n.date2,this.selectedEndDate)&&!this.isSameDate(n.date,this.selectedDate)&&(this.selectedDate=null,e&&this.setDate(n.date,!0,i),s=!0),this.isSameDate(n.date,this.selectedDate)&&!this.isSameDate(n.date2,this.selectedEndDate)&&(this.selectedEndDate=null,e&&this.setDate(n.date2,!0,i),s=!0)),this.selectedDate&&this.selectedEndDate&&!n.rangeIsValid&&e&&(this.selectedDate=null,this.selectedEndDate=null)),s)e&&(this.renderDate=this.date),this.setError(!1);else{this.type===y.range&&this.selectedDate&&this.selectedEndDate&&n.rangeIsValid?this.setError(!1):a?this.setError(!0,"disabled-date"===a&&"selected date is not allowed"):(t&&this.setError(!0,(this.type===y.datetime?"invalid date or time":this.type===y.range&&"invalid date range")||this.type===y.date&&"The selected date is not allowed."||this.type===y.time&&"invalid time"),this.setValue(!0));const e=t.split("/"),i=t&&!this.error?this.changeFormat(new Date(e[1]+"/"+e[0]+"/"+e[2])):"";this.inputElement.value=i}}setDateToday(){const t=new Date;this.type===y.range&&(this.selectedDate=null,this.selectedEndDate=null),this.setDate(t,!0,!1)}HourContentDblClick(t){const e=d.findEventPathWithNodeName(t,"SPAN");e&&e.classList.contains("selected")&&(this.setValue(),this._open=!1)}setTime(t,e){this.renderDate=new Date(this.date.setHours(Number(t||this.getClock().hours),Number(e||this.getClock().minutes))),this.type===y.time&&(this.selectedDate=this.date);const i=this.currentDate.hour||(new Date).getHours(),s=this.currentDate.minute||(new Date).getMinutes();this.setDragSelection("hours",i,!0,!0),this.setDragSelection("minutes",s,!0,!0)}setError(t=!1,e=""){this.error=t,this.errorText=t?e:""}getError(){const{error:t,errorText:e}=this;return{valid:!t,error:t,errorText:e}}getDaysInMonth(t,e){return new Date(e,t+1,0).getDate()}getIsCurrentDate(t,e){const i=new Date;return i.getDate()===e&&i.getMonth()===t.getMonth()&&i.getFullYear()===t.getFullYear()}isSameDate(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}getSelected(t,e=!1){const i=new Date(this["selected"+(e?"EndDate":"Date")]),s=i.getFullYear(),a=i.getMonth(),n=i.getDate();return t.getDate()===n&&t.getMonth()===a&&t.getFullYear()===s}getDateIsInRange(t){if(this.type!==y.range||!this.selectedDate||!this.selectedEndDate)return;const e=t.getTime(),i=this.selectedDate.getTime(),s=this.selectedEndDate.getTime();return e>i&&e<s}getMonthText(){return Object.values(f)[this.renderDate.getMonth()]}getCurrentDateText(){const t=Object.values(x)[this.currentDate.dayOfWeek],e=Object.values(f)[this.currentDate.month];return`${t}, ${this.currentDate.day}th ${e} ${this.currentDate.year}`}getTimeText(){const{hour:t,minute:e}=this.currentDate;return`${t<10?"0"+t:t}:${e<10?"0"+e:e}`}getValueText(){if(!this.selectedDate)return"";const t=this.selectedDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;let a="";if(this.type!==y.date&&this.type!==y.datetime||(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.time&&(a=this.getTimeText()),this.type===y.datetime&&(a=`${a} ${this.getTimeText()}`),this.type===y.range&&(a=`${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`),this.type===y.range&&this.selectedEndDate){const t=this.selectedEndDate,e=t.getFullYear(),i=t.getDate(),s=t.getMonth()+1;a+=`-${i<10?"0"+i:i}/${s<10?"0"+s:s}/${e}`}return this.setDataFromText(a),a}parseDate(t){var e=t.split("/"),i=parseInt(e[0],10),s=parseInt(e[1],10)-1,a=parseInt(e[2],10);if(isNaN(i)||isNaN(s)||isNaN(a))return"invalid date";var n=new Date(a,s,i);return n.getDate()!==i||n.getMonth()!==s||n.getFullYear()!==a?"invalid date":n}parse(t){const e=t.split(this.type===y.range?"-":" "),i=this.switchDDMM(e[0]),s=this.switchDDMM(e[1]),a=this.type===y.datetime?e[1]:e[0],n=new Date(i),h=new Date(s),r="invalid date"!==n.toString().toLowerCase()&&"invalid date"!==this.parseDate(t),o="invalid date"!==h.toString().toLowerCase(),c=/^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/,l=c.test(i),d=c.test(s),m=/\b([01][0-9]|2[0-3]):([0-5][0-9])\b/.test(a),p=r&&l,u=o&&d;return{date:n,date2:h,timeSections:m?a.split(":"):"",dateIsValid:p,date2IsValid:u,rangeIsValid:p&&u,timeIsValid:m}}getPrevMonth(){this.setMonth(this.renderDate.getMonth()-1)}getNextMonth(){this.setMonth(this.renderDate.getMonth()+1)}yearClick(t){this.yearsDragger.busy||this.setDragSelection("years",this.years[t],!0,!0)}hourClick(t){this.hoursDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("hours",this.hours[t],!0,!0))}minuteClick(t){this.minutesDragger.busy||(this.selectedDate||this.setTime(),this.setDragSelection("minutes",this.minutes[t],!0,!0))}openPicker(){this.disabled||!this._open&&(this._open=!0)}handleDayNumber(t){this.type===y.range&&this.selectedDate&&!this.selectedEndDate&&this.isSameDate(this.selectedDate,t)||this.setDate(t,!0)}handleInputInput(t){this.setDataFromText(t,!0)}handleInputChange(t){this.setDataFromText(this.inputElement.value,!0,!1),t.stopPropagation()}async handleInputClear(){return this.selectedDate=null,this.selectedEndDate=null,this.emptyState=!0,this.renderDate=new Date,this._open=!1,this.setValue(!0),this.setError(),this.getValueText(),await this.inputElement.setClear(),await l(10),Promise.resolve()}handleWheel(t){t.preventDefault()}handleWindowClick(t){if(this._open){const e=document.getElementById(`picker-vp-${this._id}`),i=d.findEventPath(t,this.el),s=!!e&&d.findEventPath(t,e);i||s||(this._open=!1)}}openToggle(){this.disabled||(this._open=!this._open)}async open(){await l(50),this.openToggle()}async close(){this._open=!1}async getValue(){return this.value}async setDisabled(t){this.disabled=t}changeFormat(t,e=!1){if(!t)return;const i=t=>t<10?`0${t}`:t,s=i(new Date(t).getDate()),a=i(new Date(t).getMonth()+1),n=new Date(t).getFullYear(),h=i(new Date(t).getHours()),r=i(new Date(t).getMinutes());return"range"==this.type||"date"==this.type?e?`${a}/${s}/${n}`:`${s}/${a}/${n}`:e?`${a}/${s}/${n} ${h}:${r}`:`${s}/${a}/${n} ${h}:${r}`}isTime(t){return/^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(t)}getHHMM(t){if(!t)return;const e=t=>t<10?`0${t}`:t;return`${e(new Date(t).getHours())}:${e(new Date(t).getMinutes())}`}async set(t){if(t)if("number"==typeof t&&(t=new Date(t)),"time"==this.type){let e=t;this.isTime(t)||(e=this.getHHMM(t)),this.setDataFromText(e,!0,!1)}else{const i=t.toString().split("-"),s=Date.parse(i[0]);if(i[0]&&!isNaN(s)){var e=this.changeFormat(c.convertTimeStampToDate(new Date(i[0]).getTime()));i[1]&&!isNaN(Date.parse(i[1]))&&(e=e+"-"+this.changeFormat(c.convertTimeStampToDate(new Date(i[1]).getTime()))),this.setDataFromText(e,!0,!1)}else this.setDataFromText("",!0,!1)}else this.setClear()}async get(){var t;return(null===(t=this.value)||void 0===t?void 0:t.timestamp)||null}async setClear(){return await this.handleInputClear(),Promise.resolve()}async getInput(){return this.inputElement}async isValid(){return this.getError()}async resetCaption(){return await l(10),await this.inputElement.resetCaption(),this.captionType="default",this.captionError=null,await l(10),Promise.resolve()}addZeroBefore(t){return(t<10?"0":"")+t}formatDate(t,e){const i={mm:this.addZeroBefore(t.getMonth()+1),dd:this.addZeroBefore(t.getDate()),yyyy:this.addZeroBefore(t.getFullYear()),hh:this.addZeroBefore(t.getHours()),mi:this.addZeroBefore(t.getMinutes())};return e.replace(/mm|dd|yyyy|hh|mi/gi,(t=>i[t]))}handleResize(){this.calculateLocation()}handleWheels(t){if(this._open){const e=document.querySelector(`#picker-vp-${this._id}`);e&&d.findEventPath(t,e)?this.calculateLocation():this._open=!1}}componentDidLoad(){const t=this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);t&&(document.body.appendChild(t),this.calculateLocation())}disconnectedCallback(){this.el.innerHTML="";const t=document.getElementById(`picker-vp-${this._id}`);t&&t.remove()}async calculateLocation(){const t=document.getElementById(`picker-vp-${this._id}`),e=this.placement.split("-");this.alignment&&(this.placement=e[0]+("right"==this.alignment?"-end":"-start"));var i=this.placement;const s=document.getElementById(this.linkedComponent?this.linkedComponent:this._id);if(s){const e=this.linkedComponent?s:s.shadowRoot.querySelector(`#picker-input-${this._id}`)||s.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);if(t&&e){p(t,e,i,(t=>i=t)),await l(10);let s=u(i,e),a=this.noCaption?0:20,n=0;switch(p(t,e,i,(t=>i=t)),await l(10),s=u(i,e),t.style.top=this.linkedComponent?("top"==i.split("-")[0]?s[0]-t.offsetHeight:s[0])+"px":("top"==i.split("-")[0]?s[0]-t.offsetHeight+n:s[0]-a)+"px",i.split("-")[1]){case"start":t.style.left=s[1]+"px";break;case"center":t.style.left=s[1]-t.offsetWidth/2+"px";break;case"end":t.style.left=s[1]-t.offsetWidth+"px"}t.classList.toggle("bcm-list--top","top"==i.split("-")[0])}}}handleKeyDown(t){(t.keyCode||t.which)===m.KeyCode.escape&&this._open&&(this._open=!1,t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.markForCheck())}render(){const t=o("day-numbers"),e=o("datetime-picker","datetime-picker-wrapper",{open:this._open,"no-caption":this.noCaption}),i=o(this.hidden?"hidden":null,{"full-width":this.fullWidth,"linked-component":this.linkedComponent,"no-margin":this.noMargin}),n=o("toggle",{disabled:this.disabled}),h="time"==this.type?'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>':'<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>';return s(a,{class:i,"bcm-internal-id":this.inputId},this.label&&s("div",{class:"picker-label",onClick:()=>this.openToggle()},s(b,{size:"medium",type:this.captionType,value:this.label,required:this.required,htmlFor:this._id})),s("bcm-old-input",{ref:t=>this.inputElement=t,placeholder:this.placeholder||"Select "+(this.type===y.datetime?"date and time":"")+(this.type===y.date?"date":"")+(this.type===y.time?"time":"")+(this.type===y.range?"date range":""),value:this.valueText,required:this.required,fullWidth:this.fullWidth,disabled:this.disabled,name:this.name,id:this.inputId,clearable:this.clearable,onClick:()=>this.openPicker(),"no-margin":!0,disableWatchValue:!0,"on-bcm-clear":()=>this.handleInputClear(),"on-bcm-change":t=>this.handleInputChange(t),noCaption:this.noCaption,captionError:this.captionError,caption:this.caption,captionType:this.captionType},this.error&&s("span",{slot:"suffix"},s("span",{id:"error-icon",class:n,innerHTML:'<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>',title:this.errorText})),s("span",{slot:"suffix",onClick:()=>this.openPicker()},s("span",{id:"calender-icon",class:n,innerHTML:h}))),s("div",{id:"picker-vp-"+this._id,class:e,onWheel:t=>this.handleWheel(t)},s("div",{class:"modules"},this.hasDateModule&&s("div",{class:"date-container"},s("div",{class:"bcm-datetime-picker__header"},s("span",null),s("div",{class:"month-year"},s("button",{onClick:()=>this.getPrevMonth()},s("bcm-icon",{icon:"far fa-chevron-left"})),s("div",{class:"month-year-wrapper"},s("span",{class:"month"},this.getMonthText()),",",s("span",{class:"year"},this.date.getFullYear())),s("button",{onClick:()=>this.getNextMonth()},s("bcm-icon",{icon:"far fa-chevron-right"}))),s("span",{class:"today",onClick:()=>this.setDateToday()},"Today")),s("div",{class:"bcm-datetime-picker__content"},s("div",{class:"years",ref:t=>this.yearsWrapperElement=t},s("div",{class:"items",ref:t=>this.yearsElement=t},this.years.map(((t,e)=>s("span",{onClick:()=>this.yearClick(e)},t)))),s("div",{class:"select-strip",ref:t=>this.yearsStripElement=t})),s("div",{class:"days"},s("div",{class:"day-labels"},s("span",null,"Mo"),s("span",null,"Tu"),s("span",null,"We"),s("span",null,"Th"),s("span",null,"Fr"),s("span",null,"Sa"),s("span",null,"Su")),s("div",{class:t},this.dayNumbers.map((t=>s("span",{class:{"is-disabled-date":(this.type===y.date||this.type===y.datetime)&&this.isDisabledDate(t.date),"not-this-month":!t.thisMonth,"is-weekend":t.isWeekend,today:t.today,selected:this.getSelected(t.date),"selected-start":this.getSelected(t.date)&&this.selectedEndDate&&this.type===y.range,"selected-end":this.getSelected(t.date,!0)&&this.type===y.range,range:this.getDateIsInRange(t.date)&&this.type===y.range},onClick:()=>this.handleDayNumber(t.date)},s("span",{class:"number"},t.day)))))))),this.hasTimeModule&&s("div",{class:"time-container"},s("div",{class:"bcm-datetime-picker__header"},s("div",{class:"month-year"},s("span",{class:"month"},this.getTimeText())),s("span",{class:"now",onClick:()=>{this.setTime(),"time"==this.type&&(this._open=!1)}},"Now")),s("div",{class:"bcm-datetime-picker__content",onDblClick:t=>{this.HourContentDblClick(t)}},s("div",{class:"hours",ref:t=>this.hoursWrapperElement=t},s("div",{class:"items",ref:t=>this.hoursElement=t},this.hours.map(((t,e)=>s("span",{class:this.currentDate.hour===t?"selected":"",onClick:()=>this.hourClick(e)},(t<10&&"0")+t))))),s("div",{class:"minutes",ref:t=>this.minutesWrapperElement=t},s("div",{class:"items",ref:t=>this.minutesElement=t},this.minutes.map(((t,e)=>s("span",{class:this.currentDate.minute===t?"selected":"",onClick:()=>this.minuteClick(e)},(t<10&&"0")+t))))),s("div",{class:"select-strip",ref:t=>this.timeStripElement=t}))))))}get el(){return n(this)}static get watchers(){return{_open:["openChanged","openChange"],renderDate:["renderDateChange"],value:["valueChange"],disabledDates:["disabledDatesChange"]}}};(function(t,e,i,s){var a,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(h=(n<3?a(h):n>3?a(e,i,h):a(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)})([g()],w.prototype,"el",void 0),w.style='@import url("https://fonts.googleapis.com/css?family=Roboto:400,500");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap"); .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}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:"";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}';export{w as bcm_datetime_picker}
|