@milaboratories/uikit 2.4.28 → 2.4.30
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/.turbo/turbo-build.log +41 -42
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/assets/images/required.svg.js +7 -0
- package/dist/assets/images/required.svg.js.map +1 -0
- package/dist/components/DataTable/TableComponent.vue.js +16 -19
- package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/components/PlAccordion/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -0
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +67 -60
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +76 -72
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.js +65 -61
- package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +27 -23
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +65 -61
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +47 -43
- package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +3 -6
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +43 -39
- package/dist/components/PlTextArea/PlTextArea.vue.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue.js +41 -37
- package/dist/components/PlTextField/PlTextField.vue.js.map +1 -1
- package/package.json +4 -4
- package/src/components/PlAutocomplete/PlAutocomplete.vue +4 -3
- package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +14 -11
- package/src/components/PlDropdown/PlDropdown.vue +10 -9
- package/src/components/PlDropdownLegacy/PlDropdownLegacy.vue +3 -2
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +11 -10
- package/src/components/PlFileInput/PlFileInput.vue +6 -3
- package/src/components/PlTextArea/PlTextArea.vue +3 -2
- package/src/components/PlTextField/PlTextField.vue +7 -6
- package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +0 -1
- package/dist/generated/components/svg/images/SvgRequired.vue.d.ts +0 -2
- package/dist/generated/components/svg/images/SvgRequired.vue.js +0 -17
- package/dist/generated/components/svg/images/SvgRequired.vue.js.map +0 -1
- package/dist/generated/components/svg/images/SvgRequired.vue3.js +0 -6
- package/dist/generated/components/svg/images/SvgRequired.vue3.js.map +0 -1
- package/scripts/create-svg-components.js +0 -125
- package/src/generated/components/svg/images/Svg16Add.vue +0 -13
- package/src/generated/components/svg/images/Svg16Attention.vue +0 -13
- package/src/generated/components/svg/images/Svg16Checkmark.vue +0 -13
- package/src/generated/components/svg/images/Svg16CheckmarkDark.vue +0 -13
- package/src/generated/components/svg/images/Svg16ChevronDown.vue +0 -13
- package/src/generated/components/svg/images/Svg16ChevronLeft.vue +0 -13
- package/src/generated/components/svg/images/Svg16ChevronRight.vue +0 -13
- package/src/generated/components/svg/images/Svg16ChevronUp.vue +0 -13
- package/src/generated/components/svg/images/Svg16Clear.vue +0 -13
- package/src/generated/components/svg/images/Svg16Clipboard.vue +0 -13
- package/src/generated/components/svg/images/Svg16Close.vue +0 -13
- package/src/generated/components/svg/images/Svg16Compare.vue +0 -13
- package/src/generated/components/svg/images/Svg16Down.vue +0 -13
- package/src/generated/components/svg/images/Svg16Import.vue +0 -13
- package/src/generated/components/svg/images/Svg16Info.vue +0 -13
- package/src/generated/components/svg/images/Svg16InfoDark.vue +0 -13
- package/src/generated/components/svg/images/Svg16Link.vue +0 -13
- package/src/generated/components/svg/images/Svg16Loading.vue +0 -13
- package/src/generated/components/svg/images/Svg16Maximise.vue +0 -13
- package/src/generated/components/svg/images/Svg16Play.vue +0 -13
- package/src/generated/components/svg/images/Svg16Up.vue +0 -13
- package/src/generated/components/svg/images/Svg24ArrowRight.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkDisabledChecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkDisabledIndeterminate.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkDisabledUnchecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkEnabledChecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkEnabledIndeterminate.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxDarkEnabledUnchecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightDisabledChecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightDisabledIndeterminate.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightDisabledUnchecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightEnabledChecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightEnabledIndeterminate.vue +0 -13
- package/src/generated/components/svg/images/Svg24CheckboxLightEnabledUnchecked.vue +0 -13
- package/src/generated/components/svg/images/Svg24Clips.vue +0 -13
- package/src/generated/components/svg/images/Svg24Close.vue +0 -13
- package/src/generated/components/svg/images/Svg24Code.vue +0 -13
- package/src/generated/components/svg/images/Svg24Columns.vue +0 -13
- package/src/generated/components/svg/images/Svg24DarkMode.vue +0 -13
- package/src/generated/components/svg/images/Svg24Filters.vue +0 -13
- package/src/generated/components/svg/images/Svg24LightMode.vue +0 -13
- package/src/generated/components/svg/images/Svg24Local.vue +0 -13
- package/src/generated/components/svg/images/Svg24PaperClip.vue +0 -13
- package/src/generated/components/svg/images/Svg24Search.vue +0 -13
- package/src/generated/components/svg/images/Svg24ServerOn.vue +0 -13
- package/src/generated/components/svg/images/Svg24Settings2.vue +0 -13
- package/src/generated/components/svg/images/SvgAddGraphBg.vue +0 -13
- package/src/generated/components/svg/images/SvgColorSliderThumbBig.vue +0 -13
- package/src/generated/components/svg/images/SvgColorSliderThumbSmall.vue +0 -13
- package/src/generated/components/svg/images/SvgEmptyCat.vue +0 -13
- package/src/generated/components/svg/images/SvgNoDataCat.vue +0 -13
- package/src/generated/components/svg/images/SvgRequired.vue +0 -13
- package/src/generated/components/svg/svg-styles.css +0 -5
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
.expand-collapse-fix{overflow:hidden}.expand-collapse-enter-active,.expand-collapse-leave-active{transition:height .2s ease-in-out,opacity .2s ease-in-out;height:var(--component-height)}.expand-collapse-enter-from,.expand-collapse-leave-to{opacity:.5;height:0}
|
|
13
13
|
.pl-alert{--text-font-family: var(--font-family-base);--text-white-space: normal;--indent: 24px;position:relative;padding:12px;display:flex;flex-wrap:nowrap;gap:12px;border:1px solid var(--border-color-default);border-radius:6px;color:var(--txt-01)}.pl-alert.monospace{--text-font-family: var(--font-family-monospace)}.pl-alert.whiteSpacePre{--text-white-space: pre}.pl-alert__error{background:var(--notification-error)}.pl-alert__warn{background:var(--notification-warning)}.pl-alert__success{background:var(--notification-success)}.pl-alert__info{background:var(--notification-neutral)}.pl-alert__icon{width:24px}.pl-alert__main{display:flex;flex-direction:column;min-height:24px;flex:1;overflow:hidden;width:100%;gap:6px}.pl-alert__main label{font-size:20px;font-weight:500;line-height:24px;letter-spacing:-.2px}.pl-alert__main__text{font-size:14px;font-weight:500;line-height:20px;font-family:var(--text-font-family);white-space:var(--text-white-space);max-width:100%;flex:1;--thumb-color: var(--ic-02);overflow-y:auto}.pl-alert__main__text::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.pl-alert__main__text::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.pl-alert__main__text::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.pl-alert__close-btn{position:absolute;top:10px;right:12px;cursor:pointer;background-color:#d3d7e0;mask-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.99954%2018L11.9995%2012M11.9995%2012L17.9995%206M11.9995%2012L5.99954%206M11.9995%2012L17.9995%2018'%20stroke='%23110529'%20stroke-width='1.5'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.99954%2018L11.9995%2012M11.9995%2012L17.9995%206M11.9995%2012L5.99954%206M11.9995%2012L17.9995%2018'%20stroke='%23110529'%20stroke-width='1.5'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:24px;-webkit-mask-size:24px;width:24px;height:24px;transition:all .1s ease-in-out}.pl-alert__close-btn:hover{background-color:var(--main-dark-color)}
|
|
14
14
|
.pl-autocomplete__options{--option-hover-bg: var(--btn-sec-hover-grey);z-index:var(--z-dropdown-options);border:1px solid var(--border-color-div-grey);position:absolute;background-color:var(--pl-dropdown-options-bg);border-radius:6px;max-height:244px;box-shadow:0 4px 12px -2px #0f244d14,0 6px 24px -2px #0f244d14;--thumb-color: var(--ic-02);overflow-y:auto}.pl-autocomplete__options::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.pl-autocomplete__options::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.pl-autocomplete__options::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.pl-autocomplete__options .nothing-found{padding:0 10px;height:var(--control-height);line-height:var(--control-height);background-color:#fff;opacity:.5;font-style:italic}.pl-autocomplete__options .option{position:relative;padding:0 30px 0 10px;height:var(--control-height);line-height:var(--control-height);cursor:pointer;-webkit-user-select:none;user-select:none}.pl-autocomplete__options .option .checkmark{position:absolute;display:none;right:10px;top:50%;transform:translateY(-50%)}.pl-autocomplete__options .option>span{display:block;overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis}.pl-autocomplete__options .option.selected{background-color:var(--color-active-select)}.pl-autocomplete__options .option.selected .checkmark{display:block}.pl-autocomplete__options .option.active:not(.selected){background-color:var(--option-hover-bg)}.pl-autocomplete__options .option:hover{background-color:var(--option-hover-bg)}.pl-autocomplete{--contour-color: var(--txt-01);--contour-border-width: 1px;--label-offset-left-x: 8px;--label-offset-right-x: 8px;--label-color: var(--txt-01);position:relative;outline:none;min-height:var(--control-height);border-radius:6px;font-family:var(--font-family-base);font-size:var(--font-size-base);font-weight:var(--font-weigh-base)}.pl-autocomplete__envelope{font-family:var(--control-font-family);min-width:160px}.pl-autocomplete label{display:flex;align-items:center;gap:4px;position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);padding:0 4px;max-width:calc(100% - 16px);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);font-size:12px;font-weight:500;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background:var(--bg-elevated-01)}.pl-autocomplete label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.pl-autocomplete__container{position:absolute;top:0;left:0;right:0;border-radius:6px;min-height:var(--control-height);color:var(--txt-01)}.pl-autocomplete__contour{border-radius:var(--border-radius-control);border:var(--contour-border-width) solid var(--contour-color);box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none}.pl-autocomplete__field{position:relative;border-radius:6px;overflow:hidden;background:transparent;padding-left:11px;min-height:var(--control-height);line-height:var(--control-height);display:flex;flex-direction:row;align-items:center;cursor:pointer}.pl-autocomplete__field .input-value{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;flex-direction:row;align-items:center;padding:0 60px 0 11px;pointer-events:none;line-height:20px;color:var(--txt-01);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit}.pl-autocomplete__field input{min-height:calc(var(--control-height) - 2px);line-height:20px;font-family:inherit;font-size:inherit;background-color:transparent;border:none;padding:0;width:calc(100% - 40px);color:var(--txt-01);caret-color:var(--border-color-focus)}.pl-autocomplete__field input:focus{outline:none}.pl-autocomplete__field input:placeholder-shown{text-overflow:ellipsis}.pl-autocomplete__field input::placeholder{color:var(--color-placeholder)}.pl-autocomplete__helper{font-size:12px;color:var(--txt-03);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-autocomplete__error{font-size:12px;color:var(--txt-error);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-autocomplete__controls{display:flex;flex-direction:row;align-items:center;min-height:var(--control-height);gap:6px;margin-left:auto}.pl-autocomplete__controls .mask-16,.pl-autocomplete__controls .mask-24{--icon-color: var(--control-mask-fill);cursor:pointer}.pl-autocomplete__controls .clear{--icon-color: var(--ic-02)}.pl-autocomplete__controls .mask-loading{--icon-color: var(#07AD3E);animation:spin 2.5s linear infinite}.pl-autocomplete__arrow-wrapper{display:flex;align-items:center;min-height:var(--control-height);padding-right:11px}.pl-autocomplete .arrow-icon{cursor:pointer}.pl-autocomplete .arrow-icon.arrow-icon-default{transition:transform .2s;background-color:var(--control-mask-fill);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}.pl-autocomplete.open,.pl-autocomplete:focus-within{z-index:1;--label-color: var(--txt-focus)}.pl-autocomplete.open .pl-autocomplete__container{z-index:1000}.pl-autocomplete.open .pl-autocomplete__field{border-radius:6px 6px 0 0}.pl-autocomplete.open .arrow-icon.arrow-icon-default{background-color:var(--control-mask-fill);transform:rotate(-180deg)}.pl-autocomplete:hover{--contour-color: var(--control-hover-color)}.pl-autocomplete:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.pl-autocomplete:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.pl-autocomplete.error{--contour-color: var(--txt-error);--label-color: var(--txt-error)}.pl-autocomplete.disabled{--contour-color: var(--color-dis-01);--control-mask-fill: var(--color-dis-01);--label-color: var(--color-dis-01);cursor:not-allowed;pointer-events:none;-webkit-user-select:none;user-select:none}.pl-autocomplete.disabled .input-value{color:var(--dis-01)}
|
|
15
|
-
.SvgRequired{background-image:url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%225%22%20height%3D%2212%22%20viewBox%3D%220%200%205%2012%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M1.51685%204.8L2.5%203.34159L3.47612%204.8L4.39607%204.12743L3.31461%202.7469L5%202.25133L4.64888%201.16106L3.00562%201.77699L3.06882%200H1.93118L1.99438%201.77699L0.351124%201.16106L0%202.25133L1.68539%202.7469L0.59691%204.12743L1.51685%204.8Z%22%20fill%3D%22%23F1222F%22%2F%3E%3C%2Fsvg%3E)}
|
|
16
15
|
.pl-autocomplete-multi{--contour-color: var(--txt-01);--contour-border-width: 1px;--options-bg: #fff;--option-hover-bg: var(--btn-sec-hover-grey);--label-offset-left-x: 8px;--label-offset-right-x: 8px;--label-color: var(--txt-01);position:relative;outline:none;min-height:var(--control-height);border-radius:6px;font-family:var(--font-family-base);font-size:var(--font-size-base);font-weight:var(--font-weigh-base)}[data-theme=dark] .pl-autocomplete-multi{--options-bg: #1B1B1F}.pl-autocomplete-multi__envelope{font-family:var(--control-font-family);min-width:160px}.pl-autocomplete-multi label{display:flex;align-items:center;gap:4px;position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);padding:0 4px;max-width:calc(100% - 16px);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);font-size:12px;font-weight:500;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background:var(--bg-elevated-01)}.pl-autocomplete-multi label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.pl-autocomplete-multi__container{position:absolute;top:0;left:0;right:0;border-radius:6px;min-height:var(--control-height);padding:1px;color:var(--txt-01)}.pl-autocomplete-multi__contour{border-radius:var(--border-radius-control);border:var(--contour-border-width) solid var(--contour-color);box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none}.pl-autocomplete-multi__options{position:absolute;z-index:var(--z-dropdown-options);border:1px solid var(--border-color-div-grey);background-color:var(--pl-dropdown-options-bg);border-radius:6px;max-height:244px;box-shadow:0 4px 12px -2px #0f244d14,0 6px 24px -2px #0f244d14;--thumb-color: var(--ic-02);overflow-y:auto}.pl-autocomplete-multi__options::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.pl-autocomplete-multi__options::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.pl-autocomplete-multi__options::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.pl-autocomplete-multi__options .nothing-found{padding:0 10px;height:var(--control-height);line-height:20px;background-color:#fff;opacity:.5;font-style:italic}.pl-autocomplete-multi__field{position:relative;border-radius:6px;overflow:hidden;background:transparent;padding-left:11px;min-height:var(--control-height);line-height:20px;cursor:pointer;display:flex;flex-direction:row;align-items:center}.pl-autocomplete-multi__field .chips-container{position:absolute;top:0;left:0;bottom:0;right:30px;overflow:hidden;padding:0 60px 0 11px;line-height:20px;color:var(--contour-color);display:flex;gap:8px;align-items:center}.pl-autocomplete-multi__field input{min-height:calc(var(--control-height) - 2px);line-height:20px;font-family:inherit;font-size:inherit;background-color:transparent;border:none;padding:0;width:calc(100% - 20px);color:var(--txt-01);caret-color:var(--border-color-focus)}.pl-autocomplete-multi__field input:focus{outline:none}.pl-autocomplete-multi__field input:placeholder-shown{text-overflow:ellipsis}.pl-autocomplete-multi__field input::placeholder{color:var(--color-placeholder)}.pl-autocomplete-multi__field:hover .clear{display:block}.pl-autocomplete-multi__controls{display:flex;flex-direction:row;align-items:center;gap:6px;margin-left:auto}.pl-autocomplete-multi__controls .mask-16,.pl-autocomplete-multi__controls .mask-24{--icon-color: var(--control-mask-fill);cursor:pointer}.pl-autocomplete-multi__controls .mask-loading{--icon-color: var(--ic-accent);animation:spin 2.5s linear infinite}.pl-autocomplete-multi__arrow-wrapper{display:flex;align-items:center;min-height:var(--control-height);padding-right:11px}.pl-autocomplete-multi .arrow-icon{cursor:pointer}.pl-autocomplete-multi .arrow-icon.arrow-icon-default{transition:transform .2s;background-color:var(--control-mask-fill);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}.pl-autocomplete-multi__helper{font-size:12px;color:var(--txt-03);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-autocomplete-multi__error{font-size:12px;color:var(--txt-error);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-autocomplete-multi.open .arrow-icon.arrow-icon-default{background-color:var(--control-mask-fill);transform:rotate(-180deg)}.pl-autocomplete-multi .clear{display:none;position:absolute;top:50%;transform:translateY(-50%);right:36px;z-index:1;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_586_7851)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%2016C12.4183%2016%2016%2012.4183%2016%208C16%203.58172%2012.4183%200%208%200C3.58172%200%200%203.58172%200%208C0%2012.4183%203.58172%2016%208%2016ZM4.46967%205.53033L6.93934%208L4.46967%2010.4697L5.53033%2011.5303L8%209.06066L10.4697%2011.5303L11.5303%2010.4697L9.06066%208L11.5303%205.53033L10.4697%204.46967L8%206.93934L5.53033%204.46967L4.46967%205.53033Z'%20fill='%23CFD1DB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_586_7851'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e") no-repeat center;width:16px;height:16px;cursor:pointer}.pl-autocomplete-multi.open,.pl-autocomplete-multi:focus-within{z-index:1}.pl-autocomplete-multi.open .pl-autocomplete-multi__container .label,.pl-autocomplete-multi:focus-within .pl-autocomplete-multi__container .label{color:var(--txt-focus)}.pl-autocomplete-multi.open .pl-autocomplete-multi__container{z-index:1000}.pl-autocomplete-multi.open .pl-autocomplete-multi__field{border-radius:6px 6px 0 0}.pl-autocomplete-multi.open .arrow{background-color:var(--control-mask-fill);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%204.93933L13.5303%2010.4697L12.4697%2011.5303L8%207.06065L3.53033%2011.5303L2.46967%2010.4697L8%204.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%204.93933L13.5303%2010.4697L12.4697%2011.5303L8%207.06065L3.53033%2011.5303L2.46967%2010.4697L8%204.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}.pl-autocomplete-multi:hover{--contour-color: var(--control-hover-color)}.pl-autocomplete-multi:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.pl-autocomplete-multi:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.pl-autocomplete-multi.error{--contour-color: var(--txt-error);--label-color: var(--txt-error)}.pl-autocomplete-multi.disabled{--contour-color: var(--color-dis-01);--control-mask-fill: var(--color-dis-01);--label-color: var(--color-dis-01);cursor:not-allowed;pointer-events:none}.pl-autocomplete-multi.disabled .mask-loading{animation:spin 2.5s linear infinite;--icon-color: var(--ic-accent)}.pl-autocomplete-multi__open-chips-container{padding:12px}.pl-autocomplete-multi__open-chips-container .pl-chip{margin-right:4px;margin-bottom:4px}
|
|
17
16
|
.pl-chip-tooltip{display:inline-flex}.pl-chip{--chip-color: var(--txt-01);position:relative;display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:32px;background:var(--chip-bg);border:var(--chip-border);border-radius:6px;max-width:256px;font-family:var(--font-family-base);font-size:var(--font-size-base);font-weight:var(--font-weigh-base);line-height:calc(var(--line-height-base) + 2px);letter-spacing:-.2px;color:var(--chip-color)}.pl-chip.small{height:24px;padding:0 6px;border-radius:4px}.pl-chip.large{height:40px;padding:0 12px;border-radius:6px}[data-theme=dark] .pl-chip{color:#fff}.pl-chip__text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.pl-chip__close{cursor:pointer;--mask-color: var(--chip-close-ic-color)}.pl-chip__close:hover{--mask-color: var(--chip-close-ic-hover-color)}.pl-chip__close:focus-visible{--mask-color: var(--chip-close-ic-hover-color);box-shadow:0 0 0 2px var(--border-color-focus);border-radius:1px;outline:none}.pl-chip__close--icon{background:var(--mask-color);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.00001%202.93933L8.00001%206.93933L12%202.93933L13.0607%203.99999L9.06067%207.99999L13.0607%2012L12%2013.0607L8.00001%209.06065L4.00001%2013.0607L2.93935%2012L6.93935%207.99999L2.93935%203.99999L4.00001%202.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.00001%202.93933L8.00001%206.93933L12%202.93933L13.0607%203.99999L9.06067%207.99999L13.0607%2012L12%2013.0607L8.00001%209.06065L4.00001%2013.0607L2.93935%2012L6.93935%207.99999L2.93935%203.99999L4.00001%202.93933Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}
|
|
18
17
|
.pl-btn-accent{--font-size: 14px;--border-radius: 6px;--button-height: 40px;--focus-shadow: 0 0 0 0 transparent;--btn-disabled-bg: var(--color-dis-01);--color-text: var(--txt-00);--shape-shadow: 0 0 0 0 transparent;--append-shadow: 0 0 0 0 transparent;--drop-shadow: 0 0 0 0 transparent;--active-shadow: 0 0 0 0 transparent;--main-padding: 0 12px;text-transform:capitalize;position:relative;overflow:hidden;display:flex;flex-direction:row;justify-content:space-between;align-items:center;white-space:nowrap;gap:8px;padding:var(--main-padding);color:var(--color-text);font-weight:600;font-size:var(--font-size);font-family:var(--font-family-base);line-height:16px;height:var(--button-height);min-height:var(--button-height);border-radius:var(--border-radius);outline:none;-webkit-user-select:none;user-select:none;transition:box-shadow .05s ease-in-out;box-shadow:var(--focus-shadow),var(--append-shadow),var(--shape-shadow),var(--active-shadow),var(--drop-shadow)}.pl-btn-accent.justifyCenter{justify-content:center}.pl-btn-accent.round{border-radius:50%;width:var(--button-height);min-width:var(--button-height);padding:0;justify-content:center}.pl-btn-accent.small{--button-height: 32px;--main-padding: 0 8px}.pl-btn-accent.medium{--main-padding: 0 16px}.pl-btn-accent.large{--button-height: 56px;--border-radius: 8px;--font-size: 16px;--main-padding: 0 18px}.pl-btn-accent.large .mask{--mask-size: 24px}.pl-btn-accent:disabled{--color-text: var(--dis-00);--icon-color: var(--dis-00)}.pl-btn-accent:disabled *{color:var(--color-text)}.pl-btn-accent:not([disabled]){cursor:pointer}.pl-btn-accent:not([disabled]).hover{background:var(--color-btn-hover)}.pl-btn-accent:not([disabled]):hover{background:var(--color-btn-hover)}.pl-btn-accent:focus-visible{--focus-shadow: inset 0 0 0 2px var(--border-color-focus)}.pl-btn-accent .icon{display:block;width:16px;height:16px}.pl-btn-accent.loading{box-shadow:none!important}.pl-btn-accent.loading .mask-loading{display:block;animation:spin 4s linear infinite}.pl-btn-accent.reverse{flex-direction:row-reverse}.pl-btn-accent>span{display:inline-flex}.pl-btn-accent{--color-btn-background: var(--color-accent-default);--color-btn-hover: var(--color-accent-hover);background-color:var(--color-btn-background);border:none}.pl-btn-accent.large{--drop-shadow: 3px 3px 0px #000000}.pl-btn-accent.loading{background:#070529cc}.pl-btn-accent:disabled{background-color:var(--btn-disabled-bg);box-shadow:none!important;cursor:auto}.pl-btn-accent:active{--active-shadow: inset 0px 3px 0px rgba(0, 0, 0, .24);--drop-shadow: 0 0 0 0 transparent}
|
|
@@ -66,9 +65,6 @@ import "../PlSvg/registry.js";
|
|
|
66
65
|
|
|
67
66
|
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
68
|
import "canonicalize";
|
|
73
69
|
|
|
74
70
|
|
|
@@ -87,6 +83,7 @@ import "canonicalize";
|
|
|
87
83
|
|
|
88
84
|
|
|
89
85
|
|
|
86
|
+
|
|
90
87
|
import "@vueuse/integrations/useSortable";
|
|
91
88
|
|
|
92
89
|
import "@platforma-sdk/model";
|
|
@@ -108,7 +105,7 @@ import "../../colors/gradient.js";
|
|
|
108
105
|
const K = {
|
|
109
106
|
name: "PlPureSlideModal",
|
|
110
107
|
inheritAttrs: !1
|
|
111
|
-
},
|
|
108
|
+
}, Tt = /* @__PURE__ */ f({
|
|
112
109
|
...K,
|
|
113
110
|
props: /* @__PURE__ */ c({
|
|
114
111
|
modelValue: { type: Boolean },
|
|
@@ -153,6 +150,6 @@ const K = {
|
|
|
153
150
|
}
|
|
154
151
|
});
|
|
155
152
|
export {
|
|
156
|
-
|
|
153
|
+
Tt as default
|
|
157
154
|
};
|
|
158
155
|
//# sourceMappingURL=PlPureSlideModal.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlPureSlideModal.vue.js","sources":["../../../src/components/PlSlideModal/PlPureSlideModal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport default {\n name: 'PlPureSlideModal',\n inheritAttrs: false,\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-slide-modal.scss';\nimport { ref, useAttrs } from 'vue';\nimport TransitionSlidePanel from '../TransitionSlidePanel.vue';\nimport { useClickOutside, useEventListener } from '../../index';\nimport type { Props } from './props';\nimport { defaultProps } from './props';\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\nconst modal = ref();\nconst attrs = useAttrs();\nconst props = withDefaults(\n defineProps<Props>(),\n defaultProps,\n);\n\nuseClickOutside(modal, () => {\n if (props.modelValue && props.closeOnOutsideClick) {\n emit('update:modelValue', false);\n }\n});\n\nuseEventListener(document, 'keydown', (evt: KeyboardEvent) => {\n if (evt.key === 'Escape') {\n emit('update:modelValue', false);\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <TransitionSlidePanel>\n <div\n v-if=\"props.modelValue\"\n ref=\"modal\"\n class=\"pl-slide-modal\"\n :style=\"{ width: props.width }\"\n v-bind=\"attrs\"\n @keyup.esc=\"emit('update:modelValue', false)\"\n >\n <div class=\"close-dialog-btn\" @click=\"emit('update:modelValue', false)\" />\n <slot />\n </div>\n </TransitionSlidePanel>\n <div v-if=\"props.modelValue && props.shadow\" class=\"pl-slide-modal__shadow\" @keyup.esc=\"emit('update:modelValue', false)\" />\n </Teleport>\n</template>\n"],"names":["__default__","emit","__emit","modal","ref","attrs","useAttrs","props","__props","useClickOutside","useEventListener","evt"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlPureSlideModal.vue.js","sources":["../../../src/components/PlSlideModal/PlPureSlideModal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport default {\n name: 'PlPureSlideModal',\n inheritAttrs: false,\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-slide-modal.scss';\nimport { ref, useAttrs } from 'vue';\nimport TransitionSlidePanel from '../TransitionSlidePanel.vue';\nimport { useClickOutside, useEventListener } from '../../index';\nimport type { Props } from './props';\nimport { defaultProps } from './props';\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\nconst modal = ref();\nconst attrs = useAttrs();\nconst props = withDefaults(\n defineProps<Props>(),\n defaultProps,\n);\n\nuseClickOutside(modal, () => {\n if (props.modelValue && props.closeOnOutsideClick) {\n emit('update:modelValue', false);\n }\n});\n\nuseEventListener(document, 'keydown', (evt: KeyboardEvent) => {\n if (evt.key === 'Escape') {\n emit('update:modelValue', false);\n }\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <TransitionSlidePanel>\n <div\n v-if=\"props.modelValue\"\n ref=\"modal\"\n class=\"pl-slide-modal\"\n :style=\"{ width: props.width }\"\n v-bind=\"attrs\"\n @keyup.esc=\"emit('update:modelValue', false)\"\n >\n <div class=\"close-dialog-btn\" @click=\"emit('update:modelValue', false)\" />\n <slot />\n </div>\n </TransitionSlidePanel>\n <div v-if=\"props.modelValue && props.shadow\" class=\"pl-slide-modal__shadow\" @keyup.esc=\"emit('update:modelValue', false)\" />\n </Teleport>\n</template>\n"],"names":["__default__","emit","__emit","modal","ref","attrs","useAttrs","props","__props","useClickOutside","useEventListener","evt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAAA,IAAe;AAAA,EACb,MAAM;AAAA,EACN,cAAc;AAChB;;;;;;;;;;AAWA,UAAMC,IAAOC,GAIPC,IAAQC,EAAA,GACRC,IAAQC,EAAA,GACRC,IAAQC;AAKd,WAAAC,EAAgBN,GAAO,MAAM;AAC3B,MAAII,EAAM,cAAcA,EAAM,uBAC5BN,EAAK,qBAAqB,EAAK;AAAA,IAEnC,CAAC,GAEDS,EAAiB,UAAU,WAAW,CAACC,MAAuB;AAC5D,MAAIA,EAAI,QAAQ,YACdV,EAAK,qBAAqB,EAAK;AAAA,IAEnC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(".ui-text-area{--contour-color: var(--txt-01);--label-color: var(--txt-01);--contour-border-width: 1px;--contour-box-shadow: none;--label-offset-left-x: 8px;--label-offset-right-x: 8px;--prefix-color: var(--color-placeholder);width:100%;min-height:var(--control-height);position:relative;border-radius:var(--border-radius-control);display:flex;flex-direction:row;align-items:center;outline:none}.ui-text-area__envelope{font-family:var(--font-family-base)}.ui-text-area textarea{min-height:calc(var(--control-height) - 2px);width:100%;padding:10px 12px;border:none;font-size:inherit;background-color:transparent;color:var(--txt-01);caret-color:var(--border-color-focus);cursor:inherit;resize:none;--thumb-color: var(--ic-02);overflow-y:auto}.ui-text-area textarea::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.ui-text-area textarea::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.ui-text-area textarea::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.ui-text-area textarea:focus{outline:none}.ui-text-area textarea::placeholder{color:var(--color-placeholder)}.ui-text-area label{display:flex;align-items:center;gap:4px;position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);padding:0 4px;max-width:calc(100% - 16px);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);font-size:12px;font-weight:500;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background:var(--bg-elevated-01)}.ui-text-area label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.ui-text-area__contour{position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--border-radius-control);border-width:var(--contour-border-width);border-color:var(--contour-color);border-style:solid;box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none}.ui-text-area__append{display:flex;flex-direction:row;align-items:center;gap:4px}.ui-text-area__helper{font-size:12px;color:var(--txt-03);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.ui-text-area__error{font-size:12px;color:var(--txt-error);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.ui-text-area:hover{--contour-color: var(--control-hover-color)}.ui-text-area:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.ui-text-area:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.ui-text-area.dashed .ui-text-area__contour{border-style:dashed}.ui-text-area.nonEmpty{--prefix-color: var(--txt-01)}.ui-text-area.error{--contour-color: var(--txt-error)}.ui-text-area.disabled{--contour-color: var(--color-dis-01);cursor:not-allowed;pointer-events:none}.ui-text-area.disabled *{color:var(--contour-color)}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { defineComponent as C, useSlots as
|
|
2
|
+
import { defineComponent as C, useSlots as S, ref as y, computed as l, onMounted as D, createElementBlock as a, openBlock as o, createElementVNode as s, createCommentVNode as n, normalizeClass as N, withDirectives as $, createVNode as q, createBlock as v, unref as i, toDisplayString as u, withCtx as M, renderSlot as _, vModelText as j } from "vue";
|
|
3
3
|
|
|
4
4
|
import H from "../PlTooltip/PlTooltip.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import { useLabelNotch as
|
|
7
|
-
import { useValidation as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
5
|
+
import P from "../../utils/DoubleContour.vue.js";
|
|
6
|
+
import { useLabelNotch as T } from "../../utils/useLabelNotch.js";
|
|
7
|
+
import { useValidation as z } from "../../utils/useValidation.js";
|
|
8
|
+
import { getErrorMessage as A } from "../../helpers/error.js";
|
|
9
|
+
import I from "../PlSvg/PlSvg.vue.js";
|
|
10
|
+
import L from "../../assets/images/required.svg.js";
|
|
11
|
+
const R = { class: "ui-text-area__envelope" }, U = {
|
|
11
12
|
key: 0,
|
|
12
13
|
ref: "label"
|
|
13
|
-
},
|
|
14
|
+
}, x = ["readonly", "rows", "disabled", "placeholder"], F = { class: "ui-text-area__append" }, G = {
|
|
14
15
|
key: 0,
|
|
15
16
|
class: "ui-text-area__error"
|
|
16
|
-
},
|
|
17
|
+
}, J = {
|
|
17
18
|
key: 1,
|
|
18
19
|
class: "ui-text-area__helper"
|
|
19
|
-
},
|
|
20
|
+
}, K = {
|
|
20
21
|
name: "PlTextArea"
|
|
21
|
-
},
|
|
22
|
-
...
|
|
22
|
+
}, te = /* @__PURE__ */ C({
|
|
23
|
+
...K,
|
|
23
24
|
props: {
|
|
24
25
|
modelValue: {},
|
|
25
26
|
label: {},
|
|
@@ -36,36 +37,39 @@ const P = { class: "ui-text-area__envelope" }, R = {
|
|
|
36
37
|
},
|
|
37
38
|
emits: ["update:modelValue"],
|
|
38
39
|
setup(b, { emit: g }) {
|
|
39
|
-
const k =
|
|
40
|
+
const k = S(), V = g, r = b, p = y(), m = y(), d = l({
|
|
40
41
|
get() {
|
|
41
|
-
return
|
|
42
|
+
return r.modelValue ?? "";
|
|
42
43
|
},
|
|
43
44
|
set(e) {
|
|
44
45
|
V("update:modelValue", e);
|
|
45
46
|
}
|
|
46
|
-
}), w = l(() => !!
|
|
47
|
-
|
|
47
|
+
}), w = l(() => !!r.modelValue), B = z(d, r.rules || []);
|
|
48
|
+
T(p);
|
|
48
49
|
const c = l(() => {
|
|
49
|
-
const e = [],
|
|
50
|
-
return
|
|
51
|
-
}),
|
|
52
|
-
if (!
|
|
50
|
+
const e = [], t = A(r.error);
|
|
51
|
+
return t && e.push(t), e.push(...B.value.errors), e;
|
|
52
|
+
}), h = l(() => c.value.length > 0), f = () => {
|
|
53
|
+
if (!r.autogrow)
|
|
53
54
|
return;
|
|
54
|
-
const e =
|
|
55
|
+
const e = m.value;
|
|
55
56
|
e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
|
|
56
57
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
}), (e,
|
|
58
|
+
return D(() => {
|
|
59
|
+
f();
|
|
60
|
+
}), (e, t) => (o(), a("div", R, [
|
|
60
61
|
s("div", {
|
|
61
62
|
ref_key: "root",
|
|
62
|
-
ref:
|
|
63
|
-
class:
|
|
63
|
+
ref: p,
|
|
64
|
+
class: N(["ui-text-area", { error: h.value, disabled: e.disabled, dashed: e.dashed, nonEmpty: w.value }])
|
|
64
65
|
}, [
|
|
65
|
-
e.label ? (o(), a("label",
|
|
66
|
-
e.required ? (o(),
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
e.label ? (o(), a("label", U, [
|
|
67
|
+
e.required ? (o(), v(i(I), {
|
|
68
|
+
key: 0,
|
|
69
|
+
uri: i(L)
|
|
70
|
+
}, null, 8, ["uri"])) : n("", !0),
|
|
71
|
+
s("span", null, u(e.label), 1),
|
|
72
|
+
i(k).tooltip ? (o(), v(i(H), {
|
|
69
73
|
key: 1,
|
|
70
74
|
class: "info",
|
|
71
75
|
position: "top"
|
|
@@ -78,27 +82,27 @@ const P = { class: "ui-text-area__envelope" }, R = {
|
|
|
78
82
|
], 512)) : n("", !0),
|
|
79
83
|
$(s("textarea", {
|
|
80
84
|
ref_key: "input",
|
|
81
|
-
ref:
|
|
82
|
-
"onUpdate:modelValue":
|
|
85
|
+
ref: m,
|
|
86
|
+
"onUpdate:modelValue": t[0] || (t[0] = (E) => d.value = E),
|
|
83
87
|
readonly: e.readonly,
|
|
84
88
|
rows: e.rows,
|
|
85
89
|
disabled: e.disabled,
|
|
86
90
|
placeholder: e.placeholder ?? "...",
|
|
87
91
|
spellcheck: "false",
|
|
88
|
-
onInput:
|
|
89
|
-
}, null, 40,
|
|
90
|
-
[j,
|
|
92
|
+
onInput: f
|
|
93
|
+
}, null, 40, x), [
|
|
94
|
+
[j, d.value]
|
|
91
95
|
]),
|
|
92
|
-
s("div",
|
|
96
|
+
s("div", F, [
|
|
93
97
|
_(e.$slots, "append")
|
|
94
98
|
]),
|
|
95
|
-
q(
|
|
99
|
+
q(P, { class: "ui-text-area__contour" })
|
|
96
100
|
], 2),
|
|
97
|
-
|
|
101
|
+
h.value ? (o(), a("div", G, u(c.value.join(" ")), 1)) : e.helper ? (o(), a("div", J, u(e.helper), 1)) : n("", !0)
|
|
98
102
|
]));
|
|
99
103
|
}
|
|
100
104
|
});
|
|
101
105
|
export {
|
|
102
|
-
|
|
106
|
+
te as default
|
|
103
107
|
};
|
|
104
108
|
//# sourceMappingURL=PlTextArea.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextArea.vue.js","sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: 'PlTextArea',\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-textarea.scss';\nimport { computed, onMounted, ref, useSlots } from 'vue';\nimport { PlTooltip } from '../PlTooltip';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport { useValidation } from '../../utils/useValidation';\nimport
|
|
1
|
+
{"version":3,"file":"PlTextArea.vue.js","sources":["../../../src/components/PlTextArea/PlTextArea.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Component for multi-line string data manipulation */\nexport default {\n name: 'PlTextArea',\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-textarea.scss';\nimport { computed, onMounted, ref, useSlots } from 'vue';\nimport { PlTooltip } from '../PlTooltip';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport { useValidation } from '../../utils/useValidation';\nimport { getErrorMessage } from '../../helpers/error.ts';\nimport { PlSvg } from '../PlSvg';\nimport SvgRequired from '../../assets/images/required.svg?raw';\n\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: 'update:modelValue', value: string): void;\n}>();\n\nconst props = defineProps<{\n /**\n * The current value of the texarea.\n */\n modelValue?: string;\n /**\n * The label to display above the texarea.\n */\n label?: string;\n /**\n * If `true`, the textarea is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the textarea.\n */\n error?: unknown;\n /**\n * A helper text to display below the textarea when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the textarea when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the textarea is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the textarea is in a read-only state and cannot be edited, but it can still be focused and text can be selected.\n */\n readonly?: boolean;\n /**\n * If `true`, applies a dashed border style to the textarea, likely used for stylistic purposes or to indicate a certain state.\n */\n dashed?: boolean;\n /**\n * The number of visible text lines for the textarea, which controls the height of the textarea.\n */\n rows?: number;\n /**\n * If `true`, the textarea automatically adjusts its height to fit the content as the user types.\n */\n autogrow?: boolean;\n /**\n * An array of validation rules that are applied to the textarea input. Each rule is a function that receives the input value and returns `true` for valid input or an error message string for invalid input.\n */\n rules?: ((v: string) => boolean | string)[];\n}>();\n\nconst root = ref<HTMLInputElement>();\nconst input = ref<HTMLTextAreaElement>();\n\nconst value = computed({\n get() {\n return props.modelValue ?? '';\n },\n set(v) {\n emit('update:modelValue', v);\n },\n});\n\nconst nonEmpty = computed(() => !!props.modelValue);\nconst validationData = useValidation(value, props.rules || []);\n\nuseLabelNotch(root);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n\n if (propsError) {\n errors.push(propsError);\n }\n\n errors.push(...validationData.value.errors);\n\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst adjustHeight = () => {\n if (!props.autogrow) {\n return;\n }\n const el = input.value;\n if (el) {\n el.style.height = 'auto'; // it works, do not delete it\n el.style.height = `${el.scrollHeight}px`; // Set height based on scrollHeight\n }\n};\n\nonMounted(() => {\n adjustHeight();\n});\n</script>\n\n<template>\n <div class=\"ui-text-area__envelope\">\n <div ref=\"root\" class=\"ui-text-area\" :class=\"{ error: hasErrors, disabled, dashed, nonEmpty }\">\n <label v-if=\"label\" ref=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <textarea\n ref=\"input\"\n v-model=\"value\"\n :readonly=\"readonly\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder ?? '...'\"\n spellcheck=\"false\"\n @input=\"adjustHeight\"\n />\n <div class=\"ui-text-area__append\">\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"ui-text-area__contour\" />\n </div>\n <div v-if=\"hasErrors\" class=\"ui-text-area__error\">\n {{ displayErrors.join(' ') }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-text-area__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","slots","useSlots","emit","__emit","props","__props","root","ref","input","value","computed","v","nonEmpty","validationData","useValidation","useLabelNotch","displayErrors","errors","propsError","getErrorMessage","hasErrors","adjustHeight","el","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;GAEAA,IAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;AAcA,UAAMC,IAAQC,EAAA,GAERC,IAAOC,GAOPC,IAAQC,GAmDRC,IAAOC,EAAA,GACPC,IAAQD,EAAA,GAERE,IAAQC,EAAS;AAAA,MACrB,MAAM;AACJ,eAAON,EAAM,cAAc;AAAA,MAC7B;AAAA,MACA,IAAIO,GAAG;AACL,QAAAT,EAAK,qBAAqBS,CAAC;AAAA,MAC7B;AAAA,IAAA,CACD,GAEKC,IAAWF,EAAS,MAAM,CAAC,CAACN,EAAM,UAAU,GAC5CS,IAAiBC,EAAcL,GAAOL,EAAM,SAAS,CAAA,CAAE;AAE7D,IAAAW,EAAcT,CAAI;AAElB,UAAMU,IAAgBN,EAAS,MAAM;AACnC,YAAMO,IAAmB,CAAA,GACnBC,IAAaC,EAAgBf,EAAM,KAAK;AAE9C,aAAIc,KACFD,EAAO,KAAKC,CAAU,GAGxBD,EAAO,KAAK,GAAGJ,EAAe,MAAM,MAAM,GAEnCI;AAAA,IACT,CAAC,GAEKG,IAAYV,EAAS,MAAMM,EAAc,MAAM,SAAS,CAAC,GAEzDK,IAAe,MAAM;AACzB,UAAI,CAACjB,EAAM;AACT;AAEF,YAAMkB,IAAKd,EAAM;AACjB,MAAIc,MACFA,EAAG,MAAM,SAAS,QAClBA,EAAG,MAAM,SAAS,GAAGA,EAAG,YAAY;AAAA,IAExC;AAEA,WAAAC,EAAU,MAAM;AACd,MAAAF,EAAA;AAAA,IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".pl-text-field{--pl-text-field-text-color: var(--txt-01);--contour-color: var(--txt-01);--label-color: var(--txt-01);--contour-border-width: 1px;--contour-box-shadow: none;--label-offset-left-x: 8px;--label-offset-right-x: 8px;--prefix-color: var(--color-placeholder);--show-clearable: none;width:100%;min-width:160px;min-height:var(--control-height);position:relative;border-radius:var(--border-radius-control);display:flex;flex-direction:row;align-items:center;outline:none}.pl-text-field__envelope{font-family:var(--font-family-base)}.pl-text-field input{font-family:var(--font-family-base);font-weight:500;min-height:calc(var(--control-height) - 2px);line-height:20px;width:100%;padding:0 12px;border:none;font-size:inherit;background-color:transparent;color:var(--pl-text-field-text-color);caret-color:var(--border-color-focus);cursor:inherit}.pl-text-field input:focus{outline:none}.pl-text-field input::placeholder{color:var(--color-placeholder)}.pl-text-field label{display:flex;align-items:center;gap:4px;position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);padding:0 4px;max-width:calc(100% - 16px);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);font-size:12px;font-weight:500;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background:var(--bg-elevated-01)}.pl-text-field label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.pl-text-field__contour{position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--border-radius-control);border-width:var(--contour-border-width);border-color:var(--contour-color);border-style:solid;box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none}.pl-text-field__prefix{padding-left:12px;white-space:nowrap;margin-right:-12px;color:var(--prefix-color)}.pl-text-field__append{padding-right:12px;display:flex;flex-direction:row;align-items:center;gap:4px;cursor:text}.pl-text-field__append .icon-16{cursor:pointer}.pl-text-field__append .mask-16{--icon-color: var(--control-mask-fill);cursor:pointer}.pl-text-field__clearable{display:var(--show-clearable)!important;--icon-color: var(--ic-02) !important}.pl-text-field__helper{font-size:12px;color:var(--txt-03);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-text-field__error{font-size:12px;color:var(--txt-error);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-text-field:hover{--contour-color: var(--control-hover-color);--show-clearable: inline-block}.pl-text-field:focus-within{--show-clearable: inline-block}.pl-text-field:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.pl-text-field:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.pl-text-field.dashed .pl-text-field__contour{border-style:dashed}.pl-text-field.nonEmpty{--prefix-color: var(--txt-01)}.pl-text-field.error{--contour-color: var(--txt-error);--label-color: var(--txt-error)}.pl-text-field.disabled{--contour-color: var(--color-dis-01);--label-color: var(--dis-01);--pl-text-field-text-color: var(--dis-01);--mask-icon-bg-color: var(--dis-01);cursor:not-allowed}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as I, mergeModels as N, useSlots as $, useModel as O, ref as m, reactive as T, computed as s, createElementBlock as
|
|
2
|
+
import { defineComponent as I, mergeModels as N, useSlots as $, useModel as O, ref as m, reactive as T, computed as s, createElementBlock as d, openBlock as t, createElementVNode as c, createCommentVNode as i, normalizeClass as j, withDirectives as z, createVNode as L, createBlock as p, unref as n, toDisplayString as f, withCtx as U, renderSlot as E, vModelDynamic as A, withModifiers as V } from "vue";
|
|
3
|
+
import G from "../../assets/images/required.svg.js";
|
|
4
|
+
import { getErrorMessage as H } from "../../helpers/error.js";
|
|
5
|
+
import J from "../../utils/DoubleContour.vue.js";
|
|
6
|
+
import { useLabelNotch as K } from "../../utils/useLabelNotch.js";
|
|
7
|
+
import { useValidation as Q } from "../../utils/useValidation.js";
|
|
8
|
+
import W from "../PlIcon16/PlIcon16.vue.js";
|
|
9
|
+
import X from "../PlIcon24/PlIcon24.vue.js";
|
|
10
|
+
import Y from "../PlSvg/PlSvg.vue.js";
|
|
11
|
+
import Z from "../PlTooltip/PlTooltip.vue.js";
|
|
3
12
|
|
|
4
|
-
|
|
5
|
-
import H from "../../utils/DoubleContour.vue.js";
|
|
6
|
-
import { useLabelNotch as J } from "../../utils/useLabelNotch.js";
|
|
7
|
-
import { useValidation as K } from "../../utils/useValidation.js";
|
|
8
|
-
import Q from "../PlIcon16/PlIcon16.vue.js";
|
|
9
|
-
import W from "../PlIcon24/PlIcon24.vue.js";
|
|
10
|
-
import X from "../../generated/components/svg/images/SvgRequired.vue.js";
|
|
11
|
-
import { getErrorMessage as Y } from "../../helpers/error.js";
|
|
12
|
-
const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
13
|
+
const ee = { class: "pl-text-field__envelope" }, le = {
|
|
13
14
|
key: 0,
|
|
14
15
|
ref: "label"
|
|
15
|
-
},
|
|
16
|
+
}, oe = {
|
|
16
17
|
key: 1,
|
|
17
18
|
class: "pl-text-field__prefix"
|
|
18
|
-
},
|
|
19
|
+
}, re = ["disabled", "placeholder", "type"], te = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "pl-text-field__error"
|
|
21
|
-
},
|
|
22
|
+
}, ae = {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "pl-text-field__helper"
|
|
24
|
-
},
|
|
25
|
+
}, se = {
|
|
25
26
|
name: "PlTextField"
|
|
26
|
-
},
|
|
27
|
-
...
|
|
27
|
+
}, be = /* @__PURE__ */ I({
|
|
28
|
+
...se,
|
|
28
29
|
props: /* @__PURE__ */ N({
|
|
29
30
|
label: {},
|
|
30
31
|
clearable: { type: [Boolean, Function] },
|
|
@@ -46,7 +47,7 @@ const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
|
46
47
|
}),
|
|
47
48
|
emits: ["update:modelValue"],
|
|
48
49
|
setup(h) {
|
|
49
|
-
const C = $(), o = O(h, "modelValue"), l = h, y = m(void 0), b = m(),
|
|
50
|
+
const C = $(), o = O(h, "modelValue"), l = h, y = m(void 0), b = m(), u = m(!1), a = T({
|
|
50
51
|
cached: void 0
|
|
51
52
|
}), v = s({
|
|
52
53
|
get() {
|
|
@@ -65,18 +66,18 @@ const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
|
65
66
|
else
|
|
66
67
|
o.value = e;
|
|
67
68
|
}
|
|
68
|
-
}), M = s(() => l.type && l.type === "password" ?
|
|
69
|
+
}), M = s(() => l.type && l.type === "password" ? u.value ? "text" : l.type : "text"), S = s(() => u.value ? "view-show" : "view-hide"), B = () => {
|
|
69
70
|
l.clearable && (a.cached = void 0, o.value = l.clearable === !0 ? "" : l.clearable());
|
|
70
|
-
}, _ =
|
|
71
|
-
const e = [], r =
|
|
71
|
+
}, _ = Q(v, l.rules || []), F = s(() => l.clearable ? l.clearable === !0 ? o.value === "" : o.value === l.clearable() : o.value === ""), k = s(() => !F.value), w = s(() => {
|
|
72
|
+
const e = [], r = H(l.error);
|
|
72
73
|
return r && e.push(r), a.cached && e.push(a.cached.error), _.value.isValid || e.push(..._.value.errors), e;
|
|
73
|
-
}), g = s(() => w.value.length > 0),
|
|
74
|
+
}), g = s(() => w.value.length > 0), P = s(() => l.clearable && k.value && l.type !== "password" && !l.disabled), R = () => u.value = !u.value, D = () => {
|
|
74
75
|
a.cached = void 0;
|
|
75
76
|
}, q = () => {
|
|
76
77
|
var e;
|
|
77
78
|
return (e = b.value) == null ? void 0 : e.focus();
|
|
78
79
|
};
|
|
79
|
-
return
|
|
80
|
+
return K(y), (e, r) => (t(), d("div", ee, [
|
|
80
81
|
c("div", {
|
|
81
82
|
ref_key: "rootRef",
|
|
82
83
|
ref: y,
|
|
@@ -87,10 +88,13 @@ const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
|
87
88
|
nonEmpty: k.value
|
|
88
89
|
}])
|
|
89
90
|
}, [
|
|
90
|
-
e.label ? (t(),
|
|
91
|
-
e.required ? (t(),
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
e.label ? (t(), d("label", le, [
|
|
92
|
+
e.required ? (t(), p(n(Y), {
|
|
93
|
+
key: 0,
|
|
94
|
+
uri: n(G)
|
|
95
|
+
}, null, 8, ["uri"])) : i("", !0),
|
|
96
|
+
c("span", null, f(e.label), 1),
|
|
97
|
+
n(C).tooltip ? (t(), p(n(Z), {
|
|
94
98
|
key: 1,
|
|
95
99
|
class: "info",
|
|
96
100
|
position: "top"
|
|
@@ -101,7 +105,7 @@ const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
|
101
105
|
_: 3
|
|
102
106
|
})) : i("", !0)
|
|
103
107
|
], 512)) : i("", !0),
|
|
104
|
-
e.prefix ? (t(),
|
|
108
|
+
e.prefix ? (t(), d("div", oe, f(e.prefix), 1)) : i("", !0),
|
|
105
109
|
z(c("input", {
|
|
106
110
|
ref_key: "inputRef",
|
|
107
111
|
ref: b,
|
|
@@ -110,35 +114,35 @@ const Z = { class: "pl-text-field__envelope" }, ee = {
|
|
|
110
114
|
placeholder: e.placeholder || "...",
|
|
111
115
|
type: M.value,
|
|
112
116
|
spellcheck: "false",
|
|
113
|
-
onFocusout:
|
|
114
|
-
}, null, 40,
|
|
117
|
+
onFocusout: D
|
|
118
|
+
}, null, 40, re), [
|
|
115
119
|
[A, v.value]
|
|
116
120
|
]),
|
|
117
121
|
c("div", {
|
|
118
122
|
class: "pl-text-field__append",
|
|
119
123
|
onClick: q
|
|
120
124
|
}, [
|
|
121
|
-
|
|
125
|
+
P.value ? (t(), p(n(W), {
|
|
122
126
|
key: 0,
|
|
123
127
|
class: "pl-text-field__clearable",
|
|
124
128
|
name: "delete-clear",
|
|
125
|
-
onClick: V(
|
|
129
|
+
onClick: V(B, ["stop"])
|
|
126
130
|
})) : i("", !0),
|
|
127
|
-
e.type === "password" ? (t(),
|
|
131
|
+
e.type === "password" ? (t(), p(n(X), {
|
|
128
132
|
key: 1,
|
|
129
|
-
name:
|
|
133
|
+
name: S.value,
|
|
130
134
|
style: { cursor: "pointer" },
|
|
131
|
-
onClick: V(
|
|
135
|
+
onClick: V(R, ["stop"])
|
|
132
136
|
}, null, 8, ["name"])) : i("", !0),
|
|
133
137
|
E(e.$slots, "append")
|
|
134
138
|
]),
|
|
135
|
-
L(
|
|
139
|
+
L(J, { class: "pl-text-field__contour" })
|
|
136
140
|
], 2),
|
|
137
|
-
g.value ? (t(),
|
|
141
|
+
g.value ? (t(), d("div", te, f(w.value.join(" ")), 1)) : e.helper ? (t(), d("div", ae, f(e.helper), 1)) : i("", !0)
|
|
138
142
|
]));
|
|
139
143
|
}
|
|
140
144
|
});
|
|
141
145
|
export {
|
|
142
|
-
|
|
146
|
+
be as default
|
|
143
147
|
};
|
|
144
148
|
//# sourceMappingURL=PlTextField.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlTextField.vue.js","sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: 'PlTextField',\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M, E = string, C = E\">\nimport '
|
|
1
|
+
{"version":3,"file":"PlTextField.vue.js","sources":["../../../src/components/PlTextField/PlTextField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Component for one-line string data manipulation\n */\nexport default {\n name: 'PlTextField',\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M, E = string, C = E\">\nimport type { Equal } from '@milaboratories/helpers';\nimport { computed, reactive, ref, useSlots } from 'vue';\nimport SvgRequired from '../../assets/images/required.svg?raw';\nimport { getErrorMessage } from '../../helpers/error.ts';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport { useValidation } from '../../utils/useValidation';\nimport { PlIcon16 } from '../PlIcon16';\nimport { PlMaskIcon24 } from '../PlMaskIcon24';\nimport { PlSvg } from '../PlSvg';\nimport { PlTooltip } from '../PlTooltip';\nimport './pl-text-field.scss';\n\nconst slots = useSlots();\n\ntype Model = Equal<M, E | C> extends true ? M : never; // basically in === out\n\n/**\n * The current value of the input field.\n */\nconst model = defineModel<Model>({\n required: true,\n});\n\nconst props = defineProps<{\n /**\n * The label to display above the input field.\n */\n label?: string;\n /**\n * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).\n * Or you can pass a callback that returns a custom \"empty\" value (null | undefined | string)\n */\n clearable?: boolean | (() => C);\n /**\n * An optional callback to parse and/or cast the value, the return type overrides the model type.\n * The callback must throw an exception if the value is invalid\n */\n parse?: (v: string) => E;\n /**\n * If `true`, the input field is marked as required.\n */\n required?: boolean;\n /**\n * An error message to display below the input field.\n */\n error?: unknown;\n /**\n * A helper text to display below the input field when there are no errors.\n */\n helper?: string;\n /**\n * A placeholder text to display inside the input field when it is empty.\n */\n placeholder?: string;\n /**\n * If `true`, the input field is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * If `true`, the input field has a dashed border.\n */\n dashed?: boolean;\n /**\n * A prefix text to display inside the input field before the value.\n */\n prefix?: string;\n /**\n * An array of validation rules to apply to the input field. Each rule is a function that takes the current value and returns `true` if valid or an error message if invalid.\n */\n rules?: ((v: string) => boolean | string)[];\n /**\n * The string specifies whether the field should be a password or not, value could be \"password\" or undefined.\n */\n type?: 'password';\n}>();\n\nconst rootRef = ref<HTMLInputElement | undefined>(undefined);\n\nconst inputRef = ref<HTMLInputElement | undefined>();\n\nconst showPassword = ref(false);\n\nconst data = reactive({\n cached: undefined as { error: string; value: string } | undefined,\n});\n\nconst valueRef = computed<string>({\n get() {\n if (data.cached) {\n return data.cached.value;\n }\n return model.value === undefined || model.value === null ? '' : String(model.value);\n },\n set(value) {\n data.cached = undefined;\n\n if (props.parse) {\n try {\n model.value = props.parse(value) as Model;\n } catch (err) {\n data.cached = {\n error: err instanceof Error ? err.message : String(err),\n value,\n };\n }\n } else {\n model.value = value as Model;\n }\n },\n});\n\nconst fieldType = computed(() => {\n if (props.type && props.type === 'password') {\n return showPassword.value ? 'text' : props.type;\n } else {\n return 'text';\n }\n});\n\nconst passwordIcon = computed(() => (showPassword.value ? 'view-show' : 'view-hide'));\n\nconst clear = () => {\n if (props.clearable) {\n data.cached = undefined;\n model.value = props.clearable === true ? ('' as Model) : (props.clearable() as Model);\n }\n};\n\nconst validationData = useValidation(valueRef, props.rules || []);\n\nconst isEmpty = computed(() => {\n if (props.clearable) {\n return props.clearable === true ? model.value === '' : model.value === props.clearable();\n }\n\n return model.value === '';\n});\n\nconst nonEmpty = computed(() => !isEmpty.value);\n\nconst displayErrors = computed(() => {\n const errors: string[] = [];\n const propsError = getErrorMessage(props.error);\n if (propsError) {\n errors.push(propsError);\n }\n if (data.cached) {\n errors.push(data.cached.error);\n }\n if (!validationData.value.isValid) {\n errors.push(...validationData.value.errors);\n }\n return errors;\n});\n\nconst hasErrors = computed(() => displayErrors.value.length > 0);\n\nconst canShowClearable = computed(() => props.clearable && nonEmpty.value && props.type !== 'password' && !props.disabled);\n\nconst togglePasswordVisibility = () => (showPassword.value = !showPassword.value);\n\nconst onFocusOut = () => {\n data.cached = undefined;\n};\n\nconst setFocusOnInput = () => inputRef.value?.focus();\n\nuseLabelNotch(rootRef);\n</script>\n\n<template>\n <div class=\"pl-text-field__envelope\">\n <div\n ref=\"rootRef\"\n class=\"pl-text-field\"\n :class=\"{\n error: hasErrors,\n disabled,\n dashed,\n nonEmpty,\n }\"\n >\n <label v-if=\"label\" ref=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"prefix\" class=\"pl-text-field__prefix\">\n {{ prefix }}\n </div>\n <input\n ref=\"inputRef\"\n v-model=\"valueRef\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder || '...'\"\n :type=\"fieldType\"\n spellcheck=\"false\"\n @focusout=\"onFocusOut\"\n />\n <div class=\"pl-text-field__append\" @click=\"setFocusOnInput\">\n <PlIcon16 v-if=\"canShowClearable\" class=\"pl-text-field__clearable\" name=\"delete-clear\" @click.stop=\"clear\" />\n <PlMaskIcon24 v-if=\"type === 'password'\" :name=\"passwordIcon\" style=\"cursor: pointer\" @click.stop=\"togglePasswordVisibility\" />\n <slot name=\"append\" />\n </div>\n <DoubleContour class=\"pl-text-field__contour\" />\n </div>\n <div v-if=\"hasErrors\" class=\"pl-text-field__error\">\n {{ displayErrors.join(' ') }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-text-field__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","slots","useSlots","model","_useModel","__props","props","rootRef","ref","inputRef","showPassword","data","reactive","valueRef","computed","value","err","fieldType","passwordIcon","clear","validationData","useValidation","isEmpty","nonEmpty","displayErrors","errors","propsError","getErrorMessage","hasErrors","canShowClearable","togglePasswordVisibility","onFocusOut","setFocusOnInput","_a","useLabelNotch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAIAA,KAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;;;AAiBA,UAAMC,IAAQC,EAAA,GAORC,IAAQC,EAAkBC,GAAA,YAE/B,GAEKC,IAAQD,GAqDRE,IAAUC,EAAkC,MAAS,GAErDC,IAAWD,EAAA,GAEXE,IAAeF,EAAI,EAAK,GAExBG,IAAOC,EAAS;AAAA,MACpB,QAAQ;AAAA,IAAA,CACT,GAEKC,IAAWC,EAAiB;AAAA,MAChC,MAAM;AACJ,eAAIH,EAAK,SACAA,EAAK,OAAO,QAEdR,EAAM,UAAU,UAAaA,EAAM,UAAU,OAAO,KAAK,OAAOA,EAAM,KAAK;AAAA,MACpF;AAAA,MACA,IAAIY,GAAO;AAGT,YAFAJ,EAAK,SAAS,QAEVL,EAAM;AACR,cAAI;AACF,YAAAH,EAAM,QAAQG,EAAM,MAAMS,CAAK;AAAA,UACjC,SAASC,GAAK;AACZ,YAAAL,EAAK,SAAS;AAAA,cACZ,OAAOK,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG;AAAA,cACtD,OAAAD;AAAA,YAAA;AAAA,UAEJ;AAAA;AAEA,UAAAZ,EAAM,QAAQY;AAAA,MAElB;AAAA,IAAA,CACD,GAEKE,IAAYH,EAAS,MACrBR,EAAM,QAAQA,EAAM,SAAS,aACxBI,EAAa,QAAQ,SAASJ,EAAM,OAEpC,MAEV,GAEKY,IAAeJ,EAAS,MAAOJ,EAAa,QAAQ,cAAc,WAAY,GAE9ES,IAAQ,MAAM;AAClB,MAAIb,EAAM,cACRK,EAAK,SAAS,QACdR,EAAM,QAAQG,EAAM,cAAc,KAAQ,KAAgBA,EAAM,UAAA;AAAA,IAEpE,GAEMc,IAAiBC,EAAcR,GAAUP,EAAM,SAAS,CAAA,CAAE,GAE1DgB,IAAUR,EAAS,MACnBR,EAAM,YACDA,EAAM,cAAc,KAAOH,EAAM,UAAU,KAAKA,EAAM,UAAUG,EAAM,UAAA,IAGxEH,EAAM,UAAU,EACxB,GAEKoB,IAAWT,EAAS,MAAM,CAACQ,EAAQ,KAAK,GAExCE,IAAgBV,EAAS,MAAM;AACnC,YAAMW,IAAmB,CAAA,GACnBC,IAAaC,EAAgBrB,EAAM,KAAK;AAC9C,aAAIoB,KACFD,EAAO,KAAKC,CAAU,GAEpBf,EAAK,UACPc,EAAO,KAAKd,EAAK,OAAO,KAAK,GAE1BS,EAAe,MAAM,WACxBK,EAAO,KAAK,GAAGL,EAAe,MAAM,MAAM,GAErCK;AAAA,IACT,CAAC,GAEKG,IAAYd,EAAS,MAAMU,EAAc,MAAM,SAAS,CAAC,GAEzDK,IAAmBf,EAAS,MAAMR,EAAM,aAAaiB,EAAS,SAASjB,EAAM,SAAS,cAAc,CAACA,EAAM,QAAQ,GAEnHwB,IAA2B,MAAOpB,EAAa,QAAQ,CAACA,EAAa,OAErEqB,IAAa,MAAM;AACvB,MAAApB,EAAK,SAAS;AAAA,IAChB,GAEMqB,IAAkB,MAAA;;AAAM,cAAAC,IAAAxB,EAAS,UAAT,gBAAAwB,EAAgB;AAAA;AAE9C,WAAAC,EAAc3B,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"resize-observer-polyfill": "^1.5.1",
|
|
33
33
|
"canonicalize": "~2.1.0",
|
|
34
34
|
"@milaboratories/helpers": "1.12.0",
|
|
35
|
-
"@platforma-sdk/model": "1.44.
|
|
35
|
+
"@platforma-sdk/model": "1.44.14"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"jsdom": "^25.0.1",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"svgo": "^3.3.2",
|
|
42
42
|
"typescript": "~5.6.3",
|
|
43
43
|
"@milaboratories/build-configs": "1.0.8",
|
|
44
|
+
"@milaboratories/eslint-config": "1.0.4",
|
|
44
45
|
"@milaboratories/ts-configs": "1.0.6",
|
|
45
|
-
"@milaboratories/ts-builder": "1.0.5"
|
|
46
|
-
"@milaboratories/eslint-config": "1.0.4"
|
|
46
|
+
"@milaboratories/ts-builder": "1.0.5"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"dev": "ts-builder serve --target browser-lib --build-config ./build.browser-lib.config.js",
|
|
@@ -24,9 +24,10 @@ import { PlMaskIcon24 } from '../PlMaskIcon24';
|
|
|
24
24
|
import { DropdownOverlay } from '../../utils/DropdownOverlay';
|
|
25
25
|
import { refDebounced } from '@vueuse/core';
|
|
26
26
|
import { useWatchFetch } from '../../composition/useWatchFetch.ts';
|
|
27
|
-
import SvgRequired from '../../generated/components/svg/images/SvgRequired.vue';
|
|
28
27
|
import { getErrorMessage } from '../../helpers/error.ts';
|
|
29
28
|
import type { ListOptionBase } from '@platforma-sdk/model';
|
|
29
|
+
import { PlSvg } from '../PlSvg';
|
|
30
|
+
import SvgRequired from '../../assets/images/required.svg?raw';
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* The current selected value.
|
|
@@ -297,7 +298,7 @@ const optionsRequest = useWatchFetch(() => searchDebounced.value, async (v) => {
|
|
|
297
298
|
if (v !== null) { // search is null when dropdown is closed;
|
|
298
299
|
return props.optionsSearch(v);
|
|
299
300
|
}
|
|
300
|
-
return
|
|
301
|
+
return undefined;
|
|
301
302
|
});
|
|
302
303
|
|
|
303
304
|
const modelOptionRequest = useWatchFetch(() => model.value, async (v) => {
|
|
@@ -376,7 +377,7 @@ watch(() => optionsRequest.loading || modelOptionRequest.loading, (loading) => {
|
|
|
376
377
|
</div>
|
|
377
378
|
</div>
|
|
378
379
|
<label v-if="label">
|
|
379
|
-
<
|
|
380
|
+
<PlSvg v-if="required" :uri="SvgRequired" />
|
|
380
381
|
<span>{{ label }}</span>
|
|
381
382
|
<PlTooltip v-if="slots.tooltip" class="info" position="top">
|
|
382
383
|
<template #tooltip>
|
|
@@ -39,20 +39,23 @@ export default {
|
|
|
39
39
|
|
|
40
40
|
<script lang="ts" setup generic="M = unknown">
|
|
41
41
|
import './pl-autocomplete-multi.scss';
|
|
42
|
-
|
|
43
|
-
import {
|
|
44
|
-
import
|
|
42
|
+
|
|
43
|
+
import type { ListOptionBase } from '@platforma-sdk/model';
|
|
44
|
+
import canonicalize from 'canonicalize';
|
|
45
|
+
import { computed, reactive, ref, toRef, unref, useSlots, useTemplateRef, watch } from 'vue';
|
|
46
|
+
import { useWatchFetch } from '../../composition/useWatchFetch.ts';
|
|
47
|
+
import { getErrorMessage } from '../../helpers/error.ts';
|
|
48
|
+
import { deepEqual, deepIncludes } from '../../helpers/objects';
|
|
45
49
|
import DoubleContour from '../../utils/DoubleContour.vue';
|
|
50
|
+
import DropdownOverlay from '../../utils/DropdownOverlay/DropdownOverlay.vue';
|
|
46
51
|
import { useLabelNotch } from '../../utils/useLabelNotch';
|
|
47
52
|
import DropdownListItem from '../DropdownListItem.vue';
|
|
48
|
-
import {
|
|
49
|
-
import DropdownOverlay from '../../utils/DropdownOverlay/DropdownOverlay.vue';
|
|
53
|
+
import { PlChip } from '../PlChip';
|
|
50
54
|
import { PlMaskIcon24 } from '../PlMaskIcon24';
|
|
51
|
-
import
|
|
52
|
-
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import type { ListOptionBase } from '@platforma-sdk/model';
|
|
55
|
+
import { PlTooltip } from '../PlTooltip';
|
|
56
|
+
|
|
57
|
+
import SvgRequired from '../../assets/images/required.svg?raw';
|
|
58
|
+
import { PlSvg } from '../PlSvg';
|
|
56
59
|
|
|
57
60
|
const emit = defineEmits<{
|
|
58
61
|
(e: 'update:modelValue', v: M[]): void;
|
|
@@ -362,7 +365,7 @@ const computedError = computed(() => {
|
|
|
362
365
|
</div>
|
|
363
366
|
</div>
|
|
364
367
|
<label v-if="label">
|
|
365
|
-
<
|
|
368
|
+
<PlSvg v-if="required" :uri="SvgRequired" />
|
|
366
369
|
<span>{{ label }}</span>
|
|
367
370
|
<PlTooltip v-if="slots.tooltip" class="info" position="top">
|
|
368
371
|
<template #tooltip>
|