@ionic/core 7.3.5-nightly.20230914 → 7.4.0
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/components/button-active.js +1 -1
- package/components/checkbox.js +6 -3
- package/components/data.js +31 -7
- package/components/index.js +2 -2
- package/components/index2.js +203 -429
- package/components/index3.js +429 -203
- package/components/ion-datetime-button.js +3 -0
- package/components/ion-datetime.js +132 -92
- package/components/ion-item-sliding.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +2 -2
- package/components/ion-nav.js +1 -1
- package/components/ion-range.js +3 -3
- package/components/ion-refresher.js +3 -3
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-segment.js +1 -1
- package/components/ion-toggle.js +7 -4
- package/components/ios.transition.js +1 -1
- package/components/md.transition.js +1 -1
- package/components/notch-controller.js +1 -1
- package/components/picker-column.js +1 -1
- package/components/popover.js +1 -1
- package/components/radio.js +6 -3
- package/components/swipe-back.js +1 -1
- package/css/core.css.map +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/cjs/{data-967b9c15.js → data-db832785.js} +31 -7
- package/dist/cjs/index.cjs.js +10 -9
- package/dist/cjs/ion-checkbox.cjs.entry.js +5 -3
- package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +132 -93
- package/dist/cjs/ion-input.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +5 -3
- package/dist/cjs/ion-range.cjs.entry.js +2 -2
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ion-toggle.cjs.entry.js +5 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{notch-controller-c27fe0b7.js → notch-controller-f4f6af5d.js} +1 -1
- package/dist/collection/components/checkbox/checkbox.ios.css +67 -0
- package/dist/collection/components/checkbox/checkbox.js +24 -4
- package/dist/collection/components/checkbox/checkbox.md.css +67 -0
- package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +13 -0
- package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +27 -0
- package/dist/collection/components/datetime/datetime.ios.css +32 -29
- package/dist/collection/components/datetime/datetime.js +137 -93
- package/dist/collection/components/datetime/datetime.md.css +20 -28
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +25 -0
- package/dist/collection/components/datetime/test/color/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/custom/datetime.e2e.js +27 -1
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +15 -0
- package/dist/collection/components/datetime/test/set-value/datetime.e2e.js +9 -12
- package/dist/collection/components/datetime/utils/data.js +14 -6
- package/dist/collection/components/datetime/utils/parse.js +18 -1
- package/dist/collection/components/datetime-button/datetime-button.js +3 -0
- package/dist/collection/components/radio/radio.ios.css +67 -0
- package/dist/collection/components/radio/radio.js +24 -4
- package/dist/collection/components/radio/radio.md.css +67 -0
- package/dist/collection/components/radio/test/item/radio.e2e.js +15 -0
- package/dist/collection/components/radio/test/label-placement/radio.e2e.js +31 -0
- package/dist/collection/components/range/range.ios.css +66 -1
- package/dist/collection/components/range/range.js +3 -3
- package/dist/collection/components/range/range.md.css +66 -1
- package/dist/collection/components/range/test/item/range.e2e.js +15 -0
- package/dist/collection/components/range/test/label/range.e2e.js +59 -0
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +15 -0
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +27 -0
- package/dist/collection/components/toggle/toggle.ios.css +67 -1
- package/dist/collection/components/toggle/toggle.js +24 -4
- package/dist/collection/components/toggle/toggle.md.css +67 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/forms/notch-controller.js +1 -1
- package/dist/docs.json +147 -18
- package/dist/esm/{data-4b448e3a.js → data-009dbf15.js} +31 -7
- package/dist/esm/index.js +2 -2
- package/dist/esm/ion-checkbox.entry.js +5 -3
- package/dist/esm/ion-datetime-button.entry.js +4 -1
- package/dist/esm/ion-datetime_3.entry.js +132 -93
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +5 -3
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +5 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{notch-controller-cb5bbe6a.js → notch-controller-8c9c0e54.js} +1 -1
- package/dist/esm-es5/data-009dbf15.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/html.html-data.json +52 -4
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-dc4c9086.system.entry.js → p-264b5dd9.system.entry.js} +1 -1
- package/dist/ionic/{p-4d2807fa.entry.js → p-37c9e295.entry.js} +1 -1
- package/dist/ionic/p-3d575698.system.entry.js +4 -0
- package/dist/ionic/p-44ef7224.system.js +4 -0
- package/dist/ionic/{p-1c236453.system.entry.js → p-46058a1e.system.entry.js} +1 -1
- package/dist/ionic/{p-68deb933.entry.js → p-52edd6b0.entry.js} +1 -1
- package/dist/ionic/p-60f22efc.system.entry.js +4 -0
- package/dist/ionic/p-6d640b2b.entry.js +4 -0
- package/dist/ionic/p-74ef17ea.system.entry.js +4 -0
- package/dist/ionic/p-7cfd253c.js +4 -0
- package/dist/ionic/p-9fccec52.system.js +4 -0
- package/dist/ionic/p-aa702daf.entry.js +4 -0
- package/dist/ionic/p-ab051966.entry.js +4 -0
- package/dist/ionic/p-c005eb67.system.entry.js +4 -0
- package/dist/ionic/p-c68a8814.system.js +1 -1
- package/dist/ionic/p-cc758251.system.entry.js +4 -0
- package/dist/ionic/{p-0ce43a8f.system.entry.js → p-d0d09178.system.entry.js} +1 -1
- package/dist/ionic/p-dfee12f6.entry.js +4 -0
- package/dist/ionic/{p-8db97b90.entry.js → p-e3ca182a.entry.js} +1 -1
- package/dist/ionic/p-f0c28fbd.entry.js +4 -0
- package/dist/ionic/p-fdfc7b98.entry.js +4 -0
- package/dist/ionic/p-ff0611e6.system.entry.js +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +8 -1
- package/dist/types/components/datetime/datetime.d.ts +23 -10
- package/dist/types/components/datetime/utils/data.d.ts +1 -1
- package/dist/types/components/datetime/utils/parse.d.ts +3 -3
- package/dist/types/components/radio/radio.d.ts +8 -1
- package/dist/types/components/range/range.d.ts +2 -1
- package/dist/types/components/toast/toast-interface.d.ts +3 -0
- package/dist/types/components/toggle/toggle.d.ts +8 -1
- package/dist/types/components.d.ts +40 -16
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interface.d.ts +1 -0
- package/hydrate/index.js +193 -111
- package/package.json +1 -1
- package/dist/esm-es5/data-4b448e3a.js +0 -4
- package/dist/ionic/p-17e961cf.entry.js +0 -4
- package/dist/ionic/p-1b533a76.system.entry.js +0 -4
- package/dist/ionic/p-44a6f15d.system.entry.js +0 -4
- package/dist/ionic/p-4f7109fa.entry.js +0 -4
- package/dist/ionic/p-601fd53c.js +0 -4
- package/dist/ionic/p-7106c152.system.js +0 -4
- package/dist/ionic/p-9eaaa910.entry.js +0 -4
- package/dist/ionic/p-af6125d1.system.entry.js +0 -4
- package/dist/ionic/p-b8d7f0eb.system.entry.js +0 -4
- package/dist/ionic/p-b9179eab.entry.js +0 -4
- package/dist/ionic/p-cc8910e7.system.js +0 -4
- package/dist/ionic/p-dc7d392d.entry.js +0 -4
- package/dist/ionic/p-e65aed58.system.entry.js +0 -4
- package/dist/ionic/p-f3ec1f2b.entry.js +0 -4
- package/dist/ionic/p-fb26fa56.system.entry.js +0 -4
- /package/dist/esm-es5/{notch-controller-cb5bbe6a.js → notch-controller-8c9c0e54.js} +0 -0
- /package/dist/ionic/{p-4b37d92d.js → p-3bad5c1a.js} +0 -0
- /package/dist/ionic/{p-46b2991d.system.js → p-ab4cff27.system.js} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{__spreadArray}from"tslib";
|
|
2
|
+
/*!
|
|
3
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
+
*/import{p as printIonWarning}from"./index-595d62c9.js";var isSameDay=function(e,a){return e.month===a.month&&e.day===a.day&&e.year===a.year};var isBefore=function(e,a){return!!(e.year<a.year||e.year===a.year&&e.month<a.month||e.year===a.year&&e.month===a.month&&e.day!==null&&e.day<a.day)};var isAfter=function(e,a){return!!(e.year>a.year||e.year===a.year&&e.month>a.month||e.year===a.year&&e.month===a.month&&e.day!==null&&e.day>a.day)};var warnIfValueOutOfBounds=function(e,a,r){var t=Array.isArray(e)?e:[e];for(var n=0,o=t;n<o.length;n++){var i=o[n];if(a!==undefined&&isBefore(i,a)||r!==undefined&&isAfter(i,r)){printIonWarning("The value provided to ion-datetime is out of bounds.\n\n"+"Min: ".concat(JSON.stringify(a),"\n")+"Max: ".concat(JSON.stringify(r),"\n")+"Value: ".concat(JSON.stringify(e)));break}}};var isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0};var is24Hour=function(e,a){if(a!==undefined){return a==="h23"}var r=new Intl.DateTimeFormat(e,{hour:"numeric"});var t=r.resolvedOptions();if(t.hourCycle!==undefined){return t.hourCycle==="h23"}var n=new Date("5/18/2021 00:00");var o=r.formatToParts(n);var i=o.find((function(e){return e.type==="hour"}));if(!i){throw new Error("Hour value not found from DateTimeFormat")}return i.value==="00"};var getNumDaysInMonth=function(e,a){return e===4||e===6||e===9||e===11?30:e===2?isLeapYear(a)?29:28:31};var isMonthFirstLocale=function(e,a){if(a===void 0){a={month:"numeric",year:"numeric"}}var r=new Intl.DateTimeFormat(e,a).formatToParts(new Date);return r[0].type==="month"};var isLocaleDayPeriodRTL=function(e){var a=new Intl.DateTimeFormat(e,{hour:"numeric"}).formatToParts(new Date);return a[0].type==="dayPeriod"};var ISO_8601_REGEXP=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var TIME_REGEXP=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var convertToArrayOfNumbers=function(e){if(e===undefined){return}var a=e;if(typeof e==="string"){a=e.replace(/\[|\]|\s/g,"").split(",")}var r;if(Array.isArray(a)){r=a.map((function(e){return parseInt(e,10)})).filter(isFinite)}else{r=[a]}return r};var getPartsFromCalendarDay=function(e){return{month:parseInt(e.getAttribute("data-month"),10),day:parseInt(e.getAttribute("data-day"),10),year:parseInt(e.getAttribute("data-year"),10),dayOfWeek:parseInt(e.getAttribute("data-day-of-week"),10)}};function parseDate(e){if(Array.isArray(e)){var a=[];for(var r=0,t=e;r<t.length;r++){var n=t[r];var o=parseDate(n);if(!o){return undefined}a.push(o)}return a}var i=null;if(e!=null&&e!==""){i=TIME_REGEXP.exec(e);if(i){i.unshift(undefined,undefined);i[2]=i[3]=undefined}else{i=ISO_8601_REGEXP.exec(e)}}if(i===null){printIonWarning("Unable to parse date string: ".concat(e,". Please provide a valid ISO 8601 datetime string."));return undefined}for(var u=1;u<8;u++){i[u]=i[u]!==undefined?parseInt(i[u],10):undefined}return{year:i[1],month:i[2],day:i[3],hour:i[4],minute:i[5],ampm:i[4]<12?"am":"pm"}}var clampDate=function(e,a,r){if(a&&isBefore(e,a)){return a}else if(r&&isAfter(e,r)){return r}return e};var parseAmPm=function(e){return e>=12?"pm":"am"};var parseMaxParts=function(e,a){var r=parseDate(e);if(r===undefined){return}var t=r.month,n=r.day,o=r.year,i=r.hour,u=r.minute;var d=o!==null&&o!==void 0?o:a.year;var f=t!==null&&t!==void 0?t:12;return{month:f,day:n!==null&&n!==void 0?n:getNumDaysInMonth(f,d),year:d,hour:i!==null&&i!==void 0?i:23,minute:u!==null&&u!==void 0?u:59}};var parseMinParts=function(e,a){var r=parseDate(e);if(r===undefined){return}var t=r.month,n=r.day,o=r.year,i=r.hour,u=r.minute;return{month:t!==null&&t!==void 0?t:1,day:n!==null&&n!==void 0?n:1,year:o!==null&&o!==void 0?o:a.year,hour:i!==null&&i!==void 0?i:0,minute:u!==null&&u!==void 0?u:0}};var twoDigit=function(e){return("0"+(e!==undefined?Math.abs(e):"0")).slice(-2)};var fourDigit=function(e){return("000"+(e!==undefined?Math.abs(e):"0")).slice(-4)};function convertDataToISO(e){if(Array.isArray(e)){return e.map((function(e){return convertDataToISO(e)}))}var a="";if(e.year!==undefined){a=fourDigit(e.year);if(e.month!==undefined){a+="-"+twoDigit(e.month);if(e.day!==undefined){a+="-"+twoDigit(e.day);if(e.hour!==undefined){a+="T".concat(twoDigit(e.hour),":").concat(twoDigit(e.minute),":00")}}}}else if(e.hour!==undefined){a=twoDigit(e.hour)+":"+twoDigit(e.minute)}return a}var convert12HourTo24Hour=function(e,a){if(a===undefined){return e}if(a==="am"){if(e===12){return 0}return e}if(e===12){return 12}return e+12};var getStartOfWeek=function(e){var a=e.dayOfWeek;if(a===null||a===undefined){throw new Error("No day of week provided")}return subtractDays(e,a)};var getEndOfWeek=function(e){var a=e.dayOfWeek;if(a===null||a===undefined){throw new Error("No day of week provided")}return addDays(e,6-a)};var getNextDay=function(e){return addDays(e,1)};var getPreviousDay=function(e){return subtractDays(e,1)};var getPreviousWeek=function(e){return subtractDays(e,7)};var getNextWeek=function(e){return addDays(e,7)};var subtractDays=function(e,a){var r=e.month,t=e.day,n=e.year;if(t===null){throw new Error("No day provided")}var o={month:r,day:t,year:n};o.day=t-a;if(o.day<1){o.month-=1}if(o.month<1){o.month=12;o.year-=1}if(o.day<1){var i=getNumDaysInMonth(o.month,o.year);o.day=i+o.day}return o};var addDays=function(e,a){var r=e.month,t=e.day,n=e.year;if(t===null){throw new Error("No day provided")}var o={month:r,day:t,year:n};var i=getNumDaysInMonth(r,n);o.day=t+a;if(o.day>i){o.day-=i;o.month+=1}if(o.month>12){o.month=1;o.year+=1}return o};var getPreviousMonth=function(e){var a=e.month===1?12:e.month-1;var r=e.month===1?e.year-1:e.year;var t=getNumDaysInMonth(a,r);var n=t<e.day?t:e.day;return{month:a,year:r,day:n}};var getNextMonth=function(e){var a=e.month===12?1:e.month+1;var r=e.month===12?e.year+1:e.year;var t=getNumDaysInMonth(a,r);var n=t<e.day?t:e.day;return{month:a,year:r,day:n}};var changeYear=function(e,a){var r=e.month;var t=e.year+a;var n=getNumDaysInMonth(r,t);var o=n<e.day?n:e.day;return{month:r,year:t,day:o}};var getPreviousYear=function(e){return changeYear(e,-1)};var getNextYear=function(e){return changeYear(e,1)};var getInternalHourValue=function(e,a,r){if(a){return e}return convert12HourTo24Hour(e,r)};var calculateHourFromAMPM=function(e,a){var r=e.ampm,t=e.hour;var n=t;if(r==="am"&&a==="pm"){n=convert12HourTo24Hour(n,"pm")}else if(r==="pm"&&a==="am"){n=Math.abs(n-12)}return n};var validateParts=function(e,a,r){var t=e.month,n=e.day,o=e.year;var i=clampDate(Object.assign({},e),a,r);var u=getNumDaysInMonth(t,o);if(n!==null&&u<n){i.day=u}if(a!==undefined&&isSameDay(i,a)){if(i.hour!==undefined&&a.hour!==undefined){if(i.hour<a.hour){i.hour=a.hour;i.minute=a.minute}else if(i.hour===a.hour&&i.minute!==undefined&&a.minute!==undefined&&i.minute<a.minute){i.minute=a.minute}}}if(r!==undefined&&isSameDay(e,r)){if(i.hour!==undefined&&r.hour!==undefined){if(i.hour>r.hour){i.hour=r.hour;i.minute=r.minute}else if(i.hour===r.hour&&i.minute!==undefined&&r.minute!==undefined&&i.minute>r.minute){i.minute=r.minute}}}return i};var getClosestValidDate=function(e,a,r,t,n,o){var i=e.hour,u=e.minute,d=e.day,f=e.month,m=e.year;var s=Object.assign(Object.assign({},e),{dayOfWeek:undefined});if(a!==undefined){s.month=findClosestValue(f,a)}if(d!==null&&r!==undefined){s.day=findClosestValue(d,r)}if(t!==undefined){s.year=findClosestValue(m,t)}if(i!==undefined&&n!==undefined){s.hour=findClosestValue(i,n);s.ampm=parseAmPm(s.hour)}if(u!==undefined&&o!==undefined){s.minute=findClosestValue(u,o)}return s};var findClosestValue=function(e,a){var r=a[0];var t=Math.abs(r-e);for(var n=1;n<a.length;n++){var o=a[n];var i=Math.abs(o-e);if(i<t){r=o;t=i}}return r};var getFormattedDayPeriod=function(e){if(e===undefined){return""}return e.toUpperCase()};var getLocalizedTime=function(e,a,r){var t={hour:a.hour,minute:a.minute};if(t.hour===undefined||t.minute===undefined){return"Invalid Time"}return new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric",timeZone:"UTC",hourCycle:r?"h23":"h12"}).format(new Date(convertDataToISO(Object.assign({year:2023,day:1,month:1},t))+"Z"))};var addTimePadding=function(e){var a=e.toString();if(a.length>1){return a}return"0".concat(a)};var getFormattedHour=function(e,a){if(a){return addTimePadding(e)}if(e===0){return"12"}return e.toString()};var generateDayAriaLabel=function(e,a,r){if(r.day===null){return null}var t=getNormalizedDate(r);var n=new Intl.DateTimeFormat(e,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}).format(t);return a?"Today, ".concat(n):n};var getMonthAndDay=function(e,a){var r=getNormalizedDate(a);return new Intl.DateTimeFormat(e,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(r)};var getMonthAndYear=function(e,a){var r=getNormalizedDate(a);return new Intl.DateTimeFormat(e,{month:"long",year:"numeric",timeZone:"UTC"}).format(r)};var getMonthDayAndYear=function(e,a){return getLocalizedDateTime(e,a,{month:"short",day:"numeric",year:"numeric"})};var getDay=function(e,a){return getLocalizedDateTimeParts(e,a,{day:"numeric"}).find((function(e){return e.type==="day"})).value};var getYear=function(e,a){return getLocalizedDateTime(e,a,{year:"numeric"})};var getNormalizedDate=function(e){var a,r,t;var n=e.hour!==undefined&&e.minute!==undefined?" ".concat(e.hour,":").concat(e.minute):"";return new Date("".concat((a=e.month)!==null&&a!==void 0?a:1,"/").concat((r=e.day)!==null&&r!==void 0?r:1,"/").concat((t=e.year)!==null&&t!==void 0?t:2023).concat(n," GMT+0000"))};var getLocalizedDateTime=function(e,a,r){var t=getNormalizedDate(a);return getDateTimeFormat(e,r).format(t)};var getLocalizedDateTimeParts=function(e,a,r){var t=getNormalizedDate(a);return getDateTimeFormat(e,r).formatToParts(t)};var getDateTimeFormat=function(e,a){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},a),{timeZone:"UTC"}))};var getTodayLabel=function(e){if("RelativeTimeFormat"in Intl){var a=new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"day");return a.charAt(0).toUpperCase()+a.slice(1)}else{return"Today"}};var removeDateTzOffset=function(e){var a=e.getTimezoneOffset();e.setMinutes(e.getMinutes()-a);return e};var DATE_AM=removeDateTzOffset(new Date("2022T01:00"));var DATE_PM=removeDateTzOffset(new Date("2022T13:00"));var getLocalizedDayPeriod=function(e,a){var r=a==="am"?DATE_AM:DATE_PM;var t=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}).formatToParts(r).find((function(e){return e.type==="dayPeriod"}));if(t){return t.value}return getFormattedDayPeriod(a)};var formatValue=function(e){return Array.isArray(e)?e.join(","):e};var getToday=function(){return removeDateTzOffset(new Date).toISOString()};var minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];var hour12=[0,1,2,3,4,5,6,7,8,9,10,11];var hour23=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];var getDaysOfWeek=function(e,a,r){if(r===void 0){r=0}var t=a==="ios"?"short":"narrow";var n=new Intl.DateTimeFormat(e,{weekday:t});var o=new Date("11/01/2020");var i=[];for(var u=r;u<r+7;u++){var d=new Date(o);d.setDate(d.getDate()+u);i.push(n.format(d))}return i};var getDaysOfMonth=function(e,a,r){var t=getNumDaysInMonth(e,a);var n=new Date("".concat(e,"/1/").concat(a)).getDay();var o=n>=r?n-(r+1):6-(r-n);var i=[];for(var u=1;u<=t;u++){i.push({day:u,dayOfWeek:(o+u)%7})}for(var u=0;u<=o;u++){i=__spreadArray([{day:null,dayOfWeek:null}],i,true)}return i};var generateTime=function(e,a,r,t,n,o){if(a===void 0){a="h12"}var i=a==="h23";var u=i?hour23:hour12;var d=minutes;var f=true;var m=true;if(n){u=u.filter((function(e){return n.includes(e)}))}if(o){d=d.filter((function(e){return o.includes(e)}))}if(r){if(isSameDay(e,r)){if(r.hour!==undefined){u=u.filter((function(a){var t=e.ampm==="pm"?(a+12)%24:a;return(i?a:t)>=r.hour}));f=r.hour<13}if(r.minute!==undefined){var s=false;if(r.hour!==undefined&&e.hour!==undefined){if(e.hour>r.hour){s=true}}d=d.filter((function(e){if(s){return true}return e>=r.minute}))}}else if(isBefore(e,r)){u=[];d=[];f=m=false}}if(t){if(isSameDay(e,t)){if(t.hour!==undefined){u=u.filter((function(a){var r=e.ampm==="pm"?(a+12)%24:a;return(i?a:r)<=t.hour}));m=t.hour>=12}if(t.minute!==undefined&&e.hour===t.hour){d=d.filter((function(e){return e<=t.minute}))}}else if(isAfter(e,t)){u=[];d=[];f=m=false}}return{hours:u,minutes:d,am:f,pm:m}};var generateMonths=function(e,a){var r={month:e.month,year:e.year,day:e.day};if(a!==undefined&&(e.month!==a.month||e.year!==a.year)){var t={month:a.month,year:a.year,day:a.day};var n=isBefore(t,r);return n?[t,r,getNextMonth(e)]:[getPreviousMonth(e),r,t]}return[getPreviousMonth(e),r,getNextMonth(e)]};var getMonthColumnData=function(e,a,r,t,n,o){if(o===void 0){o={month:"long"}}var i=a.year;var u=[];if(n!==undefined){var d=n;if((t===null||t===void 0?void 0:t.month)!==undefined){d=d.filter((function(e){return e<=t.month}))}if((r===null||r===void 0?void 0:r.month)!==undefined){d=d.filter((function(e){return e>=r.month}))}d.forEach((function(a){var r=new Date("".concat(a,"/1/").concat(i," GMT+0000"));var t=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},o),{timeZone:"UTC"})).format(r);u.push({text:t,value:a})}))}else{var f=t&&t.year===i?t.month:12;var m=r&&r.year===i?r.month:1;for(var s=m;s<=f;s++){var v=new Date("".concat(s,"/1/").concat(i," GMT+0000"));var y=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},o),{timeZone:"UTC"})).format(v);u.push({text:y,value:s})}}return u};var getDayColumnData=function(e,a,r,t,n,o){if(o===void 0){o={day:"numeric"}}var i=a.month,u=a.year;var d=[];var f=getNumDaysInMonth(i,u);var m=(t===null||t===void 0?void 0:t.day)!==null&&(t===null||t===void 0?void 0:t.day)!==undefined&&t.year===u&&t.month===i?t.day:f;var s=(r===null||r===void 0?void 0:r.day)!==null&&(r===null||r===void 0?void 0:r.day)!==undefined&&r.year===u&&r.month===i?r.day:1;if(n!==undefined){var v=n;v=v.filter((function(e){return e>=s&&e<=m}));v.forEach((function(a){var r=new Date("".concat(i,"/").concat(a,"/").concat(u," GMT+0000"));var t=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},o),{timeZone:"UTC"})).format(r);d.push({text:t,value:a})}))}else{for(var y=s;y<=m;y++){var l=new Date("".concat(i,"/").concat(y,"/").concat(u," GMT+0000"));var c=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},o),{timeZone:"UTC"})).format(l);d.push({text:c,value:y})}}return d};var getYearColumnData=function(e,a,r,t,n){var o,i;var u=[];if(n!==undefined){u=n;if((t===null||t===void 0?void 0:t.year)!==undefined){u=u.filter((function(e){return e<=t.year}))}if((r===null||r===void 0?void 0:r.year)!==undefined){u=u.filter((function(e){return e>=r.year}))}}else{var d=a.year;var f=(o=t===null||t===void 0?void 0:t.year)!==null&&o!==void 0?o:d;var m=(i=r===null||r===void 0?void 0:r.year)!==null&&i!==void 0?i:d-100;for(var s=m;s<=f;s++){u.push(s)}}return u.map((function(r){return{text:getYear(e,{year:r,month:a.month,day:a.day}),value:r}}))};var getAllMonthsInRange=function(e,a){if(e.month===a.month&&e.year===a.year){return[e]}return __spreadArray([e],getAllMonthsInRange(getNextMonth(e),a),true)};var getCombinedDateColumnData=function(e,a,r,t,n,o){var i=[];var u=[];var d=getAllMonthsInRange(r,t);if(o){d=d.filter((function(e){var a=e.month;return o.includes(a)}))}d.forEach((function(o){var d={month:o.month,day:null,year:o.year};var f=getDayColumnData(e,d,r,t,n,{month:"short",day:"numeric",weekday:"short"});var m=[];var s=[];f.forEach((function(r){var t=isSameDay(Object.assign(Object.assign({},d),{day:r.value}),a);s.push({text:t?getTodayLabel(e):r.text,value:"".concat(d.year,"-").concat(d.month,"-").concat(r.value)});m.push({month:d.month,year:d.year,day:r.value})}));u=__spreadArray(__spreadArray([],u,true),m,true);i=__spreadArray(__spreadArray([],i,true),s,true)}));return{parts:u,items:i}};var getTimeColumnsData=function(e,a,r,t,n,o,i){var u=is24Hour(e,r);var d=generateTime(a,u?"h23":"h12",t,n,o,i),f=d.hours,m=d.minutes,s=d.am,v=d.pm;var y=f.map((function(e){return{text:getFormattedHour(e,u),value:getInternalHourValue(e,u,a.ampm)}}));var l=m.map((function(e){return{text:addTimePadding(e),value:e}}));var c=[];if(s&&!u){c.push({text:getLocalizedDayPeriod(e,"am"),value:"am"})}if(v&&!u){c.push({text:getLocalizedDayPeriod(e,"pm"),value:"pm"})}return{minutesData:l,hoursData:y,dayPeriodData:c}};export{getDayColumnData as A,getYearColumnData as B,isMonthFirstLocale as C,getTimeColumnsData as D,isLocaleDayPeriodRTL as E,getDaysOfWeek as F,getMonthAndYear as G,getDaysOfMonth as H,generateMonths as I,is24Hour as J,getLocalizedTime as K,getMonthAndDay as L,formatValue as M,getNextYear as N,getPreviousYear as O,clampDate as P,parseAmPm as Q,calculateHourFromAMPM as R,getLocalizedDateTime as S,getMonthDayAndYear as T,getDay as a,isAfter as b,isSameDay as c,getPreviousMonth as d,getNextMonth as e,getPartsFromCalendarDay as f,generateDayAriaLabel as g,getEndOfWeek as h,isBefore as i,getStartOfWeek as j,getPreviousDay as k,getNextDay as l,getPreviousWeek as m,getNextWeek as n,parseMaxParts as o,parseMinParts as p,parseDate as q,convertToArrayOfNumbers as r,convertDataToISO as s,getToday as t,getClosestValidDate as u,validateParts as v,warnIfValueOutOfBounds as w,getNumDaysInMonth as x,getCombinedDateColumnData as y,getMonthColumnData as z};
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
export{c as createAnimation}from"./animation-a1d9e088.js";export{iosTransitionAnimation}from"./ios.transition-f43871cd.js";export{mdTransitionAnimation}from"./md.transition-12d21ad0.js";export{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";export{createGesture}from"./index-ff313b19.js";export{g as getPlatforms,i as initialize,a as isPlatform}from"./ionic-global-9080266a.js";export{c as componentOnReady}from"./helpers-3379ba19.js";export{I as IonicSafeString,g as getMode,s as setupConfig}from"./config-96c9ace3.js";export{
|
|
4
|
+
export{c as createAnimation}from"./animation-a1d9e088.js";export{a as LIFECYCLE_DID_ENTER,c as LIFECYCLE_DID_LEAVE,L as LIFECYCLE_WILL_ENTER,b as LIFECYCLE_WILL_LEAVE,d as LIFECYCLE_WILL_UNLOAD,g as getIonPageElement}from"./index-01839411.js";export{iosTransitionAnimation}from"./ios.transition-f43871cd.js";export{mdTransitionAnimation}from"./md.transition-12d21ad0.js";export{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";export{createGesture}from"./index-ff313b19.js";export{g as getPlatforms,i as initialize,a as isPlatform}from"./ionic-global-9080266a.js";export{c as componentOnReady}from"./helpers-3379ba19.js";export{I as IonicSafeString,g as getMode,s as setupConfig}from"./config-96c9ace3.js";export{m as menuController}from"./index-48f5e259.js";export{b as actionSheetController,a as alertController,l as loadingController,m as modalController,p as pickerController,c as popoverController,t as toastController}from"./overlays-4565894b.js";import"./index-7a14ecec.js";import"./index-adfb2000.js";import"./gesture-controller-0fa396c4.js";import"./hardware-back-button-39299f84.js";import"./framework-delegate-aa433dea.js";import"./index-595d62c9.js";var IonicSlides=function(e){var o=e.swiper,t=e.extendParams;var s={effect:undefined,direction:"horizontal",initialSlide:0,loop:false,parallax:false,slidesPerView:1,spaceBetween:0,speed:300,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:false,slidesOffsetBefore:0,slidesOffsetAfter:0,touchEventsTarget:"container",freeMode:false,freeModeMomentum:true,freeModeMomentumRatio:1,freeModeMomentumBounce:true,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:false,freeModeMinimumVelocity:.02,autoHeight:false,setWrapperSize:false,zoom:{maxRatio:3,minRatio:1,toggle:false},touchRatio:1,touchAngle:45,simulateTouch:true,touchStartPreventDefault:false,shortSwipes:true,longSwipes:true,longSwipesRatio:.5,longSwipesMs:300,followFinger:true,threshold:0,touchMoveStopPropagation:true,touchReleaseOnEdges:false,iOSEdgeSwipeDetection:false,iOSEdgeSwipeThreshold:20,resistance:true,resistanceRatio:.85,watchSlidesProgress:false,watchSlidesVisibility:false,preventClicks:true,preventClicksPropagation:true,slideToClickedSlide:false,loopAdditionalSlides:0,noSwiping:true,runCallbacksOnInit:true,coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:true},flipEffect:{slideShadows:true,limitRotation:true},cubeEffect:{slideShadows:true,shadow:true,shadowOffset:20,shadowScale:.94},fadeEffect:{crossFade:false},a11y:{prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide"}};if(o.pagination){s.pagination={type:"bullets",clickable:false,hideOnClick:false}}if(o.scrollbar){s.scrollbar={hide:true}}t(s)};export{IonicSlides};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-adfb2000.js";import{c as createLegacyFormController}from"./form-controller-ed77647a.js";import{i as inheritAriaAttributes,d as renderHiddenInput,e as getAriaLabel}from"./helpers-3379ba19.js";import{p as printIonWarning}from"./index-595d62c9.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-9080266a.js";var checkboxIosCss=":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px}:host(.checkbox-disabled){opacity:0.3}:host(.in-item.legacy-checkbox){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:8px;margin-bottom:8px}";var checkboxMdCss=":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--checkmark-width:3;--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px}.checkbox-icon path{stroke-dasharray:30;stroke-dashoffset:30}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{stroke-dashoffset:0;-webkit-transition:stroke-dashoffset 90ms linear 90ms;transition:stroke-dashoffset 90ms linear 90ms}:host(.legacy-checkbox.checkbox-disabled),:host(.checkbox-disabled) .label-text-wrapper{opacity:0.38}:host(.checkbox-disabled) .native-wrapper{opacity:0.63}:host(.in-item.legacy-checkbox){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px;margin-top:18px;margin-bottom:18px}";var Checkbox=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionStyle=createEvent(this,"ionStyle",7);this.inputId="ion-cb-".concat(checkboxIds++);this.inheritedAttributes={};this.hasLoggedDeprecationWarning=false;this.setChecked=function(e){var o=t.checked=e;t.ionChange.emit({checked:o,value:t.value})};this.toggleChecked=function(e){e.preventDefault();t.setFocus();t.setChecked(!t.checked);t.indeterminate=false};this.onFocus=function(){t.ionFocus.emit()};this.onBlur=function(){t.ionBlur.emit()};this.color=undefined;this.name=this.inputId;this.checked=false;this.indeterminate=false;this.disabled=false;this.value="on";this.labelPlacement="start";this.justify="space-between";this.legacy=undefined}e.prototype.connectedCallback=function(){this.legacyFormController=createLegacyFormController(this.el)};e.prototype.componentWillLoad=function(){this.emitStyle();if(!this.legacyFormController.hasLegacyControl()){this.inheritedAttributes=Object.assign({},inheritAriaAttributes(this.el))}};e.prototype.styleChanged=function(){this.emitStyle()};e.prototype.emitStyle=function(){var e={"interactive-disabled":this.disabled};if(this.legacyFormController.hasLegacyControl()){e["checkbox-checked"]=this.checked}this.ionStyle.emit(e)};e.prototype.setFocus=function(){if(this.focusEl){this.focusEl.focus()}};e.prototype.render=function(){var e=this.legacyFormController;return e.hasLegacyControl()?this.renderLegacyCheckbox():this.renderCheckbox()};e.prototype.renderCheckbox=function(){var e;var t=this;var o=this,r=o.color,i=o.checked,n=o.disabled,c=o.el,a=o.getSVGPath,s=o.indeterminate,l=o.inheritedAttributes,b=o.inputId,d=o.justify,p=o.labelPlacement,x=o.name,k=o.value;var m=getIonMode(this);var g=a(m,s);renderHiddenInput(true,c,x,i?k:"",n);return h(Host,{class:createColorClasses(r,(e={},e[m]=true,e["in-item"]=hostContext("ion-item",c),e["checkbox-checked"]=i,e["checkbox-disabled"]=n,e["checkbox-indeterminate"]=s,e.interactive=true,e["checkbox-justify-".concat(d)]=true,e["checkbox-label-placement-".concat(p)]=true,e))},h("label",{class:"checkbox-wrapper"},h("input",Object.assign({type:"checkbox",checked:i?true:undefined,disabled:n,id:b,onChange:this.toggleChecked,onFocus:function(){return t.onFocus()},onBlur:function(){return t.onBlur()},ref:function(e){return t.focusEl=e}},l)),h("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":c.textContent===""}},h("slot",null)),h("div",{class:"native-wrapper"},h("svg",{class:"checkbox-icon",viewBox:"0 0 24 24",part:"container"},g))))};e.prototype.renderLegacyCheckbox=function(){var e;var t=this;if(!this.hasLoggedDeprecationWarning){printIonWarning('ion-checkbox now requires providing a label with either the default slot or the "aria-label" attribute. To migrate, remove any usage of "ion-label" and pass the label text to either the component or the "aria-label" attribute.\n\nExample: <ion-checkbox>Label</ion-checkbox>\nExample with aria-label: <ion-checkbox aria-label="Label"></ion-checkbox>\n\nDevelopers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.',this.el);if(this.legacy){printIonWarning('ion-checkbox is being used with the "legacy" property enabled which will forcibly enable the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.\nDevelopers can dismiss this warning by removing their usage of the "legacy" property and using the new checkbox syntax.',this.el)}this.hasLoggedDeprecationWarning=true}var o=this,r=o.color,i=o.checked,n=o.disabled,c=o.el,a=o.getSVGPath,s=o.indeterminate,l=o.inputId,b=o.name,d=o.value;var p=getIonMode(this);var x=getAriaLabel(c,l),k=x.label,m=x.labelId,g=x.labelText;var u=a(p,s);renderHiddenInput(true,c,b,i?d:"",n);return h(Host,{"aria-labelledby":k?m:null,"aria-checked":"".concat(i),"aria-hidden":n?"true":null,role:"checkbox",class:createColorClasses(r,(e={},e[p]=true,e["in-item"]=hostContext("ion-item",c),e["checkbox-checked"]=i,e["checkbox-disabled"]=n,e["checkbox-indeterminate"]=s,e["legacy-checkbox"]=true,e.interactive=true,e))},h("svg",{class:"checkbox-icon",viewBox:"0 0 24 24",part:"container"},u),h("label",{htmlFor:l},g),h("input",{type:"checkbox","aria-checked":"".concat(i),disabled:n,id:l,onChange:this.toggleChecked,onFocus:function(){return t.onFocus()},onBlur:function(){return t.onBlur()},ref:function(e){return t.focusEl=e}}))};e.prototype.getSVGPath=function(e,t){var o=t?h("path",{d:"M6 12L18 12",part:"mark"}):h("path",{d:"M5.9,12.5l3.8,3.8l8.8-8.8",part:"mark"});if(e==="md"){o=t?h("path",{d:"M2 12H22",part:"mark"}):h("path",{d:"M1.73,12.91 8.1,19.28 22.79,4.59",part:"mark"})}return o};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["styleChanged"],disabled:["styleChanged"]}},enumerable:false,configurable:true});return e}();var checkboxIds=0;Checkbox.style={ios:checkboxIosCss,md:checkboxMdCss};export{Checkbox as ion_checkbox};
|
|
4
|
+
import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-adfb2000.js";import{c as createLegacyFormController}from"./form-controller-ed77647a.js";import{i as inheritAriaAttributes,d as renderHiddenInput,e as getAriaLabel}from"./helpers-3379ba19.js";import{p as printIonWarning}from"./index-595d62c9.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-9080266a.js";var checkboxIosCss=":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.checkbox-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.checkbox-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-alignment-start) .checkbox-wrapper{-ms-flex-align:start;align-items:start}:host(.checkbox-alignment-center) .checkbox-wrapper{-ms-flex-align:center;align-items:center}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-label-placement-stacked) .checkbox-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.checkbox-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).checkbox-label-placement-stacked.checkbox-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).checkbox-label-placement-stacked.checkbox-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper:dir(rtl){-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px}:host(.checkbox-disabled){opacity:0.3}:host(.in-item.legacy-checkbox){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:8px;margin-bottom:8px}";var checkboxMdCss=":host{--checkbox-background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){width:100%;height:100%}:host([slot=start]:not(.legacy-checkbox)),:host([slot=end]:not(.legacy-checkbox)){width:auto}:host(.legacy-checkbox){width:var(--size);height:var(--size)}:host(.ion-color){--checkbox-background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}:host(.legacy-checkbox) label{top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}@supports (inset-inline-start: 0){:host(.legacy-checkbox) label{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.legacy-checkbox) label{left:0}:host-context([dir=rtl]):host(.legacy-checkbox) label,:host-context([dir=rtl]).legacy-checkbox label{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.legacy-checkbox) label:dir(rtl){left:unset;right:unset;right:0}}}:host(.legacy-checkbox) label::-moz-focus-inner{border:0}.checkbox-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;cursor:inherit}.label-text-wrapper{pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item:not(.legacy-checkbox)) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.checkbox-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.checkbox-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.checkbox-icon{border-radius:var(--border-radius);position:relative;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--checkbox-background);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.legacy-checkbox) .checkbox-icon{display:block;width:100%;height:100%}:host(:not(.legacy-checkbox)) .checkbox-icon{width:var(--size);height:var(--size)}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-justify-space-between) .checkbox-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.checkbox-justify-start) .checkbox-wrapper{-ms-flex-pack:start;justify-content:start}:host(.checkbox-justify-end) .checkbox-wrapper{-ms-flex-pack:end;justify-content:end}:host(.checkbox-alignment-start) .checkbox-wrapper{-ms-flex-align:start;align-items:start}:host(.checkbox-alignment-center) .checkbox-wrapper{-ms-flex-align:center;align-items:center}:host(.checkbox-label-placement-start) .checkbox-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.checkbox-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-end) .checkbox-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.checkbox-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.checkbox-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.checkbox-label-placement-stacked) .checkbox-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.checkbox-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).checkbox-label-placement-stacked.checkbox-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.checkbox-label-placement-stacked.checkbox-alignment-start) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).checkbox-label-placement-stacked.checkbox-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.checkbox-label-placement-stacked.checkbox-alignment-center) .label-text-wrapper:dir(rtl){-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--checkbox-background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--checkmark-width:3;--checkbox-background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px}.checkbox-icon path{stroke-dasharray:30;stroke-dashoffset:30}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{stroke-dashoffset:0;-webkit-transition:stroke-dashoffset 90ms linear 90ms;transition:stroke-dashoffset 90ms linear 90ms}:host(.legacy-checkbox.checkbox-disabled),:host(.checkbox-disabled) .label-text-wrapper{opacity:0.38}:host(.checkbox-disabled) .native-wrapper{opacity:0.63}:host(.in-item.legacy-checkbox){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item.legacy-checkbox[slot=start]){-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px;margin-top:18px;margin-bottom:18px}";var Checkbox=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionStyle=createEvent(this,"ionStyle",7);this.inputId="ion-cb-".concat(checkboxIds++);this.inheritedAttributes={};this.hasLoggedDeprecationWarning=false;this.setChecked=function(e){var o=t.checked=e;t.ionChange.emit({checked:o,value:t.value})};this.toggleChecked=function(e){e.preventDefault();t.setFocus();t.setChecked(!t.checked);t.indeterminate=false};this.onFocus=function(){t.ionFocus.emit()};this.onBlur=function(){t.ionBlur.emit()};this.color=undefined;this.name=this.inputId;this.checked=false;this.indeterminate=false;this.disabled=false;this.value="on";this.labelPlacement="start";this.justify="space-between";this.alignment="center";this.legacy=undefined}e.prototype.connectedCallback=function(){this.legacyFormController=createLegacyFormController(this.el)};e.prototype.componentWillLoad=function(){this.emitStyle();if(!this.legacyFormController.hasLegacyControl()){this.inheritedAttributes=Object.assign({},inheritAriaAttributes(this.el))}};e.prototype.styleChanged=function(){this.emitStyle()};e.prototype.emitStyle=function(){var e={"interactive-disabled":this.disabled};if(this.legacyFormController.hasLegacyControl()){e["checkbox-checked"]=this.checked}this.ionStyle.emit(e)};e.prototype.setFocus=function(){if(this.focusEl){this.focusEl.focus()}};e.prototype.render=function(){var e=this.legacyFormController;return e.hasLegacyControl()?this.renderLegacyCheckbox():this.renderCheckbox()};e.prototype.renderCheckbox=function(){var e;var t=this;var o=this,r=o.color,c=o.checked,i=o.disabled,a=o.el,n=o.getSVGPath,l=o.indeterminate,s=o.inheritedAttributes,b=o.inputId,p=o.justify,d=o.labelPlacement,x=o.name,k=o.value,m=o.alignment;var g=getIonMode(this);var f=n(g,l);renderHiddenInput(true,a,x,c?k:"",i);return h(Host,{class:createColorClasses(r,(e={},e[g]=true,e["in-item"]=hostContext("ion-item",a),e["checkbox-checked"]=c,e["checkbox-disabled"]=i,e["checkbox-indeterminate"]=l,e.interactive=true,e["checkbox-justify-".concat(p)]=true,e["checkbox-alignment-".concat(m)]=true,e["checkbox-label-placement-".concat(d)]=true,e))},h("label",{class:"checkbox-wrapper"},h("input",Object.assign({type:"checkbox",checked:c?true:undefined,disabled:i,id:b,onChange:this.toggleChecked,onFocus:function(){return t.onFocus()},onBlur:function(){return t.onBlur()},ref:function(e){return t.focusEl=e}},s)),h("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":a.textContent===""}},h("slot",null)),h("div",{class:"native-wrapper"},h("svg",{class:"checkbox-icon",viewBox:"0 0 24 24",part:"container"},f))))};e.prototype.renderLegacyCheckbox=function(){var e;var t=this;if(!this.hasLoggedDeprecationWarning){printIonWarning('ion-checkbox now requires providing a label with either the default slot or the "aria-label" attribute. To migrate, remove any usage of "ion-label" and pass the label text to either the component or the "aria-label" attribute.\n\nExample: <ion-checkbox>Label</ion-checkbox>\nExample with aria-label: <ion-checkbox aria-label="Label"></ion-checkbox>\n\nDevelopers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.',this.el);if(this.legacy){printIonWarning('ion-checkbox is being used with the "legacy" property enabled which will forcibly enable the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.\nDevelopers can dismiss this warning by removing their usage of the "legacy" property and using the new checkbox syntax.',this.el)}this.hasLoggedDeprecationWarning=true}var o=this,r=o.color,c=o.checked,i=o.disabled,a=o.el,n=o.getSVGPath,l=o.indeterminate,s=o.inputId,b=o.name,p=o.value;var d=getIonMode(this);var x=getAriaLabel(a,s),k=x.label,m=x.labelId,g=x.labelText;var f=n(d,l);renderHiddenInput(true,a,b,c?p:"",i);return h(Host,{"aria-labelledby":k?m:null,"aria-checked":"".concat(c),"aria-hidden":i?"true":null,role:"checkbox",class:createColorClasses(r,(e={},e[d]=true,e["in-item"]=hostContext("ion-item",a),e["checkbox-checked"]=c,e["checkbox-disabled"]=i,e["checkbox-indeterminate"]=l,e["legacy-checkbox"]=true,e.interactive=true,e))},h("svg",{class:"checkbox-icon",viewBox:"0 0 24 24",part:"container"},f),h("label",{htmlFor:s},g),h("input",{type:"checkbox","aria-checked":"".concat(c),disabled:i,id:s,onChange:this.toggleChecked,onFocus:function(){return t.onFocus()},onBlur:function(){return t.onBlur()},ref:function(e){return t.focusEl=e}}))};e.prototype.getSVGPath=function(e,t){var o=t?h("path",{d:"M6 12L18 12",part:"mark"}):h("path",{d:"M5.9,12.5l3.8,3.8l8.8-8.8",part:"mark"});if(e==="md"){o=t?h("path",{d:"M2 12H22",part:"mark"}):h("path",{d:"M1.73,12.91 8.1,19.28 22.79,4.59",part:"mark"})}return o};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["styleChanged"],disabled:["styleChanged"]}},enumerable:false,configurable:true});return e}();var checkboxIds=0;Checkbox.style={ios:checkboxIosCss,md:checkboxMdCss};export{Checkbox as ion_checkbox};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,h,H as Host,f as getElement}from"./index-adfb2000.js";import{a as addEventListener,c as componentOnReady}from"./helpers-3379ba19.js";import{a as printIonError}from"./index-595d62c9.js";import{c as createColorClasses}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-9080266a.js";import{q as parseDate,t as getToday,J as is24Hour,S as getLocalizedDateTime,G as getMonthAndYear,K as getLocalizedTime,T as getMonthDayAndYear}from"./data-
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,f as getElement}from"./index-adfb2000.js";import{a as addEventListener,c as componentOnReady}from"./helpers-3379ba19.js";import{a as printIonError}from"./index-595d62c9.js";import{c as createColorClasses}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-9080266a.js";import{q as parseDate,t as getToday,J as is24Hour,S as getLocalizedDateTime,G as getMonthAndYear,K as getLocalizedTime,T as getMonthDayAndYear}from"./data-009dbf15.js";var iosDatetimeButtonCss=":host{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host button{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";var mdDatetimeButtonCss=":host{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host button{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";var DatetimeButton=function(){function e(e){var t=this;registerInstance(this,e);this.datetimeEl=null;this.overlayEl=null;this.getParsedDateValues=function(e){if(e===undefined||e===null){return[]}if(Array.isArray(e)){return e}return[e]};this.setDateTimeText=function(){var e=t,a=e.datetimeEl,i=e.datetimePresentation;if(!a){return}var n=a.value,r=a.locale,o=a.hourCycle,s=a.preferWheel,d=a.multiple,c=a.titleSelectedDatesFormatter;var l=t.getParsedDateValues(n);var m=parseDate(l.length>0?l:[getToday()]);if(!m){return}var u=m[0];var p=is24Hour(r,o);t.dateText=t.timeText=undefined;switch(i){case"date-time":case"time-date":var f=getMonthDayAndYear(r,u);var h=getLocalizedTime(r,u,p);if(s){t.dateText="".concat(f," ").concat(h)}else{t.dateText=f;t.timeText=h}break;case"date":if(d&&l.length!==1){var b="".concat(l.length," days");if(c!==undefined){try{b=c(l)}catch(e){printIonError("Exception in provided `titleSelectedDatesFormatter`: ",e)}}t.dateText=b}else{t.dateText=getMonthDayAndYear(r,u)}break;case"time":t.timeText=getLocalizedTime(r,u,p);break;case"month-year":t.dateText=getMonthAndYear(r,u);break;case"month":t.dateText=getLocalizedDateTime(r,u,{month:"long"});break;case"year":t.dateText=getLocalizedDateTime(r,u,{year:"numeric"});break}};this.waitForDatetimeChanges=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.datetimeEl;if(!e){return[2,Promise.resolve()]}return[2,new Promise((function(t){addEventListener(e,"ionRender",t,{once:true})}))]}))}))};this.handleDateClick=function(e){return __awaiter(t,void 0,void 0,(function(){var t,a,i,n,r;return __generator(this,(function(o){t=this,a=t.datetimeEl,i=t.datetimePresentation;if(!a){return[2]}n=false;switch(i){case"date-time":case"time-date":r=a.presentation!=="date";if(!a.preferWheel&&r){a.presentation="date";n=true}break}this.selectedButton="date";this.presentOverlay(e,n,this.dateTargetEl);return[2]}))}))};this.handleTimeClick=function(e){var a=t,i=a.datetimeEl,n=a.datetimePresentation;if(!i){return}var r=false;switch(n){case"date-time":case"time-date":var o=i.presentation!=="time";if(o){i.presentation="time";r=true}break}t.selectedButton="time";t.presentOverlay(e,r,t.timeTargetEl)};this.presentOverlay=function(e,a,i){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t=this.overlayEl;if(!t){return[2]}if(!(t.tagName==="ION-POPOVER"))return[3,3];if(!a)return[3,2];return[4,this.waitForDatetimeChanges()];case 1:n.sent();n.label=2;case 2:t.present(Object.assign(Object.assign({},e),{detail:{ionShadowTarget:i}}));return[3,4];case 3:t.present();n.label=4;case 4:return[2]}}))}))};this.datetimePresentation="date-time";this.dateText=undefined;this.timeText=undefined;this.datetimeActive=false;this.selectedButton=undefined;this.color="primary";this.disabled=false;this.datetime=undefined}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,a,i;var n=this;return __generator(this,(function(r){e=this.datetime;if(!e){printIonError("An ID associated with an ion-datetime instance is required for ion-datetime-button to function properly.",this.el);return[2]}t=this.datetimeEl=document.getElementById(e);if(!t){printIonError("No ion-datetime instance found for ID '".concat(e,"'."),this.el);return[2]}if(t.tagName!=="ION-DATETIME"){printIonError("Expected an ion-datetime instance for ID '".concat(e,"' but received '").concat(t.tagName.toLowerCase(),"' instead."),t);return[2]}a=new IntersectionObserver((function(e){var t=e[0];n.datetimeActive=t.isIntersecting}),{threshold:.01});a.observe(t);i=this.overlayEl=t.closest("ion-modal, ion-popover");if(i){i.classList.add("ion-datetime-button-overlay")}componentOnReady(t,(function(){var e=n.datetimePresentation=t.presentation||"date-time";n.setDateTimeText();addEventListener(t,"ionValueChange",n.setDateTimeText);switch(e){case"date-time":case"date":case"month-year":case"month":case"year":n.selectedButton="date";break;case"time-date":case"time":n.selectedButton="time";break}}));return[2]}))}))};e.prototype.render=function(){var e;var t=this;var a=this,i=a.color,n=a.dateText,r=a.timeText,o=a.selectedButton,s=a.datetimeActive,d=a.disabled;var c=getIonMode(this);return h(Host,{class:createColorClasses(i,(e={},e[c]=true,e["".concat(o,"-active")]=s,e["datetime-button-disabled"]=d,e))},n&&h("button",{class:"ion-activatable",id:"date-button","aria-expanded":s?"true":"false",onClick:this.handleDateClick,disabled:d,part:"native",ref:function(e){return t.dateTargetEl=e}},h("slot",{name:"date-target"},n),c==="md"&&h("ion-ripple-effect",null)),r&&h("button",{class:"ion-activatable",id:"time-button","aria-expanded":s?"true":"false",onClick:this.handleTimeClick,disabled:d,part:"native",ref:function(e){return t.timeTargetEl=e}},h("slot",{name:"time-target"},r),c==="md"&&h("ion-ripple-effect",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DatetimeButton.style={ios:iosDatetimeButtonCss,md:mdDatetimeButtonCss};export{DatetimeButton as ion_datetime_button};
|