@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { selectComponent, getAttributes } from '@pictogrammers/element';
|
|
2
|
+
|
|
3
|
+
import './icon';
|
|
4
|
+
import PgIcon from './icon';
|
|
5
|
+
|
|
6
|
+
const PG_ICON = 'pg-icon';
|
|
7
|
+
const ICON = 'M12,4C14.21,4 16,5.79 16,8C16,10.21 14.21,12 12,12C9.79,12 8,10.21 8,8C8,5.79 9.79,4 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z';
|
|
8
|
+
const DEFAULT_ICON = 'M0 0h24v24H0V0zm2 2v20h20V2H2z';
|
|
9
|
+
|
|
10
|
+
describe('pg-icon', () => {
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
var c = document.createElement(PG_ICON);
|
|
14
|
+
document.body.appendChild(c);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
while (document.body.firstChild) {
|
|
19
|
+
document.body.removeChild(document.body.firstChild);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should be registered', () => {
|
|
24
|
+
expect(customElements.get(PG_ICON)).toBeDefined();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should only expose known props', () => {
|
|
28
|
+
const props = getAttributes(PG_ICON);
|
|
29
|
+
expect(props.length).toBe(1);
|
|
30
|
+
expect(props).toContain('path');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should default path value', () => {
|
|
34
|
+
const component = selectComponent<PgIcon>(PG_ICON);
|
|
35
|
+
const { $path } = component;
|
|
36
|
+
expect($path.getAttribute('d')).toEqual(DEFAULT_ICON);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('path should be set', async () => {
|
|
40
|
+
const component = selectComponent<PgIcon>(PG_ICON);
|
|
41
|
+
const { $path } = component;
|
|
42
|
+
await component.setAttribute('path', ICON);
|
|
43
|
+
expect($path.getAttribute('d')).toEqual(ICON);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
});
|
package/pg/icon/icon.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Prop, Part } from '@pictogrammers/element';
|
|
2
|
+
|
|
3
|
+
import template from './icon.html';
|
|
4
|
+
import style from './icon.css';
|
|
5
|
+
|
|
6
|
+
const noIcon = 'M0 0h24v24H0V0zm2 2v20h20V2H2z';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'pg-icon',
|
|
10
|
+
style,
|
|
11
|
+
template
|
|
12
|
+
})
|
|
13
|
+
export default class PgIcon extends HTMLElement {
|
|
14
|
+
@Prop() path: string = noIcon;
|
|
15
|
+
|
|
16
|
+
@Part() $path: SVGPathElement;
|
|
17
|
+
|
|
18
|
+
render(changes) {
|
|
19
|
+
if (changes.path) {
|
|
20
|
+
this.$path.setAttribute('d', this.path);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
package/pg/icon/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<pg-input-check>`
|
|
2
|
+
|
|
3
|
+
The `pg-input-check` component is a styled checkbox.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import '@pictogrammers/components/pg/inputCheck';
|
|
7
|
+
import PgInputCheck from '@pictogrammers/components/pg/inputCheck';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<pg-input-check></pg-input-check>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Attributes
|
|
15
|
+
|
|
16
|
+
| Attributes | Tested | Description |
|
|
17
|
+
| ---------- | -------- | ----------- |
|
|
18
|
+
| value | ✅ | `true` or `false` |
|
|
19
|
+
|
|
20
|
+
## Events
|
|
21
|
+
|
|
22
|
+
| Attributes | Tested | Description |
|
|
23
|
+
| ---------- | -------- | ----------- |
|
|
24
|
+
| change | ✅ | Click toggles boolean. |
|
|
25
|
+
|
|
26
|
+
## CSS Variables
|
|
27
|
+
|
|
28
|
+
| CSS Variables | Default | Description |
|
|
29
|
+
| ------------------- | --------- | ----------- |
|
|
30
|
+
| `--pg-input-check-blank-color` | `#453C4F` | Color |
|
|
31
|
+
| `--pg-input-check-chcked-color` | `#453C4F` | Color |
|
|
32
|
+
| `--pg-icon-size` | `1.5rem` | Width / Height |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Part, Prop } from '@pictogrammers/element';
|
|
2
|
+
import PgInputCheck from 'pg/inputCheck/inputCheck';
|
|
3
|
+
|
|
4
|
+
import template from './basic.html';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'x-pg-input-check-basic',
|
|
8
|
+
template
|
|
9
|
+
})
|
|
10
|
+
export default class XPgInputCheckBasic extends HTMLElement {
|
|
11
|
+
|
|
12
|
+
@Part() $input: PgInputCheck;
|
|
13
|
+
@Part() $value: HTMLSpanElement;
|
|
14
|
+
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.$input.addEventListener('change', this.handleChange.bind(this));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
handleChange(e) {
|
|
20
|
+
var value = e.target.value;
|
|
21
|
+
this.$value.innerText = value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.blank {
|
|
6
|
+
color: var(--pg-input-check-blank-color, #453C4F);
|
|
7
|
+
}
|
|
8
|
+
.blank [part="check"] {
|
|
9
|
+
visibility: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.checked {
|
|
13
|
+
color: var(--pg-input-check-checked-color, #453C4F);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[part="button"] {
|
|
17
|
+
display: flex;
|
|
18
|
+
padding: 0;
|
|
19
|
+
border: 0;
|
|
20
|
+
outline: 0;
|
|
21
|
+
border-radius: 0.25rem;
|
|
22
|
+
background: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part="svg"] {
|
|
26
|
+
width: var(--pg-icon-check-size, 1.5rem);
|
|
27
|
+
height: var(--pg-icon-check-size, 1.5rem);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[part="button"]:not(:hover):active {
|
|
31
|
+
box-shadow: 0 0 0 3px var(--pg-input-check-active-glow, rgb(79, 143, 249, 0.6));
|
|
32
|
+
}
|
|
33
|
+
[part="button"]:not(:hover):focus:not(:focus-visible) {
|
|
34
|
+
box-shadow: none;
|
|
35
|
+
}
|
|
36
|
+
[part="button"]:not(:hover):focus {
|
|
37
|
+
box-shadow: 0 0 0 3px var(--pg-input-check-focus-glow, rgb(79, 143, 249, 0.5));
|
|
38
|
+
}
|
|
39
|
+
[part="button"]:not(:disabled):hover [part="path"] {
|
|
40
|
+
fill: #4f8ff9;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[part="button"]:disabled {
|
|
44
|
+
color: #AAA;
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<button part="button">
|
|
2
|
+
<svg part="svg" viewBox="0 0 24 24">
|
|
3
|
+
<path part="path" fill="currentColor" d="M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19"/>
|
|
4
|
+
<path part="check" fill="currentColor" d="M7.91 10.08L6.5 11.5L11 16L21 6L19.59 4.58L11 13.17L7.91 10.08Z"/>
|
|
5
|
+
</svg>
|
|
6
|
+
</button>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Component, Prop, Part } from '@pictogrammers/element';
|
|
2
|
+
|
|
3
|
+
import template from './inputCheck.html';
|
|
4
|
+
import style from './inputCheck.css';
|
|
5
|
+
|
|
6
|
+
const PATH_BLANK = 'M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z';
|
|
7
|
+
const PATH_CHECKED = 'M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'pg-input-check',
|
|
11
|
+
style,
|
|
12
|
+
template
|
|
13
|
+
})
|
|
14
|
+
export default class PgInputCheck extends HTMLElement {
|
|
15
|
+
@Prop() value: string | boolean = false;
|
|
16
|
+
@Prop() disabled: boolean = false;
|
|
17
|
+
|
|
18
|
+
@Part() $button: HTMLButtonElement;
|
|
19
|
+
@Part() $path: SVGPathElement;
|
|
20
|
+
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.$button.addEventListener('click', this.handleClick.bind(this));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
handleClick() {
|
|
26
|
+
const value = [true, 'true'].includes(this.value);
|
|
27
|
+
this.value = !value;
|
|
28
|
+
this.dispatchEvent(new CustomEvent('change'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render(changes) {
|
|
32
|
+
if (changes.value) {
|
|
33
|
+
const value = [true, 'true'].includes(this.value);
|
|
34
|
+
this.$path.setAttribute('d', value ? PATH_CHECKED : PATH_BLANK);
|
|
35
|
+
this.$button.classList.toggle('blank', !value);
|
|
36
|
+
this.$button.classList.toggle('checked', value);
|
|
37
|
+
}
|
|
38
|
+
if (changes.disabled) {
|
|
39
|
+
this.$button.disabled = ['', true, 'true'].includes(this.disabled);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# `<pg-input-check-list>`
|
|
2
|
+
|
|
3
|
+
The `pg-input-check-list` component is a list of checkboxes.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import '@pictogrammers/components/pg/inputCheck';
|
|
7
|
+
import PgInputCheck from '@pictogrammers/components/pg/inputCheck';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<pg-input-check-list></pg-input-check-list>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Attributes
|
|
15
|
+
|
|
16
|
+
| Attributes | Tested | Description |
|
|
17
|
+
| ---------- | -------- | ----------- |
|
|
18
|
+
| value | ✅ | Array of checked values. |
|
|
19
|
+
| options | ✅ | Array of items. |
|
|
20
|
+
|
|
21
|
+
Each option object must have a `value`. Optionally a `label` and `disabled`.
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| Attributes | Tested | Description |
|
|
26
|
+
| ---------- | -------- | ----------- |
|
|
27
|
+
| change | ✅ | Any change in the list checks. |
|
|
28
|
+
|
|
29
|
+
## CSS Variables
|
|
30
|
+
|
|
31
|
+
| CSS Variables | Default | Description |
|
|
32
|
+
| ------------------- | --------- | ----------- |
|
|
33
|
+
| `--pg-input-check-blank-color` | `#453C4F` | Color |
|
|
34
|
+
| `--pg-input-check-chcked-color` | `#453C4F` | Color |
|
|
35
|
+
| `--pg-icon-size` | `1.5rem` | Width / Height |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, Part, Prop } from '@pictogrammers/element';
|
|
2
|
+
import PgInputCheckList from 'pg/inputCheckList/inputCheckList';
|
|
3
|
+
|
|
4
|
+
import template from './basic.html';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'x-pg-input-check-list-basic',
|
|
8
|
+
template
|
|
9
|
+
})
|
|
10
|
+
export default class XPgInputCheckListBasic extends HTMLElement {
|
|
11
|
+
|
|
12
|
+
@Part() $input: PgInputCheckList;
|
|
13
|
+
@Part() $value: HTMLSpanElement;
|
|
14
|
+
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.$input.value = ['uuid1', 'uuid3'];
|
|
17
|
+
this.$input.options = [
|
|
18
|
+
{ value: 'uuid1', label: 'Item 1' },
|
|
19
|
+
{ value: 'uuid2', label: 'Item 2' },
|
|
20
|
+
{ value: 'uuid3', label: 'Item 3', disabled: true },
|
|
21
|
+
{ value: 'uuid4', label: 'Item 4' }
|
|
22
|
+
];
|
|
23
|
+
this.$value.innerText = this.$input.value.join(',');
|
|
24
|
+
this.$input.addEventListener('change', this.handleChange.bind(this));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
handleChange(e) {
|
|
28
|
+
const { value } = e.detail;
|
|
29
|
+
this.$value.innerText = value.join(',');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.blank {
|
|
7
|
+
color: var(--pg-input-check-blank-color, #453C4F);
|
|
8
|
+
}
|
|
9
|
+
.blank [part="check"] {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.checked {
|
|
14
|
+
color: var(--pg-input-check-checked-color, #453C4F);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[part="list"] {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
list-style: none;
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0.25rem 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part="list"] li {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[part="list"] li:not(:last-child) {
|
|
31
|
+
margin-bottom: 0.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part="list"] button {
|
|
35
|
+
display: flex;
|
|
36
|
+
padding: 0;
|
|
37
|
+
border: 0;
|
|
38
|
+
outline: 0;
|
|
39
|
+
border-radius: 0.25rem;
|
|
40
|
+
align-items: center;
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[part="svg"] {
|
|
45
|
+
width: var(--pg-icon-check-size, 1.5rem);
|
|
46
|
+
height: var(--pg-icon-check-size, 1.5rem);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[part="list"] button span {
|
|
50
|
+
margin-left: 0.25rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[part="list"] button:not(:hover):active {
|
|
54
|
+
box-shadow: 0 0 0 3px var(--pg-input-check-active-glow, rgb(79, 143, 249, 0.6));
|
|
55
|
+
}
|
|
56
|
+
[part="list"] button:not(:hover):focus:not(:focus-visible) {
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
}
|
|
59
|
+
[part="list"] button:not(:hover):focus-visible {
|
|
60
|
+
box-shadow: 0 0 0 3px var(--pg-input-check-focus-glow, rgb(79, 143, 249, 0.5));
|
|
61
|
+
}
|
|
62
|
+
[part="list"] button:not(:disabled):hover [part="path"] {
|
|
63
|
+
fill: #4f8ff9;
|
|
64
|
+
}
|
|
65
|
+
[part="list"] button:not(:disabled):hover span {
|
|
66
|
+
color: #4f8ff9;
|
|
67
|
+
}
|
|
68
|
+
[part="list"] button:disabled {
|
|
69
|
+
color: #AAA;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<ul part="list"></ul>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Component, Prop, Part } from '@pictogrammers/element';
|
|
2
|
+
|
|
3
|
+
import template from './inputCheckList.html';
|
|
4
|
+
import style from './inputCheckList.css';
|
|
5
|
+
import { list, item } from '../shared/list';
|
|
6
|
+
|
|
7
|
+
const NS_SVG = 'http://www.w3.org/2000/svg';
|
|
8
|
+
const PATH_BLANK = 'M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z';
|
|
9
|
+
const PATH_CHECKED = 'M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19';
|
|
10
|
+
const PATH_CHECK = 'M7.91 10.08L6.5 11.5L11 16L21 6L19.59 4.58L11 13.17L7.91 10.08Z';
|
|
11
|
+
|
|
12
|
+
export interface Option {
|
|
13
|
+
value: any;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'pg-input-check-list',
|
|
20
|
+
style,
|
|
21
|
+
template
|
|
22
|
+
})
|
|
23
|
+
export default class PgInputCheckList extends HTMLElement {
|
|
24
|
+
@Prop() value: string[] = [];
|
|
25
|
+
@Prop() options: Option[] = [];
|
|
26
|
+
|
|
27
|
+
@Part() $list: HTMLLIElement;
|
|
28
|
+
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
handleClick(option) {
|
|
33
|
+
const checked = this.value.includes(option.value);
|
|
34
|
+
const li = item<HTMLLIElement>(this.$list, option, 'value');
|
|
35
|
+
const button = li.querySelector('button');
|
|
36
|
+
button?.classList.toggle('blank', checked);
|
|
37
|
+
button?.classList.toggle('checked', !checked);
|
|
38
|
+
li.querySelector('[part="path"]')?.setAttribute('d', checked ? PATH_BLANK : PATH_CHECKED);
|
|
39
|
+
if (checked) {
|
|
40
|
+
this.value.splice(this.value.findIndex(v => v === option.value), 1);
|
|
41
|
+
} else {
|
|
42
|
+
this.value.push(option.value);
|
|
43
|
+
}
|
|
44
|
+
this.dispatchEvent(
|
|
45
|
+
new CustomEvent('change', {
|
|
46
|
+
detail: {
|
|
47
|
+
value: this.value
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render(changes) {
|
|
54
|
+
if (changes.options) {
|
|
55
|
+
list(
|
|
56
|
+
this.$list,
|
|
57
|
+
this.options,
|
|
58
|
+
'value',
|
|
59
|
+
(option) => {
|
|
60
|
+
const li = document.createElement('li');
|
|
61
|
+
const button = document.createElement('button');
|
|
62
|
+
if (option.disabled === true) {
|
|
63
|
+
button.disabled = true;
|
|
64
|
+
}
|
|
65
|
+
const checked = this.value.includes(option.value);
|
|
66
|
+
button.classList.toggle('checked', checked);
|
|
67
|
+
button.classList.toggle('blank', !checked);
|
|
68
|
+
const svg = document.createElementNS(NS_SVG, 'svg') as SVGElement;
|
|
69
|
+
svg.setAttribute('viewBox', '0 0 24 24');
|
|
70
|
+
svg.setAttribute('part', 'svg');
|
|
71
|
+
const path = document.createElementNS(NS_SVG, 'path') as SVGPathElement;
|
|
72
|
+
path.setAttribute('d', checked ? PATH_CHECKED : PATH_BLANK);
|
|
73
|
+
path.setAttribute('fill', 'currentColor');
|
|
74
|
+
path.setAttribute('part', 'path');
|
|
75
|
+
svg.appendChild(path);
|
|
76
|
+
const check = document.createElementNS(NS_SVG, 'path') as SVGPathElement;
|
|
77
|
+
check.setAttribute('d', PATH_CHECK);
|
|
78
|
+
check.setAttribute('fill', 'currentColor');
|
|
79
|
+
check.setAttribute('part', 'check');
|
|
80
|
+
svg.appendChild(check);
|
|
81
|
+
button.appendChild(svg);
|
|
82
|
+
const span = document.createElement('span');
|
|
83
|
+
span.innerText = option.label;
|
|
84
|
+
button.appendChild(span);
|
|
85
|
+
button.addEventListener('click', (e) => {
|
|
86
|
+
this.handleClick(option);
|
|
87
|
+
});
|
|
88
|
+
li.appendChild(button);
|
|
89
|
+
return li;
|
|
90
|
+
},
|
|
91
|
+
(option, $item) => {
|
|
92
|
+
$item.querySelector('button').innerText = option.label;
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (changes.value) {
|
|
97
|
+
//const value = [true, 'true'].includes(this.value);
|
|
98
|
+
//this.$path.setAttribute('d', value ? checked : unchecked);
|
|
99
|
+
//this.$button.classList.toggle('blank', !value);
|
|
100
|
+
//this.$button.classList.toggle('checked', value);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<li>
|
|
2
|
+
<button class="checked"><svg viewBox="0 0 24 24" part="svg">
|
|
3
|
+
<path part="path" fill="currentColor" d="M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19"></path>
|
|
4
|
+
<path part="check" fill="currentColor" d="M7.91 10.08L6.5 11.5L11 16L21 6L19.59 4.58L11 13.17L7.91 10.08Z"></path>
|
|
5
|
+
</svg>
|
|
6
|
+
<span part="label"></span>
|
|
7
|
+
</button>
|
|
8
|
+
</li>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `<pg-input-file-local>`
|
|
2
|
+
|
|
3
|
+
The `pg-input-file-local` component allows a quick way to read uploaded files for local processing. Such as reading a JSON file or text based file. It can also take in image files.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import '@pictogrammers/components/pg/inputLocalFile';
|
|
7
|
+
import PgInputFileLocal from '@pictogrammers/components/pg/inputLocalFile';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<pg-input-file-local
|
|
12
|
+
acceptsFileType="json,txt">
|
|
13
|
+
</pg-input-file-local>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Attributes
|
|
17
|
+
|
|
18
|
+
| Attributes | Tested | Description |
|
|
19
|
+
| ------------------- | -------- | ----------- |
|
|
20
|
+
| `accepts-file-type` | ✅ | Allowed files. |
|
|
21
|
+
|
|
22
|
+
## Events
|
|
23
|
+
|
|
24
|
+
| Events | Detail |
|
|
25
|
+
| ---------- | ------ |
|
|
26
|
+
| `change` | `{ value, name }` |
|
|
27
|
+
|
|
28
|
+
## CSS Variables
|
|
29
|
+
|
|
30
|
+
For CSS Variables please look at the `pg-button` as all CSS styles are shared.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Part, Prop } from '@pictogrammers/element';
|
|
2
|
+
import PgInputFileLocal from '../../inputFileLocal';
|
|
3
|
+
|
|
4
|
+
import template from './basic.html';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'x-pg-input-file-local-basic',
|
|
8
|
+
template
|
|
9
|
+
})
|
|
10
|
+
export default class XPgInputFileLocalBasic extends HTMLElement {
|
|
11
|
+
|
|
12
|
+
@Part() $input: PgInputFileLocal;
|
|
13
|
+
@Part() $value: HTMLSpanElement;
|
|
14
|
+
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.$input.addEventListener('change', this.handleChange.bind(this));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
handleChange(e: CustomEvent) {
|
|
20
|
+
const { name, value } = e.detail;
|
|
21
|
+
this.$value.innerText = `${name} - ${value}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
[part="label"] {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: 1.5rem auto;
|
|
8
|
+
grid-template-rows: auto;
|
|
9
|
+
font-family: var(--pg-font-family);
|
|
10
|
+
font-size: 1rem;
|
|
11
|
+
line-height: 1.5rem;
|
|
12
|
+
border: 1px solid var(--pg-button-border-color, #453C4F);
|
|
13
|
+
background-color: var(--pg-button-background-color, #fff);
|
|
14
|
+
color: var(--pg-button-color, #453C4F);
|
|
15
|
+
padding: var(--pg-button-padding, 0.25rem 0.5rem);
|
|
16
|
+
border-radius: 0.25rem;
|
|
17
|
+
outline: none;
|
|
18
|
+
--pg-icon-color: var(--pg-button-color, #453C4F);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[part="label"]:hover {
|
|
22
|
+
border: 1px solid var(--pg-button-hover-border-color, #453C4F);
|
|
23
|
+
background-color: var(--pg-button-hover-background-color, #453C4F);
|
|
24
|
+
color: var(--pg-button-hover-color, #fff);
|
|
25
|
+
--pg-icon-color: var(--pg-button-hover-color, #fff);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[part="label"]:active {
|
|
29
|
+
box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;
|
|
30
|
+
position: relative;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[part="label"]:focus {
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[part="label"]:active::before {
|
|
38
|
+
content: '';
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: -1px;
|
|
41
|
+
right: -1px;
|
|
42
|
+
bottom: -1px;
|
|
43
|
+
left: -1px;
|
|
44
|
+
border-radius: 0.25rem;
|
|
45
|
+
box-shadow: 0 0 0 3px var(--pg-search-focus-glow, rgb(79, 143, 249, 0.6));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[part="label"]:focus::before {
|
|
49
|
+
content: '';
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: -1px;
|
|
52
|
+
right: -1px;
|
|
53
|
+
bottom: -1px;
|
|
54
|
+
left: -1px;
|
|
55
|
+
border-radius: 0.25rem;
|
|
56
|
+
box-shadow: 0 0 0 3px var(--pg-search-focus-glow, rgb(79, 143, 249, 0.5));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[part="file"] {
|
|
60
|
+
width: 100%;
|
|
61
|
+
border: 0;
|
|
62
|
+
outline: 0;
|
|
63
|
+
height: 1.5rem;
|
|
64
|
+
grid-row: 1;
|
|
65
|
+
grid-column: 1 / span 2;
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[part="icon"] {
|
|
70
|
+
grid-row: 1;
|
|
71
|
+
grid-column: 1;
|
|
72
|
+
transform: translate(-0.25rem, 0.075rem);
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[part="text"] {
|
|
77
|
+
grid-row: 1;
|
|
78
|
+
grid-column: 2;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
}
|