@nuralyui/colorpicker 0.0.3
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/color-holder.component.d.ts +9 -0
- package/color-holder.component.d.ts.map +1 -0
- package/color-holder.component.js +30 -0
- package/color-holder.component.js.map +1 -0
- package/color-holder.style.d.ts +2 -0
- package/color-holder.style.d.ts.map +1 -0
- package/color-holder.style.js +21 -0
- package/color-holder.style.js.map +1 -0
- package/color-picker.component.d.ts +26 -0
- package/color-picker.component.d.ts.map +1 -0
- package/color-picker.component.js +157 -0
- package/color-picker.component.js.map +1 -0
- package/color-picker.style.d.ts +3 -0
- package/color-picker.style.d.ts.map +1 -0
- package/color-picker.style.js +75 -0
- package/color-picker.style.js.map +1 -0
- package/color-picker.types.d.ts +6 -0
- package/color-picker.types.d.ts.map +1 -0
- package/color-picker.types.js +2 -0
- package/color-picker.types.js.map +1 -0
- package/default-color-sets.component.d.ts +9 -0
- package/default-color-sets.component.d.ts.map +1 -0
- package/default-color-sets.component.js +43 -0
- package/default-color-sets.component.js.map +1 -0
- package/default-color-sets.style.d.ts +2 -0
- package/default-color-sets.style.d.ts.map +1 -0
- package/default-color-sets.style.js +16 -0
- package/default-color-sets.style.js.map +1 -0
- package/demo/color-picker-demo.d.ts +18 -0
- package/demo/color-picker-demo.d.ts.map +1 -0
- package/demo/color-picker-demo.js +157 -0
- package/demo/color-picker-demo.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -0
- package/package.json +12 -0
- package/react.d.ts +6 -0
- package/react.d.ts.map +1 -0
- package/react.js +13 -0
- package/react.js.map +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ColorPickerSize } from './color-picker.types';
|
|
3
|
+
export declare class ColerHolderBox extends LitElement {
|
|
4
|
+
color: string;
|
|
5
|
+
size: ColorPickerSize;
|
|
6
|
+
static styles: import("lit").CSSResult;
|
|
7
|
+
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=color-holder.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-holder.component.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/color-holder.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAGrC,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,qBACa,cAAe,SAAQ,UAAU;IAE5C,KAAK,SAAa;IAGlB,IAAI,EAAG,eAAe,CAAC;IAEvB,OAAgB,MAAM,0BAAU;IAEvB,MAAM;CAGhB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles } from './color-holder.style.js';
|
|
10
|
+
let ColerHolderBox = class ColerHolderBox extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.color = '#FFFFFF';
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return html ` <div class="color-holder-container" style="background-color: ${this.color}"></div> `;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
ColerHolderBox.styles = styles;
|
|
20
|
+
__decorate([
|
|
21
|
+
property({ type: String })
|
|
22
|
+
], ColerHolderBox.prototype, "color", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
property({ type: String, reflect: true })
|
|
25
|
+
], ColerHolderBox.prototype, "size", void 0);
|
|
26
|
+
ColerHolderBox = __decorate([
|
|
27
|
+
customElement('hy-colorholder-box')
|
|
28
|
+
], ColerHolderBox);
|
|
29
|
+
export { ColerHolderBox };
|
|
30
|
+
//# sourceMappingURL=color-holder.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-holder.component.js","sourceRoot":"","sources":["../../../src/components/colorpicker/color-holder.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAI/C,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,UAAU;IAA9C;;QAEE,UAAK,GAAG,SAAS,CAAC;IAUpB,CAAC;IAHU,MAAM;QACb,OAAO,IAAI,CAAA,iEAAiE,IAAI,CAAC,KAAK,WAAW,CAAC;IACpG,CAAC;CACF,CAAA;AALiB,qBAAM,GAAG,MAAO,CAAA;AALhC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACP;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CACjB;AALZ,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAY1B;SAZY,cAAc","sourcesContent":["import {LitElement, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {styles} from './color-holder.style.js';\nimport {ColorPickerSize} from './color-picker.types';\n\n@customElement('hy-colorholder-box')\nexport class ColerHolderBox extends LitElement {\n @property({type: String})\n color = '#FFFFFF';\n\n @property({type: String, reflect: true})\n size!: ColorPickerSize;\n\n static override styles = styles;\n\n override render() {\n return html` <div class=\"color-holder-container\" style=\"background-color: ${this.color}\"></div> `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-holder.style.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/color-holder.style.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,MAAM,yBAAoB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const colorHolderStyles = css `
|
|
3
|
+
:host {
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.color-holder-container {
|
|
8
|
+
width: var(--hybrid-colorpicker-default-width);
|
|
9
|
+
height: var(--hybrid-colorpicker-default-height);
|
|
10
|
+
}
|
|
11
|
+
:host([size='small']) .color-holder-container {
|
|
12
|
+
width: var(--hybrid-colorpicker-small-width);
|
|
13
|
+
height: var(--hybrid-colorpicker-small-height);
|
|
14
|
+
}
|
|
15
|
+
:host([size='large']) .color-holder-container {
|
|
16
|
+
width: var(--hybrid-colorpicker-large-width);
|
|
17
|
+
height: var(--hybrid-colorpicker-large-height);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
export const styles = colorHolderStyles;
|
|
21
|
+
//# sourceMappingURL=color-holder.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-holder.style.js","sourceRoot":"","sources":["../../../src/components/colorpicker/color-holder.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiB5B,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC","sourcesContent":["import {css} from 'lit';\n\nconst colorHolderStyles = css`\n :host {\n cursor: pointer;\n }\n\n .color-holder-container {\n width: var(--hybrid-colorpicker-default-width);\n height: var(--hybrid-colorpicker-default-height);\n }\n :host([size='small']) .color-holder-container {\n width: var(--hybrid-colorpicker-small-width);\n height: var(--hybrid-colorpicker-small-height);\n }\n :host([size='large']) .color-holder-container {\n width: var(--hybrid-colorpicker-large-width);\n height: var(--hybrid-colorpicker-large-height);\n }\n`;\n\nexport const styles = colorHolderStyles;\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import './color-holder.component.js';
|
|
3
|
+
import './default-color-sets.component.js';
|
|
4
|
+
import { ColorPickerSize } from './color-picker.types.js';
|
|
5
|
+
export declare class ColorPicker extends LitElement {
|
|
6
|
+
color: string;
|
|
7
|
+
show: boolean;
|
|
8
|
+
defaultColorSets: Array<string>;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
size: ColorPickerSize;
|
|
11
|
+
isValidColor: boolean;
|
|
12
|
+
static styles: import("lit").CSSResult;
|
|
13
|
+
constructor();
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
updated(changedProperties: PropertyValues): void;
|
|
16
|
+
private toggleColorHolder;
|
|
17
|
+
private onClickOutside;
|
|
18
|
+
private calculateDropDownPosition;
|
|
19
|
+
private handleColorChanged;
|
|
20
|
+
private onInputChange;
|
|
21
|
+
private dispatchColorChange;
|
|
22
|
+
private checkIsValidColor;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
render(): import("lit").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=color-picker.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.component.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgB,MAAM,KAAK,CAAC;AAE9D,OAAO,6BAA6B,CAAC;AACrC,OAAO,mCAAmC,CAAC;AAE3C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAExD,qBACa,WAAY,SAAQ,UAAU;IAEzC,KAAK,SAAiB;IAGtB,IAAI,UAAS;IAGb,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAM;IAGrC,QAAQ,UAAS;IAGjB,IAAI,kBAA2B;IAG/B,YAAY,UAAK;IAEjB,OAAgB,MAAM,0BAAU;;IASvB,iBAAiB,IAAI,IAAI;IASzB,OAAO,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;YAK3C,iBAAiB;IAK/B,OAAO,CAAC,cAAc,CAIpB;IACF,OAAO,CAAC,yBAAyB,CA4B/B;IAEF,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,iBAAiB;IAIhB,oBAAoB,IAAI,IAAI;IAK5B,MAAM;CAmBhB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { LitElement, html, nothing } from 'lit';
|
|
17
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
18
|
+
import './color-holder.component.js';
|
|
19
|
+
import './default-color-sets.component.js';
|
|
20
|
+
import styles from './color-picker.style.js';
|
|
21
|
+
let ColorPicker = class ColorPicker extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.color = 'transparent';
|
|
25
|
+
this.show = false;
|
|
26
|
+
this.defaultColorSets = [];
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
this.size = "default" /* ColorPickerSize.Default */;
|
|
29
|
+
this.isValidColor = true;
|
|
30
|
+
this.onClickOutside = (onClickEvent) => {
|
|
31
|
+
const outsideClick = !onClickEvent.composedPath().includes(this);
|
|
32
|
+
if (outsideClick)
|
|
33
|
+
this.show = false;
|
|
34
|
+
};
|
|
35
|
+
this.calculateDropDownPosition = () => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const dropdownContainer = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-container');
|
|
38
|
+
const colorHolder = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.color-holder');
|
|
39
|
+
if (dropdownContainer && colorHolder) {
|
|
40
|
+
const dropdownRect = dropdownContainer.getBoundingClientRect();
|
|
41
|
+
const colorHolderRect = colorHolder.getBoundingClientRect();
|
|
42
|
+
const viewportHeight = window.innerHeight;
|
|
43
|
+
const viewportWidth = window.innerWidth;
|
|
44
|
+
// Check if the dropdown is going out of the viewport vertically
|
|
45
|
+
if (colorHolderRect.bottom + dropdownRect.height > viewportHeight) {
|
|
46
|
+
// Move the dropdown upwards if it goes out of the viewport
|
|
47
|
+
dropdownContainer.style.top = `${colorHolderRect.top - dropdownRect.height}px`;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// Otherwise, position it below the color holder
|
|
51
|
+
dropdownContainer.style.top = `${colorHolderRect.bottom}px`;
|
|
52
|
+
}
|
|
53
|
+
// Check if the dropdown is going out of the viewport horizontally
|
|
54
|
+
if (colorHolderRect.right + dropdownRect.width > viewportWidth) {
|
|
55
|
+
// Move the dropdown to the left if it goes out of the viewport
|
|
56
|
+
dropdownContainer.style.left = `${viewportWidth - dropdownRect.width}px`;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// Otherwise, position it to the right of the color holder
|
|
60
|
+
dropdownContainer.style.left = `${colorHolderRect.left}px`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
if (typeof window !== 'undefined') {
|
|
65
|
+
import('vanilla-colorful');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
super.connectedCallback();
|
|
70
|
+
// Mark the scroll listener as passive:
|
|
71
|
+
document.addEventListener('scroll', this.calculateDropDownPosition, {
|
|
72
|
+
passive: true,
|
|
73
|
+
});
|
|
74
|
+
document.addEventListener('click', this.onClickOutside);
|
|
75
|
+
}
|
|
76
|
+
updated(changedProperties) {
|
|
77
|
+
if (changedProperties.has('color')) {
|
|
78
|
+
this.checkIsValidColor();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
toggleColorHolder() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
this.show = !this.show;
|
|
84
|
+
yield this.updateComplete;
|
|
85
|
+
this.calculateDropDownPosition();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
handleColorChanged(colorChangedEvent) {
|
|
89
|
+
if (this.color != colorChangedEvent.detail.value) {
|
|
90
|
+
this.color = colorChangedEvent.detail.value;
|
|
91
|
+
this.dispatchColorChange();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
onInputChange(inputChangedEvent) {
|
|
95
|
+
if (this.color != inputChangedEvent.detail.value) {
|
|
96
|
+
this.color = inputChangedEvent.detail.value;
|
|
97
|
+
this.dispatchColorChange();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
dispatchColorChange() {
|
|
101
|
+
this.dispatchEvent(new CustomEvent('color-changed', {
|
|
102
|
+
detail: {
|
|
103
|
+
value: this.color,
|
|
104
|
+
},
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
checkIsValidColor() {
|
|
108
|
+
this.isValidColor = CSS.supports('color', this.color);
|
|
109
|
+
}
|
|
110
|
+
disconnectedCallback() {
|
|
111
|
+
document.removeEventListener('click', this.onClickOutside);
|
|
112
|
+
document.removeEventListener('scroll', this.calculateDropDownPosition);
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
return html `<div class="color-picker-container">
|
|
116
|
+
<hy-colorholder-box
|
|
117
|
+
class="color-holder"
|
|
118
|
+
color="${this.color}"
|
|
119
|
+
.size=${this.size}
|
|
120
|
+
@click=${!this.disabled ? this.toggleColorHolder : nothing}
|
|
121
|
+
></hy-colorholder-box>
|
|
122
|
+
<div class='dropdown-container'>
|
|
123
|
+
<hy-default-color-sets .defaultColorSets=${this.defaultColorSets} @color-click="${this.handleColorChanged}">
|
|
124
|
+
</hy-default-color-sets>
|
|
125
|
+
<hex-color-picker
|
|
126
|
+
color="${this.color}"
|
|
127
|
+
@color-changed="${(colorChangedEvent) => this.handleColorChanged(colorChangedEvent)}"
|
|
128
|
+
></hex-color-picker>
|
|
129
|
+
<hy-input type="text" .value="${this.color}" @valueChange="${this.onInputChange}" withCopy=${true} .state=${!this.isValidColor ? 'error' : nothing}> </hy-input>
|
|
130
|
+
</div>
|
|
131
|
+
</div> `;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
ColorPicker.styles = styles;
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ type: String })
|
|
137
|
+
], ColorPicker.prototype, "color", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Boolean, reflect: true })
|
|
140
|
+
], ColorPicker.prototype, "show", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Array })
|
|
143
|
+
], ColorPicker.prototype, "defaultColorSets", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ type: Boolean, reflect: true })
|
|
146
|
+
], ColorPicker.prototype, "disabled", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
property({ type: String, reflect: true })
|
|
149
|
+
], ColorPicker.prototype, "size", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
state()
|
|
152
|
+
], ColorPicker.prototype, "isValidColor", void 0);
|
|
153
|
+
ColorPicker = __decorate([
|
|
154
|
+
customElement('hy-color-picker')
|
|
155
|
+
], ColorPicker);
|
|
156
|
+
export { ColorPicker };
|
|
157
|
+
//# sourceMappingURL=color-picker.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.component.js","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,6BAA6B,CAAC;AACrC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAI7C,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAqBzC;QACE,KAAK,EAAE,CAAC;QApBV,UAAK,GAAG,aAAa,CAAC;QAGtB,SAAI,GAAG,KAAK,CAAC;QAGb,qBAAgB,GAAkB,EAAE,CAAC;QAGrC,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,2CAA2B;QAG/B,iBAAY,GAAC,IAAI,CAAA;QA8BT,mBAA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AAGb;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;qDACa;AAGrC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACxB;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCACT;AAG/B;IADC,KAAK,EAAE;iDACS;AAjBN,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAsIvB;SAtIY,WAAW","sourcesContent":["import {LitElement, PropertyValues, html, nothing} from 'lit';\nimport {customElement, property, state} from 'lit/decorators.js';\nimport './color-holder.component.js';\nimport './default-color-sets.component.js';\nimport styles from './color-picker.style.js';\nimport {ColorPickerSize} from './color-picker.types.js';\n\n@customElement('hy-color-picker')\nexport class ColorPicker extends LitElement {\n @property({type: String})\n color = 'transparent';\n\n @property({type: Boolean, reflect: true})\n show = false;\n\n @property({type: Array})\n defaultColorSets: Array<string> = [];\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: String, reflect: true})\n size = ColorPickerSize.Default;\n\n @state()\n isValidColor=true\n\n static override styles = styles;\n\n constructor() {\n super();\n if (typeof window !== 'undefined') {\n import('vanilla-colorful');\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Mark the scroll listener as passive:\n document.addEventListener('scroll', this.calculateDropDownPosition, {\n passive: true,\n });\n document.addEventListener('click', this.onClickOutside);\n }\n\n override updated(changedProperties: PropertyValues): void {\n if (changedProperties.has('color')) {\n this.checkIsValidColor()\n }\n }\n private async toggleColorHolder() {\n this.show = !this.show;\n await this.updateComplete;\n this.calculateDropDownPosition();\n }\n private onClickOutside = (onClickEvent: Event) => {\n const outsideClick = !onClickEvent.composedPath().includes(this)\n if(outsideClick)\n this.show =false\n };\n private calculateDropDownPosition = () => {\n const dropdownContainer = this.shadowRoot?.querySelector('.dropdown-container') as HTMLElement;\n const colorHolder = this.shadowRoot?.querySelector('.color-holder') as HTMLElement;\n\n if (dropdownContainer && colorHolder) {\n const dropdownRect = dropdownContainer.getBoundingClientRect();\n const colorHolderRect = colorHolder.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n // Check if the dropdown is going out of the viewport vertically\n if (colorHolderRect.bottom + dropdownRect.height > viewportHeight) {\n // Move the dropdown upwards if it goes out of the viewport\n dropdownContainer.style.top = `${colorHolderRect.top - dropdownRect.height}px`;\n } else {\n // Otherwise, position it below the color holder\n dropdownContainer.style.top = `${colorHolderRect.bottom}px`;\n }\n\n // Check if the dropdown is going out of the viewport horizontally\n if (colorHolderRect.right + dropdownRect.width > viewportWidth) {\n // Move the dropdown to the left if it goes out of the viewport\n dropdownContainer.style.left = `${viewportWidth - dropdownRect.width}px`;\n } else {\n // Otherwise, position it to the right of the color holder\n dropdownContainer.style.left = `${colorHolderRect.left}px`;\n }\n }\n };\n\n private handleColorChanged(colorChangedEvent: CustomEvent) {\n if(this.color !=colorChangedEvent.detail.value){\n this.color = colorChangedEvent.detail.value;\n this.dispatchColorChange()\n }\n }\n\n private onInputChange(inputChangedEvent: CustomEvent) {\n if(this.color != inputChangedEvent.detail.value){\n this.color = inputChangedEvent.detail.value;\n this.dispatchColorChange()\n }\n }\n private dispatchColorChange(){\n this.dispatchEvent(\n new CustomEvent('color-changed', {\n detail: {\n value: this.color,\n },\n })\n );\n\n }\n\n private checkIsValidColor(){\n this.isValidColor = CSS.supports('color',this.color)\n }\n\n override disconnectedCallback(): void {\n document.removeEventListener('click', this.onClickOutside);\n document.removeEventListener('scroll', this.calculateDropDownPosition);\n }\n\n override render() {\n return html`<div class=\"color-picker-container\">\n <hy-colorholder-box\n class=\"color-holder\"\n color=\"${this.color}\"\n .size=${this.size}\n @click=${!this.disabled ? this.toggleColorHolder : nothing}\n ></hy-colorholder-box>\n <div class='dropdown-container'>\n <hy-default-color-sets .defaultColorSets=${this.defaultColorSets} @color-click=\"${this.handleColorChanged}\">\n </hy-default-color-sets>\n <hex-color-picker\n color=\"${this.color}\"\n @color-changed=\"${(colorChangedEvent: CustomEvent) => this.handleColorChanged(colorChangedEvent)}\"\n ></hex-color-picker>\n <hy-input type=\"text\" .value=\"${this.color}\" @valueChange=\"${this.onInputChange}\" withCopy=${true} .state=${!this.isValidColor?'error':nothing}> </hy-input>\n </div>\n </div> `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.style.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.style.ts"],"names":[],"mappings":";AAEA,wBAwEE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css `
|
|
3
|
+
.color-picker-container {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
}
|
|
7
|
+
hex-color-picker {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
.dropdown-container {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
hex-color-picker::part(saturation) {
|
|
14
|
+
border-radius: 0px;
|
|
15
|
+
}
|
|
16
|
+
hex-color-picker::part(hue) {
|
|
17
|
+
border-radius: 0px;
|
|
18
|
+
}
|
|
19
|
+
hex-color-picker::part(saturation-pointer),
|
|
20
|
+
hex-color-picker::part(hue-pointer) {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
.color-holder {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
:host([disabled]) .color-holder {
|
|
27
|
+
opacity: var(--hybrid-colorpicker-disabled-opacity);
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
}
|
|
30
|
+
:host(:not([disabled])) .color-holder {
|
|
31
|
+
border: var(--hybrid-colorpicker-border-color);
|
|
32
|
+
}
|
|
33
|
+
:host(:not([disabled])) .color-holder:hover {
|
|
34
|
+
opacity: var(--hybrid-colorpicker-hover-opacity);
|
|
35
|
+
}
|
|
36
|
+
:host(:not([disabled])) .color-holder:active {
|
|
37
|
+
border:var(--hybrid-colorpicker-active-border)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
:host([show]) .dropdown-container{
|
|
42
|
+
display: block;
|
|
43
|
+
position: fixed;
|
|
44
|
+
width: 180px;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
padding: 5px;
|
|
47
|
+
background-color: var(--hybrid-colorpicker-background-color);
|
|
48
|
+
box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);
|
|
49
|
+
-webkit-box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);
|
|
50
|
+
-moz-box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host {
|
|
54
|
+
--hybrid-colorpicker-background-color: #f4f4f4;
|
|
55
|
+
--hybrid-colorpicker-border-color: 1px solid gray;
|
|
56
|
+
--hybrid-colorpicker-active-border: 1px solid #0f62fe;
|
|
57
|
+
--hybrid-colorpicker-disabled-opacity: 0.5;
|
|
58
|
+
--hybrid-colorpicker-hover-opacity: 0.8;
|
|
59
|
+
--hybrid-colorpicker-default-width: 30px;
|
|
60
|
+
--hybrid-colorpicker-default-height: 25px;
|
|
61
|
+
--hybrid-colorpicker-small-width: 20px;
|
|
62
|
+
--hybrid-colorpicker-small-height: 15px;
|
|
63
|
+
--hybrid-colorpicker-large-width: 35px;
|
|
64
|
+
--hybrid-colorpicker-large-height: 30px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media (prefers-color-scheme: dark) {
|
|
68
|
+
:host {
|
|
69
|
+
--hybrid-colorpicker-background-color: #393939;
|
|
70
|
+
--hybrid-colorpicker-border-color: 1px solid #f4f4f4;
|
|
71
|
+
--hybrid-colorpicker-disabled-opacity: 0.2;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
//# sourceMappingURL=color-picker.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.style.js","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEjB,CAAC","sourcesContent":["import {css} from 'lit';\n\nexport default css`\n .color-picker-container {\n display: inline-flex;\n flex-direction: column;\n }\n hex-color-picker {\n width: 100%;\n }\n .dropdown-container {\n display: none;\n }\n hex-color-picker::part(saturation) {\n border-radius: 0px;\n }\n hex-color-picker::part(hue) {\n border-radius: 0px;\n }\n hex-color-picker::part(saturation-pointer),\n hex-color-picker::part(hue-pointer) {\n cursor: pointer;\n }\n .color-holder {\n cursor: pointer;\n }\n :host([disabled]) .color-holder {\n opacity: var(--hybrid-colorpicker-disabled-opacity);\n cursor: not-allowed;\n }\n :host(:not([disabled])) .color-holder {\n border: var(--hybrid-colorpicker-border-color);\n }\n :host(:not([disabled])) .color-holder:hover {\n opacity: var(--hybrid-colorpicker-hover-opacity);\n }\n :host(:not([disabled])) .color-holder:active {\n border:var(--hybrid-colorpicker-active-border)\n }\n \n\n :host([show]) .dropdown-container{\n display: block;\n position: fixed;\n width: 180px;\n z-index: 1;\n padding: 5px;\n background-color: var(--hybrid-colorpicker-background-color);\n box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);\n -webkit-box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);\n -moz-box-shadow: 1px -1px 5px 1px rgba(0, 0, 0, 0.14);\n }\n\n :host {\n --hybrid-colorpicker-background-color: #f4f4f4;\n --hybrid-colorpicker-border-color: 1px solid gray;\n --hybrid-colorpicker-active-border: 1px solid #0f62fe;\n --hybrid-colorpicker-disabled-opacity: 0.5;\n --hybrid-colorpicker-hover-opacity: 0.8;\n --hybrid-colorpicker-default-width: 30px;\n --hybrid-colorpicker-default-height: 25px;\n --hybrid-colorpicker-small-width: 20px;\n --hybrid-colorpicker-small-height: 15px;\n --hybrid-colorpicker-large-width: 35px;\n --hybrid-colorpicker-large-height: 30px;\n }\n \n @media (prefers-color-scheme: dark) {\n :host { \n --hybrid-colorpicker-background-color: #393939;\n --hybrid-colorpicker-border-color: 1px solid #f4f4f4;\n --hybrid-colorpicker-disabled-opacity: 0.2;\n }\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.types.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.types.ts"],"names":[],"mappings":"AAAA,0BAAkB,eAAe;IAC/B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.types.js","sourceRoot":"","sources":["../../../src/components/colorpicker/color-picker.types.ts"],"names":[],"mappings":"","sourcesContent":["export const enum ColorPickerSize {\n Default = 'default',\n Small = 'small',\n Large = 'large',\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import './color-holder.component.js';
|
|
3
|
+
export declare class DefaultColorSets extends LitElement {
|
|
4
|
+
defaultColorSets: Array<string>;
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
handleColorClick(color: string): void;
|
|
7
|
+
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=default-color-sets.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-color-sets.component.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/default-color-sets.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAGrC,OAAO,6BAA6B,CAAC;AACrC,qBACa,gBAAiB,SAAQ,UAAU;IAE9C,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAM;IAErC,OAAgB,MAAM,0BAAU;IAEhC,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAUrB,MAAM;CAchB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles } from './default-color-sets.style.js';
|
|
10
|
+
import './color-holder.component.js';
|
|
11
|
+
let DefaultColorSets = class DefaultColorSets extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.defaultColorSets = [];
|
|
15
|
+
}
|
|
16
|
+
handleColorClick(color) {
|
|
17
|
+
this.dispatchEvent(new CustomEvent('color-click', {
|
|
18
|
+
detail: {
|
|
19
|
+
value: color,
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return html `
|
|
25
|
+
<div class="default-color-sets-container">
|
|
26
|
+
${this.defaultColorSets.map((color) => html `<hy-colorholder-box
|
|
27
|
+
@click=${() => this.handleColorClick(color)}
|
|
28
|
+
color="${color}"
|
|
29
|
+
class='color-set-container'
|
|
30
|
+
></hy-colorholder-box>`)}
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
DefaultColorSets.styles = styles;
|
|
36
|
+
__decorate([
|
|
37
|
+
property({ type: Array })
|
|
38
|
+
], DefaultColorSets.prototype, "defaultColorSets", void 0);
|
|
39
|
+
DefaultColorSets = __decorate([
|
|
40
|
+
customElement('hy-default-color-sets')
|
|
41
|
+
], DefaultColorSets);
|
|
42
|
+
export { DefaultColorSets };
|
|
43
|
+
//# sourceMappingURL=default-color-sets.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-color-sets.component.js","sourceRoot":"","sources":["../../../src/components/colorpicker/default-color-sets.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,6BAA6B,CAAC;AAErC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAAhD;;QAEE,qBAAgB,GAAkB,EAAE,CAAC;IA4BvC,CAAC;IAxBC,gBAAgB,CAAC,KAAa;QAC5B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,aAAa,EAAE;YAC7B,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;aACb;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,gBAAgB,CAAC,GAAG,CACzB,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,CAAA;uBACO,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;uBAClC,KAAK;;mCAEO,CAC1B;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AA1BiB,uBAAM,GAAG,MAAO,CAAA;AAFhC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;0DACa;AAF1B,gBAAgB;IAD5B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,gBAAgB,CA8B5B;SA9BY,gBAAgB","sourcesContent":["import {LitElement, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {styles} from './default-color-sets.style.js';\nimport './color-holder.component.js';\n@customElement('hy-default-color-sets')\nexport class DefaultColorSets extends LitElement {\n @property({type: Array})\n defaultColorSets: Array<string> = [];\n\n static override styles = styles;\n\n handleColorClick(color: string) {\n this.dispatchEvent(\n new CustomEvent('color-click', {\n detail: {\n value: color,\n },\n })\n );\n }\n\n override render() {\n return html`\n <div class=\"default-color-sets-container\">\n ${this.defaultColorSets.map(\n (color) =>\n html`<hy-colorholder-box\n @click=${() => this.handleColorClick(color)}\n color=\"${color}\"\n class='color-set-container'\n ></hy-colorholder-box>`\n )}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-color-sets.style.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/default-color-sets.style.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,MAAM,yBAAwB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const defaultColorSetsStyle = css `
|
|
3
|
+
.default-color-sets-container {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
.default-color-sets-container * {
|
|
9
|
+
margin: 3px;
|
|
10
|
+
}
|
|
11
|
+
.color-set-container{
|
|
12
|
+
border: var(--hybrid-colorpicker-border-color);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
export const styles = defaultColorSetsStyle;
|
|
16
|
+
//# sourceMappingURL=default-color-sets.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-color-sets.style.js","sourceRoot":"","sources":["../../../src/components/colorpicker/default-color-sets.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;CAYhC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,qBAAqB,CAAC","sourcesContent":["import {css} from 'lit';\n\nconst defaultColorSetsStyle = css`\n .default-color-sets-container {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n }\n .default-color-sets-container * {\n margin: 3px;\n }\n .color-set-container{\n border: var(--hybrid-colorpicker-border-color);\n }\n`;\n\nexport const styles = defaultColorSetsStyle;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import '../color-picker.component';
|
|
8
|
+
import '../../../helpers/ThemeHandler';
|
|
9
|
+
export declare class ColorDemoElement extends LitElement {
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
render(): import("lit").TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'hy-colorpicker-demo': ColorDemoElement;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=color-picker-demo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker-demo.d.ts","sourceRoot":"","sources":["../../../../src/components/colorpicker/demo/color-picker-demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,2BAA2B,CAAC;AACnC,OAAO,+BAA+B,CAAC;AAEvC,qBACa,gBAAiB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAKpB;IAEO,MAAM;CAiIhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,gBAAgB,CAAC;KACzC;CACF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
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;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
import { LitElement, html, css } from 'lit';
|
|
13
|
+
import { customElement } from 'lit/decorators.js';
|
|
14
|
+
import '../color-picker.component';
|
|
15
|
+
import '../../../helpers/ThemeHandler';
|
|
16
|
+
let ColorDemoElement = class ColorDemoElement extends LitElement {
|
|
17
|
+
render() {
|
|
18
|
+
return html `
|
|
19
|
+
<theme-handler>
|
|
20
|
+
<div style="display: flex;">
|
|
21
|
+
<!-- Left Section -->
|
|
22
|
+
<div>
|
|
23
|
+
<h3>Default</h3>
|
|
24
|
+
<hy-color-picker
|
|
25
|
+
@color-changed="${(e) => {
|
|
26
|
+
console.log(e.detail.value);
|
|
27
|
+
}}"
|
|
28
|
+
></hy-color-picker>
|
|
29
|
+
<br />
|
|
30
|
+
<h3>With default color value</h3>
|
|
31
|
+
<hy-color-picker
|
|
32
|
+
.color="${'#E92222'}"
|
|
33
|
+
@color-changed="${(e) => {
|
|
34
|
+
console.log(e.detail.value);
|
|
35
|
+
}}"
|
|
36
|
+
></hy-color-picker>
|
|
37
|
+
<br />
|
|
38
|
+
<h3>With default color value and color sets</h3>
|
|
39
|
+
<hy-color-picker
|
|
40
|
+
.color="${'#ECDA1E'}"
|
|
41
|
+
.defaultColorSets=${[
|
|
42
|
+
'#264653',
|
|
43
|
+
'#2a9d8f',
|
|
44
|
+
'#e9c46a',
|
|
45
|
+
'#f4a261',
|
|
46
|
+
'#e76f51',
|
|
47
|
+
'#e63946',
|
|
48
|
+
'#f1faee',
|
|
49
|
+
'#a8dadc',
|
|
50
|
+
'#457b9d',
|
|
51
|
+
'#1d3557',
|
|
52
|
+
]}
|
|
53
|
+
@color-changed="${(e) => {
|
|
54
|
+
console.log(e.detail.value);
|
|
55
|
+
}}"
|
|
56
|
+
></hy-color-picker>
|
|
57
|
+
<br />
|
|
58
|
+
<h3>Disabled color picker</h3>
|
|
59
|
+
<hy-color-picker
|
|
60
|
+
.disabled=${true}
|
|
61
|
+
.color="${'#67d640'}"
|
|
62
|
+
@color-changed="${(e) => {
|
|
63
|
+
console.log(e.detail.value);
|
|
64
|
+
}}"
|
|
65
|
+
></hy-color-picker>
|
|
66
|
+
|
|
67
|
+
<br />
|
|
68
|
+
<h3>small color picker</h3>
|
|
69
|
+
<hy-color-picker
|
|
70
|
+
.color="${'#E92222'}"
|
|
71
|
+
.size="${'small'}"
|
|
72
|
+
@color-changed="${(e) => {
|
|
73
|
+
console.log(e.detail.value);
|
|
74
|
+
}}"
|
|
75
|
+
></hy-color-picker>
|
|
76
|
+
|
|
77
|
+
<br />
|
|
78
|
+
<h3>large color picker</h3>
|
|
79
|
+
<hy-color-picker
|
|
80
|
+
.color="${'#ECDA1E'}"
|
|
81
|
+
.size="${'large'}"
|
|
82
|
+
@color-changed="${(e) => {
|
|
83
|
+
console.log(e.detail.value);
|
|
84
|
+
}}"
|
|
85
|
+
></hy-color-picker>
|
|
86
|
+
|
|
87
|
+
<br />
|
|
88
|
+
<div style="margin-top:50%;">
|
|
89
|
+
<hy-color-picker
|
|
90
|
+
.color="${'#67d640'}"
|
|
91
|
+
@color-changed="${(e) => {
|
|
92
|
+
console.log(e.detail.value);
|
|
93
|
+
}}"
|
|
94
|
+
></hy-color-picker>
|
|
95
|
+
</div>
|
|
96
|
+
<br />
|
|
97
|
+
<div style="margin-top:100%;">
|
|
98
|
+
<hy-color-picker
|
|
99
|
+
.color="${'#000000'}"
|
|
100
|
+
@color-changed="${(e) => {
|
|
101
|
+
console.log(e.detail.value);
|
|
102
|
+
}}"
|
|
103
|
+
></hy-color-picker>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<!-- Right Section -->
|
|
108
|
+
<div id="right">
|
|
109
|
+
<h3>Right Demo Section</h3>
|
|
110
|
+
<hy-color-picker
|
|
111
|
+
.color="${'#3498db'}"
|
|
112
|
+
@color-changed="${(e) => {
|
|
113
|
+
console.log('Right side color changed:', e.detail.value);
|
|
114
|
+
}}"
|
|
115
|
+
></hy-color-picker>
|
|
116
|
+
<br />
|
|
117
|
+
<h3>Another color picker</h3>
|
|
118
|
+
<hy-color-picker
|
|
119
|
+
id="right-block"
|
|
120
|
+
|
|
121
|
+
.color="${'#9b59b6'}"
|
|
122
|
+
@color-changed="${(e) => {
|
|
123
|
+
console.log('Right side color changed:', e.detail.value);
|
|
124
|
+
}}"
|
|
125
|
+
></hy-color-picker>
|
|
126
|
+
<br />
|
|
127
|
+
<h3>Custom color set on the right</h3>
|
|
128
|
+
<hy-color-picker
|
|
129
|
+
.color="${'#f39c12'}"
|
|
130
|
+
.defaultColorSets=${[
|
|
131
|
+
'#8e44ad',
|
|
132
|
+
'#e74c3c',
|
|
133
|
+
'#2ecc71',
|
|
134
|
+
'#f1c40f',
|
|
135
|
+
'#3498db',
|
|
136
|
+
]}
|
|
137
|
+
@color-changed="${(e) => {
|
|
138
|
+
console.log('Right side color changed:', e.detail.value);
|
|
139
|
+
}}"
|
|
140
|
+
></hy-color-picker>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</theme-handler>
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
ColorDemoElement.styles = css `
|
|
148
|
+
#right-block {
|
|
149
|
+
right: 0;
|
|
150
|
+
position: fixed;
|
|
151
|
+
}
|
|
152
|
+
`;
|
|
153
|
+
ColorDemoElement = __decorate([
|
|
154
|
+
customElement('hy-colorpicker-demo')
|
|
155
|
+
], ColorDemoElement);
|
|
156
|
+
export { ColorDemoElement };
|
|
157
|
+
//# sourceMappingURL=color-picker-demo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker-demo.js","sourceRoot":"","sources":["../../../../src/components/colorpicker/demo/color-picker-demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAC,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,2BAA2B,CAAC;AACnC,OAAO,+BAA+B,CAAC;AAGvC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAQrC,MAAM;QACb,OAAO,IAAI,CAAA;;;;;;;gCAOiB,CAAC,CAAc,EAAE,EAAE;YAC7C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;;;;;wBAKmB,SAAS;gCACD,CAAC,CAAc,EAAE,EAAE;YAC7C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;;;;;wBAKmB,SAAS;kCACC;YAC5B,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;SACV;gCAC2B,CAAC,CAAc,EAAE,EAAE;YAC7C,OAAO,CAAC,GAAG,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,CAAC,2BAA2B,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;;;;;KAKA,CAAC;IACJ,CAAC;CACF,CAAA;AAxIiB,uBAAM,GAAG,GAAG,CAAA;;;;;GAK1B,CAAA;AANS,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CAyI5B;SAzIY,gBAAgB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport {LitElement, html, css} from 'lit';\nimport {customElement} from 'lit/decorators.js';\nimport '../color-picker.component';\nimport '../../../helpers/ThemeHandler';\n\n@customElement('hy-colorpicker-demo')\nexport class ColorDemoElement extends LitElement {\n static override styles = css`\n #right-block {\n right: 0;\n position: fixed;\n }\n `;\n\n override render() {\n return html`\n <theme-handler>\n <div style=\"display: flex;\">\n <!-- Left Section -->\n <div>\n <h3>Default</h3>\n <hy-color-picker\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n <br />\n <h3>With default color value</h3>\n <hy-color-picker\n .color=\"${'#E92222'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n <br />\n <h3>With default color value and color sets</h3>\n <hy-color-picker\n .color=\"${'#ECDA1E'}\"\n .defaultColorSets=${[\n '#264653',\n '#2a9d8f',\n '#e9c46a',\n '#f4a261',\n '#e76f51',\n '#e63946',\n '#f1faee',\n '#a8dadc',\n '#457b9d',\n '#1d3557',\n ]}\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n <br />\n <h3>Disabled color picker</h3>\n <hy-color-picker\n .disabled=${true}\n .color=\"${'#67d640'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n\n <br />\n <h3>small color picker</h3>\n <hy-color-picker\n .color=\"${'#E92222'}\"\n .size=\"${'small'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n\n <br />\n <h3>large color picker</h3>\n <hy-color-picker\n .color=\"${'#ECDA1E'}\"\n .size=\"${'large'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n\n <br />\n <div style=\"margin-top:50%;\">\n <hy-color-picker\n .color=\"${'#67d640'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n </div>\n <br />\n <div style=\"margin-top:100%;\">\n <hy-color-picker\n .color=\"${'#000000'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log(e.detail.value);\n }}\"\n ></hy-color-picker>\n </div>\n </div>\n\n <!-- Right Section -->\n <div id=\"right\">\n <h3>Right Demo Section</h3>\n <hy-color-picker\n .color=\"${'#3498db'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log('Right side color changed:', e.detail.value);\n }}\"\n ></hy-color-picker>\n <br />\n <h3>Another color picker</h3>\n <hy-color-picker\n id=\"right-block\"\n \n .color=\"${'#9b59b6'}\"\n @color-changed=\"${(e: CustomEvent) => {\n console.log('Right side color changed:', e.detail.value);\n }}\"\n ></hy-color-picker>\n <br />\n <h3>Custom color set on the right</h3>\n <hy-color-picker\n .color=\"${'#f39c12'}\"\n .defaultColorSets=${[\n '#8e44ad',\n '#e74c3c',\n '#2ecc71',\n '#f1c40f',\n '#3498db',\n ]}\n @color-changed=\"${(e: CustomEvent) => {\n console.log('Right side color changed:', e.detail.value);\n }}\"\n ></hy-color-picker>\n </div>\n </div>\n </theme-handler>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hy-colorpicker-demo': ColorDemoElement;\n }\n}"]}
|
package/index.d.ts
ADDED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC"}
|
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/colorpicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './color-picker.component.js';\nexport * from './color-holder.component.js';"]}
|
package/package.json
ADDED
package/react.d.ts
ADDED
package/react.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/colorpicker/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAExD,eAAO,MAAM,aAAa;;;EAQxB,CAAC"}
|
package/react.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createComponent } from '@lit-labs/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ColorPicker } from './color-picker.component.js';
|
|
4
|
+
export const HyColorPicker = createComponent({
|
|
5
|
+
tagName: 'hy-color-picker',
|
|
6
|
+
elementClass: ColorPicker,
|
|
7
|
+
react: React,
|
|
8
|
+
events: {
|
|
9
|
+
colorChange: 'color-change',
|
|
10
|
+
change: 'change',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=react.js.map
|
package/react.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/colorpicker/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;IAC3C,OAAO,EAAE,iBAAiB;IAC1B,YAAY,EAAE,WAAW;IACzB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,QAAQ;KACjB;CACF,CAAC,CAAC","sourcesContent":["import {createComponent} from '@lit-labs/react';\nimport * as React from 'react';\nimport {ColorPicker} from './color-picker.component.js';\n\nexport const HyColorPicker = createComponent({\n tagName: 'hy-color-picker',\n elementClass: ColorPicker,\n react: React,\n events: {\n colorChange: 'color-change',\n change: 'change',\n },\n});\n"]}
|