@everymatrix/helper-accordion 1.32.4 → 1.33.1
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/helper-accordion.cjs.entry.js +133 -0
- package/dist/cjs/helper-accordion.cjs.js +19 -0
- package/dist/cjs/index-ed89de9c.js +1191 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/helper-accordion/helper-accordion.css +101 -0
- package/dist/collection/components/helper-accordion/helper-accordion.js +353 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +23 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/helper-accordion.d.ts +11 -0
- package/dist/components/helper-accordion.js +162 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/helper-accordion.entry.js +129 -0
- package/dist/esm/helper-accordion.js +17 -0
- package/dist/esm/index-a87a3869.js +1165 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/helper-accordion/helper-accordion.esm.js +1 -0
- package/dist/helper-accordion/index.esm.js +0 -0
- package/dist/helper-accordion/p-a199c923.entry.js +1 -0
- package/dist/helper-accordion/p-a8ce3eea.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/helper-accordion/.stencil/packages/helper-accordion/stencil.config.d.ts +2 -0
- package/dist/types/components/helper-accordion/helper-accordion.d.ts +65 -0
- package/dist/types/components.d.ts +137 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ed89de9c.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
deleteTicket: 'Delete ticket'
|
|
12
|
+
},
|
|
13
|
+
ro: {
|
|
14
|
+
deleteTicket: 'Sterge biletul'
|
|
15
|
+
},
|
|
16
|
+
fr: {
|
|
17
|
+
deleteTicket: 'Supprimer le billet'
|
|
18
|
+
},
|
|
19
|
+
ar: {
|
|
20
|
+
deleteTicket: 'حذف التذكرة'
|
|
21
|
+
},
|
|
22
|
+
hr: {
|
|
23
|
+
deleteTicket: 'Izbriši listić'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const translate = (key, customLang) => {
|
|
27
|
+
const lang = customLang;
|
|
28
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
32
|
+
|
|
33
|
+
const Accordion = class {
|
|
34
|
+
constructor(hostRef) {
|
|
35
|
+
index.registerInstance(this, hostRef);
|
|
36
|
+
this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
|
|
37
|
+
/**
|
|
38
|
+
* Flag for ticket history
|
|
39
|
+
*/
|
|
40
|
+
this.ticketHistoryFlag = false;
|
|
41
|
+
/**
|
|
42
|
+
* Title (top header)
|
|
43
|
+
*/
|
|
44
|
+
this.headerTitle = '';
|
|
45
|
+
/**
|
|
46
|
+
* SubTitle (top header)
|
|
47
|
+
*/
|
|
48
|
+
this.headerSubtitle = '';
|
|
49
|
+
/**
|
|
50
|
+
* Description
|
|
51
|
+
*/
|
|
52
|
+
this.description = '';
|
|
53
|
+
/**
|
|
54
|
+
* Enables footer content
|
|
55
|
+
*/
|
|
56
|
+
this.footer = false;
|
|
57
|
+
/**
|
|
58
|
+
* Enables footer button for tab deletion
|
|
59
|
+
*/
|
|
60
|
+
this.deleteTab = false;
|
|
61
|
+
/**
|
|
62
|
+
* Activates postMessages as events for actions from the widget
|
|
63
|
+
*/
|
|
64
|
+
this.postMessage = false;
|
|
65
|
+
/**
|
|
66
|
+
* Name of the event emitter by the action button
|
|
67
|
+
*/
|
|
68
|
+
this.eventName = 'helperAccordionAction';
|
|
69
|
+
/**
|
|
70
|
+
* Collapsed
|
|
71
|
+
*/
|
|
72
|
+
this.collapsed = true;
|
|
73
|
+
/**
|
|
74
|
+
* Language
|
|
75
|
+
*/
|
|
76
|
+
this.language = 'en';
|
|
77
|
+
/**
|
|
78
|
+
* Client custom styling via string
|
|
79
|
+
*/
|
|
80
|
+
this.clientStyling = '';
|
|
81
|
+
/**
|
|
82
|
+
* Client custom styling via url content
|
|
83
|
+
*/
|
|
84
|
+
this.clientStylingUrlContent = '';
|
|
85
|
+
this.limitStylingAppends = false;
|
|
86
|
+
this.setClientStyling = () => {
|
|
87
|
+
let sheet = document.createElement('style');
|
|
88
|
+
sheet.innerHTML = this.clientStyling;
|
|
89
|
+
this.stylingContainer.prepend(sheet);
|
|
90
|
+
};
|
|
91
|
+
this.setClientStylingURL = () => {
|
|
92
|
+
let cssFile = document.createElement('style');
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
95
|
+
this.stylingContainer.prepend(cssFile);
|
|
96
|
+
}, 1);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// @TODO fix the `any` type :)
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
this.showContent = !this.collapsed;
|
|
102
|
+
}
|
|
103
|
+
componentDidRender() {
|
|
104
|
+
// start custom styling area
|
|
105
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
106
|
+
if (this.clientStyling)
|
|
107
|
+
this.setClientStyling();
|
|
108
|
+
if (this.clientStylingUrlContent)
|
|
109
|
+
this.setClientStylingURL();
|
|
110
|
+
this.limitStylingAppends = true;
|
|
111
|
+
}
|
|
112
|
+
// end custom styling area
|
|
113
|
+
}
|
|
114
|
+
toggleContent() {
|
|
115
|
+
this.showContent = !this.showContent;
|
|
116
|
+
}
|
|
117
|
+
deleteAction() {
|
|
118
|
+
if (this.postMessage) {
|
|
119
|
+
// @TODO maybe change the name type, this one sucks
|
|
120
|
+
window.postMessage({ type: this.eventName }, window.location.href);
|
|
121
|
+
}
|
|
122
|
+
this.accordionEvent.emit();
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
return (index.h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, index.h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, index.h("p", { class: "Title" }, this.headerTitle), index.h("p", { class: "Subtitle" }, this.headerSubtitle), index.h("p", { class: "Subtitle Description" }, this.description), index.h("span", { class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
|
|
126
|
+
index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
127
|
+
index.h("div", null, this.deleteTab &&
|
|
128
|
+
index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
Accordion.style = helperAccordionCss;
|
|
132
|
+
|
|
133
|
+
exports.helper_accordion = Accordion;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-ed89de9c.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('helper-accordion.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["helper-accordion.cjs",[[1,"helper-accordion",{"ticketHistoryFlag":[516,"ticket-history-flag"],"headerTitle":[513,"header-title"],"headerSubtitle":[513,"header-subtitle"],"description":[513],"footer":[516],"deleteTab":[516,"delete-tab"],"postMessage":[516,"post-message"],"eventName":[513,"event-name"],"collapsed":[516],"language":[513],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"showContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
19
|
+
});
|