@postnord/pn-marketweb-components 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +1 -1
- package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js.map +1 -1
- package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js +2 -2
- package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js.map +1 -1
- package/cjs/pn-multi-row-connected-dropdown-row.cjs.entry.js +4 -4
- package/cjs/pn-multi-row-connected-dropdown-row.cjs.entry.js.map +1 -1
- package/cjs/pn-multi-row-connected-dropdown.cjs.entry.js +2 -2
- package/cjs/pn-multi-row-connected-dropdown.cjs.entry.js.map +1 -1
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +1 -1
- package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js.map +1 -1
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js +2 -2
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js.map +1 -1
- package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown-row.js +4 -4
- package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown-row.js.map +1 -1
- package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown.js +2 -2
- package/collection/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown.js.map +1 -1
- package/components/pn-dropdown-choice-adds-row.js +1 -1
- package/components/pn-dropdown-choice-adds-row.js.map +1 -1
- package/components/pn-dropdown-with-multi-input-rows.js +2 -2
- package/components/pn-dropdown-with-multi-input-rows.js.map +1 -1
- package/components/pn-multi-row-connected-dropdown-row2.js +4 -4
- package/components/pn-multi-row-connected-dropdown-row2.js.map +1 -1
- package/components/pn-multi-row-connected-dropdown.js +2 -2
- package/components/pn-multi-row-connected-dropdown.js.map +1 -1
- package/esm/pn-dropdown-choice-adds-row.entry.js +1 -1
- package/esm/pn-dropdown-choice-adds-row.entry.js.map +1 -1
- package/esm/pn-dropdown-with-multi-input-rows.entry.js +2 -2
- package/esm/pn-dropdown-with-multi-input-rows.entry.js.map +1 -1
- package/esm/pn-multi-row-connected-dropdown-row.entry.js +4 -4
- package/esm/pn-multi-row-connected-dropdown-row.entry.js.map +1 -1
- package/esm/pn-multi-row-connected-dropdown.entry.js +2 -2
- package/esm/pn-multi-row-connected-dropdown.entry.js.map +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-07253be3.entry.js +2 -0
- package/pn-market-web-components/{p-3847f9af.entry.js.map → p-07253be3.entry.js.map} +1 -1
- package/pn-market-web-components/{p-23916c49.entry.js → p-3ae1657a.entry.js} +2 -2
- package/pn-market-web-components/{p-23916c49.entry.js.map → p-3ae1657a.entry.js.map} +1 -1
- package/pn-market-web-components/p-5ff663be.entry.js +2 -0
- package/pn-market-web-components/p-5ff663be.entry.js.map +1 -0
- package/pn-market-web-components/p-af16f7e3.entry.js +2 -0
- package/pn-market-web-components/p-af16f7e3.entry.js.map +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/p-00ea6211.entry.js +0 -2
- package/pn-market-web-components/p-00ea6211.entry.js.map +0 -1
- package/pn-market-web-components/p-3847f9af.entry.js +0 -2
- package/pn-market-web-components/p-67089fc8.entry.js +0 -2
- package/pn-market-web-components/p-67089fc8.entry.js.map +0 -1
|
@@ -266,7 +266,7 @@ const pnDropdownChoiceAddsRow = class {
|
|
|
266
266
|
}
|
|
267
267
|
render() {
|
|
268
268
|
var _a;
|
|
269
|
-
return (index.h(index.Host, { key: 'e42637fdfbc059fe081da8fb8af2a2469f357d15' }, index.h("div", { key: 'da4240a50ed0be9b937bbcb998ca26569c1ffd8c', class: "dropdown-choice-form-row" }, index.h("pn-select", { key: '
|
|
269
|
+
return (index.h(index.Host, { key: 'e42637fdfbc059fe081da8fb8af2a2469f357d15' }, index.h("div", { key: 'da4240a50ed0be9b937bbcb998ca26569c1ffd8c', class: "dropdown-choice-form-row" }, index.h("pn-select", { key: '7b57bbef46778d4ce63b937e80b2df10501e36c5', ref: el => (this.pnRowSelectDropdown = el), name: this.addRowDropdownName, placeholder: this.addRowDropdownPlaceholder, label: this.addRowDropdownLabel, class: "pn-row-select-dropdown", "empty-option": "true" }, (_a = this.rowSelectDropdownArr) === null || _a === void 0 ? void 0 : _a.map((value) => index.h("pn-option", { label: value, value: value })))), index.h("div", { key: 'ae290b0a39886fead6a6cf6cff9e7ff0329b0cf2', class: "dropdown-choice-form-row" }, index.h("table", { key: '1fac0a253d5ea42876bda4a32dd43db1223bd650', class: "pn-dropdown-choice-table" }, index.h("thead", { key: 'dc119ee9a215b433e480d3ace1a04fc4c093fe5a', ref: el => (this.tableHead = el) }, this.nextRowIndex === 0 ? null : (index.h("tr", null, index.h("th", { class: "table-header--name" }, index.h("label", null, this.rowNameLabel)), this.rowHasDropdown ? (index.h("th", { class: "table-header--dropdown" }, index.h("label", null, this.rowDropdownLabel))) : null, index.h("th", { class: "table-header--input" }, index.h("label", null, this.rowInputLabel)), index.h("th", { class: "table-header--delete" })))), index.h("tbody", { key: '334d8505ff7214e80cf26ae638134b8efedf1c6e', ref: el => (this.tableBody = el), class: "pn-dropdown-choice-table-slot" }, index.h("slot", { key: '40463ee8d5959bb3c2fbf10d7256883699eaf5ca' })), index.h("tfoot", { key: '8bc7637282d2e5656096233a7b431ae6d9961972' }, this.showWarning ? (index.h("tr", null, index.h("td", { colSpan: this.columnCount }, index.h("pn-icon", { icon: alert_exclamation_circle.alert_exclamation_circle, small: true, color: "warning" }), index.h("small", { class: "dropdown-choice-error-message" }, this.inputLimitWarning)))) : null)))));
|
|
270
270
|
}
|
|
271
271
|
get hostElement() { return index.getElement(this); }
|
|
272
272
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
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AAS,GAAW,EACzEF,mBAAO,KAAK,EAAC,+BAA+B,IAAE,IAAI,CAAC,iBAAiB,CAAS,CAC1E,CACF,IACH,IAAI,CACF,CACF,CACJ,CACD,EACP;KACH;;;;;;;;;;","names":["debounce","h","Host","alert_exclamation_circle"],"sources":["src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.scss?tag=pn-dropdown-choice-adds-row","src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-choice-adds-row {\n gap: 1rem;\n\n .dropdown-choice-form-row {\n display: flex;\n gap: 1rem;\n }\n\n .pn-row-select-dropdown {\n width: 50%;\n margin-bottom: 1rem;\n }\n\n @media only screen and (max-width: 640px) {\n .pn-row-select-dropdown {\n width: 100%;\n }\n }\n\n .pn-dropdown-choice-table {\n width: 100%;\n border-spacing: 0rem;\n\n thead {\n th {\n text-align: left;\n padding: 1rem 0.5rem;\n\n label {\n color: $gray700;\n font-size: 1.4rem;\n font-weight: 400;\n }\n }\n\n .table-header {\n &--name {\n width: 40%;\n }\n\n &--dropdown {\n width: 40%;\n }\n\n &--input {\n width: 10%;\n }\n\n &--delete {\n width: 10%;\n }\n }\n }\n\n tbody {\n td {\n padding: 0.5rem;\n }\n\n tr:nth-child(even) {\n background-color: #effbff;\n }\n\n .tr-delete {\n text-align: center;\n }\n }\n\n tfoot {\n td {\n small {\n color: $warning;\n vertical-align: middle;\n }\n\n pn-icon {\n margin-right: 0.25em;\n vertical-align: middle;\n }\n }\n }\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter } from '@stencil/core';\nimport { FormValue, RowValue, Root } from './types';\nimport debounce from 'debounce';\nimport { alert_exclamation_circle } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-choice-adds-row',\n styleUrl: 'pn-dropdown-choice-adds-row.scss',\n})\nexport class pnDropdownChoiceAddsRow {\n @Element() hostElement: Element;\n pnRowSelectDropdown: HTMLElement = null;\n tableHead: HTMLElement = null;\n tableBody: HTMLElement = null;\n private _dropdownData: Root[];\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() addRowDropdownName: string = '';\n @Prop() addRowDropdownPlaceholder: string = '';\n @Prop() addRowDropdownLabel: string = '';\n @Prop() rowNameLabel: string = '';\n @Prop() rowHasDropdown: boolean = true;\n @Prop() rowDropdownLabel: string = '';\n @Prop() rowDropdownPlaceholder: string = '';\n @Prop() rowInputLabel: string = '';\n @Prop() rowDeleteButtonText: string = '';\n @Prop() totalInputLimit: number = 0;\n @Prop() inputLimitWarning: string = null;\n\n @State() nextRowIndex: number = null;\n @State() rowSelectDropdownArr: string[] = null;\n @State() columnCount: number = null;\n @State() showWarning: boolean = false;\n @State() formValue: string = null;\n\n @Event() rowvalues: EventEmitter<string>;\n\n @Watch('dropdownData')\n dropdownDataWatcher() {\n if (typeof this.dropdownData === 'string') {\n this._dropdownData = JSON.parse(this.dropdownData);\n } else {\n this._dropdownData = this.dropdownData;\n }\n }\n\n componentWillLoad() {\n this.dropdownDataWatcher();\n }\n\n componentDidLoad() {\n this.setInitialValues();\n this.addEventHandlers();\n }\n\n addEventHandlers() {\n this.pnRowSelectDropdown.addEventListener('selectOption', debounce(this.addRowElement.bind(this), 500));\n }\n\n setInitialValues() {\n this.nextRowIndex = 0;\n this.columnCount = this.rowHasDropdown ? 4 : 3;\n this.setRowSelectDropdownArr();\n }\n\n setRowSelectDropdownArr() {\n this.rowSelectDropdownArr = [];\n this._dropdownData.forEach(element => {\n this.rowSelectDropdownArr.push(element.label);\n });\n }\n\n formRowEvent = e => {\n const debouncedAddValue = debounce(this.updateHiddenFieldValue.bind(this), 500);\n\n if (e.target.matches('input')) {\n ['change', 'keyup'].forEach(eventName => {\n e.target.addEventListener(eventName, debouncedAddValue);\n });\n } else {\n const rowDropdown = e.target.closest('.generated-table-row')?.querySelector('pn-select') as HTMLElement;\n if (rowDropdown) {\n rowDropdown.addEventListener('selectOption', debouncedAddValue);\n }\n }\n };\n\n updateHiddenFieldValue() {\n const allRows = [...this.tableBody.querySelectorAll('tr')];\n const columnValueCount = this.rowHasDropdown ? 3 : 2;\n const formValues: FormValue[] = [];\n\n if (allRows.length) {\n allRows.forEach(elm => {\n const row: FormValue = { row: [] };\n const nameElm = elm.querySelector('.tr-name');\n const dropdownElm = elm.querySelector('.tr-dropdown');\n const inputElm = elm.querySelector('.tr-input');\n\n const nameValue: RowValue = { name: this.rowNameLabel, value: nameElm?.innerHTML };\n row.row.push(nameValue);\n\n const dropdown = dropdownElm.querySelector('.current-selection');\n if (dropdown) {\n const dropdownSelection = dropdown.textContent ?? '';\n\n if (dropdownSelection.length) {\n const dropdownValue: RowValue = {\n name: this.rowDropdownLabel,\n value: dropdownSelection,\n };\n row.row.push(dropdownValue);\n }\n }\n if (!dropdown && columnValueCount === 3) {\n const dropdownValue: RowValue = {\n name: this.rowDropdownLabel,\n value: '',\n };\n row.row.push(dropdownValue);\n }\n\n const inputValue = parseInt(inputElm.querySelector('input')?.value ?? '0');\n if (inputValue > 0) {\n const inputColumnValue: RowValue = { name: this.rowInputLabel, value: inputValue.toString() };\n row.row.push(inputColumnValue);\n }\n\n if (row.row.length === columnValueCount) {\n formValues.push(row);\n }\n });\n }\n\n if (formValues.length && formValues.length === allRows.length) {\n const valueJsonString = JSON.stringify(formValues);\n this.formValue = `PN-JSON|${valueJsonString}`;\n } else {\n this.formValue = '';\n }\n\n this.rowvalues.emit(this.formValue);\n this.checkInputTotal();\n }\n\n addRowElement() {\n const selected = this.pnRowSelectDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n const slotElm = this.tableBody;\n const newRow = document.createElement('tr');\n newRow.setAttribute('index', `${this.nextRowIndex}`);\n newRow.setAttribute('class', 'generated-table-row');\n newRow.onclick = e => this.formRowEvent(e);\n const rowNameColumn = document.createElement('td');\n rowNameColumn.setAttribute('class', 'tr-name');\n rowNameColumn.innerHTML = selectedValue;\n rowNameColumn.dataset.name = selectedValue;\n newRow.appendChild(rowNameColumn);\n\n if (this.rowHasDropdown) {\n const rowDropdownColumn = this.createDropdownColumn(selectedValue);\n newRow.appendChild(rowDropdownColumn);\n }\n\n const rowInputColumn = this.createInputColumn(selectedValue);\n newRow.appendChild(rowInputColumn);\n const deleteButton = this.createDeleteButtonColumn();\n newRow.appendChild(deleteButton);\n\n slotElm.appendChild(newRow);\n this.updateRowSelectDropdown();\n this.nextRowIndex++;\n }\n\n getCurrentRow(selectedValue: string) {\n return this.hostElement.querySelectorAll(`.tr-name[data-name='${selectedValue}'`);\n }\n\n createDropdownColumn(selectedValue: string) {\n const dropdownColumn = document.createElement('td');\n dropdownColumn.setAttribute('class', 'tr-dropdown');\n const selectedItem = this._dropdownData.find(arr => arr.label === selectedValue);\n const selectedOptionValues = [];\n const currentRow = this.getCurrentRow(selectedValue);\n\n currentRow.forEach(row => {\n selectedOptionValues.push(row.parentElement?.querySelector('.tr-dropdown [aria-selected=true]')?.textContent);\n });\n\n if (Array.isArray(selectedItem.values) && selectedItem.values.length) {\n const dropdown = document.createElement('pn-select');\n dropdown.setAttribute('name', `${selectedValue}-dropdown`);\n dropdown.setAttribute('placeholder', this.rowDropdownPlaceholder);\n\n const filtereredValues = selectedItem.values.filter(item => !selectedOptionValues?.includes(item.value));\n\n filtereredValues.forEach(childItem => {\n const childOption = document.createElement('pn-option');\n childOption.setAttribute(\"label\", childItem.label);\n childOption.setAttribute(\"value\", childItem.label)\n dropdown.appendChild(childOption);\n });\n\n dropdownColumn.appendChild(dropdown);\n }\n\n return dropdownColumn;\n }\n\n createInputColumn(selectedValue: string) {\n const inputColumn = document.createElement('td');\n inputColumn.setAttribute('class', 'tr-input');\n const inputElm = document.createElement('pn-marketweb-input');\n inputElm.setAttribute('type', 'number');\n inputElm.setAttribute('name', `${selectedValue}-input`);\n inputElm.setAttribute('placeholder', '0');\n inputColumn.appendChild(inputElm);\n return inputColumn;\n }\n\n createDeleteButtonColumn() {\n const buttonColumn = document.createElement('td');\n buttonColumn.setAttribute('class', 'tr-delete');\n const buttonElm = document.createElement('pn-button');\n buttonElm.onclick = e => this.deleteRow(e);\n buttonElm.setAttribute('appearance', 'warning');\n buttonElm.setAttribute('small', 'true');\n buttonElm.appendChild(document.createTextNode(this.rowDeleteButtonText));\n buttonColumn.appendChild(buttonElm);\n return buttonColumn;\n }\n\n updateRowSelectDropdown() {\n type Row = { rowName: string; selectedValue: string; placeholder: string };\n\n const rows: Row[] = [].map.call(this.tableBody.querySelectorAll('.tr-name'), el => {\n const dropdownColumn = el?.parentElement?.querySelector('.tr-dropdown');\n const dropdownPlaceholder = dropdownColumn?.querySelector('.pn-select-content span')?.textContent;\n const row: Row = {\n rowName: el?.innerHTML,\n selectedValue: dropdownColumn?.querySelector('[aria-selected=true]')?.textContent,\n placeholder: dropdownPlaceholder,\n };\n return row;\n });\n\n if (rows.length) {\n this.rowSelectDropdownArr = [];\n\n this._dropdownData.forEach(element => {\n const filteredRows = rows.filter(row => row.rowName === element.label);\n const mainOptionReachedMaxPossibleRows =\n (element.values.length > 0 && filteredRows.length >= element.values.length) || (element.values.length === 0 && filteredRows.length === 1);\n if (!mainOptionReachedMaxPossibleRows) {\n this.rowSelectDropdownArr.push(element.label);\n }\n });\n } else {\n this.setRowSelectDropdownArr();\n }\n\n const selectOptions = this.pnRowSelectDropdown.querySelectorAll('pn-option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n\n const placeholder = this.pnRowSelectDropdown.querySelector('.pn-select-content span');\n placeholder.innerHTML = this.addRowDropdownPlaceholder;\n\n this.updateHiddenFieldValue();\n }\n\n deleteRow(e: Event) {\n e.preventDefault();\n this.nextRowIndex--;\n const targetElm = e.currentTarget as HTMLButtonElement;\n const targetRow = targetElm.closest('tr');\n targetRow.remove();\n const allRows = [...this.tableBody.querySelectorAll('tr')];\n\n allRows.map((elm, index) => {\n elm.setAttribute('index', `${index}`);\n });\n\n this.updateRowSelectDropdown();\n }\n\n checkInputTotal() {\n const allRows = this.tableBody.querySelectorAll('tr');\n\n if (this.totalInputLimit === 0 || allRows.length < 1) {\n this.showWarning = false;\n return;\n }\n\n let totalInput = 0;\n\n allRows.forEach(element => {\n const inputField = element.querySelector('pn-marketweb-input');\n if (inputField.value) {\n totalInput += parseInt(inputField.value) ?? 0;\n }\n });\n this.showWarning = totalInput > this.totalInputLimit ? true : false;\n }\n\n render() {\n return (\n <Host>\n <div class=\"dropdown-choice-form-row\">\n <pn-select\n ref={el => (this.pnRowSelectDropdown = el as HTMLElement)}\n name={this.addRowDropdownName}\n placeholder={this.addRowDropdownPlaceholder}\n label={this.addRowDropdownLabel}\n class=\"pn-row-select-dropdown\"\n >\n {this.rowSelectDropdownArr?.map((value: string) => <pn-option label={value} value={value}></pn-option>)}\n </pn-select>\n </div>\n <div class=\"dropdown-choice-form-row\">\n <table class=\"pn-dropdown-choice-table\">\n <thead ref={el => (this.tableHead = el as HTMLElement)}>\n {this.nextRowIndex === 0 ? null : (\n <tr>\n <th class=\"table-header--name\">\n <label>{this.rowNameLabel}</label>\n </th>\n {this.rowHasDropdown ? (\n <th class=\"table-header--dropdown\">\n <label>{this.rowDropdownLabel}</label>\n </th>\n ) : null}\n <th class=\"table-header--input\">\n <label>{this.rowInputLabel}</label>\n </th>\n <th class=\"table-header--delete\"></th>\n </tr>\n )}\n </thead>\n <tbody ref={el => (this.tableBody = el as HTMLElement)} class=\"pn-dropdown-choice-table-slot\">\n <slot></slot>\n </tbody>\n <tfoot>\n {this.showWarning ? (\n <tr>\n <td colSpan={this.columnCount}>\n <pn-icon icon={alert_exclamation_circle} small color=\"warning\"></pn-icon>\n <small class=\"dropdown-choice-error-message\">{this.inputLimitWarning}</small>\n </td>\n </tr>\n ) : null}\n </tfoot>\n </table>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-dropdown-choice-adds-row.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,0BAA0B,GAAG,igDAAigD,CAAC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C1E,CACF,IACH,IAAI,CACF,CACF,CACJ,CACD,EACP;KACH;;;;;;;;;;","names":["debounce","h","Host","alert_exclamation_circle"],"sources":["src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.scss?tag=pn-dropdown-choice-adds-row","src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-choice-adds-row {\n gap: 1rem;\n\n .dropdown-choice-form-row {\n display: flex;\n gap: 1rem;\n }\n\n .pn-row-select-dropdown {\n width: 50%;\n margin-bottom: 1rem;\n }\n\n @media only screen and (max-width: 640px) {\n .pn-row-select-dropdown {\n width: 100%;\n }\n }\n\n .pn-dropdown-choice-table {\n width: 100%;\n border-spacing: 0rem;\n\n thead {\n th {\n text-align: left;\n padding: 1rem 0.5rem;\n\n label {\n color: $gray700;\n font-size: 1.4rem;\n font-weight: 400;\n }\n }\n\n .table-header {\n &--name {\n width: 40%;\n }\n\n &--dropdown {\n width: 40%;\n }\n\n &--input {\n width: 10%;\n }\n\n &--delete {\n width: 10%;\n }\n }\n }\n\n tbody {\n td {\n padding: 0.5rem;\n }\n\n tr:nth-child(even) {\n background-color: #effbff;\n }\n\n .tr-delete {\n text-align: center;\n }\n }\n\n tfoot {\n td {\n small {\n color: $warning;\n vertical-align: middle;\n }\n\n pn-icon {\n margin-right: 0.25em;\n vertical-align: middle;\n }\n }\n }\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter } from '@stencil/core';\nimport { FormValue, RowValue, Root } from './types';\nimport debounce from 'debounce';\nimport { alert_exclamation_circle } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-choice-adds-row',\n styleUrl: 'pn-dropdown-choice-adds-row.scss',\n})\nexport class pnDropdownChoiceAddsRow {\n @Element() hostElement: Element;\n pnRowSelectDropdown: HTMLElement = null;\n tableHead: HTMLElement = null;\n tableBody: HTMLElement = null;\n private _dropdownData: Root[];\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() addRowDropdownName: string = '';\n @Prop() addRowDropdownPlaceholder: string = '';\n @Prop() addRowDropdownLabel: string = '';\n @Prop() rowNameLabel: string = '';\n @Prop() rowHasDropdown: boolean = true;\n @Prop() rowDropdownLabel: string = '';\n @Prop() rowDropdownPlaceholder: string = '';\n @Prop() rowInputLabel: string = '';\n @Prop() rowDeleteButtonText: string = '';\n @Prop() totalInputLimit: number = 0;\n @Prop() inputLimitWarning: string = null;\n\n @State() nextRowIndex: number = null;\n @State() rowSelectDropdownArr: string[] = null;\n @State() columnCount: number = null;\n @State() showWarning: boolean = false;\n @State() formValue: string = null;\n\n @Event() rowvalues: EventEmitter<string>;\n\n @Watch('dropdownData')\n dropdownDataWatcher() {\n if (typeof this.dropdownData === 'string') {\n this._dropdownData = JSON.parse(this.dropdownData);\n } else {\n this._dropdownData = this.dropdownData;\n }\n }\n\n componentWillLoad() {\n this.dropdownDataWatcher();\n }\n\n componentDidLoad() {\n this.setInitialValues();\n this.addEventHandlers();\n }\n\n addEventHandlers() {\n this.pnRowSelectDropdown.addEventListener('selectOption', debounce(this.addRowElement.bind(this), 500));\n }\n\n setInitialValues() {\n this.nextRowIndex = 0;\n this.columnCount = this.rowHasDropdown ? 4 : 3;\n this.setRowSelectDropdownArr();\n }\n\n setRowSelectDropdownArr() {\n this.rowSelectDropdownArr = [];\n this._dropdownData.forEach(element => {\n this.rowSelectDropdownArr.push(element.label);\n });\n }\n\n formRowEvent = e => {\n const debouncedAddValue = debounce(this.updateHiddenFieldValue.bind(this), 500);\n\n if (e.target.matches('input')) {\n ['change', 'keyup'].forEach(eventName => {\n e.target.addEventListener(eventName, debouncedAddValue);\n });\n } else {\n const rowDropdown = e.target.closest('.generated-table-row')?.querySelector('pn-select') as HTMLElement;\n if (rowDropdown) {\n rowDropdown.addEventListener('selectOption', debouncedAddValue);\n }\n }\n };\n\n updateHiddenFieldValue() {\n const allRows = [...this.tableBody.querySelectorAll('tr')];\n const columnValueCount = this.rowHasDropdown ? 3 : 2;\n const formValues: FormValue[] = [];\n\n if (allRows.length) {\n allRows.forEach(elm => {\n const row: FormValue = { row: [] };\n const nameElm = elm.querySelector('.tr-name');\n const dropdownElm = elm.querySelector('.tr-dropdown');\n const inputElm = elm.querySelector('.tr-input');\n\n const nameValue: RowValue = { name: this.rowNameLabel, value: nameElm?.innerHTML };\n row.row.push(nameValue);\n\n const dropdown = dropdownElm.querySelector('.current-selection');\n if (dropdown) {\n const dropdownSelection = dropdown.textContent ?? '';\n\n if (dropdownSelection.length) {\n const dropdownValue: RowValue = {\n name: this.rowDropdownLabel,\n value: dropdownSelection,\n };\n row.row.push(dropdownValue);\n }\n }\n if (!dropdown && columnValueCount === 3) {\n const dropdownValue: RowValue = {\n name: this.rowDropdownLabel,\n value: '',\n };\n row.row.push(dropdownValue);\n }\n\n const inputValue = parseInt(inputElm.querySelector('input')?.value ?? '0');\n if (inputValue > 0) {\n const inputColumnValue: RowValue = { name: this.rowInputLabel, value: inputValue.toString() };\n row.row.push(inputColumnValue);\n }\n\n if (row.row.length === columnValueCount) {\n formValues.push(row);\n }\n });\n }\n\n if (formValues.length && formValues.length === allRows.length) {\n const valueJsonString = JSON.stringify(formValues);\n this.formValue = `PN-JSON|${valueJsonString}`;\n } else {\n this.formValue = '';\n }\n\n this.rowvalues.emit(this.formValue);\n this.checkInputTotal();\n }\n\n addRowElement() {\n const selected = this.pnRowSelectDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n const slotElm = this.tableBody;\n const newRow = document.createElement('tr');\n newRow.setAttribute('index', `${this.nextRowIndex}`);\n newRow.setAttribute('class', 'generated-table-row');\n newRow.onclick = e => this.formRowEvent(e);\n const rowNameColumn = document.createElement('td');\n rowNameColumn.setAttribute('class', 'tr-name');\n rowNameColumn.innerHTML = selectedValue;\n rowNameColumn.dataset.name = selectedValue;\n newRow.appendChild(rowNameColumn);\n\n if (this.rowHasDropdown) {\n const rowDropdownColumn = this.createDropdownColumn(selectedValue);\n newRow.appendChild(rowDropdownColumn);\n }\n\n const rowInputColumn = this.createInputColumn(selectedValue);\n newRow.appendChild(rowInputColumn);\n const deleteButton = this.createDeleteButtonColumn();\n newRow.appendChild(deleteButton);\n\n slotElm.appendChild(newRow);\n this.updateRowSelectDropdown();\n this.nextRowIndex++;\n }\n\n getCurrentRow(selectedValue: string) {\n return this.hostElement.querySelectorAll(`.tr-name[data-name='${selectedValue}'`);\n }\n\n createDropdownColumn(selectedValue: string) {\n const dropdownColumn = document.createElement('td');\n dropdownColumn.setAttribute('class', 'tr-dropdown');\n const selectedItem = this._dropdownData.find(arr => arr.label === selectedValue);\n const selectedOptionValues = [];\n const currentRow = this.getCurrentRow(selectedValue);\n\n currentRow.forEach(row => {\n selectedOptionValues.push(row.parentElement?.querySelector('.tr-dropdown [aria-selected=true]')?.textContent);\n });\n\n if (Array.isArray(selectedItem.values) && selectedItem.values.length) {\n const dropdown = document.createElement('pn-select');\n dropdown.setAttribute('name', `${selectedValue}-dropdown`);\n dropdown.setAttribute('placeholder', this.rowDropdownPlaceholder);\n\n const filtereredValues = selectedItem.values.filter(item => !selectedOptionValues?.includes(item.value));\n\n filtereredValues.forEach(childItem => {\n const childOption = document.createElement('pn-option');\n childOption.setAttribute(\"label\", childItem.label);\n childOption.setAttribute(\"value\", childItem.label)\n dropdown.appendChild(childOption);\n });\n\n dropdownColumn.appendChild(dropdown);\n }\n\n return dropdownColumn;\n }\n\n createInputColumn(selectedValue: string) {\n const inputColumn = document.createElement('td');\n inputColumn.setAttribute('class', 'tr-input');\n const inputElm = document.createElement('pn-marketweb-input');\n inputElm.setAttribute('type', 'number');\n inputElm.setAttribute('name', `${selectedValue}-input`);\n inputElm.setAttribute('placeholder', '0');\n inputColumn.appendChild(inputElm);\n return inputColumn;\n }\n\n createDeleteButtonColumn() {\n const buttonColumn = document.createElement('td');\n buttonColumn.setAttribute('class', 'tr-delete');\n const buttonElm = document.createElement('pn-button');\n buttonElm.onclick = e => this.deleteRow(e);\n buttonElm.setAttribute('appearance', 'warning');\n buttonElm.setAttribute('small', 'true');\n buttonElm.appendChild(document.createTextNode(this.rowDeleteButtonText));\n buttonColumn.appendChild(buttonElm);\n return buttonColumn;\n }\n\n updateRowSelectDropdown() {\n type Row = { rowName: string; selectedValue: string; placeholder: string };\n\n const rows: Row[] = [].map.call(this.tableBody.querySelectorAll('.tr-name'), el => {\n const dropdownColumn = el?.parentElement?.querySelector('.tr-dropdown');\n const dropdownPlaceholder = dropdownColumn?.querySelector('.pn-select-content span')?.textContent;\n const row: Row = {\n rowName: el?.innerHTML,\n selectedValue: dropdownColumn?.querySelector('[aria-selected=true]')?.textContent,\n placeholder: dropdownPlaceholder,\n };\n return row;\n });\n\n if (rows.length) {\n this.rowSelectDropdownArr = [];\n\n this._dropdownData.forEach(element => {\n const filteredRows = rows.filter(row => row.rowName === element.label);\n const mainOptionReachedMaxPossibleRows =\n (element.values.length > 0 && filteredRows.length >= element.values.length) || (element.values.length === 0 && filteredRows.length === 1);\n if (!mainOptionReachedMaxPossibleRows) {\n this.rowSelectDropdownArr.push(element.label);\n }\n });\n } else {\n this.setRowSelectDropdownArr();\n }\n\n const selectOptions = this.pnRowSelectDropdown.querySelectorAll('pn-option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n\n const placeholder = this.pnRowSelectDropdown.querySelector('.pn-select-content span');\n placeholder.innerHTML = this.addRowDropdownPlaceholder;\n\n this.updateHiddenFieldValue();\n }\n\n deleteRow(e: Event) {\n e.preventDefault();\n this.nextRowIndex--;\n const targetElm = e.currentTarget as HTMLButtonElement;\n const targetRow = targetElm.closest('tr');\n targetRow.remove();\n const allRows = [...this.tableBody.querySelectorAll('tr')];\n\n allRows.map((elm, index) => {\n elm.setAttribute('index', `${index}`);\n });\n\n this.updateRowSelectDropdown();\n }\n\n checkInputTotal() {\n const allRows = this.tableBody.querySelectorAll('tr');\n\n if (this.totalInputLimit === 0 || allRows.length < 1) {\n this.showWarning = false;\n return;\n }\n\n let totalInput = 0;\n\n allRows.forEach(element => {\n const inputField = element.querySelector('pn-marketweb-input');\n if (inputField.value) {\n totalInput += parseInt(inputField.value) ?? 0;\n }\n });\n this.showWarning = totalInput > this.totalInputLimit ? true : false;\n }\n\n render() {\n return (\n <Host>\n <div class=\"dropdown-choice-form-row\">\n <pn-select\n ref={el => (this.pnRowSelectDropdown = el as HTMLElement)}\n name={this.addRowDropdownName}\n placeholder={this.addRowDropdownPlaceholder}\n label={this.addRowDropdownLabel}\n class=\"pn-row-select-dropdown\"\n empty-option=\"true\"\n >\n {this.rowSelectDropdownArr?.map((value: string) => <pn-option label={value} value={value}></pn-option>)}\n </pn-select>\n </div>\n <div class=\"dropdown-choice-form-row\">\n <table class=\"pn-dropdown-choice-table\">\n <thead ref={el => (this.tableHead = el as HTMLElement)}>\n {this.nextRowIndex === 0 ? null : (\n <tr>\n <th class=\"table-header--name\">\n <label>{this.rowNameLabel}</label>\n </th>\n {this.rowHasDropdown ? (\n <th class=\"table-header--dropdown\">\n <label>{this.rowDropdownLabel}</label>\n </th>\n ) : null}\n <th class=\"table-header--input\">\n <label>{this.rowInputLabel}</label>\n </th>\n <th class=\"table-header--delete\"></th>\n </tr>\n )}\n </thead>\n <tbody ref={el => (this.tableBody = el as HTMLElement)} class=\"pn-dropdown-choice-table-slot\">\n <slot></slot>\n </tbody>\n <tfoot>\n {this.showWarning ? (\n <tr>\n <td colSpan={this.columnCount}>\n <pn-icon icon={alert_exclamation_circle} small color=\"warning\"></pn-icon>\n <small class=\"dropdown-choice-error-message\">{this.inputLimitWarning}</small>\n </td>\n </tr>\n ) : null}\n </tfoot>\n </table>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -297,10 +297,10 @@ const PnDropdownWithMultiInputRows = class {
|
|
|
297
297
|
}
|
|
298
298
|
render() {
|
|
299
299
|
var _a, _b, _c, _d, _e, _f;
|
|
300
|
-
return (index.h(index.Host, { key: 'db917d14641b4a13e6ed4d3a56f4b9ea52a8e0c1', class: "dropdown-with-multi-input-elemet" }, index.h("div", { key: 'bdc73044cdb1e6a791b9965086971ecbb796719d', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: 'b605ca3179d5884577c78abddf1b9a572a78b927' }, index.h("pn-select", { key: '
|
|
300
|
+
return (index.h(index.Host, { key: 'db917d14641b4a13e6ed4d3a56f4b9ea52a8e0c1', class: "dropdown-with-multi-input-elemet" }, index.h("div", { key: 'bdc73044cdb1e6a791b9965086971ecbb796719d', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: 'b605ca3179d5884577c78abddf1b9a572a78b927' }, index.h("pn-select", { key: 'fd3a84a88a5fb2eb1cae9288b2750f495d10f75d', ref: el => (this.pnFirstDropdown = el), class: "pn-row-select-dropdown dropDown1-dropdown", label: this.firstDropdownLabel, "empty-option": "true" }, (_a = this.dropdownDataRoot) === null || _a === void 0 ? void 0 : _a.map((item, i) => (index.h("pn-option", { index: i, label: item.value, value: item.value, selected: item.checked, onClick: index$1.debounce(this.handleFirstDropdown.bind(this), 500) })))), ((_b = this.firstDropdownHelperText) === null || _b === void 0 ? void 0 : _b.length) ? index.h("small", null, this.firstDropdownHelperText) : null)), index.h("div", { key: '8b44e50e1460925caec54bd4013ee38420d66761', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: '5a0c06493c7a1176f0a98df2742766d876b2c605' }, index.h("pn-select", { key: '7bcd69a360ef76ff93f610fe8f8d3a2346838538', ref: el => (this.pnSecondDropdown = el), class: "pn-row-select-dropdown dropDown2-dropdown", label: this.secondDropdownLabel, "empty-option": "true" }, (_c = this.secondDropdownArr) === null || _c === void 0 ? void 0 : _c.map((item, i) => (index.h("pn-option", { index: i, label: item, value: item, selected: item === this._secondDropdownSelection, onClick: index$1.debounce(this.handleSecondDropdown.bind(this), 500) })))), ((_d = this.secondDropdownHelperText) === null || _d === void 0 ? void 0 : _d.length) ? index.h("small", null, this.secondDropdownHelperText) : null)), this.showDelteConfirm ? (index.h("div", { class: "dropdown-with-multi-input-elemet__delete" }, index.h("p", null, this.deleteMultipleRowsWarningText), index.h("pn-button", { ref: el => (this.pnConfirmDeleteButton = el), small: "true", appearance: "warning", onClick: this.deleteExcessRows.bind(this) }, this.confirmDeleteButtonText), index.h("pn-button", { ref: el => (this.pnAbortDeleteButton = el), small: "true", appearance: "light", onClick: this.abortDeleteRows.bind(this) }, this.abortDeleteButtonText))) : null, index.h("div", { key: '442d4cb2e1929663d3c684ae2b8144354d6c1ca3', class: "dropdown-with-multi-input-elemet__label-row" }, index.h("div", { key: '67ea3ffdd6145f4f54196c2d4661f44172ca862b', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '5f67d7f607818ef0734da82ec2319ff09a6e22aa' }, this.fristInputLabel)), index.h("div", { key: '191274165ed68bc8d15192e1bae9fe0b51cfabfa', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '03b4feed9670e23d437c180be328638a6818d683' }, this.secondInputLabel)), index.h("div", { key: '0ada8f9bb65f5328243b284717dd237a624a15bd', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: 'bb453907c1d3ede20e707799b194826fbbeffa71' }, this.dateLabel))), (_e = this.rowData) === null || _e === void 0 ? void 0 :
|
|
301
301
|
_e.map((data, i) => {
|
|
302
302
|
return (index.h("div", { class: 'dropdown-with-multi-input-elemet__row generated-row-' + i, id: 'generated-row-' + i }, index.h("pn-dropdown-with-multi-input-rows-row", { "language-code": this.languageCode, "frist-input-placeholder": this.fristInputPlaceholder, "first-input-min": this.firstInputMin, "first-input-max": this.firstInputMax, "first-input-warning": this.firstInputWarning, "first-input-warning-text": this.firstInputWarningText, "first-input-low-error-text": this.firstInputLowErrorText, "first-input-high-error-text": this.firstInputHighErrorText, "second-input-placeholder": this.secondInputPlaceholder, "second-input-min": this.secondInputMin, "second-input-max": this.secondInputMax, "second-input-warning": this.secondInputWarning, "second-input-warning-text": this.secondInputWarningText, "second-input-low-error-text": this.secondInputLowErrorText, "second-input-high-error-text": this.secondInputHighErrorText, datePlaceholder: this.datePlaceholder, firstValidDate: this.firstValidDateString, lastValidDate: this.lastValidDateString, "predefined-value": JSON.stringify(data), "min-row-count": this.minRowCount, "row-index": i })));
|
|
303
|
-
}), index.h("div", { key: '
|
|
303
|
+
}), index.h("div", { key: 'f82a77eb8e120440084210f5cdec604a5dd05172', class: "dropdown-with-multi-input-elemet__row sum-row" }, index.h("pn-marketweb-input", { key: '8197ba89d43c00fa04bd81c33a5e36dbca40b255', disabled: true, ref: el => (this.pnSumField = el), type: "number", value: this.rowSum, label: this.sumFieldLabel }), index.h("pn-button", { key: '6c11671b82b65dbf541d2b85c5dc79f437a62d67', tooltip: this.addRowText ? this.addRowText : null, "left-icon": "true", arialabel: "Add", icon: plus.plus, appearance: "light", variant: "borderless", class: "connected-dropdown__button-right", onClick: () => {
|
|
304
304
|
this.addRow(this.generateUniqueId());
|
|
305
305
|
} }, this.addRowText)), ((_f = this.elementHelperText) === null || _f === void 0 ? void 0 : _f.length) ? index.h("div", { class: "dropdown-with-multi-input-elemet__row" }, this.elementHelperText) : null));
|
|
306
306
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pn-dropdown-with-multi-input-rows.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,+BAA+B,GAAG,guBAAguB,CAAC;AACzwB,2CAAe,+BAA+B;;MCSjC,4BAA4B;;;;QAEvC,oBAAe,GAAgB,IAAI,CAAC;QACpC,qBAAgB,GAAgB,IAAI,CAAC;QACrC,eAAU,GAAgB,IAAI,CAAC;QAC/B,0BAAqB,GAAgB,IAAI,CAAC;QAC1C,wBAAmB,GAAgB,IAAI,CAAC;QAiDhC,4BAAuB,GAAW,IAAI,CAAC;QACvC,6BAAwB,GAAW,IAAI,CAAC;QAExC,gBAAW,GAAqB;YACtC,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAC3B,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC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AAwB,EAC3D,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,cAAc,EAAE,IAAI,CAAC,oBAAoB,EACzC,aAAa,EAAE,IAAI,CAAC,mBAAmB,sBACrB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBACvB,IAAI,CAAC,WAAW,eACpB,CAAC,GAC2B,CACrC,EACN;aACH,CAAC,EAEFA,kEAAK,KAAK,EAAC,+CAA+C,IACxDA,iFAAoB,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,UAAU,GAAG,EAAiB,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,GAAuB,EAExKA,wEACE,OAAO,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,eACvC,MAAM,EAChB,SAAS,EAAC,KAAK,EACf,IAAI,EAAEG,SAAI,EACV,UAAU,EAAC,OAAO,EAClB,OAAO,EAAC,YAAY,EACpB,KAAK,EAAC,kCAAkC,EACxC,OAAO,EAAE;gBACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;aACtC,IAEA,IAAI,CAAC,UAAU,CACN,CACR,EAEL,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,MAAM,IAAGH,iBAAK,KAAK,EAAC,uCAAuC,IAAE,IAAI,CAAC,iBAAiB,CAAO,GAAG,IAAI,CACrH,EACP;KACH;;;;;;;","names":["uuidv4","h","Host","debounce","plus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.scss?tag=pn-dropdown-with-multi-input-rows","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows {\n .dropdown-with-multi-input-elemet {\n &__row {\n margin-bottom: 1rem;\n }\n\n &__delete {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n padding: 1rem;\n background-color: $gray25;\n\n pn-button {\n margin-top: 0.9rem;\n }\n }\n\n &__label-row {\n display: flex;\n gap: 1rem;\n }\n\n &__label {\n width: 30%;\n font-size: 0.875em;\n color: #5e554a;\n }\n }\n\n .sum-row {\n display: flex;\n justify-content: space-between;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport { v4 as uuidv4 } from 'uuid';\nimport debounce from 'debounce';\nimport { plus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows',\n styleUrl: 'pn-dropdown-with-multi-input-rows.scss',\n})\nexport class PnDropdownWithMultiInputRows {\n @Element() hostElement: Element;\n pnFirstDropdown: HTMLElement = null;\n pnSecondDropdown: HTMLElement = null;\n pnSumField: HTMLElement = null;\n pnConfirmDeleteButton: HTMLElement = null;\n pnAbortDeleteButton: HTMLElement = null;\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() firstDropdownLabel: string = null;\n @Prop() firstDropdownHelperText: string = null;\n @Prop() secondDropdownLabel: string = null;\n @Prop() secondDropdownHelperText: string = null;\n @Prop() secondDropdownMax: number = null;\n @Prop() deleteMultipleRowsWarningText: string = null;\n @Prop() confirmDeleteButtonText: string = null;\n @Prop() abortDeleteButtonText: string = null;\n @Prop() fristInputLabel: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputLabel: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() dateDaysFromToday: number = 1;\n @Prop() yearsToAddToEndDate: number = null;\n @Prop() sumFieldLabel: string = null;\n @Prop() addRowText: string = null;\n @Prop() elementHelperText: string = null;\n\n @State() dropdownDataRoot: Root[] = null;\n @State() secondDropdownArr: number[] = [];\n @State() rowCount: number = null;\n @State() rowData: PredefinedValues[] = null;\n @State() formValues: FormValue[] = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n @State() rowSum: string = null;\n @State() minRowCount: number = null;\n @State() showDelteConfirm: boolean = false;\n\n @Event() allFormValues: EventEmitter<string>;\n\n private _firstDropdownSelection: string = null;\n private _secondDropdownSelection: number = null;\n\n private _defaultRow: PredefinedValues = {\n id: this.generateUniqueId(),\n firstInput: '',\n secondInput: this.secondInputWarning.toString(),\n date: '',\n };\n\n componentWillLoad() {\n this.formValues = [];\n this.setDropDownData();\n this.updateSecondDropdown();\n this.setRowData();\n this.setFirstValidDate();\n }\n\n componentDidLoad() {\n this.updateSum();\n }\n\n setDropDownData() {\n if (typeof this.dropdownData === 'string') {\n this.dropdownDataRoot = JSON.parse(this.dropdownData);\n } else {\n this.dropdownDataRoot = this.dropdownData;\n }\n\n if (this.dropdownDataRoot?.length) {\n this.dropdownDataRoot.forEach(element => {\n if (!element.value) {\n element.value = 0;\n }\n });\n }\n\n if (this.dropdownDataRoot.length > 0) {\n this.dropdownDataRoot[0].checked = true;\n this._firstDropdownSelection = this.dropdownDataRoot[0].label;\n this._secondDropdownSelection = this.dropdownDataRoot[0].value;\n this.minRowCount = this.dropdownDataRoot[0].value;\n }\n }\n\n updateSecondDropdown() {\n const selectedItem = this.dropdownDataRoot.find(arr => arr.checked === true);\n this.secondDropdownArr = [];\n\n for (let index = selectedItem.value; index <= this.secondDropdownMax; index++) {\n this.secondDropdownArr.push(index);\n }\n }\n\n updateSelectItemArr(arr: Root[], caption: string) {\n arr.forEach(item => {\n if (item.label === caption) {\n item.checked = !item.checked;\n } else {\n item.checked = false;\n }\n });\n return arr;\n }\n\n setRowData() {\n this.rowData = [];\n for (let index = 0; index < this._secondDropdownSelection; index++) {\n const row = Object.assign({}, this._defaultRow);\n row.id = this.generateUniqueId();\n this.rowData = [...this.rowData, row];\n }\n\n this.rowCount = this.rowData.length;\n }\n\n generateUniqueId() {\n return uuidv4();\n }\n\n setFirstValidDate() {\n const yearsToadd = this.yearsToAddToEndDate ? this.yearsToAddToEndDate : 2;\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + yearsToadd;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n addRow(newRowId: string) {\n const newRow = Object.assign({}, this.rowData[0]);\n newRow.id = newRowId ? newRowId : this.generateUniqueId();\n newRow.date = '';\n this.rowData = [...this.rowData, newRow];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleFirstDropdown() {\n const selected = this.pnFirstDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n this.dropdownDataRoot.forEach(element => {\n element.checked = false;\n });\n\n const selectionRoot = this.dropdownDataRoot.find(x => x.label === selectedValue);\n selectionRoot.checked = true;\n this._firstDropdownSelection = selectionRoot.label;\n this.minRowCount = selectionRoot.value;\n\n if (selectionRoot.value > this._secondDropdownSelection) {\n this.dropdownDataRoot = [...this.dropdownDataRoot];\n\n for (let index = this.rowCount; index < selectionRoot.value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n\n this.updateSecondDropdown();\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleSecondDropdown() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n const value = parseInt(selectedValue);\n if (value < this._secondDropdownSelection) {\n this.showDelteConfirm = true;\n } else {\n for (let index = this.rowCount; index < value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n @Listen('rowValueChange')\n @Listen('firstInputChange')\n @Listen('secondInputChange')\n predefinedValueChange(e) {\n const indexToUpdate = this.rowData.findIndex(data => data.id === e.detail.id);\n const val: PredefinedValues = e.detail;\n this.rowData[indexToUpdate] = {\n ...this.rowData[indexToUpdate],\n firstInput: val.firstInput,\n secondInput: val.secondInput,\n date: val.date,\n };\n\n if (e.type === 'firstInputChange' && indexToUpdate === 0) {\n this.updateFirstInputOfRows(val.firstInput);\n }\n\n if (e.type === 'secondInputChange' && indexToUpdate === 0) {\n this.updateSecondInputOfRows(val.secondInput);\n }\n\n this.rowData = [...this.rowData];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateFirstInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n firstInput: value,\n };\n }\n }\n\n updateSecondInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n secondInput: value,\n };\n }\n }\n\n @Listen('deleteRowEvent')\n deleteRowEvent(e) {\n const indexToRemove = this.rowData.findIndex(data => data.id === e.detail);\n if (indexToRemove < 0) {\n return;\n }\n\n this.rowData.splice(indexToRemove, 1);\n this.rowData = [...this.rowData];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateSum() {\n this.rowSum = '';\n let sum = 0;\n this.rowData.forEach(element => {\n if (element?.firstInput?.length) {\n sum += parseInt(element.firstInput);\n }\n });\n\n this.rowSum = sum.toString();\n }\n\n deleteExcessRows() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n const rowsToDelete = this.rowCount - parseInt(selectedValue);\n for (let index = 0; index < rowsToDelete; index++) {\n this.rowData.pop();\n }\n this.rowData = [...this.rowData];\n this.showDelteConfirm = false;\n this.updateSum();\n }\n\n abortDeleteRows() {\n this.showDelteConfirm = false;\n }\n\n emitValuesIfValid() {\n this.formValues = [];\n this.rowData.forEach(item => {\n const rowValue: FormValue = { row: [] };\n\n if (this._firstDropdownSelection?.length) {\n const dropDownValue: RowValue = { name: this.firstDropdownLabel, value: this._firstDropdownSelection };\n rowValue.row.push(dropDownValue);\n }\n\n if (item.firstInput?.length) {\n const firstInputValue: RowValue = { name: this.fristInputLabel, value: item.firstInput };\n rowValue.row.push(firstInputValue);\n }\n\n if (item.secondInput?.length) {\n const secondInputValue: RowValue = { name: this.secondInputLabel, value: item.secondInput };\n rowValue.row.push(secondInputValue);\n }\n\n if (item.date?.length) {\n const dateValue: RowValue = { name: this.dateLabel, value: item.date };\n rowValue.row.push(dateValue);\n }\n\n if (rowValue.row.length === 4) {\n this.formValues.push(rowValue);\n }\n });\n\n if (this.formValues.length === this.rowData.length) {\n const valueJsonString = JSON.stringify(this.formValues);\n this.allFormValues.emit(valueJsonString);\n } else {\n this.allFormValues.emit('');\n }\n }\n\n render() {\n return (\n <Host class=\"dropdown-with-multi-input-elemet\">\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnFirstDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown1-dropdown\" label={this.firstDropdownLabel}>\n {this.dropdownDataRoot?.map((item, i) => (\n <pn-option index={i} label={item.value} value={item.value} selected={item.checked} onClick={debounce(this.handleFirstDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.firstDropdownHelperText?.length ? <small>{this.firstDropdownHelperText}</small> : null}\n </div>\n </div>\n\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnSecondDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown2-dropdown\" label={this.secondDropdownLabel}>\n {this.secondDropdownArr?.map((item, i) => (\n <pn-option index={i} label={item} value={item} selected={item === this._secondDropdownSelection} onClick={debounce(this.handleSecondDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.secondDropdownHelperText?.length ? <small>{this.secondDropdownHelperText}</small> : null}\n </div>\n </div>\n\n {this.showDelteConfirm ? (\n <div class=\"dropdown-with-multi-input-elemet__delete\">\n <p>{this.deleteMultipleRowsWarningText}</p>\n <pn-button ref={el => (this.pnConfirmDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"warning\" onClick={this.deleteExcessRows.bind(this)}>\n {this.confirmDeleteButtonText}\n </pn-button>\n <pn-button ref={el => (this.pnAbortDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"light\" onClick={this.abortDeleteRows.bind(this)}>\n {this.abortDeleteButtonText}\n </pn-button>\n </div>\n ) : null}\n\n <div class=\"dropdown-with-multi-input-elemet__label-row\">\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.fristInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.secondInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.dateLabel}</label>\n </div>\n </div>\n\n {this.rowData?.map((data, i) => {\n return (\n <div class={'dropdown-with-multi-input-elemet__row generated-row-' + i} id={'generated-row-' + i}>\n <pn-dropdown-with-multi-input-rows-row\n language-code={this.languageCode}\n frist-input-placeholder={this.fristInputPlaceholder}\n first-input-min={this.firstInputMin}\n first-input-max={this.firstInputMax}\n first-input-warning={this.firstInputWarning}\n first-input-warning-text={this.firstInputWarningText}\n first-input-low-error-text={this.firstInputLowErrorText}\n first-input-high-error-text={this.firstInputHighErrorText}\n second-input-placeholder={this.secondInputPlaceholder}\n second-input-min={this.secondInputMin}\n second-input-max={this.secondInputMax}\n second-input-warning={this.secondInputWarning}\n second-input-warning-text={this.secondInputWarningText}\n second-input-low-error-text={this.secondInputLowErrorText}\n second-input-high-error-text={this.secondInputHighErrorText}\n datePlaceholder={this.datePlaceholder}\n firstValidDate={this.firstValidDateString}\n lastValidDate={this.lastValidDateString}\n predefined-value={JSON.stringify(data)}\n min-row-count={this.minRowCount}\n row-index={i}\n ></pn-dropdown-with-multi-input-rows-row>\n </div>\n );\n })}\n\n <div class=\"dropdown-with-multi-input-elemet__row sum-row\">\n <pn-marketweb-input disabled={true} ref={el => (this.pnSumField = el as HTMLElement)} type=\"number\" value={this.rowSum} label={this.sumFieldLabel}></pn-marketweb-input>\n\n <pn-button\n tooltip={this.addRowText ? this.addRowText : null}\n left-icon=\"true\"\n arialabel=\"Add\"\n icon={plus}\n appearance=\"light\"\n variant=\"borderless\"\n class=\"connected-dropdown__button-right\"\n onClick={() => {\n this.addRow(this.generateUniqueId());\n }}\n >\n {this.addRowText}\n </pn-button>\n </div>\n\n {this.elementHelperText?.length ? <div class=\"dropdown-with-multi-input-elemet__row\">{this.elementHelperText}</div> : null}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pn-dropdown-with-multi-input-rows.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,+BAA+B,GAAG,guBAAguB,CAAC;AACzwB,2CAAe,+BAA+B;;MCSjC,4BAA4B;;;;QAEvC,oBAAe,GAAgB,IAAI,CAAC;QACpC,qBAAgB,GAAgB,IAAI,CAAC;QACrC,eAAU,GAAgB,IAAI,CAAC;QAC/B,0BAAqB,GAAgB,IAAI,CAAC;QAC1C,wBAAmB,GAAgB,IAAI,CAAC;QAiDhC,4BAAuB,GAAW,IAAI,CAAC;QACvC,6BAAwB,GAAW,IAAI,CAAC;QAExC,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C,IAAI,CAAC,cAAc,sBACnB,IAAI,CAAC,cAAc,0BACf,IAAI,CAAC,kBAAkB,+BAClB,IAAI,CAAC,sBAAsB,iCACzB,IAAI,CAAC,uBAAuB,kCAC3B,IAAI,CAAC,wBAAwB,EAC3D,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,cAAc,EAAE,IAAI,CAAC,oBAAoB,EACzC,aAAa,EAAE,IAAI,CAAC,mBAAmB,sBACrB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBACvB,IAAI,CAAC,WAAW,eACpB,CAAC,GAC2B,CACrC,EACN;aACH,CAAC,EAEFA,kEAAK,KAAK,EAAC,+CAA+C,IACxDA,iFAAoB,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,UAAU,GAAG,EAAiB,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,GAAuB,EAExKA,wEACE,OAAO,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,eACvC,MAAM,EAChB,SAAS,EAAC,KAAK,EACf,IAAI,EAAEG,SAAI,EACV,UAAU,EAAC,OAAO,EAClB,OAAO,EAAC,YAAY,EACpB,KAAK,EAAC,kCAAkC,EACxC,OAAO,EAAE;gBACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;aACtC,IAEA,IAAI,CAAC,UAAU,CACN,CACR,EAEL,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,MAAM,IAAGH,iBAAK,KAAK,EAAC,uCAAuC,IAAE,IAAI,CAAC,iBAAiB,CAAO,GAAG,IAAI,CACrH,EACP;KACH;;;;;;;","names":["uuidv4","h","Host","debounce","plus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.scss?tag=pn-dropdown-with-multi-input-rows","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows {\n .dropdown-with-multi-input-elemet {\n &__row {\n margin-bottom: 1rem;\n }\n\n &__delete {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n padding: 1rem;\n background-color: $gray25;\n\n pn-button {\n margin-top: 0.9rem;\n }\n }\n\n &__label-row {\n display: flex;\n gap: 1rem;\n }\n\n &__label {\n width: 30%;\n font-size: 0.875em;\n color: #5e554a;\n }\n }\n\n .sum-row {\n display: flex;\n justify-content: space-between;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport { v4 as uuidv4 } from 'uuid';\nimport debounce from 'debounce';\nimport { plus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows',\n styleUrl: 'pn-dropdown-with-multi-input-rows.scss',\n})\nexport class PnDropdownWithMultiInputRows {\n @Element() hostElement: Element;\n pnFirstDropdown: HTMLElement = null;\n pnSecondDropdown: HTMLElement = null;\n pnSumField: HTMLElement = null;\n pnConfirmDeleteButton: HTMLElement = null;\n pnAbortDeleteButton: HTMLElement = null;\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() firstDropdownLabel: string = null;\n @Prop() firstDropdownHelperText: string = null;\n @Prop() secondDropdownLabel: string = null;\n @Prop() secondDropdownHelperText: string = null;\n @Prop() secondDropdownMax: number = null;\n @Prop() deleteMultipleRowsWarningText: string = null;\n @Prop() confirmDeleteButtonText: string = null;\n @Prop() abortDeleteButtonText: string = null;\n @Prop() fristInputLabel: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputLabel: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() dateDaysFromToday: number = 1;\n @Prop() yearsToAddToEndDate: number = null;\n @Prop() sumFieldLabel: string = null;\n @Prop() addRowText: string = null;\n @Prop() elementHelperText: string = null;\n\n @State() dropdownDataRoot: Root[] = null;\n @State() secondDropdownArr: number[] = [];\n @State() rowCount: number = null;\n @State() rowData: PredefinedValues[] = null;\n @State() formValues: FormValue[] = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n @State() rowSum: string = null;\n @State() minRowCount: number = null;\n @State() showDelteConfirm: boolean = false;\n\n @Event() allFormValues: EventEmitter<string>;\n\n private _firstDropdownSelection: string = null;\n private _secondDropdownSelection: number = null;\n\n private _defaultRow: PredefinedValues = {\n id: this.generateUniqueId(),\n firstInput: '',\n secondInput: this.secondInputWarning.toString(),\n date: '',\n };\n\n componentWillLoad() {\n this.formValues = [];\n this.setDropDownData();\n this.updateSecondDropdown();\n this.setRowData();\n this.setFirstValidDate();\n }\n\n componentDidLoad() {\n this.updateSum();\n }\n\n setDropDownData() {\n if (typeof this.dropdownData === 'string') {\n this.dropdownDataRoot = JSON.parse(this.dropdownData);\n } else {\n this.dropdownDataRoot = this.dropdownData;\n }\n\n if (this.dropdownDataRoot?.length) {\n this.dropdownDataRoot.forEach(element => {\n if (!element.value) {\n element.value = 0;\n }\n });\n }\n\n if (this.dropdownDataRoot.length > 0) {\n this.dropdownDataRoot[0].checked = true;\n this._firstDropdownSelection = this.dropdownDataRoot[0].label;\n this._secondDropdownSelection = this.dropdownDataRoot[0].value;\n this.minRowCount = this.dropdownDataRoot[0].value;\n }\n }\n\n updateSecondDropdown() {\n const selectedItem = this.dropdownDataRoot.find(arr => arr.checked === true);\n this.secondDropdownArr = [];\n\n for (let index = selectedItem.value; index <= this.secondDropdownMax; index++) {\n this.secondDropdownArr.push(index);\n }\n }\n\n updateSelectItemArr(arr: Root[], caption: string) {\n arr.forEach(item => {\n if (item.label === caption) {\n item.checked = !item.checked;\n } else {\n item.checked = false;\n }\n });\n return arr;\n }\n\n setRowData() {\n this.rowData = [];\n for (let index = 0; index < this._secondDropdownSelection; index++) {\n const row = Object.assign({}, this._defaultRow);\n row.id = this.generateUniqueId();\n this.rowData = [...this.rowData, row];\n }\n\n this.rowCount = this.rowData.length;\n }\n\n generateUniqueId() {\n return uuidv4();\n }\n\n setFirstValidDate() {\n const yearsToadd = this.yearsToAddToEndDate ? this.yearsToAddToEndDate : 2;\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + yearsToadd;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n addRow(newRowId: string) {\n const newRow = Object.assign({}, this.rowData[0]);\n newRow.id = newRowId ? newRowId : this.generateUniqueId();\n newRow.date = '';\n this.rowData = [...this.rowData, newRow];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleFirstDropdown() {\n const selected = this.pnFirstDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n this.dropdownDataRoot.forEach(element => {\n element.checked = false;\n });\n\n const selectionRoot = this.dropdownDataRoot.find(x => x.label === selectedValue);\n selectionRoot.checked = true;\n this._firstDropdownSelection = selectionRoot.label;\n this.minRowCount = selectionRoot.value;\n\n if (selectionRoot.value > this._secondDropdownSelection) {\n this.dropdownDataRoot = [...this.dropdownDataRoot];\n\n for (let index = this.rowCount; index < selectionRoot.value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n\n this.updateSecondDropdown();\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleSecondDropdown() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n const value = parseInt(selectedValue);\n if (value < this._secondDropdownSelection) {\n this.showDelteConfirm = true;\n } else {\n for (let index = this.rowCount; index < value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n @Listen('rowValueChange')\n @Listen('firstInputChange')\n @Listen('secondInputChange')\n predefinedValueChange(e) {\n const indexToUpdate = this.rowData.findIndex(data => data.id === e.detail.id);\n const val: PredefinedValues = e.detail;\n this.rowData[indexToUpdate] = {\n ...this.rowData[indexToUpdate],\n firstInput: val.firstInput,\n secondInput: val.secondInput,\n date: val.date,\n };\n\n if (e.type === 'firstInputChange' && indexToUpdate === 0) {\n this.updateFirstInputOfRows(val.firstInput);\n }\n\n if (e.type === 'secondInputChange' && indexToUpdate === 0) {\n this.updateSecondInputOfRows(val.secondInput);\n }\n\n this.rowData = [...this.rowData];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateFirstInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n firstInput: value,\n };\n }\n }\n\n updateSecondInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n secondInput: value,\n };\n }\n }\n\n @Listen('deleteRowEvent')\n deleteRowEvent(e) {\n const indexToRemove = this.rowData.findIndex(data => data.id === e.detail);\n if (indexToRemove < 0) {\n return;\n }\n\n this.rowData.splice(indexToRemove, 1);\n this.rowData = [...this.rowData];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateSum() {\n this.rowSum = '';\n let sum = 0;\n this.rowData.forEach(element => {\n if (element?.firstInput?.length) {\n sum += parseInt(element.firstInput);\n }\n });\n\n this.rowSum = sum.toString();\n }\n\n deleteExcessRows() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n const rowsToDelete = this.rowCount - parseInt(selectedValue);\n for (let index = 0; index < rowsToDelete; index++) {\n this.rowData.pop();\n }\n this.rowData = [...this.rowData];\n this.showDelteConfirm = false;\n this.updateSum();\n }\n\n abortDeleteRows() {\n this.showDelteConfirm = false;\n }\n\n emitValuesIfValid() {\n this.formValues = [];\n this.rowData.forEach(item => {\n const rowValue: FormValue = { row: [] };\n\n if (this._firstDropdownSelection?.length) {\n const dropDownValue: RowValue = { name: this.firstDropdownLabel, value: this._firstDropdownSelection };\n rowValue.row.push(dropDownValue);\n }\n\n if (item.firstInput?.length) {\n const firstInputValue: RowValue = { name: this.fristInputLabel, value: item.firstInput };\n rowValue.row.push(firstInputValue);\n }\n\n if (item.secondInput?.length) {\n const secondInputValue: RowValue = { name: this.secondInputLabel, value: item.secondInput };\n rowValue.row.push(secondInputValue);\n }\n\n if (item.date?.length) {\n const dateValue: RowValue = { name: this.dateLabel, value: item.date };\n rowValue.row.push(dateValue);\n }\n\n if (rowValue.row.length === 4) {\n this.formValues.push(rowValue);\n }\n });\n\n if (this.formValues.length === this.rowData.length) {\n const valueJsonString = JSON.stringify(this.formValues);\n this.allFormValues.emit(valueJsonString);\n } else {\n this.allFormValues.emit('');\n }\n }\n\n render() {\n return (\n <Host class=\"dropdown-with-multi-input-elemet\">\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnFirstDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown1-dropdown\" label={this.firstDropdownLabel} empty-option=\"true\">\n {this.dropdownDataRoot?.map((item, i) => (\n <pn-option index={i} label={item.value} value={item.value} selected={item.checked} onClick={debounce(this.handleFirstDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.firstDropdownHelperText?.length ? <small>{this.firstDropdownHelperText}</small> : null}\n </div>\n </div>\n\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnSecondDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown2-dropdown\" label={this.secondDropdownLabel} empty-option=\"true\">\n {this.secondDropdownArr?.map((item, i) => (\n <pn-option index={i} label={item} value={item} selected={item === this._secondDropdownSelection} onClick={debounce(this.handleSecondDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.secondDropdownHelperText?.length ? <small>{this.secondDropdownHelperText}</small> : null}\n </div>\n </div>\n\n {this.showDelteConfirm ? (\n <div class=\"dropdown-with-multi-input-elemet__delete\">\n <p>{this.deleteMultipleRowsWarningText}</p>\n <pn-button ref={el => (this.pnConfirmDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"warning\" onClick={this.deleteExcessRows.bind(this)}>\n {this.confirmDeleteButtonText}\n </pn-button>\n <pn-button ref={el => (this.pnAbortDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"light\" onClick={this.abortDeleteRows.bind(this)}>\n {this.abortDeleteButtonText}\n </pn-button>\n </div>\n ) : null}\n\n <div class=\"dropdown-with-multi-input-elemet__label-row\">\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.fristInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.secondInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.dateLabel}</label>\n </div>\n </div>\n\n {this.rowData?.map((data, i) => {\n return (\n <div class={'dropdown-with-multi-input-elemet__row generated-row-' + i} id={'generated-row-' + i}>\n <pn-dropdown-with-multi-input-rows-row\n language-code={this.languageCode}\n frist-input-placeholder={this.fristInputPlaceholder}\n first-input-min={this.firstInputMin}\n first-input-max={this.firstInputMax}\n first-input-warning={this.firstInputWarning}\n first-input-warning-text={this.firstInputWarningText}\n first-input-low-error-text={this.firstInputLowErrorText}\n first-input-high-error-text={this.firstInputHighErrorText}\n second-input-placeholder={this.secondInputPlaceholder}\n second-input-min={this.secondInputMin}\n second-input-max={this.secondInputMax}\n second-input-warning={this.secondInputWarning}\n second-input-warning-text={this.secondInputWarningText}\n second-input-low-error-text={this.secondInputLowErrorText}\n second-input-high-error-text={this.secondInputHighErrorText}\n datePlaceholder={this.datePlaceholder}\n firstValidDate={this.firstValidDateString}\n lastValidDate={this.lastValidDateString}\n predefined-value={JSON.stringify(data)}\n min-row-count={this.minRowCount}\n row-index={i}\n ></pn-dropdown-with-multi-input-rows-row>\n </div>\n );\n })}\n\n <div class=\"dropdown-with-multi-input-elemet__row sum-row\">\n <pn-marketweb-input disabled={true} ref={el => (this.pnSumField = el as HTMLElement)} type=\"number\" value={this.rowSum} label={this.sumFieldLabel}></pn-marketweb-input>\n\n <pn-button\n tooltip={this.addRowText ? this.addRowText : null}\n left-icon=\"true\"\n arialabel=\"Add\"\n icon={plus}\n appearance=\"light\"\n variant=\"borderless\"\n class=\"connected-dropdown__button-right\"\n onClick={() => {\n this.addRow(this.generateUniqueId());\n }}\n >\n {this.addRowText}\n </pn-button>\n </div>\n\n {this.elementHelperText?.length ? <div class=\"dropdown-with-multi-input-elemet__row\">{this.elementHelperText}</div> : null}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -144,12 +144,12 @@ const PnMultiRowConnectedDropdownRow = class {
|
|
|
144
144
|
setDateValue() {
|
|
145
145
|
var _a, _b, _c;
|
|
146
146
|
if (this.allowMultipleDates) {
|
|
147
|
-
this.pnDateRangeContainer.style.display = ((_a = this._predefinedValue.dates) === null || _a === void 0 ? void 0 : _a.length) ? '' : 'none';
|
|
148
|
-
this.generatedDatesArr = ((_b = this._predefinedValue.dates) === null || _b === void 0 ? void 0 : _b.length) ? this._predefinedValue.dates.split(',') : [];
|
|
147
|
+
this.pnDateRangeContainer.style.display = ((_a = this._predefinedValue.dates["start"]) === null || _a === void 0 ? void 0 : _a.length) ? '' : 'none';
|
|
148
|
+
this.generatedDatesArr = ((_b = this._predefinedValue.dates["start"]) === null || _b === void 0 ? void 0 : _b.length) ? this._predefinedValue.dates["start"].split(',') : [];
|
|
149
149
|
this.saveGeneratedDates();
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
this.dateValue = ((_c = this._predefinedValue.dates) === null || _c === void 0 ? void 0 : _c.length) ? this._predefinedValue.dates : '';
|
|
152
|
+
this.dateValue = ((_c = this._predefinedValue.dates["start"]) === null || _c === void 0 ? void 0 : _c.length) ? this._predefinedValue.dates["start"] : '';
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
setDateRangeDefaults() {
|
|
@@ -367,7 +367,7 @@ const PnMultiRowConnectedDropdownRow = class {
|
|
|
367
367
|
}
|
|
368
368
|
render() {
|
|
369
369
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
370
|
-
return (index.h(index.Host, { key: '
|
|
370
|
+
return (index.h(index.Host, { key: 'ad539e2ba8ab36a8b052be6cd30a901847de6f00' }, index.h("div", { key: '36b00805294171c2bf910cda8fb80da2b449cd31', ref: el => (this.pnConnectedDropdownSlotElement = el), class: "connected-dropdown-slot-element" }, index.h("div", { key: '3d3e46feab301b4e9f3db92365fd0e3c4b69a518', class: "connected-dropdown-parent-element connected-dropdown" }, index.h("div", { key: '62bd8eb88f0ca11ad06c2a1053bd823500719c6a', class: "connected-dropdown__row__no-margin" }, index.h("label", { key: 'afe3977594b5a3e54865e6cd10a6cbdefb578c79' }, this.label)), index.h("div", { key: '96ffced084b72620088cb2357f8266fc12c9fc87', class: "connected-dropdown__row button-row" }, index.h("div", { key: '9539103ef44c6e314c792f46b8ef33e114ce8306', class: "connected-dropdown__button-container option-buttons" }, (_a = this.buttonsArray) === null || _a === void 0 ? void 0 : _a.map(item => (index.h("button", { class: `${this.setActive(item.selected)}`, id: this.generateUniqueId(), onClick: this.handleOptionButtonClick.bind(this) }, item.value)))), index.h("div", { key: '39fdaad5b12573c7e8d453deaf5b10ad558a8eb3', class: "connected-dropdown__button-container delete-button" }, this.index > 0 ? (index.h("pn-button", { ref: el => (this.pnDeleteRowButton = el), small: "true", icon: minus.minus, appearance: "warning", index: this.index }, "Delete")) : null)), index.h("div", { key: 'c8c808aa6214dfd234b0d383c2f3dbe075c938af', class: "connected-dropdown__row input-row" }, index.h("pn-select", { key: '54a0e807950b4d70b6a253ffff772452767a9d1b', ref: el => (this.pnFirstDropdown = el), class: "pn-row-select-dropdown dropDown1-dropdown", placeholder: this.firstDropdownPlaceholder, label: this.firstDropdownLabel, "empty-option": "true" }, (_b = this.firstDropdownArr) === null || _b === void 0 ? void 0 : _b.map((item, i) => (index.h("pn-option", { index: i, label: item.label, value: item.value, selected: item.selected, onClick: index$1.debounce(this.handleFirstDropdownChange.bind(this), 500) })))), index.h("pn-select", { key: 'ac1a665b98da67b0cb7e74609c4e21f0d67a7244', ref: el => (this.pnSecondDropdown = el), class: "pn-row-select-dropdown dropDown2-dropdown", placeholder: this.secondDropdownPlaceholder, label: this.secondDropdownLabel, "empty-option": "true" }, (_c = this.secondDropdownArr) === null || _c === void 0 ? void 0 : _c.map((item, i) => (index.h("pn-option", { index: i, label: item.label, value: item.value, selected: item.selected, onClick: index$1.debounce(this.handleSecondDropdownChange.bind(this), 500) })))), index.h("pn-marketweb-input", { key: '7c8c8093092dae071cb25473062b0da157f7070f', ref: el => (this.pnInputField = el), type: "number", placeholder: "0", label: this.inputFildLabel, value: this.inputFieldValue, min: "1" }), this.allowMultipleDates ? (index.h("pn-button", { ref: el => (this.pnShowDateRangeFiledButton = el), class: "connected-dropdown__toggle-date-button", small: "true", appearance: "light" }, this.dateButtonText)) : (index.h("div", { class: "connected-dropdown__date-container" }, index.h("div", { class: "connected-dropdown__label-container" }, index.h("label", null, this.dateButtonText)), index.h("pn-date-picker", { ref: el => (this.pnSingleDatePicker = el), range: "false", "disable-weekends": true, "min-date": this.firstValidDateString, language: this.languageCode, placeholder: this.datePlaceholder, class: "connected-dropdown__date-picker", start: ((_d = this.dateValue) === null || _d === void 0 ? void 0 : _d.length) ? this.dateValue : null })))), this.allowMultipleDates ? (index.h("div", { ref: el => (this.pnDateRangeContainer = el), class: "connected-dropdown__date-container", style: { display: 'none' } }, this.multiDateHelperText ? (index.h("div", { class: "connected-dropdown__row" }, index.h("p", null, this.multiDateHelperText))) : null, index.h("div", { class: "connected-dropdown__multi-date-row" }, index.h("div", { class: "connected-dropdown__date-container" }, index.h("div", { class: "connected-dropdown__label-container" }, index.h("label", null, this.startDateLabel)), index.h("pn-date-picker", { ref: el => (this.pnStartDate = el), range: "false", "disable-weekends": true, class: "connected-dropdown__date-picker", "min-date": this.firstValidDateString, "max-date": this.lastValidDateString, language: this.languageCode, placeholder: this.datePlaceholder, start: ((_e = this.starDateValue) === null || _e === void 0 ? void 0 : _e.length) ? this.starDateValue : null })), index.h("div", { class: "connected-dropdown__date-container" }, index.h("div", { class: "connected-dropdown__label-container" }, index.h("label", null, this.endDateLabel)), index.h("pn-date-picker", { ref: el => (this.pnEndDate = el), range: "false", "disable-weekends": true, class: "connected-dropdown__date-picker", "min-date": this.firstValidDateString, "max-date": this.lastValidDateString, language: this.languageCode, placeholder: this.datePlaceholder, start: ((_f = this.endDateValue) === null || _f === void 0 ? void 0 : _f.length) ? this.endDateValue : null }))), index.h("div", { ref: el => (this.pnDaysRow = el), class: "connected-dropdown__multi-date-row" }, (_g = this.daysArr) === null || _g === void 0 ? void 0 : _g.map((day) => (index.h("div", { class: "connected-dropdown__checkbox" }, index.h("pn-filter-checkbox", { checkboxid: 'day-' + day.value, name: '__' + day.label, value: day.value, checked: day.selected }), index.h("label", { htmlFor: 'day-' + day.value }, day.label))))), index.h("div", { class: "connected-dropdown__row" }, index.h("pn-button", { ref: el => (this.pnGenerateDatesButton = el), small: "true" }, this.generateDatesButtonText)), index.h("div", { ref: el => (this.pnGeneratedDatesSlot = el), class: "connected-dropdown__date-slot" }, (_h = this.generatedDatesArr) === null || _h === void 0 ? void 0 :
|
|
371
371
|
_h.map((date, i) => (index.h("div", { class: "connected-dropdown__row generated-date-row" }, index.h("p", null, date), index.h("pn-button", { index: i, small: "true", icon: minus.minus, appearance: "warning", id: 'delete-date-' + i, onClick: this.deleteGeneratedDateRow.bind(this, i) }, date)))), !((_j = this.generatedDatesArr) === null || _j === void 0 ? void 0 : _j.length) ? index.h("p", null, this.noDatesText) : null), index.h("div", { class: "connected-dropdown__row" }, index.h("pn-button", { ref: el => (this.pnSaveGeneratedDatesButton = el), class: "connected-dropdown__button-right", small: "true" }, this.saveDateButtonText)))) : null))));
|
|
372
372
|
}
|
|
373
373
|
get hostElement() { return index.getElement(this); }
|