@pictogrammers/components 0.3.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/@types/css.d.ts +4 -0
- package/@types/html.d.ts +4 -0
- package/README.md +49 -0
- package/dist/main.js +3819 -0
- package/dist/pgAnnoy.js +116 -0
- package/dist/pgAvatar.js +136 -0
- package/dist/pgButton.js +116 -0
- package/dist/pgButtonGroup.js +116 -0
- package/dist/pgButtonLink.js +116 -0
- package/dist/pgButtonToggle.js +146 -0
- package/dist/pgCard.js +116 -0
- package/dist/pgCardUser.js +196 -0
- package/dist/pgColor.js +136 -0
- package/dist/pgDatabase.js +236 -0
- package/dist/pgDropdown.js +686 -0
- package/dist/pgGrid.js +126 -0
- package/dist/pgHeader.js +116 -0
- package/dist/pgIcon.js +116 -0
- package/dist/pgInputCheck.js +116 -0
- package/dist/pgInputCheckList.js +126 -0
- package/dist/pgInputFileLocal.js +116 -0
- package/dist/pgInputHexRgb.js +126 -0
- package/dist/pgInputRange.js +116 -0
- package/dist/pgInputSelect.js +116 -0
- package/dist/pgInputText.js +116 -0
- package/dist/pgInputTextIcon.js +176 -0
- package/dist/pgInputUserSelect.js +116 -0
- package/dist/pgListTag.js +136 -0
- package/dist/pgMarkdown.js +346 -0
- package/dist/pgMenuIcon.js +206 -0
- package/dist/pgModalAlert.js +126 -0
- package/dist/pgModification.js +396 -0
- package/dist/pgNav.js +116 -0
- package/dist/pgOverlay.js +96 -0
- package/dist/pgPicker.js +116 -0
- package/dist/pgPreview.js +116 -0
- package/dist/pgScroll.js +266 -0
- package/dist/pgSearch.js +146 -0
- package/dist/pgTab.js +116 -0
- package/dist/pgTabs.js +136 -0
- package/dist/pgToast.js +136 -0
- package/dist/pgToasts.js +136 -0
- package/dist/pgTooltip.js +126 -0
- package/index.html +302 -0
- package/package.json +25 -0
- package/pg/annoy/README.md +18 -0
- package/pg/annoy/__examples__/basic/basic.html +8 -0
- package/pg/annoy/__examples__/basic/basic.ts +11 -0
- package/pg/annoy/annoy.css +238 -0
- package/pg/annoy/annoy.html +59 -0
- package/pg/annoy/annoy.ts +48 -0
- package/pg/annoy/index.ts +3 -0
- package/pg/avatar/README.md +23 -0
- package/pg/avatar/__examples__/basic/basic.html +6 -0
- package/pg/avatar/__examples__/basic/basic.ts +41 -0
- package/pg/avatar/__examples__/basic/constants.ts +1 -0
- package/pg/avatar/avatar.css +45 -0
- package/pg/avatar/avatar.html +8 -0
- package/pg/avatar/avatar.spec.ts +51 -0
- package/pg/avatar/avatar.ts +37 -0
- package/pg/avatar/index.ts +3 -0
- package/pg/button/README.md +51 -0
- package/pg/button/__examples__/basic/basic.html +11 -0
- package/pg/button/__examples__/basic/basic.ts +11 -0
- package/pg/button/__examples__/states/states.html +8 -0
- package/pg/button/__examples__/states/states.ts +20 -0
- package/pg/button/button.css +91 -0
- package/pg/button/button.html +3 -0
- package/pg/button/button.ts +45 -0
- package/pg/button/index.ts +3 -0
- package/pg/buttonGroup/README.md +28 -0
- package/pg/buttonGroup/__examples__/basic/basic.html +12 -0
- package/pg/buttonGroup/__examples__/basic/basic.ts +11 -0
- package/pg/buttonGroup/buttonGroup.css +4 -0
- package/pg/buttonGroup/buttonGroup.html +1 -0
- package/pg/buttonGroup/buttonGroup.spec.ts +30 -0
- package/pg/buttonGroup/buttonGroup.ts +50 -0
- package/pg/buttonGroup/index.ts +3 -0
- package/pg/buttonLink/README.md +51 -0
- package/pg/buttonLink/__examples__/basic/basic.html +17 -0
- package/pg/buttonLink/__examples__/basic/basic.ts +11 -0
- package/pg/buttonLink/buttonLink.css +91 -0
- package/pg/buttonLink/buttonLink.html +3 -0
- package/pg/buttonLink/buttonLink.ts +46 -0
- package/pg/buttonLink/index.ts +3 -0
- package/pg/buttonToggle/README.md +54 -0
- package/pg/buttonToggle/__examples__/basic/basic.html +10 -0
- package/pg/buttonToggle/__examples__/basic/basic.ts +23 -0
- package/pg/buttonToggle/buttonToggle.css +8 -0
- package/pg/buttonToggle/buttonToggle.html +4 -0
- package/pg/buttonToggle/buttonToggle.ts +44 -0
- package/pg/buttonToggle/index.ts +3 -0
- package/pg/card/README.md +21 -0
- package/pg/card/__examples__/basic/basic.html +5 -0
- package/pg/card/__examples__/basic/basic.ts +11 -0
- package/pg/card/card.css +11 -0
- package/pg/card/card.html +3 -0
- package/pg/card/card.spec.ts +30 -0
- package/pg/card/card.ts +13 -0
- package/pg/card/index.ts +3 -0
- package/pg/cardUser/README.md +22 -0
- package/pg/cardUser/__examples__/basic/basic.html +3 -0
- package/pg/cardUser/__examples__/basic/basic.ts +30 -0
- package/pg/cardUser/__examples__/basic/constants.ts +1 -0
- package/pg/cardUser/cardUser.css +67 -0
- package/pg/cardUser/cardUser.html +23 -0
- package/pg/cardUser/cardUser.spec.ts +46 -0
- package/pg/cardUser/cardUser.ts +53 -0
- package/pg/cardUser/index.ts +3 -0
- package/pg/color/README.md +13 -0
- package/pg/color/__examples__/basic/basic.html +4 -0
- package/pg/color/__examples__/basic/basic.ts +20 -0
- package/pg/color/color.css +21 -0
- package/pg/color/color.html +1 -0
- package/pg/color/color.ts +97 -0
- package/pg/color/constants.ts +357 -0
- package/pg/color/index.ts +3 -0
- package/pg/color/utils.ts +27 -0
- package/pg/database/README.md +28 -0
- package/pg/database/__examples__/basic/basic.html +9 -0
- package/pg/database/__examples__/basic/basic.ts +37 -0
- package/pg/database/database.css +0 -0
- package/pg/database/database.html +0 -0
- package/pg/database/database.ts +42 -0
- package/pg/database/index.ts +3 -0
- package/pg/dropdown/README.md +13 -0
- package/pg/dropdown/__examples__/basic/basic.html +14 -0
- package/pg/dropdown/__examples__/basic/basic.ts +11 -0
- package/pg/dropdown/dropdown.css +46 -0
- package/pg/dropdown/dropdown.html +5 -0
- package/pg/dropdown/dropdown.ts +60 -0
- package/pg/dropdown/index.ts +3 -0
- package/pg/grid/README.md +97 -0
- package/pg/grid/__examples__/basic/basic.html +29 -0
- package/pg/grid/__examples__/basic/basic.ts +139 -0
- package/pg/grid/grid.css +68 -0
- package/pg/grid/grid.html +6 -0
- package/pg/grid/grid.spec.ts +66 -0
- package/pg/grid/grid.ts +417 -0
- package/pg/grid/index.ts +3 -0
- package/pg/header/README.md +23 -0
- package/pg/header/__examples__/basic/basic.html +8 -0
- package/pg/header/__examples__/basic/basic.ts +11 -0
- package/pg/header/header.css +42 -0
- package/pg/header/header.html +15 -0
- package/pg/header/header.ts +28 -0
- package/pg/header/index.ts +3 -0
- package/pg/icon/README.md +26 -0
- package/pg/icon/__examples__/basic/basic.html +16 -0
- package/pg/icon/__examples__/basic/basic.ts +34 -0
- package/pg/icon/__examples__/basic/constants.ts +2 -0
- package/pg/icon/icon.css +9 -0
- package/pg/icon/icon.html +3 -0
- package/pg/icon/icon.spec.ts +46 -0
- package/pg/icon/icon.ts +23 -0
- package/pg/icon/index.ts +3 -0
- package/pg/inputCheck/README.md +32 -0
- package/pg/inputCheck/__examples__/basic/basic.html +8 -0
- package/pg/inputCheck/__examples__/basic/basic.ts +23 -0
- package/pg/inputCheck/index.ts +3 -0
- package/pg/inputCheck/inputCheck.css +45 -0
- package/pg/inputCheck/inputCheck.html +6 -0
- package/pg/inputCheck/inputCheck.ts +42 -0
- package/pg/inputCheckList/README.md +35 -0
- package/pg/inputCheckList/__examples__/basic/basic.html +4 -0
- package/pg/inputCheckList/__examples__/basic/basic.ts +31 -0
- package/pg/inputCheckList/index.ts +3 -0
- package/pg/inputCheckList/inputCheckList.css +70 -0
- package/pg/inputCheckList/inputCheckList.html +1 -0
- package/pg/inputCheckList/inputCheckList.ts +103 -0
- package/pg/inputCheckList/templates/option.html +8 -0
- package/pg/inputFileLocal/README.md +30 -0
- package/pg/inputFileLocal/__examples__/basic/basic.html +4 -0
- package/pg/inputFileLocal/__examples__/basic/basic.ts +23 -0
- package/pg/inputFileLocal/index.ts +3 -0
- package/pg/inputFileLocal/inputFileLocal.css +80 -0
- package/pg/inputFileLocal/inputFileLocal.html +5 -0
- package/pg/inputFileLocal/inputFileLocal.ts +82 -0
- package/pg/inputHexRgb/README.md +15 -0
- package/pg/inputHexRgb/__examples__/basic/basic.html +4 -0
- package/pg/inputHexRgb/__examples__/basic/basic.ts +23 -0
- package/pg/inputHexRgb/index.ts +3 -0
- package/pg/inputHexRgb/inputHexRgb.css +96 -0
- package/pg/inputHexRgb/inputHexRgb.html +9 -0
- package/pg/inputHexRgb/inputHexRgb.ts +79 -0
- package/pg/inputHexRgb/utils.ts +27 -0
- package/pg/inputRange/README.md +18 -0
- package/pg/inputRange/__examples__/basic/basic.html +9 -0
- package/pg/inputRange/__examples__/basic/basic.ts +30 -0
- package/pg/inputRange/index.ts +3 -0
- package/pg/inputRange/inputRange.css +0 -0
- package/pg/inputRange/inputRange.html +1 -0
- package/pg/inputRange/inputRange.ts +53 -0
- package/pg/inputSelect/README.md +25 -0
- package/pg/inputSelect/__examples__/basic/basic.html +6 -0
- package/pg/inputSelect/__examples__/basic/basic.ts +30 -0
- package/pg/inputSelect/index.ts +3 -0
- package/pg/inputSelect/inputSelect.css +36 -0
- package/pg/inputSelect/inputSelect.html +4 -0
- package/pg/inputSelect/inputSelect.ts +57 -0
- package/pg/inputText/README.md +27 -0
- package/pg/inputText/__examples__/basic/basic.html +9 -0
- package/pg/inputText/__examples__/basic/basic.ts +30 -0
- package/pg/inputText/index.ts +3 -0
- package/pg/inputText/inputText.css +20 -0
- package/pg/inputText/inputText.html +1 -0
- package/pg/inputText/inputText.spec.ts +59 -0
- package/pg/inputText/inputText.ts +59 -0
- package/pg/inputTextIcon/README.md +26 -0
- package/pg/inputTextIcon/index.ts +3 -0
- package/pg/inputTextIcon/inputTextIcon.css +24 -0
- package/pg/inputTextIcon/inputTextIcon.html +4 -0
- package/pg/inputTextIcon/inputTextIcon.spec.ts +44 -0
- package/pg/inputTextIcon/inputTextIcon.ts +26 -0
- package/pg/inputUserSelect/README.md +31 -0
- package/pg/inputUserSelect/__examples__/basic/basic.html +4 -0
- package/pg/inputUserSelect/__examples__/basic/basic.ts +25 -0
- package/pg/inputUserSelect/__examples__/basic/constants.ts +33 -0
- package/pg/inputUserSelect/index.ts +3 -0
- package/pg/inputUserSelect/inputUserSelect.css +174 -0
- package/pg/inputUserSelect/inputUserSelect.html +18 -0
- package/pg/inputUserSelect/inputUserSelect.ts +266 -0
- package/pg/listTag/README.md +26 -0
- package/pg/listTag/__examples__/basic/basic.html +16 -0
- package/pg/listTag/__examples__/basic/basic.ts +53 -0
- package/pg/listTag/__examples__/basic/constants.ts +22 -0
- package/pg/listTag/index.ts +3 -0
- package/pg/listTag/listTag.css +9 -0
- package/pg/listTag/listTag.html +1 -0
- package/pg/listTag/listTag.ts +48 -0
- package/pg/listTag/partials/tag.html +3 -0
- package/pg/markdown/README.md +13 -0
- package/pg/markdown/__examples__/basic/basic.html +3 -0
- package/pg/markdown/__examples__/basic/basic.ts +51 -0
- package/pg/markdown/__examples__/basic/constants.ts +129 -0
- package/pg/markdown/index.ts +5 -0
- package/pg/markdown/markdown.css +760 -0
- package/pg/markdown/markdown.html +1 -0
- package/pg/markdown/markdown.md +123 -0
- package/pg/markdown/markdown.spec.ts +87 -0
- package/pg/markdown/markdown.ts +381 -0
- package/pg/markdown/markdownReplace.ts +7 -0
- package/pg/menuIcon/README.md +13 -0
- package/pg/menuIcon/__examples__/basic/basic.html +3 -0
- package/pg/menuIcon/__examples__/basic/basic.ts +15 -0
- package/pg/menuIcon/index.ts +3 -0
- package/pg/menuIcon/menuIcon.css +168 -0
- package/pg/menuIcon/menuIcon.html +64 -0
- package/pg/menuIcon/menuIcon.ts +271 -0
- package/pg/modalAlert/README.md +17 -0
- package/pg/modalAlert/__examples__/basic/basic.html +4 -0
- package/pg/modalAlert/__examples__/basic/basic.ts +27 -0
- package/pg/modalAlert/index.ts +3 -0
- package/pg/modalAlert/modalAlert.css +43 -0
- package/pg/modalAlert/modalAlert.html +22 -0
- package/pg/modalAlert/modalAlert.ts +45 -0
- package/pg/modification/README.md +34 -0
- package/pg/modification/__examples__/basic/basic.html +8 -0
- package/pg/modification/__examples__/basic/basic.ts +63 -0
- package/pg/modification/__examples__/basic/constants.ts +416 -0
- package/pg/modification/index.ts +3 -0
- package/pg/modification/modification.css +311 -0
- package/pg/modification/modification.html +1 -0
- package/pg/modification/modification.spec.ts +33 -0
- package/pg/modification/modification.ts +201 -0
- package/pg/modification/type/date.html +1 -0
- package/pg/modification/type/iconAliasCreated.html +13 -0
- package/pg/modification/type/iconAliasDeleted.html +13 -0
- package/pg/modification/type/iconAuthorModified.html +13 -0
- package/pg/modification/type/iconCreated.html +13 -0
- package/pg/modification/type/iconDeleted.html +13 -0
- package/pg/modification/type/iconDeprecated.html +13 -0
- package/pg/modification/type/iconDescriptionModified.html +10 -0
- package/pg/modification/type/iconModified.html +14 -0
- package/pg/modification/type/iconRenamed.html +13 -0
- package/pg/modification/type/iconTagCreated.html +13 -0
- package/pg/modification/type/iconTagDeleted.html +13 -0
- package/pg/modification/type/news.html +5 -0
- package/pg/nav/README.md +16 -0
- package/pg/nav/__examples__/basic/basic.html +5 -0
- package/pg/nav/__examples__/basic/basic.ts +11 -0
- package/pg/nav/index.ts +3 -0
- package/pg/nav/nav.css +14 -0
- package/pg/nav/nav.html +16 -0
- package/pg/nav/nav.ts +21 -0
- package/pg/overlay/README.md +37 -0
- package/pg/overlay/__examples__/basic/basic.css +3 -0
- package/pg/overlay/__examples__/basic/basic.html +3 -0
- package/pg/overlay/__examples__/basic/basic.ts +13 -0
- package/pg/overlay/index.ts +3 -0
- package/pg/overlay/overlay.ts +26 -0
- package/pg/picker/README.md +13 -0
- package/pg/picker/index.ts +3 -0
- package/pg/picker/picker.css +56 -0
- package/pg/picker/picker.html +8 -0
- package/pg/picker/picker.ts +66 -0
- package/pg/preview/README.md +19 -0
- package/pg/preview/__examples__/basic/basic.html +11 -0
- package/pg/preview/__examples__/basic/basic.ts +22 -0
- package/pg/preview/index.ts +3 -0
- package/pg/preview/preview.css +34 -0
- package/pg/preview/preview.html +5 -0
- package/pg/preview/preview.ts +38 -0
- package/pg/scroll/README.md +42 -0
- package/pg/scroll/__examples__/basic/basic.css +4 -0
- package/pg/scroll/__examples__/basic/basic.html +11 -0
- package/pg/scroll/__examples__/basic/basic.ts +88 -0
- package/pg/scroll/index.ts +3 -0
- package/pg/scroll/scroll.css +7 -0
- package/pg/scroll/scroll.html +3 -0
- package/pg/scroll/scroll.ts +158 -0
- package/pg/search/README.md +59 -0
- package/pg/search/__examples__/basic/basic.html +3 -0
- package/pg/search/__examples__/basic/basic.ts +29 -0
- package/pg/search/__examples__/basic/constants.ts +3 -0
- package/pg/search/index.ts +3 -0
- package/pg/search/search.css +188 -0
- package/pg/search/search.html +18 -0
- package/pg/search/search.ts +252 -0
- package/pg/search/utils.ts +12 -0
- package/pg/shared/README.md +28 -0
- package/pg/shared/copy.ts +25 -0
- package/pg/shared/database.ts +35 -0
- package/pg/shared/databaseService.ts +230 -0
- package/pg/shared/debounce.ts +12 -0
- package/pg/shared/enums/modificationType.ts +19 -0
- package/pg/shared/filter.ts +14 -0
- package/pg/shared/http.ts +83 -0
- package/pg/shared/iconFilter.spec.ts +61 -0
- package/pg/shared/iconFilter.ts +71 -0
- package/pg/shared/list.ts +34 -0
- package/pg/shared/models/alias.ts +40 -0
- package/pg/shared/models/font.ts +31 -0
- package/pg/shared/models/fontIcon.ts +25 -0
- package/pg/shared/models/fontVersion.ts +22 -0
- package/pg/shared/models/icon.ts +97 -0
- package/pg/shared/models/modification.ts +45 -0
- package/pg/shared/models/style.ts +12 -0
- package/pg/shared/models/tag.ts +37 -0
- package/pg/shared/models/user.ts +35 -0
- package/pg/shared/models/version.ts +20 -0
- package/pg/shared/removeDiacritics.ts +94 -0
- package/pg/shared/toast.ts +47 -0
- package/pg/shared/uuid.ts +6 -0
- package/pg/tab/README.md +18 -0
- package/pg/tab/index.ts +3 -0
- package/pg/tab/tab.css +13 -0
- package/pg/tab/tab.html +3 -0
- package/pg/tab/tab.ts +51 -0
- package/pg/tabs/README.md +31 -0
- package/pg/tabs/__examples__/basic/basic.html +13 -0
- package/pg/tabs/__examples__/basic/basic.ts +11 -0
- package/pg/tabs/index.ts +3 -0
- package/pg/tabs/partials/tab.html +3 -0
- package/pg/tabs/tabs.css +69 -0
- package/pg/tabs/tabs.html +4 -0
- package/pg/tabs/tabs.ts +102 -0
- package/pg/toast/README.md +13 -0
- package/pg/toast/index.ts +3 -0
- package/pg/toast/toast.css +112 -0
- package/pg/toast/toast.html +13 -0
- package/pg/toast/toast.ts +39 -0
- package/pg/toasts/README.md +37 -0
- package/pg/toasts/__examples__/basic/basic.html +11 -0
- package/pg/toasts/__examples__/basic/basic.ts +86 -0
- package/pg/toasts/index.ts +3 -0
- package/pg/toasts/toasts.css +8 -0
- package/pg/toasts/toasts.html +1 -0
- package/pg/toasts/toasts.ts +51 -0
- package/pg/tooltip/README.md +51 -0
- package/pg/tooltip/__examples__/basic/basic.css +38 -0
- package/pg/tooltip/__examples__/basic/basic.html +21 -0
- package/pg/tooltip/__examples__/basic/basic.ts +55 -0
- package/pg/tooltip/addTooltip.ts +31 -0
- package/pg/tooltip/index.ts +20 -0
- package/pg/tooltip/position.ts +15 -0
- package/pg/tooltip/tooltip.css +36 -0
- package/pg/tooltip/tooltip.html +4 -0
- package/pg/tooltip/tooltip.ts +170 -0
package/dist/pgToasts.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ "use strict";
|
|
11
|
+
/******/ var __webpack_modules__ = ({
|
|
12
|
+
|
|
13
|
+
/***/ "./node_modules/@pictogrammers/element/dist/element.esm.js":
|
|
14
|
+
/*!*****************************************************************!*\
|
|
15
|
+
!*** ./node_modules/@pictogrammers/element/dist/element.esm.js ***!
|
|
16
|
+
\*****************************************************************/
|
|
17
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
18
|
+
|
|
19
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Component\": () => (/* binding */ Component),\n/* harmony export */ \"Local\": () => (/* binding */ Local),\n/* harmony export */ \"Part\": () => (/* binding */ Part),\n/* harmony export */ \"Prop\": () => (/* binding */ Prop),\n/* harmony export */ \"TransmutePart\": () => (/* binding */ TransmutePart),\n/* harmony export */ \"getAttributes\": () => (/* binding */ getAttributes),\n/* harmony export */ \"node\": () => (/* binding */ node),\n/* harmony export */ \"selectComponent\": () => (/* binding */ selectComponent),\n/* harmony export */ \"selectPart\": () => (/* binding */ selectPart)\n/* harmony export */ });\nvar init = Symbol('init');\r\nvar template = Symbol('template');\r\nvar style = Symbol('style');\r\nvar parent = Symbol('parent');\r\nfunction extendTemplate(base, append) {\r\n if (append && append.match(/<parent\\/>/)) {\r\n return append.replace(/<parent\\/>/, base);\r\n }\r\n else {\r\n return \"\".concat(base).concat(append || '');\r\n }\r\n}\r\nfunction camelToDash(str) {\r\n return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\r\n}\r\nfunction dashToCamel(str) {\r\n return str.replace(/-([a-z])/g, function (m) { return m[1].toUpperCase(); });\r\n}\r\nfunction Component(config) {\r\n if (config === void 0) { config = {}; }\r\n return function (cls) {\r\n if (cls.prototype[parent]) {\r\n cls.prototype[parent].push(cls.prototype);\r\n cls.prototype[style] = \"\".concat(cls.prototype[style]).concat(config.style);\r\n cls.prototype[template] = extendTemplate(cls.prototype[template], config.template || null);\r\n }\r\n else {\r\n cls.prototype[parent] = [cls.prototype];\r\n cls.prototype[style] = config.style || '';\r\n cls.prototype[template] = config.template || '';\r\n }\r\n if (!cls.symbols) {\r\n cls.symbols = {};\r\n }\r\n var connectedCallback = cls.prototype.connectedCallback || (function () { });\r\n var disconnectedCallback = cls.prototype.disconnectedCallback || (function () { });\r\n cls.prototype.connectedCallback = function () {\r\n var _this = this;\r\n if (!this[init] && !config.template) {\r\n if (config.useShadow === false) {\r\n // Base class with no template\r\n }\r\n else {\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n else if (!this[init] && config.template) {\r\n var $template = document.createElement('template');\r\n $template.innerHTML = \"\".concat(cls.prototype[template], \"<style>\").concat(cls.prototype[style], \"</style>\");\r\n var $node = document.importNode($template.content, true);\r\n if (config.useShadow === false) {\r\n this.appendChild($node);\r\n }\r\n else {\r\n this.attachShadow({ mode: 'open' }).appendChild($node);\r\n }\r\n }\r\n else if (this[init] && config.style) {\r\n /*if (this.shadowRoot) {\r\n const style = document.createElement('style');\r\n style.appendChild(document.createTextNode(config.style));\r\n this.appendChild(style);\r\n }*/\r\n // } else if (this[init] && config.template) {\r\n // This is allowed now via <parent/>\r\n // throw new Error('template from base class cannot be overriden. Fix: remove template from @Component');\r\n }\r\n else if (this[init] && !config.template) {\r\n throw new Error('You need to pass a template for an extended element.');\r\n }\r\n if (this.componentWillMount) {\r\n this.componentWillMount();\r\n }\r\n this[parent].map(function (p) {\r\n if (p.render) {\r\n p.render.call(_this, cls.observedAttributes\r\n ? cls.observedAttributes.reduce(function (a, c) {\r\n var n = dashToCamel(c);\r\n a[n] = true;\r\n return a;\r\n }, {})\r\n : {});\r\n }\r\n });\r\n this[init] = true;\r\n connectedCallback.call(this);\r\n if (this.componentDidMount) {\r\n this.componentDidMount();\r\n }\r\n };\r\n cls.prototype.disconnectedCallback = function () {\r\n if (this.componentWillUnmount) {\r\n this.componentWillUnmount();\r\n }\r\n disconnectedCallback.call(this);\r\n if (this.componentDidUnmount) {\r\n this.componentDidUnmount();\r\n }\r\n };\r\n cls.prototype.attributeChangedCallback = function (name, oldValue, newValue) {\r\n var normalizedName = dashToCamel(name);\r\n this[normalizedName] = newValue;\r\n };\r\n if (config.selector && !window.customElements.get(config.selector)) {\r\n window.customElements.define(config.selector, cls);\r\n }\r\n };\r\n}\r\nvar transmute = Symbol('transmute');\r\nfunction TransmutePart(part, selector) {\r\n return function (cls) {\r\n var _a;\r\n if (cls.prototype[transmute]) {\r\n cls.prototype[transmute][part] = selector;\r\n }\r\n else {\r\n cls.prototype[transmute] = (_a = {}, _a[part] = selector, _a);\r\n }\r\n };\r\n}\r\nfunction Prop() {\r\n return function (target, propertyKey, descriptor) {\r\n var constructor = target.constructor;\r\n if (!constructor.observedAttributes) {\r\n constructor.observedAttributes = [];\r\n }\r\n var observedAttributes = constructor.observedAttributes;\r\n if (!constructor.symbols) {\r\n constructor.symbols = {};\r\n }\r\n var symbols = constructor.symbols;\r\n var normalizedPropertyKey = camelToDash(propertyKey);\r\n constructor.observedAttributes = observedAttributes.concat([normalizedPropertyKey]);\r\n var symbol = Symbol(propertyKey);\r\n symbols[propertyKey] = symbol;\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n return this[symbol];\r\n },\r\n set: function (value) {\r\n var _this = this;\r\n this[symbol] = value;\r\n if (this[init]) {\r\n this[parent].map(function (p) {\r\n var _a;\r\n if (p.render) {\r\n p.render.call(_this, (_a = {}, _a[propertyKey] = true, _a));\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n}\r\nfunction Part() {\r\n return function (target, propertyKey, descriptor) {\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n var _a;\r\n var key = propertyKey.replace(/^\\$/, '');\r\n return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(\"[part~=\".concat(key, \"]\"));\r\n }\r\n });\r\n };\r\n}\r\nfunction Local(initialValue, key) {\r\n if (initialValue === void 0) { initialValue = null; }\r\n return function (target, propertyKey, descriptor) {\r\n var getKey = function (self) {\r\n return (key ? key : \"\".concat(self.constructor.name, \":\").concat(propertyKey));\r\n };\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n var k = getKey(this);\r\n return window.localStorage.getItem(k) || initialValue;\r\n },\r\n set: function (value) {\r\n var k = getKey(this);\r\n if (value === null) {\r\n window.localStorage.removeItem(k);\r\n }\r\n else {\r\n window.localStorage.setItem(k, value);\r\n }\r\n }\r\n });\r\n };\r\n}\r\nfunction node(template, init) {\r\n var $template = document.createElement('template');\r\n $template.innerHTML = template;\r\n var $node = document.importNode($template.content, true);\r\n for (var _i = 0, _a = Object.entries(init); _i < _a.length; _i++) {\r\n var _b = _a[_i], part = _b[0], attributes = _b[1];\r\n var $part = $node.querySelector(\"[part~=\\\"\".concat(part, \"\\\"]\"));\r\n if ($part) {\r\n for (var _c = 0, _d = Object.entries(attributes); _c < _d.length; _c++) {\r\n var _e = _d[_c], prop = _e[0], value = _e[1];\r\n if (value instanceof Function) {\r\n var val = value();\r\n if (val === null) {\r\n $part.removeAttribute(prop);\r\n }\r\n else {\r\n $part.setAttribute(prop, value());\r\n }\r\n }\r\n else {\r\n $part[prop] = value;\r\n }\r\n }\r\n }\r\n }\r\n return $node;\r\n}\r\n// JEST\r\nfunction selectComponent(tag) {\r\n return document.querySelector(tag);\r\n}\r\nfunction selectPart(component, name) {\r\n return component.shadowRoot.querySelector(\"[part=\".concat(name, \"]\"));\r\n}\r\nfunction getAttributes(tag) {\r\n var symbols = customElements.get(tag).symbols;\r\n return Object.keys(symbols);\r\n}\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./node_modules/@pictogrammers/element/dist/element.esm.js?");
|
|
20
|
+
|
|
21
|
+
/***/ }),
|
|
22
|
+
|
|
23
|
+
/***/ "./src/pg/toasts/toasts.css":
|
|
24
|
+
/*!**********************************!*\
|
|
25
|
+
!*** ./src/pg/toasts/toasts.css ***!
|
|
26
|
+
\**********************************/
|
|
27
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
28
|
+
|
|
29
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"[part~=container] {\\r\\n display: inline-flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-end;\\r\\n position: fixed;\\r\\n top: 1rem;\\r\\n right: 1rem;\\r\\n}\");\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/toasts/toasts.css?");
|
|
30
|
+
|
|
31
|
+
/***/ }),
|
|
32
|
+
|
|
33
|
+
/***/ "./src/pg/toasts/toasts.html":
|
|
34
|
+
/*!***********************************!*\
|
|
35
|
+
!*** ./src/pg/toasts/toasts.html ***!
|
|
36
|
+
\***********************************/
|
|
37
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
38
|
+
|
|
39
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"<div part=\\\"container\\\"></div>\");\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/toasts/toasts.html?");
|
|
40
|
+
|
|
41
|
+
/***/ }),
|
|
42
|
+
|
|
43
|
+
/***/ "./src/pg/shared/toast.ts":
|
|
44
|
+
/*!********************************!*\
|
|
45
|
+
!*** ./src/pg/shared/toast.ts ***!
|
|
46
|
+
\********************************/
|
|
47
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
48
|
+
|
|
49
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"addErrorToast\": () => (/* binding */ addErrorToast),\n/* harmony export */ \"addInfoToast\": () => (/* binding */ addInfoToast),\n/* harmony export */ \"addToast\": () => (/* binding */ addToast),\n/* harmony export */ \"addWarningToast\": () => (/* binding */ addWarningToast),\n/* harmony export */ \"observeToasts\": () => (/* binding */ observeToasts),\n/* harmony export */ \"removeToast\": () => (/* binding */ removeToast)\n/* harmony export */ });\n/* harmony import */ var _uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uuid */ \"./src/pg/shared/uuid.ts\");\n\r\nconst ADD = 'pgtoastadd';\r\nconst REMOVE = 'pgtoastremove';\r\nfunction observeToasts({ add, remove }) {\r\n document.body.addEventListener(ADD, (e) => {\r\n add(e.detail);\r\n });\r\n document.body.addEventListener(REMOVE, (e) => {\r\n remove(e.detail.key);\r\n });\r\n}\r\nfunction addToast(config) {\r\n config.key = config.key || (0,_uuid__WEBPACK_IMPORTED_MODULE_0__.uuid)();\r\n const event = new CustomEvent(ADD, {\r\n detail: config\r\n });\r\n document.body.dispatchEvent(event);\r\n setTimeout(() => {\r\n removeToast(config.key);\r\n }, config.seconds * 1000);\r\n return config.key;\r\n}\r\nfunction removeToast(key) {\r\n const event = new CustomEvent(REMOVE, {\r\n detail: { key }\r\n });\r\n document.body.dispatchEvent(event);\r\n}\r\nfunction addInfoToast(message, seconds = 3) {\r\n const type = 'info';\r\n return addToast({ type, message, seconds });\r\n}\r\nfunction addWarningToast(message, seconds = 3) {\r\n const type = 'warning';\r\n return addToast({ type, message, seconds });\r\n}\r\nfunction addErrorToast(message, seconds = 3) {\r\n const type = 'error';\r\n return addToast({ type, message, seconds });\r\n}\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/shared/toast.ts?");
|
|
50
|
+
|
|
51
|
+
/***/ }),
|
|
52
|
+
|
|
53
|
+
/***/ "./src/pg/shared/uuid.ts":
|
|
54
|
+
/*!*******************************!*\
|
|
55
|
+
!*** ./src/pg/shared/uuid.ts ***!
|
|
56
|
+
\*******************************/
|
|
57
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
58
|
+
|
|
59
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"uuid\": () => (/* binding */ uuid)\n/* harmony export */ });\nfunction uuid() {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n}\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/shared/uuid.ts?");
|
|
60
|
+
|
|
61
|
+
/***/ }),
|
|
62
|
+
|
|
63
|
+
/***/ "./src/pg/toasts/toasts.ts":
|
|
64
|
+
/*!*********************************!*\
|
|
65
|
+
!*** ./src/pg/toasts/toasts.ts ***!
|
|
66
|
+
\*********************************/
|
|
67
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
68
|
+
|
|
69
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @pictogrammers/element */ \"./node_modules/@pictogrammers/element/dist/element.esm.js\");\n/* harmony import */ var _shared_toast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/toast */ \"./src/pg/shared/toast.ts\");\n/* harmony import */ var _toasts_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toasts.html */ \"./src/pg/toasts/toasts.html\");\n/* harmony import */ var _toasts_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toasts.css */ \"./src/pg/toasts/toasts.css\");\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\n\r\n\r\n\r\n\r\nlet PgToasts = class PgToasts extends HTMLElement {\r\n constructor() {\r\n super(...arguments);\r\n this.toasts = [];\r\n }\r\n connectedCallback() {\r\n (0,_shared_toast__WEBPACK_IMPORTED_MODULE_1__.observeToasts)({\r\n add: (toast) => {\r\n this.toasts.push(toast);\r\n this.render();\r\n },\r\n remove: (key) => {\r\n var _a;\r\n const index = this.toasts.findIndex(t => t.key === key);\r\n if (index !== -1) {\r\n var [toast] = this.toasts.splice(index, 1);\r\n (_a = this.$container.querySelector(`[key=\"${toast.key}\"]`)) === null || _a === void 0 ? void 0 : _a.remove();\r\n }\r\n }\r\n });\r\n }\r\n render() {\r\n this.toasts.forEach((toast) => {\r\n const existing = this.$container.querySelector(`[key=\"${toast.key}\"]`);\r\n if (existing) {\r\n existing.message = toast.message;\r\n existing.loading = toast.loading;\r\n existing.type = toast.type;\r\n }\r\n else {\r\n const ele = document.createElement('pg-toast');\r\n ele.setAttribute('key', toast.key);\r\n ele.message = toast.message;\r\n ele.loading = toast.loading;\r\n ele.type = toast.type;\r\n this.$container.appendChild(ele);\r\n }\r\n });\r\n }\r\n};\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Part)()\r\n], PgToasts.prototype, \"$container\", void 0);\r\nPgToasts = __decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Component)({\r\n selector: 'pg-toasts',\r\n style: _toasts_css__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\r\n template: _toasts_html__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\r\n })\r\n], PgToasts);\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PgToasts);\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/toasts/toasts.ts?");
|
|
70
|
+
|
|
71
|
+
/***/ })
|
|
72
|
+
|
|
73
|
+
/******/ });
|
|
74
|
+
/************************************************************************/
|
|
75
|
+
/******/ // The module cache
|
|
76
|
+
/******/ var __webpack_module_cache__ = {};
|
|
77
|
+
/******/
|
|
78
|
+
/******/ // The require function
|
|
79
|
+
/******/ function __webpack_require__(moduleId) {
|
|
80
|
+
/******/ // Check if module is in cache
|
|
81
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
82
|
+
/******/ if (cachedModule !== undefined) {
|
|
83
|
+
/******/ return cachedModule.exports;
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ // Create a new module (and put it into the cache)
|
|
86
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
87
|
+
/******/ // no module.id needed
|
|
88
|
+
/******/ // no module.loaded needed
|
|
89
|
+
/******/ exports: {}
|
|
90
|
+
/******/ };
|
|
91
|
+
/******/
|
|
92
|
+
/******/ // Execute the module function
|
|
93
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
94
|
+
/******/
|
|
95
|
+
/******/ // Return the exports of the module
|
|
96
|
+
/******/ return module.exports;
|
|
97
|
+
/******/ }
|
|
98
|
+
/******/
|
|
99
|
+
/************************************************************************/
|
|
100
|
+
/******/ /* webpack/runtime/define property getters */
|
|
101
|
+
/******/ (() => {
|
|
102
|
+
/******/ // define getter functions for harmony exports
|
|
103
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
104
|
+
/******/ for(var key in definition) {
|
|
105
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
106
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
107
|
+
/******/ }
|
|
108
|
+
/******/ }
|
|
109
|
+
/******/ };
|
|
110
|
+
/******/ })();
|
|
111
|
+
/******/
|
|
112
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
113
|
+
/******/ (() => {
|
|
114
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
115
|
+
/******/ })();
|
|
116
|
+
/******/
|
|
117
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
118
|
+
/******/ (() => {
|
|
119
|
+
/******/ // define __esModule on exports
|
|
120
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
121
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
122
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
123
|
+
/******/ }
|
|
124
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
125
|
+
/******/ };
|
|
126
|
+
/******/ })();
|
|
127
|
+
/******/
|
|
128
|
+
/************************************************************************/
|
|
129
|
+
/******/
|
|
130
|
+
/******/ // startup
|
|
131
|
+
/******/ // Load entry module and return exports
|
|
132
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
133
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/pg/toasts/toasts.ts");
|
|
134
|
+
/******/
|
|
135
|
+
/******/ })()
|
|
136
|
+
;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ "use strict";
|
|
11
|
+
/******/ var __webpack_modules__ = ({
|
|
12
|
+
|
|
13
|
+
/***/ "./node_modules/@pictogrammers/element/dist/element.esm.js":
|
|
14
|
+
/*!*****************************************************************!*\
|
|
15
|
+
!*** ./node_modules/@pictogrammers/element/dist/element.esm.js ***!
|
|
16
|
+
\*****************************************************************/
|
|
17
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
18
|
+
|
|
19
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Component\": () => (/* binding */ Component),\n/* harmony export */ \"Local\": () => (/* binding */ Local),\n/* harmony export */ \"Part\": () => (/* binding */ Part),\n/* harmony export */ \"Prop\": () => (/* binding */ Prop),\n/* harmony export */ \"TransmutePart\": () => (/* binding */ TransmutePart),\n/* harmony export */ \"getAttributes\": () => (/* binding */ getAttributes),\n/* harmony export */ \"node\": () => (/* binding */ node),\n/* harmony export */ \"selectComponent\": () => (/* binding */ selectComponent),\n/* harmony export */ \"selectPart\": () => (/* binding */ selectPart)\n/* harmony export */ });\nvar init = Symbol('init');\r\nvar template = Symbol('template');\r\nvar style = Symbol('style');\r\nvar parent = Symbol('parent');\r\nfunction extendTemplate(base, append) {\r\n if (append && append.match(/<parent\\/>/)) {\r\n return append.replace(/<parent\\/>/, base);\r\n }\r\n else {\r\n return \"\".concat(base).concat(append || '');\r\n }\r\n}\r\nfunction camelToDash(str) {\r\n return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\r\n}\r\nfunction dashToCamel(str) {\r\n return str.replace(/-([a-z])/g, function (m) { return m[1].toUpperCase(); });\r\n}\r\nfunction Component(config) {\r\n if (config === void 0) { config = {}; }\r\n return function (cls) {\r\n if (cls.prototype[parent]) {\r\n cls.prototype[parent].push(cls.prototype);\r\n cls.prototype[style] = \"\".concat(cls.prototype[style]).concat(config.style);\r\n cls.prototype[template] = extendTemplate(cls.prototype[template], config.template || null);\r\n }\r\n else {\r\n cls.prototype[parent] = [cls.prototype];\r\n cls.prototype[style] = config.style || '';\r\n cls.prototype[template] = config.template || '';\r\n }\r\n if (!cls.symbols) {\r\n cls.symbols = {};\r\n }\r\n var connectedCallback = cls.prototype.connectedCallback || (function () { });\r\n var disconnectedCallback = cls.prototype.disconnectedCallback || (function () { });\r\n cls.prototype.connectedCallback = function () {\r\n var _this = this;\r\n if (!this[init] && !config.template) {\r\n if (config.useShadow === false) {\r\n // Base class with no template\r\n }\r\n else {\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n else if (!this[init] && config.template) {\r\n var $template = document.createElement('template');\r\n $template.innerHTML = \"\".concat(cls.prototype[template], \"<style>\").concat(cls.prototype[style], \"</style>\");\r\n var $node = document.importNode($template.content, true);\r\n if (config.useShadow === false) {\r\n this.appendChild($node);\r\n }\r\n else {\r\n this.attachShadow({ mode: 'open' }).appendChild($node);\r\n }\r\n }\r\n else if (this[init] && config.style) {\r\n /*if (this.shadowRoot) {\r\n const style = document.createElement('style');\r\n style.appendChild(document.createTextNode(config.style));\r\n this.appendChild(style);\r\n }*/\r\n // } else if (this[init] && config.template) {\r\n // This is allowed now via <parent/>\r\n // throw new Error('template from base class cannot be overriden. Fix: remove template from @Component');\r\n }\r\n else if (this[init] && !config.template) {\r\n throw new Error('You need to pass a template for an extended element.');\r\n }\r\n if (this.componentWillMount) {\r\n this.componentWillMount();\r\n }\r\n this[parent].map(function (p) {\r\n if (p.render) {\r\n p.render.call(_this, cls.observedAttributes\r\n ? cls.observedAttributes.reduce(function (a, c) {\r\n var n = dashToCamel(c);\r\n a[n] = true;\r\n return a;\r\n }, {})\r\n : {});\r\n }\r\n });\r\n this[init] = true;\r\n connectedCallback.call(this);\r\n if (this.componentDidMount) {\r\n this.componentDidMount();\r\n }\r\n };\r\n cls.prototype.disconnectedCallback = function () {\r\n if (this.componentWillUnmount) {\r\n this.componentWillUnmount();\r\n }\r\n disconnectedCallback.call(this);\r\n if (this.componentDidUnmount) {\r\n this.componentDidUnmount();\r\n }\r\n };\r\n cls.prototype.attributeChangedCallback = function (name, oldValue, newValue) {\r\n var normalizedName = dashToCamel(name);\r\n this[normalizedName] = newValue;\r\n };\r\n if (config.selector && !window.customElements.get(config.selector)) {\r\n window.customElements.define(config.selector, cls);\r\n }\r\n };\r\n}\r\nvar transmute = Symbol('transmute');\r\nfunction TransmutePart(part, selector) {\r\n return function (cls) {\r\n var _a;\r\n if (cls.prototype[transmute]) {\r\n cls.prototype[transmute][part] = selector;\r\n }\r\n else {\r\n cls.prototype[transmute] = (_a = {}, _a[part] = selector, _a);\r\n }\r\n };\r\n}\r\nfunction Prop() {\r\n return function (target, propertyKey, descriptor) {\r\n var constructor = target.constructor;\r\n if (!constructor.observedAttributes) {\r\n constructor.observedAttributes = [];\r\n }\r\n var observedAttributes = constructor.observedAttributes;\r\n if (!constructor.symbols) {\r\n constructor.symbols = {};\r\n }\r\n var symbols = constructor.symbols;\r\n var normalizedPropertyKey = camelToDash(propertyKey);\r\n constructor.observedAttributes = observedAttributes.concat([normalizedPropertyKey]);\r\n var symbol = Symbol(propertyKey);\r\n symbols[propertyKey] = symbol;\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n return this[symbol];\r\n },\r\n set: function (value) {\r\n var _this = this;\r\n this[symbol] = value;\r\n if (this[init]) {\r\n this[parent].map(function (p) {\r\n var _a;\r\n if (p.render) {\r\n p.render.call(_this, (_a = {}, _a[propertyKey] = true, _a));\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n}\r\nfunction Part() {\r\n return function (target, propertyKey, descriptor) {\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n var _a;\r\n var key = propertyKey.replace(/^\\$/, '');\r\n return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(\"[part~=\".concat(key, \"]\"));\r\n }\r\n });\r\n };\r\n}\r\nfunction Local(initialValue, key) {\r\n if (initialValue === void 0) { initialValue = null; }\r\n return function (target, propertyKey, descriptor) {\r\n var getKey = function (self) {\r\n return (key ? key : \"\".concat(self.constructor.name, \":\").concat(propertyKey));\r\n };\r\n Object.defineProperty(target, propertyKey, {\r\n get: function () {\r\n var k = getKey(this);\r\n return window.localStorage.getItem(k) || initialValue;\r\n },\r\n set: function (value) {\r\n var k = getKey(this);\r\n if (value === null) {\r\n window.localStorage.removeItem(k);\r\n }\r\n else {\r\n window.localStorage.setItem(k, value);\r\n }\r\n }\r\n });\r\n };\r\n}\r\nfunction node(template, init) {\r\n var $template = document.createElement('template');\r\n $template.innerHTML = template;\r\n var $node = document.importNode($template.content, true);\r\n for (var _i = 0, _a = Object.entries(init); _i < _a.length; _i++) {\r\n var _b = _a[_i], part = _b[0], attributes = _b[1];\r\n var $part = $node.querySelector(\"[part~=\\\"\".concat(part, \"\\\"]\"));\r\n if ($part) {\r\n for (var _c = 0, _d = Object.entries(attributes); _c < _d.length; _c++) {\r\n var _e = _d[_c], prop = _e[0], value = _e[1];\r\n if (value instanceof Function) {\r\n var val = value();\r\n if (val === null) {\r\n $part.removeAttribute(prop);\r\n }\r\n else {\r\n $part.setAttribute(prop, value());\r\n }\r\n }\r\n else {\r\n $part[prop] = value;\r\n }\r\n }\r\n }\r\n }\r\n return $node;\r\n}\r\n// JEST\r\nfunction selectComponent(tag) {\r\n return document.querySelector(tag);\r\n}\r\nfunction selectPart(component, name) {\r\n return component.shadowRoot.querySelector(\"[part=\".concat(name, \"]\"));\r\n}\r\nfunction getAttributes(tag) {\r\n var symbols = customElements.get(tag).symbols;\r\n return Object.keys(symbols);\r\n}\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./node_modules/@pictogrammers/element/dist/element.esm.js?");
|
|
20
|
+
|
|
21
|
+
/***/ }),
|
|
22
|
+
|
|
23
|
+
/***/ "./src/pg/tooltip/tooltip.css":
|
|
24
|
+
/*!************************************!*\
|
|
25
|
+
!*** ./src/pg/tooltip/tooltip.css ***!
|
|
26
|
+
\************************************/
|
|
27
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
28
|
+
|
|
29
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\":host {\\r\\n pointer-events: none;\\r\\n}\\r\\n\\r\\n[part~=tooltip] {\\r\\n position: relative;\\r\\n}\\r\\n\\r\\n[part~=tooltipText] {\\r\\n position: absolute;\\r\\n background: #737E9E;\\r\\n border-radius: 0.25rem;\\r\\n color: #FFF;\\r\\n padding: 0.15rem 0.5rem 0.3rem 0.5rem;\\r\\n white-space: nowrap;\\r\\n left: 0;\\r\\n top: 0;\\r\\n}\\r\\n\\r\\n[part~=tooltipArrow] {\\r\\n left: 16px;\\r\\n top: -7px;\\r\\n}\\r\\n\\r\\n[part~=tooltipArrow],\\r\\n[part~=tooltipArrow]::before {\\r\\n position: absolute;\\r\\n width: 10px;\\r\\n height: 10px;\\r\\n}\\r\\n\\r\\n[part~=tooltipArrow]::before {\\r\\n content: '';\\r\\n transform: rotate(45deg);\\r\\n background: #737E9E;\\r\\n}\");\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/tooltip/tooltip.css?");
|
|
30
|
+
|
|
31
|
+
/***/ }),
|
|
32
|
+
|
|
33
|
+
/***/ "./src/pg/tooltip/tooltip.html":
|
|
34
|
+
/*!*************************************!*\
|
|
35
|
+
!*** ./src/pg/tooltip/tooltip.html ***!
|
|
36
|
+
\*************************************/
|
|
37
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
38
|
+
|
|
39
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"<div part=\\\"tooltip\\\">\\r\\n <span part=\\\"tooltipText\\\"></span>\\r\\n <div part=\\\"tooltipArrow\\\"></div>\\r\\n</div>\");\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/tooltip/tooltip.html?");
|
|
40
|
+
|
|
41
|
+
/***/ }),
|
|
42
|
+
|
|
43
|
+
/***/ "./src/pg/tooltip/position.ts":
|
|
44
|
+
/*!************************************!*\
|
|
45
|
+
!*** ./src/pg/tooltip/position.ts ***!
|
|
46
|
+
\************************************/
|
|
47
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
48
|
+
|
|
49
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BOTTOM\": () => (/* binding */ BOTTOM),\n/* harmony export */ \"BOTTOM_END\": () => (/* binding */ BOTTOM_END),\n/* harmony export */ \"BOTTOM_START\": () => (/* binding */ BOTTOM_START),\n/* harmony export */ \"LEFT\": () => (/* binding */ LEFT),\n/* harmony export */ \"LEFT_END\": () => (/* binding */ LEFT_END),\n/* harmony export */ \"LEFT_START\": () => (/* binding */ LEFT_START),\n/* harmony export */ \"RIGHT\": () => (/* binding */ RIGHT),\n/* harmony export */ \"RIGHT_END\": () => (/* binding */ RIGHT_END),\n/* harmony export */ \"RIGHT_START\": () => (/* binding */ RIGHT_START),\n/* harmony export */ \"TOP\": () => (/* binding */ TOP),\n/* harmony export */ \"TOP_END\": () => (/* binding */ TOP_END),\n/* harmony export */ \"TOP_START\": () => (/* binding */ TOP_START)\n/* harmony export */ });\nconst TOP = 'top';\r\nconst TOP_START = 'top-start';\r\nconst TOP_END = 'top-end';\r\nconst RIGHT = 'right';\r\nconst RIGHT_START = 'right-start';\r\nconst RIGHT_END = 'right-end';\r\nconst BOTTOM = 'bottom';\r\nconst BOTTOM_START = 'bottom-start';\r\nconst BOTTOM_END = 'bottom-end';\r\nconst LEFT = 'left';\r\nconst LEFT_START = 'left-start';\r\nconst LEFT_END = 'left-end';\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/tooltip/position.ts?");
|
|
50
|
+
|
|
51
|
+
/***/ }),
|
|
52
|
+
|
|
53
|
+
/***/ "./src/pg/tooltip/tooltip.ts":
|
|
54
|
+
/*!***********************************!*\
|
|
55
|
+
!*** ./src/pg/tooltip/tooltip.ts ***!
|
|
56
|
+
\***********************************/
|
|
57
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
58
|
+
|
|
59
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @pictogrammers/element */ \"./node_modules/@pictogrammers/element/dist/element.esm.js\");\n/* harmony import */ var _tooltip_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip.html */ \"./src/pg/tooltip/tooltip.html\");\n/* harmony import */ var _tooltip_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tooltip.css */ \"./src/pg/tooltip/tooltip.css\");\n/* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ \"./src/pg/tooltip/position.ts\");\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\n\r\n\r\n\r\n\r\nconst map = {\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.TOP_START]: (width, height, rect) => {\r\n return {\r\n arrowTop: height - 5,\r\n arrowLeft: rect.width > width\r\n ? Math.floor(width / 2) - 5\r\n : Math.floor(rect.width / 2) - 5,\r\n left: rect.left,\r\n top: rect.top - height - 10\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.TOP]: (width, height, rect) => {\r\n return {\r\n arrowTop: height - 5,\r\n arrowLeft: Math.floor(width / 2) - 5,\r\n left: rect.left - Math.floor((width - rect.width) / 2),\r\n top: rect.top - height - 10\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.TOP_END]: (width, height, rect) => {\r\n return {\r\n arrowTop: height - 5,\r\n arrowLeft: rect.width > width\r\n ? width - Math.floor(width / 2) - 5\r\n : width - Math.floor(rect.width / 2) - 5,\r\n left: rect.left - width + rect.width,\r\n top: rect.top - height - 10\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.RIGHT_START]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: -5,\r\n left: rect.left + rect.width + 10,\r\n top: rect.top\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.RIGHT]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: -5,\r\n left: rect.left + rect.width + 10,\r\n top: rect.top + Math.floor(rect.height / 2) - Math.floor(height / 2)\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.RIGHT_END]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: -5,\r\n left: rect.left + rect.width + 10,\r\n top: rect.top + rect.height - height\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.BOTTOM_START]: (width, height, rect) => {\r\n return {\r\n arrowTop: -5,\r\n arrowLeft: rect.width > width\r\n ? Math.floor(width / 2) - 5\r\n : Math.floor(rect.width / 2) - 5,\r\n left: rect.left,\r\n top: rect.top + rect.height + height - 20\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.BOTTOM]: (width, height, rect) => {\r\n return {\r\n arrowTop: -5,\r\n arrowLeft: Math.floor(width / 2) - 5,\r\n left: rect.left - Math.floor((width - rect.width) / 2),\r\n top: rect.top + rect.height + height - 20\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.BOTTOM_END]: (width, height, rect) => {\r\n return {\r\n arrowTop: -5,\r\n arrowLeft: rect.width > width\r\n ? width - Math.floor(width / 2) - 5\r\n : width - Math.floor(rect.width / 2) - 5,\r\n left: rect.left - width + rect.width,\r\n top: rect.top + rect.height + height - 20\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.LEFT_START]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: width - 5,\r\n left: rect.left - width - 10,\r\n top: rect.top\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.LEFT]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: width - 5,\r\n left: rect.left - width - 10,\r\n top: rect.top + Math.floor(rect.height / 2) - Math.floor(height / 2)\r\n };\r\n },\r\n [_position__WEBPACK_IMPORTED_MODULE_3__.LEFT_END]: (width, height, rect) => {\r\n return {\r\n arrowTop: Math.floor(height / 2) - 5,\r\n arrowLeft: width - 5,\r\n left: rect.left - width - 10,\r\n top: rect.top + rect.height - height\r\n };\r\n }\r\n};\r\nlet PgTooltip = class PgTooltip extends HTMLElement {\r\n constructor() {\r\n super(...arguments);\r\n this.visible = false;\r\n this.rect = null;\r\n this.text = '';\r\n this.position = _position__WEBPACK_IMPORTED_MODULE_3__.BOTTOM;\r\n }\r\n render(changes) {\r\n this.$tooltipText.innerText = this.text;\r\n this.style.position = 'absolute';\r\n if (changes.visible) {\r\n this.style.display = this.visible ? 'block' : 'none';\r\n }\r\n const { width: tooltipWidth, height: tooltipHeight } = this.$tooltipText.getBoundingClientRect();\r\n let position = this.position;\r\n if (!(position in map)) {\r\n position = _position__WEBPACK_IMPORTED_MODULE_3__.BOTTOM;\r\n }\r\n if (this.rect) {\r\n const { arrowLeft, arrowTop, left, top } = map[position](tooltipWidth, tooltipHeight, this.rect);\r\n this.style.left = `${left + window.scrollX}px`;\r\n this.style.top = `${top + window.scrollY}px`;\r\n this.$tooltipArrow.style.left = `${arrowLeft}px`;\r\n this.$tooltipArrow.style.top = `${arrowTop}px`;\r\n }\r\n }\r\n};\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Prop)()\r\n], PgTooltip.prototype, \"visible\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Prop)()\r\n], PgTooltip.prototype, \"rect\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Prop)()\r\n], PgTooltip.prototype, \"text\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Prop)()\r\n], PgTooltip.prototype, \"position\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Part)()\r\n], PgTooltip.prototype, \"$tooltip\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Part)()\r\n], PgTooltip.prototype, \"$tooltipText\", void 0);\r\n__decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Part)()\r\n], PgTooltip.prototype, \"$tooltipArrow\", void 0);\r\nPgTooltip = __decorate([\r\n (0,_pictogrammers_element__WEBPACK_IMPORTED_MODULE_0__.Component)({\r\n selector: 'pg-tooltip',\r\n style: _tooltip_css__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\r\n template: _tooltip_html__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\r\n })\r\n], PgTooltip);\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PgTooltip);\r\n\n\n//# sourceURL=webpack://@pictogrammers/components/./src/pg/tooltip/tooltip.ts?");
|
|
60
|
+
|
|
61
|
+
/***/ })
|
|
62
|
+
|
|
63
|
+
/******/ });
|
|
64
|
+
/************************************************************************/
|
|
65
|
+
/******/ // The module cache
|
|
66
|
+
/******/ var __webpack_module_cache__ = {};
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // The require function
|
|
69
|
+
/******/ function __webpack_require__(moduleId) {
|
|
70
|
+
/******/ // Check if module is in cache
|
|
71
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
72
|
+
/******/ if (cachedModule !== undefined) {
|
|
73
|
+
/******/ return cachedModule.exports;
|
|
74
|
+
/******/ }
|
|
75
|
+
/******/ // Create a new module (and put it into the cache)
|
|
76
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
77
|
+
/******/ // no module.id needed
|
|
78
|
+
/******/ // no module.loaded needed
|
|
79
|
+
/******/ exports: {}
|
|
80
|
+
/******/ };
|
|
81
|
+
/******/
|
|
82
|
+
/******/ // Execute the module function
|
|
83
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
84
|
+
/******/
|
|
85
|
+
/******/ // Return the exports of the module
|
|
86
|
+
/******/ return module.exports;
|
|
87
|
+
/******/ }
|
|
88
|
+
/******/
|
|
89
|
+
/************************************************************************/
|
|
90
|
+
/******/ /* webpack/runtime/define property getters */
|
|
91
|
+
/******/ (() => {
|
|
92
|
+
/******/ // define getter functions for harmony exports
|
|
93
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
94
|
+
/******/ for(var key in definition) {
|
|
95
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
96
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
97
|
+
/******/ }
|
|
98
|
+
/******/ }
|
|
99
|
+
/******/ };
|
|
100
|
+
/******/ })();
|
|
101
|
+
/******/
|
|
102
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
103
|
+
/******/ (() => {
|
|
104
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
105
|
+
/******/ })();
|
|
106
|
+
/******/
|
|
107
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
108
|
+
/******/ (() => {
|
|
109
|
+
/******/ // define __esModule on exports
|
|
110
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
111
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
112
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
113
|
+
/******/ }
|
|
114
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
115
|
+
/******/ };
|
|
116
|
+
/******/ })();
|
|
117
|
+
/******/
|
|
118
|
+
/************************************************************************/
|
|
119
|
+
/******/
|
|
120
|
+
/******/ // startup
|
|
121
|
+
/******/ // Load entry module and return exports
|
|
122
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
123
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/pg/tooltip/tooltip.ts");
|
|
124
|
+
/******/
|
|
125
|
+
/******/ })()
|
|
126
|
+
;
|
package/index.html
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<link rel="shortcut icon" type="image/png" href="favicon.png"/>
|
|
7
|
+
<title>Pictogrammers Components</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--pg-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
11
|
+
--pg-icon-color: #453C4F;
|
|
12
|
+
--pg-header-color: #453C4F;
|
|
13
|
+
--pg-header-background: #fff;
|
|
14
|
+
--pg-search-border-color: #453C4F;
|
|
15
|
+
--pg-dropdown-border-color: #453C4F;
|
|
16
|
+
}
|
|
17
|
+
body {
|
|
18
|
+
margin: 0;
|
|
19
|
+
font-family: var(--pg-font-family);
|
|
20
|
+
}
|
|
21
|
+
.wrapper {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: 12rem calc(100% - 12rem);
|
|
24
|
+
grid-template-rows: 3rem auto;
|
|
25
|
+
}
|
|
26
|
+
code {
|
|
27
|
+
font-family: 'Consolas', 'Courier New', Courier, monospace;
|
|
28
|
+
border: 1px solid #ddd;
|
|
29
|
+
padding: 0.15rem 0.25rem;
|
|
30
|
+
border-radius: 0.25rem;
|
|
31
|
+
}
|
|
32
|
+
header {
|
|
33
|
+
display: flex;
|
|
34
|
+
grid-row: 1;
|
|
35
|
+
grid-column: 1 / span 2;
|
|
36
|
+
background: #453C4F;
|
|
37
|
+
color: #FFF;
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
header > svg {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
width: 1.5rem;
|
|
43
|
+
height: 1.5rem;
|
|
44
|
+
margin: 0 0.75rem 0 1rem;
|
|
45
|
+
}
|
|
46
|
+
header > h1 {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
color: #FFF;
|
|
49
|
+
font-size: 1.5rem;
|
|
50
|
+
margin: 0;
|
|
51
|
+
font-weight: normal;
|
|
52
|
+
}
|
|
53
|
+
aside {
|
|
54
|
+
grid-row: 2;
|
|
55
|
+
grid-column: 1;
|
|
56
|
+
padding: 1rem;
|
|
57
|
+
}
|
|
58
|
+
aside > div {
|
|
59
|
+
font-weight: bold;;
|
|
60
|
+
}
|
|
61
|
+
aside > ul {
|
|
62
|
+
list-style: none;
|
|
63
|
+
padding: 0 0 0 0.5rem;
|
|
64
|
+
line-height: 1.5rem;
|
|
65
|
+
margin: 0.5rem 0;
|
|
66
|
+
}
|
|
67
|
+
aside > ul > li {
|
|
68
|
+
margin-bottom: 0.25rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
aside a {
|
|
72
|
+
position: relative;
|
|
73
|
+
color: #414F56;
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
}
|
|
76
|
+
aside a:hover {
|
|
77
|
+
text-decoration: underline;
|
|
78
|
+
}
|
|
79
|
+
main {
|
|
80
|
+
grid-row: 2;
|
|
81
|
+
grid-column: 2;
|
|
82
|
+
padding: 0 1rem 1rem 1rem;
|
|
83
|
+
}
|
|
84
|
+
main > p {
|
|
85
|
+
line-height: 1.5rem;
|
|
86
|
+
}
|
|
87
|
+
main > section {
|
|
88
|
+
padding: 1.5rem 1rem 1rem 1rem;
|
|
89
|
+
border-radius: 0.5rem;
|
|
90
|
+
border: 1px solid #ccc;
|
|
91
|
+
margin-top: 2rem;
|
|
92
|
+
}
|
|
93
|
+
main > h2 {
|
|
94
|
+
position: relative;
|
|
95
|
+
margin: 1.5rem 0 0.5rem 0;
|
|
96
|
+
border-bottom: 1px solid #ddd;
|
|
97
|
+
padding-bottom: 0.5rem;
|
|
98
|
+
font-size: 1.5rem;
|
|
99
|
+
font-weight: normal;
|
|
100
|
+
}
|
|
101
|
+
main > h2.open {
|
|
102
|
+
border-bottom: none;
|
|
103
|
+
}
|
|
104
|
+
main > h2 > a {
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
color: #aaa;
|
|
107
|
+
}
|
|
108
|
+
main > h2 > a:hover {
|
|
109
|
+
color: #453C4F;
|
|
110
|
+
}
|
|
111
|
+
main > h2 > a > svg {
|
|
112
|
+
width: 24px;
|
|
113
|
+
height: 24px;
|
|
114
|
+
vertical-align: middle;
|
|
115
|
+
margin-top: -2px;
|
|
116
|
+
}
|
|
117
|
+
main > h2 > button {
|
|
118
|
+
margin: 0;
|
|
119
|
+
border-radius: 0.25rem 0.25rem 0 0;
|
|
120
|
+
border: 1px solid #ccc;
|
|
121
|
+
background: #fff;
|
|
122
|
+
padding: 0.25rem 0.5rem;
|
|
123
|
+
position: absolute;
|
|
124
|
+
bottom: -1px;
|
|
125
|
+
right: 0.5rem;
|
|
126
|
+
color: #453C4F;
|
|
127
|
+
outline: none;
|
|
128
|
+
}
|
|
129
|
+
main > h2 > button.active,
|
|
130
|
+
main > h2 > button:focus,
|
|
131
|
+
main > h2 > button:hover {
|
|
132
|
+
background: #453C4F;
|
|
133
|
+
border-top-color: #453C4F;
|
|
134
|
+
border-right-color: #453C4F;
|
|
135
|
+
border-bottom-color: transparent;
|
|
136
|
+
border-left-color: #453C4F;
|
|
137
|
+
color: #fff;
|
|
138
|
+
}
|
|
139
|
+
main > h2 > button:focus::before {
|
|
140
|
+
content: '';
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: -1px;
|
|
143
|
+
right: -1px;
|
|
144
|
+
bottom: -1px;
|
|
145
|
+
left: -1px;
|
|
146
|
+
border-radius: 0.25rem 0.25rem 0 0;
|
|
147
|
+
box-shadow: 0 0 0 3px var(--pg-search-focus-glow, rgb(79, 143, 249, 0.6));
|
|
148
|
+
}
|
|
149
|
+
main > h2 > button > svg {
|
|
150
|
+
width: 24px;
|
|
151
|
+
height: 24px;
|
|
152
|
+
vertical-align: middle;
|
|
153
|
+
}
|
|
154
|
+
main > h2 > button + span.line {
|
|
155
|
+
display: none;
|
|
156
|
+
position: absolute;
|
|
157
|
+
left: 0;
|
|
158
|
+
right: 0;
|
|
159
|
+
bottom: -0.25rem;
|
|
160
|
+
height: 0.25rem;
|
|
161
|
+
background: transparent;
|
|
162
|
+
transition: background-color linear 0.2s;
|
|
163
|
+
}
|
|
164
|
+
main > h2 > button:not(.active):focus + span.line,
|
|
165
|
+
main > h2 > button:not(.active):hover + span.line {
|
|
166
|
+
display: block;
|
|
167
|
+
background: #453C4F;
|
|
168
|
+
}
|
|
169
|
+
main > h2 > span.label {
|
|
170
|
+
padding: 0.75rem 0.5rem 0.5rem 0.25rem;
|
|
171
|
+
font-size: 1rem;
|
|
172
|
+
display: inline;
|
|
173
|
+
color: #aaa;
|
|
174
|
+
position: absolute;
|
|
175
|
+
right: 4rem;
|
|
176
|
+
}
|
|
177
|
+
main > div.markdown {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
main > div.markdown > *:first-child {
|
|
181
|
+
border: 0.25rem solid #453C4F;
|
|
182
|
+
margin-top: -0.5rem;
|
|
183
|
+
padding: 0 1rem;
|
|
184
|
+
border-radius: 0.5rem;
|
|
185
|
+
}
|
|
186
|
+
main > div.markdown.show {
|
|
187
|
+
display: block;
|
|
188
|
+
}
|
|
189
|
+
main > section > h3 {
|
|
190
|
+
font-size: 1.25rem;
|
|
191
|
+
font-weight: normal;
|
|
192
|
+
padding: 0;
|
|
193
|
+
display: inline-block;
|
|
194
|
+
position: absolute;
|
|
195
|
+
margin: -2.5rem 0 0 1rem;
|
|
196
|
+
}
|
|
197
|
+
main > section > h3::before {
|
|
198
|
+
content: ' ';
|
|
199
|
+
background: #fff;
|
|
200
|
+
left: -1rem;
|
|
201
|
+
right: -1rem;
|
|
202
|
+
position: absolute;
|
|
203
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
204
|
+
margin: 0;
|
|
205
|
+
height: 1rem;
|
|
206
|
+
border-bottom: 1px solid #ccc;
|
|
207
|
+
border-left: 1px solid #ccc;
|
|
208
|
+
border-right: 1px solid #ccc;
|
|
209
|
+
top: calc(1rem - 1px);
|
|
210
|
+
}
|
|
211
|
+
main > section > h3 > span {
|
|
212
|
+
position: relative;
|
|
213
|
+
}
|
|
214
|
+
h1 small,
|
|
215
|
+
h2 small,
|
|
216
|
+
h3 small {
|
|
217
|
+
color: #999;
|
|
218
|
+
font-weight: normal;
|
|
219
|
+
font-size: 0.875rem;
|
|
220
|
+
}
|
|
221
|
+
.example {
|
|
222
|
+
vertical-align: top;
|
|
223
|
+
background: #F1F1F1;
|
|
224
|
+
border-radius: 0.25rem;
|
|
225
|
+
border: 1px dashed #222;
|
|
226
|
+
padding: 0.5rem;
|
|
227
|
+
margin-bottom: 0.5rem;
|
|
228
|
+
margin-right: 1rem;
|
|
229
|
+
box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.1) inset;
|
|
230
|
+
}
|
|
231
|
+
.example-flex {
|
|
232
|
+
display: flex;
|
|
233
|
+
}
|
|
234
|
+
body > button {
|
|
235
|
+
border: 1px solid #DDD;
|
|
236
|
+
background-image: linear-gradient(-180deg,#fafbfc,#eff3f6 90%);
|
|
237
|
+
color: #24292e;
|
|
238
|
+
border: 1px solid rgba(27,31,35,.2);
|
|
239
|
+
border-radius: .25em;
|
|
240
|
+
padding: 0.25rem 0.4rem 0.2rem 0.4rem;
|
|
241
|
+
}
|
|
242
|
+
body > button:hover {
|
|
243
|
+
background-image: linear-gradient(-180deg,#f0f3f6,#e6ebf1 90%);
|
|
244
|
+
background-position: -.5em;
|
|
245
|
+
border-color: rgba(27,31,35,.35);
|
|
246
|
+
}
|
|
247
|
+
</style>
|
|
248
|
+
</head>
|
|
249
|
+
|
|
250
|
+
<body>
|
|
251
|
+
<script>
|
|
252
|
+
var markdownCache = {};
|
|
253
|
+
function markdown(name, text) {
|
|
254
|
+
var h2 = document.getElementById(`${name}H2`);
|
|
255
|
+
var readme = document.getElementById(`${name}Readme`);
|
|
256
|
+
var container = document.getElementById(`${name}Container`);
|
|
257
|
+
readme.addEventListener('click', function () {
|
|
258
|
+
// Create
|
|
259
|
+
if (!(name in markdownCache)) {
|
|
260
|
+
var element = document.createElement('pg-markdown');
|
|
261
|
+
container.appendChild(element);
|
|
262
|
+
element.text = text;
|
|
263
|
+
markdownCache[name] = false;
|
|
264
|
+
}
|
|
265
|
+
// Flip
|
|
266
|
+
markdownCache[name] = !markdownCache[name];
|
|
267
|
+
h2.classList.toggle('open', markdownCache[name]);
|
|
268
|
+
readme.classList.toggle('active', markdownCache[name]);
|
|
269
|
+
container.classList.toggle('show', markdownCache[name]);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
</script>
|
|
273
|
+
<div class="wrapper">
|
|
274
|
+
<header>
|
|
275
|
+
<svg viewBox="0 0 24 24">
|
|
276
|
+
<path fill="currentColor" d="M2,2H8V4H16V2H22V8H20V16H22V22H16V20H8V22H2V16H4V8H2V2M16,8V6H8V8H6V16H8V18H16V16H18V8H16M4,4V6H6V4H4M18,4V6H20V4H18M4,18V20H6V18H4M18,18V20H20V18H18Z" />
|
|
277
|
+
</svg>
|
|
278
|
+
<h1>Pictogrammers Components</h1>
|
|
279
|
+
</header>
|
|
280
|
+
<aside>
|
|
281
|
+
<div>Components</div>
|
|
282
|
+
<ul>
|
|
283
|
+
<!-- [ListComponents] -->
|
|
284
|
+
</ul>
|
|
285
|
+
<div>Overlays</div>
|
|
286
|
+
<ul>
|
|
287
|
+
<!-- [ListOverlays] -->
|
|
288
|
+
</ul>
|
|
289
|
+
<div>Shared</div>
|
|
290
|
+
<ul>
|
|
291
|
+
<!-- [ListShared] -->
|
|
292
|
+
</ul>
|
|
293
|
+
</aside>
|
|
294
|
+
<main>
|
|
295
|
+
<p>This page is generated from <code>npm start</code>. To render only specific components use <code>npm start pg-button</code>.</p>
|
|
296
|
+
|
|
297
|
+
<!-- [Examples] -->
|
|
298
|
+
</main>
|
|
299
|
+
</div>
|
|
300
|
+
<script src="main.js"></script>
|
|
301
|
+
</body>
|
|
302
|
+
</html>
|