1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-checkbox.entry.js"],"names":["checkboxIosCss","checkboxMdCss","Checkbox","hostRef","ionChange","ionFocus","ionBlur","ionStyle","inputId","checkboxIds","name","checked","indeterminate","disabled","value","onClick","ev","preventDefault","setFocus","onFocus","emit","onBlur","emitStyle","isChecked","focusEl","focus","color","el","mode","label","labelId","labelText","path","d","part","role","viewBox","htmlFor","type","id","ref","style","ios","md"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAKA,UAAMA,cAAc,GAAG,w1FAAvB;AAEA,UAAMC,aAAa,GAAG,m+FAAtB;;AAEA,UAAMC,QAAQ;AACZ,0BAAYC,OAAZ,EAAqB;AAAA;;AAAA;;AACnB,uEAAiB,IAAjB,EAAuBA,OAAvB;AACA,eAAKC,SAAL,GAAiB,6DAAY,IAAZ,EAAkB,WAAlB,EAA+B,CAA/B,CAAjB;AACA,eAAKC,QAAL,GAAgB,6DAAY,IAAZ,EAAkB,UAAlB,EAA8B,CAA9B,CAAhB;AACA,eAAKC,OAAL,GAAe,6DAAY,IAAZ,EAAkB,SAAlB,EAA6B,CAA7B,CAAf;AACA,eAAKC,QAAL,GAAgB,6DAAY,IAAZ,EAAkB,UAAlB,EAA8B,CAA9B,CAAhB;AACA,eAAKC,OAAL,oBAAyBC,WAAW,EAApC;AACA;;;;AAGA,eAAKC,IAAL,GAAY,KAAKF,OAAjB;AACA;;;;AAGA,eAAKG,OAAL,GAAe,KAAf;AACA;;;;AAGA,eAAKC,aAAL,GAAqB,KAArB;AACA;;;;AAGA,eAAKC,QAAL,GAAgB,KAAhB;AACA;;;;;;;;AAOA,eAAKC,KAAL,GAAa,IAAb;;AACA,eAAKC,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EAG5JhB,OAH4J,6BAIhL,mBAJgL,EAI3JE,QAJ2J,6BAKhL,wBALgL,EAKtJD,aALsJ,6BAMhL,aANgL,EAMjK,IANiK;AAApK,aAAR,EAOA,6DAAE,KAAF,EAAS;AAAE,uBAAO,eAAT;AAA0BwB,qBAAO,EAAE,WAAnC;AAAgDF,kBAAI,EAAE;AAAtD,aAAT,EAA8EF,IAA9E,CAPA,EAOqF,6DAAE,OAAF,EAAW;AAAEK,qBAAO,EAAE7B;AAAX,aAAX,EAAiCuB,SAAjC,CAPrF,EAOkI,6DAAE,OAAF,EAAW;AAAEO,kBAAI,EAAE,UAAR;AAAoB,wCAAmB3B,OAAnB,CAApB;AAAkDE,sBAAQ,EAAEA,QAA5D;AAAsE0B,gBAAE,EAAE/B,OAA1E;AAAmFW,qBAAO,EAAE;AAAA,uBAAM,MAAI,CAACA,OAAL,EAAN;AAAA,eAA5F;AAAkHE,oBAAM,EAAE;AAAA,uBAAM,MAAI,CAACA,MAAL,EAAN;AAAA,eAA1H;AAA+ImB,iBAAG,EAAE,aAAAhB,OAAO;AAAA,uBAAI,MAAI,CAACA,OAAL,GAAeA,OAAnB;AAAA;AAA3J,aAAX,CAPlI,CAAR;AAQD;AA1FW;AAAA;AAAA,8BA2FH;AAAE,mBAAO,6DAAW,IAAX,CAAP;AAA0B;AA3FzB;AAAA;AAAA,8BA4FU;AAAE,mBAAO;AAC7B,yBAAW,CAAC,gBAAD,CADkB;AAE7B,0BAAY,CAAC,iBAAD;AAFiB,aAAP;AAGpB;AA/FQ;;AAAA;AAAA,SAAd;;AAiGA,UAAIf,WAAW,GAAG,CAAlB;AACAP,cAAQ,CAACuC,KAAT,GAAiB;AACfC,WAAG,EAAE1C,cADU;AAEf2C,UAAE,EAAE1C;AAFW,OAAjB","file":"8-es5.js","sourcesContent":["import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-e806d1f6.js';\nimport { b as getIonMode } from './ionic-global-9d5c8ee3.js';\nimport { c as getAriaLabel, d as renderHiddenInput } from './helpers-90f46169.js';\nimport { c as createColorClasses, h as hostContext } from './theme-ff3fc52f.js';\n\nconst checkboxIosCss = \":host{--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;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.ion-color){--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}label{left:0;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}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}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}.checkbox-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-sizing:border-box;box-sizing:border-box}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--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);--background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px;width:var(--size);height:var(--size)}:host(.checkbox-disabled){opacity:0.3}:host(.in-item){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.in-item[slot=start]){margin-left:2px;margin-right:20px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:20px;margin-inline-end:20px}}\";\n\nconst checkboxMdCss = \":host{--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;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.ion-color){--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}label{left:0;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}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}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}.checkbox-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-sizing:border-box;box-sizing:border-box}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--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:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.51);--checkmark-width:3;--background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px;width:var(--size);height:var(--size)}.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(.checkbox-disabled){opacity:0.3}:host(.in-item){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item[slot=start]){margin-left:4px;margin-right:36px;margin-top:18px;margin-bottom:18px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}\";\n\nconst Checkbox = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionChange = createEvent(this, \"ionChange\", 7);\n this.ionFocus = createEvent(this, \"ionFocus\", 7);\n this.ionBlur = createEvent(this, \"ionBlur\", 7);\n this.ionStyle = createEvent(this, \"ionStyle\", 7);\n this.inputId = `ion-cb-${checkboxIds++}`;\n /**\n * The name of the control, which is submitted with the form data.\n */\n this.name = this.inputId;\n /**\n * If `true`, the checkbox is selected.\n */\n this.checked = false;\n /**\n * If `true`, the checkbox will visually appear as indeterminate.\n */\n this.indeterminate = false;\n /**\n * If `true`, the user cannot interact with the checkbox.\n */\n this.disabled = false;\n /**\n * The value of the checkbox does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a checkbox is analogous to the value of an `<input type=\"checkbox\">`,\n * it's only used when the checkbox participates in a native `<form>`.\n */\n this.value = 'on';\n this.onClick = (ev) => {\n ev.preventDefault();\n this.setFocus();\n this.checked = !this.checked;\n this.indeterminate = false;\n };\n this.onFocus = () => {\n this.ionFocus.emit();\n };\n this.onBlur = () => {\n this.ionBlur.emit();\n };\n }\n componentWillLoad() {\n this.emitStyle();\n }\n checkedChanged(isChecked) {\n this.ionChange.emit({\n checked: isChecked,\n value: this.value\n });\n this.emitStyle();\n }\n disabledChanged() {\n this.emitStyle();\n }\n emitStyle() {\n this.ionStyle.emit({\n 'checkbox-checked': this.checked,\n 'interactive-disabled': this.disabled,\n });\n }\n setFocus() {\n if (this.focusEl) {\n this.focusEl.focus();\n }\n }\n render() {\n const { color, checked, disabled, el, indeterminate, inputId, name, value } = this;\n const mode = getIonMode(this);\n const { label, labelId, labelText } = getAriaLabel(el, inputId);\n renderHiddenInput(true, el, name, (checked ? value : ''), disabled);\n let path = indeterminate\n ? h(\"path\", { d: \"M6 12L18 12\", part: \"mark\" })\n : h(\"path\", { d: \"M5.9,12.5l3.8,3.8l8.8-8.8\", part: \"mark\" });\n if (mode === 'md') {\n path = indeterminate\n ? h(\"path\", { d: \"M2 12H22\", part: \"mark\" })\n : h(\"path\", { d: \"M1.73,12.91 8.1,19.28 22.79,4.59\", part: \"mark\" });\n }\n return (h(Host, { onClick: this.onClick, \"aria-labelledby\": label ? labelId : null, \"aria-checked\": `${checked}`, \"aria-hidden\": disabled ? 'true' : null, role: \"checkbox\", class: createColorClasses(color, {\n [mode]: true,\n 'in-item': hostContext('ion-item', el),\n 'checkbox-checked': checked,\n 'checkbox-disabled': disabled,\n 'checkbox-indeterminate': indeterminate,\n 'interactive': true\n }) }, h(\"svg\", { class: \"checkbox-icon\", viewBox: \"0 0 24 24\", part: \"container\" }, path), h(\"label\", { htmlFor: inputId }, labelText), h(\"input\", { type: \"checkbox\", \"aria-checked\": `${checked}`, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: focusEl => this.focusEl = focusEl })));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"checked\": [\"checkedChanged\"],\n \"disabled\": [\"disabledChanged\"]\n }; }\n};\nlet checkboxIds = 0;\nCheckbox.style = {\n ios: checkboxIosCss,\n md: checkboxMdCss\n};\n\nexport { Checkbox as ion_checkbox };\n"]} |