@ptcwebops/ptcw-design 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{icon-asset_5.cjs.entry.js → icon-asset_4.cjs.entry.js} +38 -61
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ptc-responsive-wrapper.cjs.entry.js +65 -0
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.js +87 -16
- package/dist/custom-elements/index.js +39 -3
- package/dist/esm/{icon-asset_5.entry.js → icon-asset_4.entry.js} +40 -62
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ptc-responsive-wrapper.entry.js +61 -0
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/ptcw-design/p-91456c49.entry.js +1 -0
- package/dist/ptcw-design/p-b7981c22.entry.js +7 -0
- package/dist/ptcw-design/ptcw-design.css +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/ptc-mobile-select/ptc-mobile-select.d.ts +16 -4
- package/dist/types/components.d.ts +26 -10
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-4bacc49a.entry.js +0 -7
|
@@ -817,96 +817,74 @@ const ptcMobileSelectCss = ".mobileSelect{position:relative;z-index:0;opacity:0;
|
|
|
817
817
|
let PtcMobileSelect = class {
|
|
818
818
|
constructor(hostRef) {
|
|
819
819
|
index.registerInstance(this, hostRef);
|
|
820
|
+
/**
|
|
821
|
+
* Selected Id
|
|
822
|
+
* - initialize the id(string) of default wheel
|
|
823
|
+
*/
|
|
824
|
+
this.selectedId = '';
|
|
820
825
|
/**
|
|
821
826
|
* Confirm Text
|
|
827
|
+
* - translation goes here
|
|
822
828
|
*/
|
|
823
829
|
this.ensureBtnText = 'Confirm';
|
|
824
830
|
/**
|
|
825
831
|
* Cancel Text
|
|
832
|
+
* - translation goes here
|
|
826
833
|
*/
|
|
827
834
|
this.cancelBtnText = 'Cancel';
|
|
828
835
|
/**
|
|
829
836
|
* Mobile select list title (Optional)
|
|
830
837
|
*/
|
|
831
838
|
this.listTitle = undefined;
|
|
839
|
+
/**
|
|
840
|
+
* link url
|
|
841
|
+
*/
|
|
842
|
+
this.linkUrl = undefined;
|
|
832
843
|
}
|
|
833
844
|
render() {
|
|
834
|
-
return (index.h("
|
|
845
|
+
return (index.h("div", { class: "mobile-select-wrapper" }, index.h("div", { id: this.triggerName }, this.selectedText), index.h("icon-asset", { type: "ptc", size: "x-small", name: "chevron-down", color: "white" })));
|
|
835
846
|
}
|
|
836
847
|
componentDidRender() {
|
|
848
|
+
let currentId = this.selectedId; //input current lang
|
|
849
|
+
let storeIndex = 0;
|
|
837
850
|
new mobileSelect({
|
|
838
851
|
trigger: `#${this.triggerName}`,
|
|
839
852
|
title: `${this.listTitle ? this.listTitle : ''}`,
|
|
840
|
-
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: [
|
|
853
|
+
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: ['test1', 'test2'] }],
|
|
841
854
|
position: [0],
|
|
842
855
|
ensureBtnText: this.ensureBtnText,
|
|
843
856
|
cancelBtnText: this.cancelBtnText,
|
|
844
857
|
ensureBtnColor: 'var(--color-gray-12)',
|
|
845
858
|
cancelBtnColor: 'var(--color-gray-12)',
|
|
846
859
|
titleColor: 'var(--color-gray-12)',
|
|
860
|
+
onShow: function (e) {
|
|
861
|
+
if (currentId) {
|
|
862
|
+
let liEle = document.querySelectorAll('.selectContainer li');
|
|
863
|
+
liEle.forEach((currentValue, currentIndex) => {
|
|
864
|
+
if (currentValue.getAttribute('data-id') == currentId) {
|
|
865
|
+
storeIndex = currentIndex;
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
e.locatePosition(0, storeIndex);
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
callback: function (indexArr, data) {
|
|
876
|
+
if (this.linkUrl !== undefined) {
|
|
877
|
+
window.location.href = this.linkUrl + '/' + data[0].id;
|
|
878
|
+
}
|
|
879
|
+
else {
|
|
880
|
+
console.log('index: ' + indexArr + ', id: ' + data[0].id + '; No link url founded!');
|
|
881
|
+
}
|
|
882
|
+
}.bind(this),
|
|
847
883
|
});
|
|
848
884
|
}
|
|
849
885
|
};
|
|
850
886
|
PtcMobileSelect.style = ptcMobileSelectCss;
|
|
851
887
|
|
|
852
|
-
const ptcResponsiveWrapperCss = ":host{display:block}";
|
|
853
|
-
|
|
854
|
-
let PtcResponsiveWrapper = class {
|
|
855
|
-
constructor(hostRef) {
|
|
856
|
-
index.registerInstance(this, hostRef);
|
|
857
|
-
}
|
|
858
|
-
componentDidLoad() {
|
|
859
|
-
this.ro = new ResizeObserver(entries => {
|
|
860
|
-
for (const entry of entries) {
|
|
861
|
-
this.applySizeClasses(entry.contentRect.width);
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
this.ro.observe(this.element);
|
|
865
|
-
}
|
|
866
|
-
disconnectedCallback() {
|
|
867
|
-
this.ro.disconnect();
|
|
868
|
-
}
|
|
869
|
-
applySizeClasses(size) {
|
|
870
|
-
let xsmall = false;
|
|
871
|
-
let small = false;
|
|
872
|
-
let medium = false;
|
|
873
|
-
let large = false;
|
|
874
|
-
let xlarge = false;
|
|
875
|
-
let xxlarge = false;
|
|
876
|
-
let large2k = false;
|
|
877
|
-
let large4k = false;
|
|
878
|
-
if (size >= 2600)
|
|
879
|
-
large4k = true;
|
|
880
|
-
else if (size >= 1980)
|
|
881
|
-
large2k = true;
|
|
882
|
-
else if (size >= 1600)
|
|
883
|
-
xxlarge = true;
|
|
884
|
-
else if (size >= 1440)
|
|
885
|
-
xlarge = true;
|
|
886
|
-
else if (size >= 1200)
|
|
887
|
-
large = true;
|
|
888
|
-
else if (size >= 992)
|
|
889
|
-
medium = true;
|
|
890
|
-
else if (size >= 768)
|
|
891
|
-
small = true;
|
|
892
|
-
else
|
|
893
|
-
xsmall = true;
|
|
894
|
-
this.element.classList.toggle("xsmall", xsmall);
|
|
895
|
-
this.element.classList.toggle("small", small);
|
|
896
|
-
this.element.classList.toggle("medium", medium);
|
|
897
|
-
this.element.classList.toggle("large", large);
|
|
898
|
-
this.element.classList.toggle("xlarge", xlarge);
|
|
899
|
-
this.element.classList.toggle("xxlarge", xxlarge);
|
|
900
|
-
this.element.classList.toggle("large2k", large2k);
|
|
901
|
-
this.element.classList.toggle("large4k", large4k);
|
|
902
|
-
}
|
|
903
|
-
render() {
|
|
904
|
-
return (index.h("div", null, index.h("slot", null)));
|
|
905
|
-
}
|
|
906
|
-
get element() { return index.getElement(this); }
|
|
907
|
-
};
|
|
908
|
-
PtcResponsiveWrapper.style = ptcResponsiveWrapperCss;
|
|
909
|
-
|
|
910
888
|
const closeSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 42 41.485">
|
|
911
889
|
<g id="Group_1042" data-name="Group 1042" transform="rotate(180 108.25 87.993)">
|
|
912
890
|
<path id="Line_446" d="M0 0v39.486" class="cls-1" data-name="Line 446"></path>
|
|
@@ -984,5 +962,4 @@ PtcSvgBtn.style = ptcSvgBtnCss;
|
|
|
984
962
|
exports.icon_asset = IconAsset;
|
|
985
963
|
exports.ptc_announcement = PtcAnnouncement;
|
|
986
964
|
exports.ptc_mobile_select = PtcMobileSelect;
|
|
987
|
-
exports.ptc_responsive_wrapper = PtcResponsiveWrapper;
|
|
988
965
|
exports.ptc_svg_btn = PtcSvgBtn;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ptc-breadcrumb.cjs",[[1,"ptc-breadcrumb"]]],["ptc-hero.cjs",[[1,"ptc-hero",{"heroType":[1,"hero-type"],"bgUrl":[1,"bg-url"]}]]],["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"headingTransform":[1,"heading-transform"],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["ptc-social-share.cjs",[[1,"ptc-social-share",{"display":[1],"shareType":[1,"share-type"],"shareTitle":[1,"share-title"],"text":[1],"url":[1],"source":[1],"recipient":[1],"isHover":[32]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-button.cjs",[[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"linkTitle":[1,"link-title"],"target":[1],"rel":[1],"tabNav":[2,"tab-nav"],"styles":[1]}]]],["ptc-card-bottom.cjs",[[1,"ptc-card-bottom",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-content.cjs",[[1,"ptc-card-content",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-plm.cjs",[[1,"ptc-card-plm",{"cardType":[1,"card-type"],"cardLink":[1,"card-link"],"linkTitle":[1,"link-title"],"linkTarget":[1,"link-target"]}]]],["ptc-countdown.cjs",[[1,"ptc-countdown"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-form.cjs",[[6,"ptc-form",{"value":[32],"inputValue":[32],"selectValue":[32]}]]],["ptc-input.cjs",[[6,"ptc-input",{"type":[1],"dataEloquaName":[1,"data-eloqua-name"],"inputId":[1,"input-id"],"inputName":[1,"input-name"],"focused":[32]}]]],["ptc-list.cjs",[[2,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-modal.cjs",[[1,"ptc-modal",{"iframeUrl":[1025,"iframe-url"],"size":[1025],"show":[1028],"overlay":[1028],"closeOnBlur":[1028,"close-on-blur"],"overlayHeight":[32],"bodyOverflowSetting":[32]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-para.cjs",[[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraColor":[1,"para-color"],"paraLineH":[1,"para-line-h"],"paraMargin":[1,"para-margin"]}]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imagePosition":[1,"image-position"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"isFullHeight":[4,"is-full-height"],"isFullWidth":[4,"is-full-width"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-select.cjs",[[6,"ptc-select",{"dataEloquaName":[1,"data-eloqua-name"],"selectId":[1,"select-id"],"name":[1],"valueOptions":[1040]}]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[6,"ptc-title",{"isPlmHub":[4,"is-plm-hub"],"type":[1],"textAlign":[1,"text-align"],"upperline":[1],"titleShadow":[1,"title-shadow"],"titleMargin":[1,"title-margin"],"titleWeight":[1,"title-weight"],"titleSize":[1,"title-size"],"titleLHeight":[1,"title-l-height"],"styles":[1]}]]],["list-item.cjs",[[1,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"],"flushBefore":[4,"flush-before"]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateColor":[1,"date-color"],"dateStyles":[1,"date-styles"],"dataSize":[1,"data-size"]}]]],["ptc-img_2.cjs",[[4,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]],[1,"ptc-overlay",{"filterColor":[1,"filter-color"],"borderRadius":[1,"border-radius"],"overlayZIndex":[1,"overlay-z-index"],"styles":[1]}]]],["icon-
|
|
17
|
+
return index.bootstrapLazy([["ptc-breadcrumb.cjs",[[1,"ptc-breadcrumb"]]],["ptc-hero.cjs",[[1,"ptc-hero",{"heroType":[1,"hero-type"],"bgUrl":[1,"bg-url"]}]]],["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"headingTransform":[1,"heading-transform"],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["ptc-social-share.cjs",[[1,"ptc-social-share",{"display":[1],"shareType":[1,"share-type"],"shareTitle":[1,"share-title"],"text":[1],"url":[1],"source":[1],"recipient":[1],"isHover":[32]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-button.cjs",[[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"linkTitle":[1,"link-title"],"target":[1],"rel":[1],"tabNav":[2,"tab-nav"],"styles":[1]}]]],["ptc-card-bottom.cjs",[[1,"ptc-card-bottom",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-content.cjs",[[1,"ptc-card-content",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-plm.cjs",[[1,"ptc-card-plm",{"cardType":[1,"card-type"],"cardLink":[1,"card-link"],"linkTitle":[1,"link-title"],"linkTarget":[1,"link-target"]}]]],["ptc-countdown.cjs",[[1,"ptc-countdown"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-form.cjs",[[6,"ptc-form",{"value":[32],"inputValue":[32],"selectValue":[32]}]]],["ptc-input.cjs",[[6,"ptc-input",{"type":[1],"dataEloquaName":[1,"data-eloqua-name"],"inputId":[1,"input-id"],"inputName":[1,"input-name"],"focused":[32]}]]],["ptc-list.cjs",[[2,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-modal.cjs",[[1,"ptc-modal",{"iframeUrl":[1025,"iframe-url"],"size":[1025],"show":[1028],"overlay":[1028],"closeOnBlur":[1028,"close-on-blur"],"overlayHeight":[32],"bodyOverflowSetting":[32]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-para.cjs",[[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraColor":[1,"para-color"],"paraLineH":[1,"para-line-h"],"paraMargin":[1,"para-margin"]}]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imagePosition":[1,"image-position"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"isFullHeight":[4,"is-full-height"],"isFullWidth":[4,"is-full-width"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-responsive-wrapper.cjs",[[1,"ptc-responsive-wrapper"]]],["ptc-select.cjs",[[6,"ptc-select",{"dataEloquaName":[1,"data-eloqua-name"],"selectId":[1,"select-id"],"name":[1],"valueOptions":[1040]}]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[6,"ptc-title",{"isPlmHub":[4,"is-plm-hub"],"type":[1],"textAlign":[1,"text-align"],"upperline":[1],"titleShadow":[1,"title-shadow"],"titleMargin":[1,"title-margin"],"titleWeight":[1,"title-weight"],"titleSize":[1,"title-size"],"titleLHeight":[1,"title-l-height"],"styles":[1]}]]],["list-item.cjs",[[1,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"],"flushBefore":[4,"flush-before"]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateColor":[1,"date-color"],"dateStyles":[1,"date-styles"],"dataSize":[1,"data-size"]}]]],["ptc-img_2.cjs",[[4,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]],[1,"ptc-overlay",{"filterColor":[1,"filter-color"],"borderRadius":[1,"border-radius"],"overlayZIndex":[1,"overlay-z-index"],"styles":[1]}]]],["icon-asset_4.cjs",[[1,"ptc-announcement",{"barTitle":[1,"bar-title"],"Description":[1,"description"],"linkText":[513,"link-text"],"visible":[1540],"linkUrl":[513,"link-url"],"tempContainer":[4,"temp-container"]}],[0,"ptc-mobile-select",{"triggerName":[1,"trigger-name"],"selectedText":[1,"selected-text"],"wheelData":[1040],"selectedId":[1,"selected-id"],"ensureBtnText":[1,"ensure-btn-text"],"cancelBtnText":[1,"cancel-btn-text"],"listTitle":[1,"list-title"],"linkUrl":[1025,"link-url"]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"],"display":[1]}],[2,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-3adcf9f4.js');
|
|
6
|
+
|
|
7
|
+
const ptcResponsiveWrapperCss = ":host{display:block}";
|
|
8
|
+
|
|
9
|
+
let PtcResponsiveWrapper = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
componentDidLoad() {
|
|
14
|
+
this.ro = new ResizeObserver(entries => {
|
|
15
|
+
for (const entry of entries) {
|
|
16
|
+
this.applySizeClasses(entry.contentRect.width);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
this.ro.observe(this.element);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
this.ro.disconnect();
|
|
23
|
+
}
|
|
24
|
+
applySizeClasses(size) {
|
|
25
|
+
let xsmall = false;
|
|
26
|
+
let small = false;
|
|
27
|
+
let medium = false;
|
|
28
|
+
let large = false;
|
|
29
|
+
let xlarge = false;
|
|
30
|
+
let xxlarge = false;
|
|
31
|
+
let large2k = false;
|
|
32
|
+
let large4k = false;
|
|
33
|
+
if (size >= 2600)
|
|
34
|
+
large4k = true;
|
|
35
|
+
else if (size >= 1980)
|
|
36
|
+
large2k = true;
|
|
37
|
+
else if (size >= 1600)
|
|
38
|
+
xxlarge = true;
|
|
39
|
+
else if (size >= 1440)
|
|
40
|
+
xlarge = true;
|
|
41
|
+
else if (size >= 1200)
|
|
42
|
+
large = true;
|
|
43
|
+
else if (size >= 992)
|
|
44
|
+
medium = true;
|
|
45
|
+
else if (size >= 768)
|
|
46
|
+
small = true;
|
|
47
|
+
else
|
|
48
|
+
xsmall = true;
|
|
49
|
+
this.element.classList.toggle("xsmall", xsmall);
|
|
50
|
+
this.element.classList.toggle("small", small);
|
|
51
|
+
this.element.classList.toggle("medium", medium);
|
|
52
|
+
this.element.classList.toggle("large", large);
|
|
53
|
+
this.element.classList.toggle("xlarge", xlarge);
|
|
54
|
+
this.element.classList.toggle("xxlarge", xxlarge);
|
|
55
|
+
this.element.classList.toggle("large2k", large2k);
|
|
56
|
+
this.element.classList.toggle("large4k", large4k);
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return (index.h("div", null, index.h("slot", null)));
|
|
60
|
+
}
|
|
61
|
+
get element() { return index.getElement(this); }
|
|
62
|
+
};
|
|
63
|
+
PtcResponsiveWrapper.style = ptcResponsiveWrapperCss;
|
|
64
|
+
|
|
65
|
+
exports.ptc_responsive_wrapper = PtcResponsiveWrapper;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["ptc-breadcrumb.cjs",[[1,"ptc-breadcrumb"]]],["ptc-hero.cjs",[[1,"ptc-hero",{"heroType":[1,"hero-type"],"bgUrl":[1,"bg-url"]}]]],["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"headingTransform":[1,"heading-transform"],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["ptc-social-share.cjs",[[1,"ptc-social-share",{"display":[1],"shareType":[1,"share-type"],"shareTitle":[1,"share-title"],"text":[1],"url":[1],"source":[1],"recipient":[1],"isHover":[32]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-button.cjs",[[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"linkTitle":[1,"link-title"],"target":[1],"rel":[1],"tabNav":[2,"tab-nav"],"styles":[1]}]]],["ptc-card-bottom.cjs",[[1,"ptc-card-bottom",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-content.cjs",[[1,"ptc-card-content",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-plm.cjs",[[1,"ptc-card-plm",{"cardType":[1,"card-type"],"cardLink":[1,"card-link"],"linkTitle":[1,"link-title"],"linkTarget":[1,"link-target"]}]]],["ptc-countdown.cjs",[[1,"ptc-countdown"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-form.cjs",[[6,"ptc-form",{"value":[32],"inputValue":[32],"selectValue":[32]}]]],["ptc-input.cjs",[[6,"ptc-input",{"type":[1],"dataEloquaName":[1,"data-eloqua-name"],"inputId":[1,"input-id"],"inputName":[1,"input-name"],"focused":[32]}]]],["ptc-list.cjs",[[2,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-modal.cjs",[[1,"ptc-modal",{"iframeUrl":[1025,"iframe-url"],"size":[1025],"show":[1028],"overlay":[1028],"closeOnBlur":[1028,"close-on-blur"],"overlayHeight":[32],"bodyOverflowSetting":[32]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-para.cjs",[[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraColor":[1,"para-color"],"paraLineH":[1,"para-line-h"],"paraMargin":[1,"para-margin"]}]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imagePosition":[1,"image-position"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"isFullHeight":[4,"is-full-height"],"isFullWidth":[4,"is-full-width"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-select.cjs",[[6,"ptc-select",{"dataEloquaName":[1,"data-eloqua-name"],"selectId":[1,"select-id"],"name":[1],"valueOptions":[1040]}]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[6,"ptc-title",{"isPlmHub":[4,"is-plm-hub"],"type":[1],"textAlign":[1,"text-align"],"upperline":[1],"titleShadow":[1,"title-shadow"],"titleMargin":[1,"title-margin"],"titleWeight":[1,"title-weight"],"titleSize":[1,"title-size"],"titleLHeight":[1,"title-l-height"],"styles":[1]}]]],["list-item.cjs",[[1,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"],"flushBefore":[4,"flush-before"]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateColor":[1,"date-color"],"dateStyles":[1,"date-styles"],"dataSize":[1,"data-size"]}]]],["ptc-img_2.cjs",[[4,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]],[1,"ptc-overlay",{"filterColor":[1,"filter-color"],"borderRadius":[1,"border-radius"],"overlayZIndex":[1,"overlay-z-index"],"styles":[1]}]]],["icon-
|
|
18
|
+
return index.bootstrapLazy([["ptc-breadcrumb.cjs",[[1,"ptc-breadcrumb"]]],["ptc-hero.cjs",[[1,"ptc-hero",{"heroType":[1,"hero-type"],"bgUrl":[1,"bg-url"]}]]],["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"headingTransform":[1,"heading-transform"],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["ptc-social-share.cjs",[[1,"ptc-social-share",{"display":[1],"shareType":[1,"share-type"],"shareTitle":[1,"share-title"],"text":[1],"url":[1],"source":[1],"recipient":[1],"isHover":[32]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-button.cjs",[[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"linkTitle":[1,"link-title"],"target":[1],"rel":[1],"tabNav":[2,"tab-nav"],"styles":[1]}]]],["ptc-card-bottom.cjs",[[1,"ptc-card-bottom",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-content.cjs",[[1,"ptc-card-content",{"cardType":[1,"card-type"],"styles":[1]}]]],["ptc-card-plm.cjs",[[1,"ptc-card-plm",{"cardType":[1,"card-type"],"cardLink":[1,"card-link"],"linkTitle":[1,"link-title"],"linkTarget":[1,"link-target"]}]]],["ptc-countdown.cjs",[[1,"ptc-countdown"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-form.cjs",[[6,"ptc-form",{"value":[32],"inputValue":[32],"selectValue":[32]}]]],["ptc-input.cjs",[[6,"ptc-input",{"type":[1],"dataEloquaName":[1,"data-eloqua-name"],"inputId":[1,"input-id"],"inputName":[1,"input-name"],"focused":[32]}]]],["ptc-list.cjs",[[2,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-modal.cjs",[[1,"ptc-modal",{"iframeUrl":[1025,"iframe-url"],"size":[1025],"show":[1028],"overlay":[1028],"closeOnBlur":[1028,"close-on-blur"],"overlayHeight":[32],"bodyOverflowSetting":[32]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-para.cjs",[[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraColor":[1,"para-color"],"paraLineH":[1,"para-line-h"],"paraMargin":[1,"para-margin"]}]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imagePosition":[1,"image-position"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"isFullHeight":[4,"is-full-height"],"isFullWidth":[4,"is-full-width"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-responsive-wrapper.cjs",[[1,"ptc-responsive-wrapper"]]],["ptc-select.cjs",[[6,"ptc-select",{"dataEloquaName":[1,"data-eloqua-name"],"selectId":[1,"select-id"],"name":[1],"valueOptions":[1040]}]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[6,"ptc-title",{"isPlmHub":[4,"is-plm-hub"],"type":[1],"textAlign":[1,"text-align"],"upperline":[1],"titleShadow":[1,"title-shadow"],"titleMargin":[1,"title-margin"],"titleWeight":[1,"title-weight"],"titleSize":[1,"title-size"],"titleLHeight":[1,"title-l-height"],"styles":[1]}]]],["list-item.cjs",[[1,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"],"flushBefore":[4,"flush-before"]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateColor":[1,"date-color"],"dateStyles":[1,"date-styles"],"dataSize":[1,"data-size"]}]]],["ptc-img_2.cjs",[[4,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]],[1,"ptc-overlay",{"filterColor":[1,"filter-color"],"borderRadius":[1,"border-radius"],"overlayZIndex":[1,"overlay-z-index"],"styles":[1]}]]],["icon-asset_4.cjs",[[1,"ptc-announcement",{"barTitle":[1,"bar-title"],"Description":[1,"description"],"linkText":[513,"link-text"],"visible":[1540],"linkUrl":[513,"link-url"],"tempContainer":[4,"temp-container"]}],[0,"ptc-mobile-select",{"triggerName":[1,"trigger-name"],"selectedText":[1,"selected-text"],"wheelData":[1040],"selectedId":[1,"selected-id"],"ensureBtnText":[1,"ensure-btn-text"],"cancelBtnText":[1,"cancel-btn-text"],"listTitle":[1,"list-title"],"linkUrl":[1025,"link-url"]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"],"display":[1]}],[2,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
|
|
19
19
|
});
|
|
@@ -2,36 +2,71 @@ import { Component, h, Prop } from '@stencil/core';
|
|
|
2
2
|
import MobileSelect from 'mobile-select';
|
|
3
3
|
export class PtcMobileSelect {
|
|
4
4
|
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Selected Id
|
|
7
|
+
* - initialize the id(string) of default wheel
|
|
8
|
+
*/
|
|
9
|
+
this.selectedId = '';
|
|
5
10
|
/**
|
|
6
11
|
* Confirm Text
|
|
12
|
+
* - translation goes here
|
|
7
13
|
*/
|
|
8
14
|
this.ensureBtnText = 'Confirm';
|
|
9
15
|
/**
|
|
10
16
|
* Cancel Text
|
|
17
|
+
* - translation goes here
|
|
11
18
|
*/
|
|
12
19
|
this.cancelBtnText = 'Cancel';
|
|
13
20
|
/**
|
|
14
21
|
* Mobile select list title (Optional)
|
|
15
22
|
*/
|
|
16
23
|
this.listTitle = undefined;
|
|
24
|
+
/**
|
|
25
|
+
* link url
|
|
26
|
+
*/
|
|
27
|
+
this.linkUrl = undefined;
|
|
17
28
|
}
|
|
18
29
|
render() {
|
|
19
|
-
return (h("
|
|
20
|
-
h("div", {
|
|
21
|
-
|
|
22
|
-
h("icon-asset", { type: "ptc", size: "x-small", name: "chevron-down", color: "white" }))));
|
|
30
|
+
return (h("div", { class: "mobile-select-wrapper" },
|
|
31
|
+
h("div", { id: this.triggerName }, this.selectedText),
|
|
32
|
+
h("icon-asset", { type: "ptc", size: "x-small", name: "chevron-down", color: "white" })));
|
|
23
33
|
}
|
|
24
34
|
componentDidRender() {
|
|
35
|
+
let currentId = this.selectedId; //input current lang
|
|
36
|
+
let storeIndex = 0;
|
|
25
37
|
new MobileSelect({
|
|
26
38
|
trigger: `#${this.triggerName}`,
|
|
27
39
|
title: `${this.listTitle ? this.listTitle : ''}`,
|
|
28
|
-
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: [
|
|
40
|
+
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: ['test1', 'test2'] }],
|
|
29
41
|
position: [0],
|
|
30
42
|
ensureBtnText: this.ensureBtnText,
|
|
31
43
|
cancelBtnText: this.cancelBtnText,
|
|
32
44
|
ensureBtnColor: 'var(--color-gray-12)',
|
|
33
45
|
cancelBtnColor: 'var(--color-gray-12)',
|
|
34
46
|
titleColor: 'var(--color-gray-12)',
|
|
47
|
+
onShow: function (e) {
|
|
48
|
+
if (currentId) {
|
|
49
|
+
let liEle = document.querySelectorAll('.selectContainer li');
|
|
50
|
+
liEle.forEach((currentValue, currentIndex) => {
|
|
51
|
+
if (currentValue.getAttribute('data-id') == currentId) {
|
|
52
|
+
storeIndex = currentIndex;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
e.locatePosition(0, storeIndex);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
callback: function (indexArr, data) {
|
|
63
|
+
if (this.linkUrl !== undefined) {
|
|
64
|
+
window.location.href = this.linkUrl + '/' + data[0].id;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
console.log('index: ' + indexArr + ', id: ' + data[0].id + '; No link url founded!');
|
|
68
|
+
}
|
|
69
|
+
}.bind(this),
|
|
35
70
|
});
|
|
36
71
|
}
|
|
37
72
|
static get is() { return "ptc-mobile-select"; }
|
|
@@ -59,7 +94,7 @@ export class PtcMobileSelect {
|
|
|
59
94
|
"attribute": "trigger-name",
|
|
60
95
|
"reflect": false
|
|
61
96
|
},
|
|
62
|
-
"
|
|
97
|
+
"selectedText": {
|
|
63
98
|
"type": "string",
|
|
64
99
|
"mutable": false,
|
|
65
100
|
"complexType": {
|
|
@@ -71,11 +106,44 @@ export class PtcMobileSelect {
|
|
|
71
106
|
"optional": false,
|
|
72
107
|
"docs": {
|
|
73
108
|
"tags": [],
|
|
74
|
-
"text": "
|
|
109
|
+
"text": "Selected Text (Mandatory)"
|
|
75
110
|
},
|
|
76
|
-
"attribute": "
|
|
111
|
+
"attribute": "selected-text",
|
|
77
112
|
"reflect": false
|
|
78
113
|
},
|
|
114
|
+
"wheelData": {
|
|
115
|
+
"type": "unknown",
|
|
116
|
+
"mutable": true,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string[]",
|
|
119
|
+
"resolved": "string[]",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": "Wheel Data (Mandatory)\neg: data: [{ id: \"1\", value: \"\u9644\u8FD1\" }],"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"selectedId": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "string",
|
|
134
|
+
"resolved": "string",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": "Selected Id\n- initialize the id(string) of default wheel"
|
|
142
|
+
},
|
|
143
|
+
"attribute": "selected-id",
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"defaultValue": "''"
|
|
146
|
+
},
|
|
79
147
|
"ensureBtnText": {
|
|
80
148
|
"type": "string",
|
|
81
149
|
"mutable": false,
|
|
@@ -88,7 +156,7 @@ export class PtcMobileSelect {
|
|
|
88
156
|
"optional": false,
|
|
89
157
|
"docs": {
|
|
90
158
|
"tags": [],
|
|
91
|
-
"text": "Confirm Text"
|
|
159
|
+
"text": "Confirm Text\n- translation goes here"
|
|
92
160
|
},
|
|
93
161
|
"attribute": "ensure-btn-text",
|
|
94
162
|
"reflect": false,
|
|
@@ -106,7 +174,7 @@ export class PtcMobileSelect {
|
|
|
106
174
|
"optional": false,
|
|
107
175
|
"docs": {
|
|
108
176
|
"tags": [],
|
|
109
|
-
"text": "Cancel Text"
|
|
177
|
+
"text": "Cancel Text\n- translation goes here"
|
|
110
178
|
},
|
|
111
179
|
"attribute": "cancel-btn-text",
|
|
112
180
|
"reflect": false,
|
|
@@ -130,20 +198,23 @@ export class PtcMobileSelect {
|
|
|
130
198
|
"reflect": false,
|
|
131
199
|
"defaultValue": "undefined"
|
|
132
200
|
},
|
|
133
|
-
"
|
|
134
|
-
"type": "
|
|
201
|
+
"linkUrl": {
|
|
202
|
+
"type": "string",
|
|
135
203
|
"mutable": true,
|
|
136
204
|
"complexType": {
|
|
137
|
-
"original": "string
|
|
138
|
-
"resolved": "string
|
|
205
|
+
"original": "string",
|
|
206
|
+
"resolved": "string",
|
|
139
207
|
"references": {}
|
|
140
208
|
},
|
|
141
209
|
"required": false,
|
|
142
210
|
"optional": false,
|
|
143
211
|
"docs": {
|
|
144
212
|
"tags": [],
|
|
145
|
-
"text": "
|
|
146
|
-
}
|
|
213
|
+
"text": "link url"
|
|
214
|
+
},
|
|
215
|
+
"attribute": "link-url",
|
|
216
|
+
"reflect": false,
|
|
217
|
+
"defaultValue": "undefined"
|
|
147
218
|
}
|
|
148
219
|
}; }
|
|
149
220
|
}
|
|
@@ -15089,33 +15089,69 @@ let PtcMobileSelect$1 = class extends HTMLElement$1 {
|
|
|
15089
15089
|
constructor() {
|
|
15090
15090
|
super();
|
|
15091
15091
|
this.__registerHost();
|
|
15092
|
+
/**
|
|
15093
|
+
* Selected Id
|
|
15094
|
+
* - initialize the id(string) of default wheel
|
|
15095
|
+
*/
|
|
15096
|
+
this.selectedId = '';
|
|
15092
15097
|
/**
|
|
15093
15098
|
* Confirm Text
|
|
15099
|
+
* - translation goes here
|
|
15094
15100
|
*/
|
|
15095
15101
|
this.ensureBtnText = 'Confirm';
|
|
15096
15102
|
/**
|
|
15097
15103
|
* Cancel Text
|
|
15104
|
+
* - translation goes here
|
|
15098
15105
|
*/
|
|
15099
15106
|
this.cancelBtnText = 'Cancel';
|
|
15100
15107
|
/**
|
|
15101
15108
|
* Mobile select list title (Optional)
|
|
15102
15109
|
*/
|
|
15103
15110
|
this.listTitle = undefined;
|
|
15111
|
+
/**
|
|
15112
|
+
* link url
|
|
15113
|
+
*/
|
|
15114
|
+
this.linkUrl = undefined;
|
|
15104
15115
|
}
|
|
15105
15116
|
render() {
|
|
15106
|
-
return (h("
|
|
15117
|
+
return (h("div", { class: "mobile-select-wrapper" }, h("div", { id: this.triggerName }, this.selectedText), h("icon-asset", { type: "ptc", size: "x-small", name: "chevron-down", color: "white" })));
|
|
15107
15118
|
}
|
|
15108
15119
|
componentDidRender() {
|
|
15120
|
+
let currentId = this.selectedId; //input current lang
|
|
15121
|
+
let storeIndex = 0;
|
|
15109
15122
|
new mobileSelect({
|
|
15110
15123
|
trigger: `#${this.triggerName}`,
|
|
15111
15124
|
title: `${this.listTitle ? this.listTitle : ''}`,
|
|
15112
|
-
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: [
|
|
15125
|
+
wheels: this.wheelData ? [{ data: this.wheelData }] : [{ data: ['test1', 'test2'] }],
|
|
15113
15126
|
position: [0],
|
|
15114
15127
|
ensureBtnText: this.ensureBtnText,
|
|
15115
15128
|
cancelBtnText: this.cancelBtnText,
|
|
15116
15129
|
ensureBtnColor: 'var(--color-gray-12)',
|
|
15117
15130
|
cancelBtnColor: 'var(--color-gray-12)',
|
|
15118
15131
|
titleColor: 'var(--color-gray-12)',
|
|
15132
|
+
onShow: function (e) {
|
|
15133
|
+
if (currentId) {
|
|
15134
|
+
let liEle = document.querySelectorAll('.selectContainer li');
|
|
15135
|
+
liEle.forEach((currentValue, currentIndex) => {
|
|
15136
|
+
if (currentValue.getAttribute('data-id') == currentId) {
|
|
15137
|
+
storeIndex = currentIndex;
|
|
15138
|
+
return;
|
|
15139
|
+
}
|
|
15140
|
+
});
|
|
15141
|
+
e.locatePosition(0, storeIndex);
|
|
15142
|
+
}
|
|
15143
|
+
else {
|
|
15144
|
+
return;
|
|
15145
|
+
}
|
|
15146
|
+
},
|
|
15147
|
+
callback: function (indexArr, data) {
|
|
15148
|
+
if (this.linkUrl !== undefined) {
|
|
15149
|
+
window.location.href = this.linkUrl + '/' + data[0].id;
|
|
15150
|
+
}
|
|
15151
|
+
else {
|
|
15152
|
+
console.log('index: ' + indexArr + ', id: ' + data[0].id + '; No link url founded!');
|
|
15153
|
+
}
|
|
15154
|
+
}.bind(this),
|
|
15119
15155
|
});
|
|
15120
15156
|
}
|
|
15121
15157
|
static get style() { return ptcMobileSelectCss; }
|
|
@@ -15942,7 +15978,7 @@ const PtcInput = /*@__PURE__*/proxyCustomElement(PtcInput$1, [6,"ptc-input",{"ty
|
|
|
15942
15978
|
const PtcLink = /*@__PURE__*/proxyCustomElement(PtcLink$1, [1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]);
|
|
15943
15979
|
const PtcList = /*@__PURE__*/proxyCustomElement(PtcList$1, [2,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]);
|
|
15944
15980
|
const PtcLottie = /*@__PURE__*/proxyCustomElement(PtcLottie$1, [1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]);
|
|
15945
|
-
const PtcMobileSelect = /*@__PURE__*/proxyCustomElement(PtcMobileSelect$1, [0,"ptc-mobile-select",{"triggerName":[1,"trigger-name"],"
|
|
15981
|
+
const PtcMobileSelect = /*@__PURE__*/proxyCustomElement(PtcMobileSelect$1, [0,"ptc-mobile-select",{"triggerName":[1,"trigger-name"],"selectedText":[1,"selected-text"],"wheelData":[1040],"selectedId":[1,"selected-id"],"ensureBtnText":[1,"ensure-btn-text"],"cancelBtnText":[1,"cancel-btn-text"],"listTitle":[1,"list-title"],"linkUrl":[1025,"link-url"]}]);
|
|
15946
15982
|
const PtcModal = /*@__PURE__*/proxyCustomElement(PtcModal$1, [1,"ptc-modal",{"iframeUrl":[1025,"iframe-url"],"size":[1025],"show":[1028],"overlay":[1028],"closeOnBlur":[1028,"close-on-blur"],"overlayHeight":[32],"bodyOverflowSetting":[32]}]);
|
|
15947
15983
|
const PtcNav = /*@__PURE__*/proxyCustomElement(PtcNav$1, [1,"ptc-nav"]);
|
|
15948
15984
|
const PtcNavItem = /*@__PURE__*/proxyCustomElement(PtcNavItem$1, [1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]);
|