@venite/components 0.16.2 → 0.16.6
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/ion-button_13.cjs.entry.js +1787 -0
- package/dist/cjs/ion-checkbox_3.cjs.entry.js +235 -0
- package/dist/cjs/ion-segment_16.cjs.entry.js +5 -4
- package/dist/cjs/ldf-day-name_5.cjs.entry.js +1 -2
- package/dist/cjs/ldf-editable-add-block-menu.cjs.entry.js +2 -2
- package/dist/cjs/ldf-editable-filter-documents.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-lookup_2.cjs.entry.js +3 -3
- package/dist/cjs/ldf-editable-metadata.cjs.entry.js +3 -3
- package/dist/cjs/ldf.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{option-a9f12c93.js → option-1ebd4514.js} +6 -2
- package/dist/cjs/{rubric-85fc7418.js → rubric-662d8baa.js} +44 -5
- package/dist/cjs/{specific-class-acf1bb37.js → specific-class-d80d272a.js} +2 -2
- package/dist/collection/components/liturgical-document/dist/liturgical-document.js +6 -1
- package/dist/collection/components/liturgical-document/liturgical-document.js +21 -1
- package/dist/collection/components/option/dist/option.js +318 -0
- package/dist/collection/components/prayers-and-thanksgivings/dist/prayers-and-thanksgivings.js +258 -0
- package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.js +55 -36
- package/dist/collection/components/psalm/dist/psalm.js +0 -1
- package/dist/collection/components/psalm/psalm.js +0 -1
- package/dist/collection/components/string/dist/string.js +0 -1
- package/dist/collection/components/string/string.js +0 -1
- package/dist/collection/components/text/dist/text.js +1 -1
- package/dist/collection/components/text/text.js +1 -1
- package/dist/esm/{app-globals-2b41bd8d.js → app-globals-729b03cf.js} +1 -1
- package/dist/esm/{index-1885f1b8.js → index-734a6b69.js} +1 -1
- package/dist/esm/{index-8b9e221a.js → index-9579282b.js} +3 -3
- package/dist/esm/{index-dcd553ac.js → index-f0f6a379.js} +1 -1
- package/dist/esm/ion-action-sheet.entry.js +3 -3
- package/dist/esm/ion-alert.entry.js +3 -3
- package/dist/esm/ion-app.entry.js +3 -3
- package/dist/esm/ion-avatar.entry.js +2 -2
- package/dist/esm/ion-back-button.entry.js +2 -2
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-badge.entry.js +2 -2
- package/dist/esm/ion-button_13.entry.js +1771 -0
- package/dist/esm/ion-card-content_6.entry.js +3 -3
- package/dist/esm/ion-card-subtitle.entry.js +2 -2
- package/dist/esm/ion-card_2.entry.js +2 -2
- package/dist/esm/ion-checkbox_3.entry.js +229 -0
- package/dist/esm/ion-chip.entry.js +2 -2
- package/dist/esm/ion-datetime_2.entry.js +3 -3
- package/dist/esm/ion-fab-button.entry.js +2 -2
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +2 -2
- package/dist/esm/ion-img.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll-content.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll.entry.js +2 -2
- package/dist/esm/ion-input_2.entry.js +2 -2
- package/dist/esm/ion-item-divider.entry.js +2 -2
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +2 -2
- package/dist/esm/ion-item-options.entry.js +2 -2
- package/dist/esm/ion-item-sliding.entry.js +2 -2
- package/dist/esm/ion-list-header.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu-button.entry.js +4 -4
- package/dist/esm/ion-menu-toggle.entry.js +4 -4
- package/dist/esm/ion-menu.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +4 -4
- package/dist/esm/ion-nav-link.entry.js +1 -1
- package/dist/esm/ion-nav.entry.js +3 -3
- package/dist/esm/ion-note.entry.js +2 -2
- package/dist/esm/ion-picker-column.entry.js +2 -2
- package/dist/esm/ion-picker.entry.js +3 -3
- package/dist/esm/ion-popover.entry.js +4 -4
- package/dist/esm/ion-progress-bar.entry.js +2 -2
- package/dist/esm/ion-radio_2.entry.js +2 -2
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-refresher-content.entry.js +2 -2
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +2 -2
- package/dist/esm/ion-reorder.entry.js +2 -2
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +2 -2
- package/dist/esm/ion-router-outlet.entry.js +3 -3
- package/dist/esm/ion-router.entry.js +1 -1
- package/dist/esm/ion-segment_16.entry.js +8 -7
- package/dist/esm/ion-select-popover.entry.js +3 -3
- package/dist/esm/ion-select_2.entry.js +3 -3
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +2 -2
- package/dist/esm/ion-spinner.entry.js +2 -2
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar.entry.js +2 -2
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +1 -1
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-text.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +3 -3
- package/dist/esm/ion-virtual-scroll.entry.js +1 -1
- package/dist/esm/{ionic-global-fef4299f.js → ionic-global-ef89a0a5.js} +1 -1
- package/dist/esm/{ios.transition-2460f61e.js → ios.transition-b1be0863.js} +2 -2
- package/dist/esm/ldf-day-name_5.entry.js +4 -5
- package/dist/esm/ldf-editable-add-block-menu.entry.js +3 -3
- package/dist/esm/ldf-editable-condition-piece.entry.js +1 -1
- package/dist/esm/ldf-editable-condition.entry.js +1 -1
- package/dist/esm/ldf-editable-filter-documents.entry.js +2 -2
- package/dist/esm/ldf-editable-lookup_2.entry.js +4 -4
- package/dist/esm/ldf-editable-metadata.entry.js +4 -4
- package/dist/esm/ldf-editable-preference-option.entry.js +1 -1
- package/dist/esm/ldf-editable-preference.entry.js +1 -1
- package/dist/esm/ldf-editable-preferences.entry.js +3 -3
- package/dist/esm/ldf-editable-string-list.entry.js +1 -1
- package/dist/esm/ldf-editor-cursors.entry.js +1 -1
- package/dist/esm/ldf-editor.entry.js +1 -1
- package/dist/esm/ldf.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{md.transition-7eb37dd1.js → md.transition-1763f475.js} +2 -2
- package/dist/esm/{menu-toggle-util-d6bed342.js → menu-toggle-util-29e61ff3.js} +1 -1
- package/dist/esm/{option-042c9673.js → option-47d50244.js} +6 -2
- package/dist/esm/{overlays-e1d5aa58.js → overlays-06b43b65.js} +2 -2
- package/dist/esm/{rubric-9c750946.js → rubric-2330a030.js} +44 -5
- package/dist/esm/{specific-class-2df4b72a.js → specific-class-28e26e40.js} +2 -2
- package/dist/esm/{status-tap-900b721a.js → status-tap-7458bd71.js} +1 -1
- package/dist/ldf/ldf.esm.js +1 -1
- package/dist/ldf/{p-a7a10747.entry.js → p-018e57db.entry.js} +1 -1
- package/dist/ldf/p-02ef484e.entry.js +1 -0
- package/dist/ldf/{p-5bfa9969.entry.js → p-04715bf0.entry.js} +1 -1
- package/dist/ldf/{p-8cb241a8.entry.js → p-0651768a.entry.js} +1 -1
- package/dist/ldf/{p-a80bce6a.entry.js → p-07d6d3ad.entry.js} +1 -1
- package/dist/ldf/p-08584ccc.entry.js +1 -0
- package/dist/ldf/{p-d3a17399.entry.js → p-0873a34a.entry.js} +1 -1
- package/dist/ldf/{p-5febfbde.entry.js → p-0f69db87.entry.js} +1 -1
- package/dist/ldf/{p-6b6b9f77.entry.js → p-1504379f.entry.js} +1 -1
- package/dist/ldf/{p-110c6e85.entry.js → p-1a8e2899.entry.js} +1 -1
- package/dist/ldf/p-21e2f0a3.entry.js +1 -0
- package/dist/ldf/{p-6c3d4341.entry.js → p-25a736f1.entry.js} +1 -1
- package/dist/ldf/{p-43d7a734.entry.js → p-2c36a583.entry.js} +1 -1
- package/dist/ldf/{p-4c8f895f.entry.js → p-2fa1c501.entry.js} +1 -1
- package/dist/ldf/{p-a0b9b689.entry.js → p-302dc0d5.entry.js} +1 -1
- package/dist/ldf/{p-54f83929.entry.js → p-327b14ac.entry.js} +1 -1
- package/dist/ldf/{p-4d5b52ad.entry.js → p-32f7ba8e.entry.js} +1 -1
- package/dist/ldf/{p-8a064810.entry.js → p-3545fcdc.entry.js} +1 -1
- package/dist/ldf/{p-8c8bf861.entry.js → p-374118d7.entry.js} +1 -1
- package/dist/ldf/p-37f356a4.entry.js +1 -0
- package/dist/ldf/{p-7f7de09a.entry.js → p-380f8655.entry.js} +1 -1
- package/dist/ldf/{p-7df0687c.entry.js → p-3c9930ff.entry.js} +1 -1
- package/dist/ldf/{p-dbdb2b0a.entry.js → p-3f39c2ad.entry.js} +1 -1
- package/dist/ldf/{p-35680ca6.entry.js → p-430c418a.entry.js} +1 -1
- package/dist/ldf/{p-986921d2.js → p-48e44122.js} +1 -1
- package/dist/ldf/{p-4b154310.entry.js → p-4a4380fa.entry.js} +1 -1
- package/dist/ldf/p-4b80de48.js +1 -0
- package/dist/ldf/{p-06bc76d9.entry.js → p-4d392128.entry.js} +1 -1
- package/dist/ldf/p-4e0b3c0f.entry.js +1 -0
- package/dist/ldf/{p-b631cadf.entry.js → p-52656429.entry.js} +1 -1
- package/dist/ldf/p-53c807a4.js +1 -0
- package/dist/ldf/{p-91969280.js → p-55d797c1.js} +1 -1
- package/dist/ldf/{p-71ed0c0f.entry.js → p-59340423.entry.js} +1 -1
- package/dist/ldf/{p-0c8f1542.entry.js → p-5be7ff17.entry.js} +1 -1
- package/dist/ldf/p-5bf20b51.js +1 -0
- package/dist/ldf/{p-ae3cd06a.entry.js → p-63b5daf6.entry.js} +1 -1
- package/dist/ldf/{p-0afd3d32.entry.js → p-66a7385e.entry.js} +1 -1
- package/dist/ldf/p-698a3399.entry.js +1 -0
- package/dist/ldf/{p-4d92e32b.entry.js → p-69f85ad3.entry.js} +1 -1
- package/dist/ldf/{p-0cb749f6.entry.js → p-6fe24d85.entry.js} +1 -1
- package/dist/ldf/{p-ceb4c199.entry.js → p-70e47f8b.entry.js} +1 -1
- package/dist/ldf/{p-e778bf3c.entry.js → p-73a16936.entry.js} +1 -1
- package/dist/ldf/{p-bacac874.entry.js → p-79a526a1.entry.js} +1 -1
- package/dist/ldf/{p-20f5f7c0.entry.js → p-7abeb82c.entry.js} +1 -1
- package/dist/ldf/{p-79997a72.entry.js → p-7df11f48.entry.js} +1 -1
- package/dist/ldf/{p-91cef52f.entry.js → p-7efa633b.entry.js} +1 -1
- package/dist/ldf/{p-8ed588f7.entry.js → p-84f38db6.entry.js} +1 -1
- package/dist/ldf/{p-5a74ad40.entry.js → p-8767a74e.entry.js} +1 -1
- package/dist/ldf/{p-7fba586d.entry.js → p-8932ec85.entry.js} +1 -1
- package/dist/ldf/{p-74e1596c.entry.js → p-8c2727db.entry.js} +1 -1
- package/dist/ldf/{p-913c92ca.entry.js → p-972e4f2a.entry.js} +1 -1
- package/dist/ldf/{p-0ce10dcd.js → p-978e2c6d.js} +1 -1
- package/dist/ldf/p-9bd5d1d4.entry.js +1 -0
- package/dist/ldf/{p-5fa1dcfb.entry.js → p-9c397c49.entry.js} +1 -1
- package/dist/ldf/p-9e2c172e.entry.js +1 -0
- package/dist/ldf/{p-6b0fab5d.js → p-9e82b403.js} +2 -2
- package/dist/ldf/{p-2b9556d3.entry.js → p-a98c89d1.entry.js} +1 -1
- package/dist/ldf/{p-c3dbb344.entry.js → p-ac7a17ce.entry.js} +1 -1
- package/dist/ldf/{p-3b236b73.js → p-acbbd1ec.js} +1 -1
- package/dist/ldf/p-b1242016.js +1 -0
- package/dist/ldf/{p-50d56c76.entry.js → p-b7388aec.entry.js} +1 -1
- package/dist/ldf/{p-37ead536.entry.js → p-b78336d7.entry.js} +1 -1
- package/dist/ldf/{p-9282f514.entry.js → p-ba021918.entry.js} +1 -1
- package/dist/ldf/{p-65c80b87.entry.js → p-c1bcd0a9.entry.js} +1 -1
- package/dist/ldf/{p-4c825920.entry.js → p-c1df632d.entry.js} +1 -1
- package/dist/ldf/{p-a467efd9.entry.js → p-c3042920.entry.js} +1 -1
- package/dist/ldf/{p-860e2e8c.entry.js → p-c3807857.entry.js} +1 -1
- package/dist/ldf/{p-faf3cb15.entry.js → p-c3841978.entry.js} +1 -1
- package/dist/ldf/{p-b7fe7b29.entry.js → p-c41e055c.entry.js} +1 -1
- package/dist/ldf/{p-5cefe450.entry.js → p-c6163f81.entry.js} +1 -1
- package/dist/ldf/{p-944c44a7.entry.js → p-c6b42618.entry.js} +1 -1
- package/dist/ldf/{p-1d8e06c7.entry.js → p-c74d3fd0.entry.js} +1 -1
- package/dist/ldf/{p-741e1b4e.entry.js → p-c82dd468.entry.js} +1 -1
- package/dist/ldf/{p-342e45c0.entry.js → p-ca698b8f.entry.js} +1 -1
- package/dist/ldf/p-ca7e0de9.entry.js +1 -0
- package/dist/ldf/{p-059fcd05.entry.js → p-cbfbb80c.entry.js} +1 -1
- package/dist/ldf/{p-a8264864.entry.js → p-d195c957.entry.js} +1 -1
- package/dist/ldf/{p-664b2872.js → p-d282d4f9.js} +1 -1
- package/dist/ldf/{p-bc59e89e.entry.js → p-d7966e9b.entry.js} +1 -1
- package/dist/ldf/{p-f562ae50.js → p-d7f8c770.js} +1 -1
- package/dist/ldf/{p-396025ba.entry.js → p-d7fa99cc.entry.js} +1 -1
- package/dist/ldf/{p-ae136041.entry.js → p-db435131.entry.js} +1 -1
- package/dist/ldf/{p-ae287f67.entry.js → p-dc445c36.entry.js} +1 -1
- package/dist/ldf/{p-385a3ecf.entry.js → p-dd99e42a.entry.js} +1 -1
- package/dist/ldf/{p-b8a8f9c8.js → p-de5bb5ad.js} +1 -1
- package/dist/ldf/{p-7e388cb7.entry.js → p-e0e12ae3.entry.js} +1 -1
- package/dist/ldf/{p-128ac9e9.entry.js → p-e215fd02.entry.js} +1 -1
- package/dist/ldf/{p-4b7027b1.entry.js → p-e4be11ad.entry.js} +1 -1
- package/dist/ldf/{p-8d6f1d6b.entry.js → p-ea66c343.entry.js} +1 -1
- package/dist/ldf/{p-ac9a93aa.entry.js → p-ec5eecdc.entry.js} +1 -1
- package/dist/ldf/{p-64c46765.js → p-f2ce126e.js} +1 -1
- package/dist/ldf/{p-186eed18.entry.js → p-fe59a676.entry.js} +1 -1
- package/dist/ldf/p-ff51dbd0.entry.js +1 -0
- package/dist/types/components/liturgical-document/liturgical-document.d.ts +2 -0
- package/dist/types/components/prayers-and-thanksgivings/prayers-and-thanksgivings.d.ts +1 -1
- package/dist/types/components.d.ts +8 -0
- package/package.json +2 -2
- package/dist/cjs/ion-button_3.cjs.entry.js +0 -413
- package/dist/cjs/ion-buttons_6.cjs.entry.js +0 -584
- package/dist/cjs/ion-content.cjs.entry.js +0 -303
- package/dist/cjs/ion-item_2.cjs.entry.js +0 -168
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +0 -93
- package/dist/cjs/ion-searchbar.cjs.entry.js +0 -330
- package/dist/cjs/ion-title.cjs.entry.js +0 -48
- package/dist/cjs/ldf-prayers-and-thanksgivings.cjs.entry.js +0 -108
- package/dist/esm/ion-button_3.entry.js +0 -407
- package/dist/esm/ion-buttons_6.entry.js +0 -575
- package/dist/esm/ion-content.entry.js +0 -299
- package/dist/esm/ion-item_2.entry.js +0 -163
- package/dist/esm/ion-ripple-effect.entry.js +0 -89
- package/dist/esm/ion-searchbar.entry.js +0 -326
- package/dist/esm/ion-title.entry.js +0 -44
- package/dist/esm/ldf-prayers-and-thanksgivings.entry.js +0 -104
- package/dist/ldf/p-01655d40.js +0 -1
- package/dist/ldf/p-07e48862.entry.js +0 -1
- package/dist/ldf/p-2471a9c7.entry.js +0 -1
- package/dist/ldf/p-356f9ee6.entry.js +0 -1
- package/dist/ldf/p-68f963c7.entry.js +0 -1
- package/dist/ldf/p-72718314.entry.js +0 -1
- package/dist/ldf/p-78ed7ef0.entry.js +0 -1
- package/dist/ldf/p-7aecb410.js +0 -1
- package/dist/ldf/p-7ccf2257.entry.js +0 -1
- package/dist/ldf/p-867f7c02.js +0 -1
- package/dist/ldf/p-8e1286c3.entry.js +0 -1
- package/dist/ldf/p-92461769.entry.js +0 -1
- package/dist/ldf/p-9382bbe1.entry.js +0 -1
- package/dist/ldf/p-96967103.entry.js +0 -1
- package/dist/ldf/p-accacaed.entry.js +0 -1
- package/dist/ldf/p-bcb82c8e.js +0 -1
- package/dist/ldf/p-c7c0acf1.entry.js +0 -1
- package/dist/ldf/p-cee7604d.entry.js +0 -1
- package/dist/ldf/p-e3ce57d7.entry.js +0 -1
- package/dist/ldf/p-ecb2e631.entry.js +0 -1
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
7
|
-
const helpers = require('./helpers-41dfb43a.js');
|
|
8
|
-
const theme = require('./theme-81caa5b0.js');
|
|
9
|
-
|
|
10
|
-
let CACHED_MAP;
|
|
11
|
-
const getIconMap = () => {
|
|
12
|
-
if (typeof window === 'undefined') {
|
|
13
|
-
return new Map();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
if (!CACHED_MAP) {
|
|
17
|
-
const win = window;
|
|
18
|
-
win.Ionicons = win.Ionicons || {};
|
|
19
|
-
CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
|
|
20
|
-
}
|
|
21
|
-
return CACHED_MAP;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const getUrl = (i) => {
|
|
25
|
-
let url = getSrc(i.src);
|
|
26
|
-
if (url) {
|
|
27
|
-
return url;
|
|
28
|
-
}
|
|
29
|
-
url = getName(i.name, i.icon, i.mode, i.ios, i.md);
|
|
30
|
-
if (url) {
|
|
31
|
-
return getNamedUrl(url);
|
|
32
|
-
}
|
|
33
|
-
if (i.icon) {
|
|
34
|
-
url = getSrc(i.icon);
|
|
35
|
-
if (url) {
|
|
36
|
-
return url;
|
|
37
|
-
}
|
|
38
|
-
url = getSrc(i.icon[i.mode]);
|
|
39
|
-
if (url) {
|
|
40
|
-
return url;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
};
|
|
45
|
-
const getNamedUrl = (iconName) => {
|
|
46
|
-
const url = getIconMap().get(iconName);
|
|
47
|
-
if (url) {
|
|
48
|
-
return url;
|
|
49
|
-
}
|
|
50
|
-
return index.getAssetPath(`svg/${iconName}.svg`);
|
|
51
|
-
};
|
|
52
|
-
const getName = (iconName, icon, mode, ios, md) => {
|
|
53
|
-
// default to "md" if somehow the mode wasn't set
|
|
54
|
-
mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
|
|
55
|
-
// if an icon was passed in using the ios or md attributes
|
|
56
|
-
// set the iconName to whatever was passed in
|
|
57
|
-
if (ios && mode === 'ios') {
|
|
58
|
-
iconName = toLower(ios);
|
|
59
|
-
}
|
|
60
|
-
else if (md && mode === 'md') {
|
|
61
|
-
iconName = toLower(md);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
if (!iconName && icon && !isSrc(icon)) {
|
|
65
|
-
iconName = icon;
|
|
66
|
-
}
|
|
67
|
-
if (isStr(iconName)) {
|
|
68
|
-
iconName = toLower(iconName);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (!isStr(iconName) || iconName.trim() === '') {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
// only allow alpha characters and dash
|
|
75
|
-
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
|
76
|
-
if (invalidChars !== '') {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return iconName;
|
|
80
|
-
};
|
|
81
|
-
const getSrc = (src) => {
|
|
82
|
-
if (isStr(src)) {
|
|
83
|
-
src = src.trim();
|
|
84
|
-
if (isSrc(src)) {
|
|
85
|
-
return src;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
};
|
|
90
|
-
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
|
91
|
-
const isStr = (val) => typeof val === 'string';
|
|
92
|
-
const toLower = (val) => val.toLowerCase();
|
|
93
|
-
|
|
94
|
-
const buttonIosCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}:host(.button-outline){--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}:host(.button-large){--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-strong){font-weight:600}:host(.button-clear.ion-activated){opacity:0.4}:host(.button-outline.ion-activated.ion-color) .button-native{color:var(--ion-color-contrast)}:host(.button-outline.ion-activated.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}:host(.button-outline.ion-focused.ion-color) .button-native,:host(.button-clear.ion-focused.ion-color) .button-native{color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native::after,:host(.button-clear.ion-focused.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.button-clear:hover),:host(.button-outline:hover){opacity:0.6}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{color:var(--ion-color-base)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:transparent}:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after{background:#fff;opacity:0.1}}";
|
|
95
|
-
|
|
96
|
-
const buttonMdCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}:host(.button-solid.ion-activated){--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-outline.ion-activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:bold}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast);opacity:0.24}:host(.button-clear.ion-color.ion-focused) .button-native::after,:host(.button-outline.ion-color.ion-focused) .button-native::after{background:var(--ion-color-base);opacity:0.12}@media (any-hover: hover){:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-contrast);opacity:0.08}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:var(--ion-color-base);opacity:0.04}}";
|
|
97
|
-
|
|
98
|
-
const Button = class {
|
|
99
|
-
constructor(hostRef) {
|
|
100
|
-
index.registerInstance(this, hostRef);
|
|
101
|
-
this.ionFocus = index.createEvent(this, "ionFocus", 7);
|
|
102
|
-
this.ionBlur = index.createEvent(this, "ionBlur", 7);
|
|
103
|
-
this.inItem = false;
|
|
104
|
-
this.inListHeader = false;
|
|
105
|
-
this.inToolbar = false;
|
|
106
|
-
/**
|
|
107
|
-
* The type of button.
|
|
108
|
-
*/
|
|
109
|
-
this.buttonType = 'button';
|
|
110
|
-
/**
|
|
111
|
-
* If `true`, the user cannot interact with the button.
|
|
112
|
-
*/
|
|
113
|
-
this.disabled = false;
|
|
114
|
-
/**
|
|
115
|
-
* When using a router, it specifies the transition direction when navigating to
|
|
116
|
-
* another page using `href`.
|
|
117
|
-
*/
|
|
118
|
-
this.routerDirection = 'forward';
|
|
119
|
-
/**
|
|
120
|
-
* If `true`, activates a button with a heavier font weight.
|
|
121
|
-
*/
|
|
122
|
-
this.strong = false;
|
|
123
|
-
/**
|
|
124
|
-
* The type of the button.
|
|
125
|
-
*/
|
|
126
|
-
this.type = 'button';
|
|
127
|
-
this.handleClick = (ev) => {
|
|
128
|
-
if (this.type === 'button') {
|
|
129
|
-
theme.openURL(this.href, ev, this.routerDirection);
|
|
130
|
-
}
|
|
131
|
-
else if (helpers.hasShadowDom(this.el)) {
|
|
132
|
-
// this button wants to specifically submit a form
|
|
133
|
-
// climb up the dom to see if we're in a <form>
|
|
134
|
-
// and if so, then use JS to submit it
|
|
135
|
-
const form = this.el.closest('form');
|
|
136
|
-
if (form) {
|
|
137
|
-
ev.preventDefault();
|
|
138
|
-
const fakeButton = document.createElement('button');
|
|
139
|
-
fakeButton.type = this.type;
|
|
140
|
-
fakeButton.style.display = 'none';
|
|
141
|
-
form.appendChild(fakeButton);
|
|
142
|
-
fakeButton.click();
|
|
143
|
-
fakeButton.remove();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
this.onFocus = () => {
|
|
148
|
-
this.ionFocus.emit();
|
|
149
|
-
};
|
|
150
|
-
this.onBlur = () => {
|
|
151
|
-
this.ionBlur.emit();
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
componentWillLoad() {
|
|
155
|
-
this.inToolbar = !!this.el.closest('ion-buttons');
|
|
156
|
-
this.inListHeader = !!this.el.closest('ion-list-header');
|
|
157
|
-
this.inItem = !!this.el.closest('ion-item') || !!this.el.closest('ion-item-divider');
|
|
158
|
-
}
|
|
159
|
-
get hasIconOnly() {
|
|
160
|
-
return !!this.el.querySelector('ion-icon[slot="icon-only"]');
|
|
161
|
-
}
|
|
162
|
-
get rippleType() {
|
|
163
|
-
const hasClearFill = this.fill === undefined || this.fill === 'clear';
|
|
164
|
-
// If the button is in a toolbar, has a clear fill (which is the default)
|
|
165
|
-
// and only has an icon we use the unbounded "circular" ripple effect
|
|
166
|
-
if (hasClearFill && this.hasIconOnly && this.inToolbar) {
|
|
167
|
-
return 'unbounded';
|
|
168
|
-
}
|
|
169
|
-
return 'bounded';
|
|
170
|
-
}
|
|
171
|
-
render() {
|
|
172
|
-
const mode = ionicGlobal.getIonMode(this);
|
|
173
|
-
const { buttonType, type, disabled, rel, target, size, href, color, expand, hasIconOnly, shape, strong } = this;
|
|
174
|
-
const finalSize = size === undefined && this.inItem ? 'small' : size;
|
|
175
|
-
const TagType = href === undefined ? 'button' : 'a';
|
|
176
|
-
const attrs = (TagType === 'button')
|
|
177
|
-
? { type }
|
|
178
|
-
: {
|
|
179
|
-
download: this.download,
|
|
180
|
-
href,
|
|
181
|
-
rel,
|
|
182
|
-
target
|
|
183
|
-
};
|
|
184
|
-
let fill = this.fill;
|
|
185
|
-
if (fill === undefined) {
|
|
186
|
-
fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
|
|
187
|
-
}
|
|
188
|
-
return (index.h(index.Host, { onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: Object.assign(Object.assign({}, theme.createColorClasses(color)), { [mode]: true, [buttonType]: true, [`${buttonType}-${expand}`]: expand !== undefined, [`${buttonType}-${finalSize}`]: finalSize !== undefined, [`${buttonType}-${shape}`]: shape !== undefined, [`${buttonType}-${fill}`]: true, [`${buttonType}-strong`]: strong, 'in-toolbar': theme.hostContext('ion-toolbar', this.el), 'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el), 'button-has-icon-only': hasIconOnly, 'button-disabled': disabled, 'ion-activatable': true, 'ion-focusable': true }) }, index.h(TagType, Object.assign({}, attrs, { class: "button-native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }), index.h("span", { class: "button-inner" }, index.h("slot", { name: "icon-only" }), index.h("slot", { name: "start" }), index.h("slot", null), index.h("slot", { name: "end" })), mode === 'md' && index.h("ion-ripple-effect", { type: this.rippleType }))));
|
|
189
|
-
}
|
|
190
|
-
get el() { return index.getElement(this); }
|
|
191
|
-
};
|
|
192
|
-
Button.style = {
|
|
193
|
-
ios: buttonIosCss,
|
|
194
|
-
md: buttonMdCss
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const validateContent = (svgContent) => {
|
|
198
|
-
if (svgContent && typeof document !== 'undefined') {
|
|
199
|
-
const div = document.createElement('div');
|
|
200
|
-
div.innerHTML = svgContent;
|
|
201
|
-
// setup this way to ensure it works on our buddy IE
|
|
202
|
-
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
|
203
|
-
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
|
204
|
-
div.removeChild(div.childNodes[i]);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
// must only have 1 root element
|
|
208
|
-
const svgElm = div.firstElementChild;
|
|
209
|
-
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
|
210
|
-
const svgClass = svgElm.getAttribute('class') || '';
|
|
211
|
-
svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
|
|
212
|
-
// root element must be an svg
|
|
213
|
-
// lets double check we've got valid elements
|
|
214
|
-
// do not allow scripts
|
|
215
|
-
if (isValid(svgElm)) {
|
|
216
|
-
return div.innerHTML;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return '';
|
|
221
|
-
};
|
|
222
|
-
const isValid = (elm) => {
|
|
223
|
-
if (elm.nodeType === 1) {
|
|
224
|
-
if (elm.nodeName.toLowerCase() === 'script') {
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
for (let i = 0; i < elm.attributes.length; i++) {
|
|
228
|
-
const val = elm.attributes[i].value;
|
|
229
|
-
if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
|
|
230
|
-
return false;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
for (let i = 0; i < elm.childNodes.length; i++) {
|
|
234
|
-
if (!isValid(elm.childNodes[i])) {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return true;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const ioniconContent = new Map();
|
|
243
|
-
const requests = new Map();
|
|
244
|
-
const getSvgContent = (url) => {
|
|
245
|
-
// see if we already have a request for this url
|
|
246
|
-
let req = requests.get(url);
|
|
247
|
-
if (!req) {
|
|
248
|
-
if (typeof fetch !== 'undefined') {
|
|
249
|
-
// we don't already have a request
|
|
250
|
-
req = fetch(url).then(rsp => {
|
|
251
|
-
if (rsp.ok) {
|
|
252
|
-
return rsp.text().then(svgContent => {
|
|
253
|
-
ioniconContent.set(url, validateContent(svgContent));
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
ioniconContent.set(url, '');
|
|
257
|
-
});
|
|
258
|
-
// cache for the same requests
|
|
259
|
-
requests.set(url, req);
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
// set to empty for ssr scenarios and resolve promise
|
|
263
|
-
ioniconContent.set(url, '');
|
|
264
|
-
return Promise.resolve();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return req;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const iconCss = ":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";
|
|
271
|
-
|
|
272
|
-
const Icon = class {
|
|
273
|
-
constructor(hostRef) {
|
|
274
|
-
index.registerInstance(this, hostRef);
|
|
275
|
-
this.isVisible = false;
|
|
276
|
-
/**
|
|
277
|
-
* The mode determines which platform styles to use.
|
|
278
|
-
*/
|
|
279
|
-
this.mode = getIonMode();
|
|
280
|
-
/**
|
|
281
|
-
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
|
|
282
|
-
* Default, `false`.
|
|
283
|
-
*/
|
|
284
|
-
this.lazy = false;
|
|
285
|
-
}
|
|
286
|
-
connectedCallback() {
|
|
287
|
-
// purposely do not return the promise here because loading
|
|
288
|
-
// the svg file should not hold up loading the app
|
|
289
|
-
// only load the svg if it's visible
|
|
290
|
-
this.waitUntilVisible(this.el, '50px', () => {
|
|
291
|
-
this.isVisible = true;
|
|
292
|
-
this.loadIcon();
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
disconnectedCallback() {
|
|
296
|
-
if (this.io) {
|
|
297
|
-
this.io.disconnect();
|
|
298
|
-
this.io = undefined;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
waitUntilVisible(el, rootMargin, cb) {
|
|
302
|
-
if (this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {
|
|
303
|
-
const io = this.io = new window.IntersectionObserver((data) => {
|
|
304
|
-
if (data[0].isIntersecting) {
|
|
305
|
-
io.disconnect();
|
|
306
|
-
this.io = undefined;
|
|
307
|
-
cb();
|
|
308
|
-
}
|
|
309
|
-
}, { rootMargin });
|
|
310
|
-
io.observe(el);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
// browser doesn't support IntersectionObserver
|
|
314
|
-
// so just fallback to always show it
|
|
315
|
-
cb();
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
loadIcon() {
|
|
319
|
-
if (this.isVisible) {
|
|
320
|
-
const url = getUrl(this);
|
|
321
|
-
if (url) {
|
|
322
|
-
if (ioniconContent.has(url)) {
|
|
323
|
-
// sync if it's already loaded
|
|
324
|
-
this.svgContent = ioniconContent.get(url);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
// async if it hasn't been loaded
|
|
328
|
-
getSvgContent(url).then(() => this.svgContent = ioniconContent.get(url));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
if (!this.ariaLabel) {
|
|
333
|
-
const label = getName(this.name, this.icon, this.mode, this.ios, this.md);
|
|
334
|
-
// user did not provide a label
|
|
335
|
-
// come up with the label based on the icon name
|
|
336
|
-
if (label) {
|
|
337
|
-
this.ariaLabel = label.replace(/\-/g, ' ');
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
render() {
|
|
342
|
-
const mode = this.mode || 'md';
|
|
343
|
-
const flipRtl = this.flipRtl || (this.ariaLabel && (this.ariaLabel.indexOf('arrow') > -1 || this.ariaLabel.indexOf('chevron') > -1) && this.flipRtl !== false);
|
|
344
|
-
return (index.h(index.Host, { role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': !!flipRtl && this.el.ownerDocument.dir === 'rtl' }) }, ((this.svgContent)
|
|
345
|
-
? index.h("div", { class: "icon-inner", innerHTML: this.svgContent })
|
|
346
|
-
: index.h("div", { class: "icon-inner" }))));
|
|
347
|
-
}
|
|
348
|
-
static get assetsDirs() { return ["svg"]; }
|
|
349
|
-
get el() { return index.getElement(this); }
|
|
350
|
-
static get watchers() { return {
|
|
351
|
-
"name": ["loadIcon"],
|
|
352
|
-
"src": ["loadIcon"],
|
|
353
|
-
"icon": ["loadIcon"]
|
|
354
|
-
}; }
|
|
355
|
-
};
|
|
356
|
-
const getIonMode = () => (typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
|
|
357
|
-
const createColorClasses = (color) => {
|
|
358
|
-
return (color) ? {
|
|
359
|
-
'ion-color': true,
|
|
360
|
-
[`ion-color-${color}`]: true
|
|
361
|
-
} : null;
|
|
362
|
-
};
|
|
363
|
-
Icon.style = iconCss;
|
|
364
|
-
|
|
365
|
-
const labelIosCss = ".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{align-self:baseline}.label-fixed.sc-ion-label-ios-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;transform:translate3d(0, 27px, 0);transform-origin:left top;transition:transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{transform-origin:right top}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.label-floating.sc-ion-label-ios-h,.item-has-placeholder .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{transform:translate3d(0, 0, 0) scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.ion-color.sc-ion-label-ios-s>p,.ion-color .sc-ion-label-ios-h.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}";
|
|
366
|
-
|
|
367
|
-
const labelMdCss = ".item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{align-self:baseline}.label-fixed.sc-ion-label-md-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h{transform-origin:left top;transform:translate3d(0, 50%, 0) scale(0.75);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl].label-stacked.sc-ion-label-md-h,[dir=rtl] .label-stacked.sc-ion-label-md-h{transform-origin:right top}.label-floating.sc-ion-label-md-h{transform:translate3d(0, 96%, 0);transform-origin:left top;transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl].label-floating.sc-ion-label-md-h,[dir=rtl] .label-floating.sc-ion-label-md-h{transform-origin:right top}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.item-select.label-floating.sc-ion-label-md-h,.item-select .label-floating.sc-ion-label-md-h{transform:translate3d(0, 130%, 0)}.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.label-floating.sc-ion-label-md-h,.item-has-placeholder .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{transform:translate3d(0, 50%, 0) scale(0.75)}.item-has-focus.label-stacked.sc-ion-label-md-h,.item-has-focus .label-stacked.sc-ion-label-md-h,.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h{color:var(--ion-color-primary, #3880ff)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.ion-color.sc-ion-label-md-s>p,.ion-color .sc-ion-label-md-h.sc-ion-label-md-s>p{color:inherit}";
|
|
368
|
-
|
|
369
|
-
const Label = class {
|
|
370
|
-
constructor(hostRef) {
|
|
371
|
-
index.registerInstance(this, hostRef);
|
|
372
|
-
this.ionStyle = index.createEvent(this, "ionStyle", 7);
|
|
373
|
-
this.noAnimate = false;
|
|
374
|
-
}
|
|
375
|
-
componentWillLoad() {
|
|
376
|
-
this.noAnimate = (this.position === 'floating');
|
|
377
|
-
this.emitStyle();
|
|
378
|
-
}
|
|
379
|
-
componentDidLoad() {
|
|
380
|
-
if (this.noAnimate) {
|
|
381
|
-
setTimeout(() => {
|
|
382
|
-
this.noAnimate = false;
|
|
383
|
-
}, 1000);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
positionChanged() {
|
|
387
|
-
this.emitStyle();
|
|
388
|
-
}
|
|
389
|
-
emitStyle() {
|
|
390
|
-
const position = this.position;
|
|
391
|
-
this.ionStyle.emit({
|
|
392
|
-
'label': true,
|
|
393
|
-
[`label-${position}`]: position !== undefined
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
render() {
|
|
397
|
-
const position = this.position;
|
|
398
|
-
const mode = ionicGlobal.getIonMode(this);
|
|
399
|
-
return (index.h(index.Host, { class: Object.assign(Object.assign({}, theme.createColorClasses(this.color)), { [mode]: true, [`label-${position}`]: position !== undefined, [`label-no-animate`]: (this.noAnimate) }) }));
|
|
400
|
-
}
|
|
401
|
-
get el() { return index.getElement(this); }
|
|
402
|
-
static get watchers() { return {
|
|
403
|
-
"position": ["positionChanged"]
|
|
404
|
-
}; }
|
|
405
|
-
};
|
|
406
|
-
Label.style = {
|
|
407
|
-
ios: labelIosCss,
|
|
408
|
-
md: labelMdCss
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
exports.ion_button = Button;
|
|
412
|
-
exports.ion_icon = Icon;
|
|
413
|
-
exports.ion_label = Label;
|