@digipair/skill-web-jsoneditor 0.94.0-8 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/index.cjs.js → index.cjs.js} +18039 -18073
- package/index.d.ts +1 -0
- package/{dist/index.esm.js → index.esm.js} +18032 -18068
- package/{dist → libs/skill-web-jsoneditor}/src/index.d.ts +0 -1
- package/{dist → libs/skill-web-jsoneditor}/src/lib/jsoneditor.element.d.ts +0 -1
- package/libs/skill-web-jsoneditor/src/lib/skill-web-jsoneditor.d.ts +1 -0
- package/package.json +6 -22
- package/{dist/vanilla-picker.cjs.js → vanilla-picker.cjs.js} +262 -256
- package/{dist/vanilla-picker.esm.js → vanilla-picker.esm.js} +261 -255
- package/README.md +0 -7
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/lib/jsoneditor.element.d.ts.map +0 -1
- package/dist/src/lib/skill-web-jsoneditor.d.ts +0 -2
- package/dist/src/lib/skill-web-jsoneditor.d.ts.map +0 -1
- package/dist/src/lib/skill-web-jsoneditor.spec.d.ts +0 -2
- package/dist/src/lib/skill-web-jsoneditor.spec.d.ts.map +0 -1
- /package/{dist/index.d.ts → index.cjs.d.ts} +0 -0
- /package/{dist/schema.fr.json → schema.fr.json} +0 -0
- /package/{dist/schema.json → schema.json} +0 -0
|
@@ -76,159 +76,159 @@ String.prototype.padStart = String.prototype.padStart || function(len, pad) {
|
|
|
76
76
|
return str;
|
|
77
77
|
};
|
|
78
78
|
var colorNames = {
|
|
79
|
-
cb:
|
|
80
|
-
tqw:
|
|
81
|
-
q:
|
|
82
|
-
qmrn:
|
|
83
|
-
zr:
|
|
84
|
-
bg:
|
|
85
|
-
bsq:
|
|
86
|
-
bck:
|
|
87
|
-
nch:
|
|
88
|
-
b:
|
|
89
|
-
bvt:
|
|
90
|
-
brwn:
|
|
91
|
-
brw:
|
|
92
|
-
ctb:
|
|
93
|
-
hrt:
|
|
94
|
-
chcT:
|
|
95
|
-
cr:
|
|
96
|
-
rnw:
|
|
97
|
-
crns:
|
|
98
|
-
crms:
|
|
99
|
-
cn:
|
|
100
|
-
Db:
|
|
101
|
-
Dcn:
|
|
102
|
-
Dgnr:
|
|
103
|
-
Dgr:
|
|
104
|
-
Dgrn:
|
|
105
|
-
Dkhk:
|
|
106
|
-
Dmgn:
|
|
107
|
-
Dvgr:
|
|
108
|
-
Drng:
|
|
109
|
-
Drch:
|
|
110
|
-
Dr:
|
|
111
|
-
Dsmn:
|
|
112
|
-
Dsgr:
|
|
113
|
-
DsTb:
|
|
114
|
-
DsTg:
|
|
115
|
-
Dtrq:
|
|
116
|
-
Dvt:
|
|
117
|
-
ppnk:
|
|
118
|
-
pskb:
|
|
119
|
-
mgr:
|
|
120
|
-
grb:
|
|
121
|
-
rbrc:
|
|
122
|
-
rwht:
|
|
123
|
-
stg:
|
|
124
|
-
chs:
|
|
125
|
-
gnsb:
|
|
126
|
-
st:
|
|
127
|
-
g:
|
|
128
|
-
gnr:
|
|
129
|
-
gr:
|
|
130
|
-
grn:
|
|
131
|
-
grnw:
|
|
132
|
-
hnw:
|
|
133
|
-
htpn:
|
|
134
|
-
nnr:
|
|
135
|
-
ng:
|
|
136
|
-
vr:
|
|
137
|
-
khk:
|
|
138
|
-
vnr:
|
|
139
|
-
nrb:
|
|
140
|
-
wngr:
|
|
141
|
-
mnch:
|
|
142
|
-
Lb:
|
|
143
|
-
Lcr:
|
|
144
|
-
Lcn:
|
|
145
|
-
Lgnr:
|
|
146
|
-
Lgr:
|
|
147
|
-
Lgrn:
|
|
148
|
-
Lpnk:
|
|
149
|
-
Lsmn:
|
|
150
|
-
Lsgr:
|
|
151
|
-
Lskb:
|
|
152
|
-
LsTg:
|
|
153
|
-
Lstb:
|
|
154
|
-
Lw:
|
|
155
|
-
m:
|
|
156
|
-
mgrn:
|
|
157
|
-
nn:
|
|
158
|
-
mgnt:
|
|
159
|
-
mrn:
|
|
160
|
-
mqm:
|
|
161
|
-
mmb:
|
|
162
|
-
mmrc:
|
|
163
|
-
mmpr:
|
|
164
|
-
msg:
|
|
165
|
-
mmsT:
|
|
166
|
-
|
|
167
|
-
mtr:
|
|
168
|
-
mmvt:
|
|
169
|
-
mnLb:
|
|
170
|
-
ntc:
|
|
171
|
-
mstr:
|
|
172
|
-
mccs:
|
|
173
|
-
vjw:
|
|
174
|
-
nv:
|
|
175
|
-
c:
|
|
176
|
-
v:
|
|
177
|
-
vrb:
|
|
178
|
-
rng:
|
|
179
|
-
rngr:
|
|
180
|
-
rch:
|
|
181
|
-
pgnr:
|
|
182
|
-
pgrn:
|
|
183
|
-
ptrq:
|
|
184
|
-
pvtr:
|
|
185
|
-
ppwh:
|
|
186
|
-
pchp:
|
|
187
|
-
pr:
|
|
188
|
-
pnk:
|
|
189
|
-
pm:
|
|
190
|
-
pwrb:
|
|
191
|
-
prp:
|
|
192
|
-
cc:
|
|
193
|
-
r:
|
|
194
|
-
sbr:
|
|
195
|
-
rb:
|
|
196
|
-
sbrw:
|
|
197
|
-
smn:
|
|
198
|
-
nbr:
|
|
199
|
-
sgrn:
|
|
200
|
-
ssh:
|
|
201
|
-
snn:
|
|
202
|
-
svr:
|
|
203
|
-
skb:
|
|
204
|
-
sTb:
|
|
205
|
-
sTgr:
|
|
206
|
-
snw:
|
|
207
|
-
n:
|
|
208
|
-
stb:
|
|
209
|
-
tn:
|
|
210
|
-
t:
|
|
211
|
-
thst:
|
|
212
|
-
tmT:
|
|
213
|
-
trqs:
|
|
214
|
-
vt:
|
|
215
|
-
whT:
|
|
216
|
-
wht:
|
|
217
|
-
hts:
|
|
218
|
-
w:
|
|
219
|
-
wgrn:
|
|
79
|
+
cb: "0f8ff",
|
|
80
|
+
tqw: "aebd7",
|
|
81
|
+
q: "-ffff",
|
|
82
|
+
qmrn: "7fffd4",
|
|
83
|
+
zr: "0ffff",
|
|
84
|
+
bg: "5f5dc",
|
|
85
|
+
bsq: "e4c4",
|
|
86
|
+
bck: "---",
|
|
87
|
+
nch: "ebcd",
|
|
88
|
+
b: "--ff",
|
|
89
|
+
bvt: "8a2be2",
|
|
90
|
+
brwn: "a52a2a",
|
|
91
|
+
brw: "deb887",
|
|
92
|
+
ctb: "5f9ea0",
|
|
93
|
+
hrt: "7fff-",
|
|
94
|
+
chcT: "d2691e",
|
|
95
|
+
cr: "7f50",
|
|
96
|
+
rnw: "6495ed",
|
|
97
|
+
crns: "8dc",
|
|
98
|
+
crms: "dc143c",
|
|
99
|
+
cn: "-ffff",
|
|
100
|
+
Db: "--8b",
|
|
101
|
+
Dcn: "-8b8b",
|
|
102
|
+
Dgnr: "b8860b",
|
|
103
|
+
Dgr: "a9a9a9",
|
|
104
|
+
Dgrn: "-64-",
|
|
105
|
+
Dkhk: "bdb76b",
|
|
106
|
+
Dmgn: "8b-8b",
|
|
107
|
+
Dvgr: "556b2f",
|
|
108
|
+
Drng: "8c-",
|
|
109
|
+
Drch: "9932cc",
|
|
110
|
+
Dr: "8b--",
|
|
111
|
+
Dsmn: "e9967a",
|
|
112
|
+
Dsgr: "8fbc8f",
|
|
113
|
+
DsTb: "483d8b",
|
|
114
|
+
DsTg: "2f4f4f",
|
|
115
|
+
Dtrq: "-ced1",
|
|
116
|
+
Dvt: "94-d3",
|
|
117
|
+
ppnk: "1493",
|
|
118
|
+
pskb: "-bfff",
|
|
119
|
+
mgr: "696969",
|
|
120
|
+
grb: "1e90ff",
|
|
121
|
+
rbrc: "b22222",
|
|
122
|
+
rwht: "af0",
|
|
123
|
+
stg: "228b22",
|
|
124
|
+
chs: "-ff",
|
|
125
|
+
gnsb: "dcdcdc",
|
|
126
|
+
st: "8f8ff",
|
|
127
|
+
g: "d7-",
|
|
128
|
+
gnr: "daa520",
|
|
129
|
+
gr: "808080",
|
|
130
|
+
grn: "-8-0",
|
|
131
|
+
grnw: "adff2f",
|
|
132
|
+
hnw: "0fff0",
|
|
133
|
+
htpn: "69b4",
|
|
134
|
+
nnr: "cd5c5c",
|
|
135
|
+
ng: "4b-82",
|
|
136
|
+
vr: "0",
|
|
137
|
+
khk: "0e68c",
|
|
138
|
+
vnr: "e6e6fa",
|
|
139
|
+
nrb: "0f5",
|
|
140
|
+
wngr: "7cfc-",
|
|
141
|
+
mnch: "acd",
|
|
142
|
+
Lb: "add8e6",
|
|
143
|
+
Lcr: "08080",
|
|
144
|
+
Lcn: "e0ffff",
|
|
145
|
+
Lgnr: "afad2",
|
|
146
|
+
Lgr: "d3d3d3",
|
|
147
|
+
Lgrn: "90ee90",
|
|
148
|
+
Lpnk: "b6c1",
|
|
149
|
+
Lsmn: "a07a",
|
|
150
|
+
Lsgr: "20b2aa",
|
|
151
|
+
Lskb: "87cefa",
|
|
152
|
+
LsTg: "778899",
|
|
153
|
+
Lstb: "b0c4de",
|
|
154
|
+
Lw: "e0",
|
|
155
|
+
m: "-ff-",
|
|
156
|
+
mgrn: "32cd32",
|
|
157
|
+
nn: "af0e6",
|
|
158
|
+
mgnt: "-ff",
|
|
159
|
+
mrn: "8--0",
|
|
160
|
+
mqm: "66cdaa",
|
|
161
|
+
mmb: "--cd",
|
|
162
|
+
mmrc: "ba55d3",
|
|
163
|
+
mmpr: "9370db",
|
|
164
|
+
msg: "3cb371",
|
|
165
|
+
mmsT: "7b68ee",
|
|
166
|
+
"": "-fa9a",
|
|
167
|
+
mtr: "48d1cc",
|
|
168
|
+
mmvt: "c71585",
|
|
169
|
+
mnLb: "191970",
|
|
170
|
+
ntc: "5fffa",
|
|
171
|
+
mstr: "e4e1",
|
|
172
|
+
mccs: "e4b5",
|
|
173
|
+
vjw: "dead",
|
|
174
|
+
nv: "--80",
|
|
175
|
+
c: "df5e6",
|
|
176
|
+
v: "808-0",
|
|
177
|
+
vrb: "6b8e23",
|
|
178
|
+
rng: "a5-",
|
|
179
|
+
rngr: "45-",
|
|
180
|
+
rch: "da70d6",
|
|
181
|
+
pgnr: "eee8aa",
|
|
182
|
+
pgrn: "98fb98",
|
|
183
|
+
ptrq: "afeeee",
|
|
184
|
+
pvtr: "db7093",
|
|
185
|
+
ppwh: "efd5",
|
|
186
|
+
pchp: "dab9",
|
|
187
|
+
pr: "cd853f",
|
|
188
|
+
pnk: "c0cb",
|
|
189
|
+
pm: "dda0dd",
|
|
190
|
+
pwrb: "b0e0e6",
|
|
191
|
+
prp: "8-080",
|
|
192
|
+
cc: "663399",
|
|
193
|
+
r: "--",
|
|
194
|
+
sbr: "bc8f8f",
|
|
195
|
+
rb: "4169e1",
|
|
196
|
+
sbrw: "8b4513",
|
|
197
|
+
smn: "a8072",
|
|
198
|
+
nbr: "4a460",
|
|
199
|
+
sgrn: "2e8b57",
|
|
200
|
+
ssh: "5ee",
|
|
201
|
+
snn: "a0522d",
|
|
202
|
+
svr: "c0c0c0",
|
|
203
|
+
skb: "87ceeb",
|
|
204
|
+
sTb: "6a5acd",
|
|
205
|
+
sTgr: "708090",
|
|
206
|
+
snw: "afa",
|
|
207
|
+
n: "-ff7f",
|
|
208
|
+
stb: "4682b4",
|
|
209
|
+
tn: "d2b48c",
|
|
210
|
+
t: "-8080",
|
|
211
|
+
thst: "d8bfd8",
|
|
212
|
+
tmT: "6347",
|
|
213
|
+
trqs: "40e0d0",
|
|
214
|
+
vt: "ee82ee",
|
|
215
|
+
whT: "5deb3",
|
|
216
|
+
wht: "",
|
|
217
|
+
hts: "5f5f5",
|
|
218
|
+
w: "-",
|
|
219
|
+
wgrn: "9acd32"
|
|
220
220
|
};
|
|
221
221
|
function printNum(num) {
|
|
222
222
|
var decs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
223
|
-
var str = decs > 0 ? num.toFixed(decs).replace(/0+$/,
|
|
224
|
-
return str ||
|
|
223
|
+
var str = decs > 0 ? num.toFixed(decs).replace(/0+$/, "").replace(/\.$/, "") : num.toString();
|
|
224
|
+
return str || "0";
|
|
225
225
|
}
|
|
226
226
|
var Color = function() {
|
|
227
227
|
function Color(r, g, b, a) {
|
|
228
228
|
classCallCheck(this, Color);
|
|
229
229
|
var that = this;
|
|
230
230
|
function parseString(input) {
|
|
231
|
-
if (input.startsWith(
|
|
231
|
+
if (input.startsWith("hsl")) {
|
|
232
232
|
var _input$match$map = input.match(/([\-\d\.e]+)/g).map(Number), _input$match$map2 = slicedToArray(_input$match$map, 4), h = _input$match$map2[0], s = _input$match$map2[1], l = _input$match$map2[2], _a = _input$match$map2[3];
|
|
233
233
|
if (_a === undefined) {
|
|
234
234
|
_a = 1;
|
|
@@ -242,7 +242,7 @@ var Color = function() {
|
|
|
242
242
|
l,
|
|
243
243
|
_a
|
|
244
244
|
];
|
|
245
|
-
} else if (input.startsWith(
|
|
245
|
+
} else if (input.startsWith("rgb")) {
|
|
246
246
|
var _input$match$map3 = input.match(/([\-\d\.e]+)/g).map(Number), _input$match$map4 = slicedToArray(_input$match$map3, 4), _r = _input$match$map4[0], _g = _input$match$map4[1], _b = _input$match$map4[2], _a2 = _input$match$map4[3];
|
|
247
247
|
if (_a2 === undefined) {
|
|
248
248
|
_a2 = 1;
|
|
@@ -254,7 +254,7 @@ var Color = function() {
|
|
|
254
254
|
_a2
|
|
255
255
|
];
|
|
256
256
|
} else {
|
|
257
|
-
if (input.startsWith(
|
|
257
|
+
if (input.startsWith("#")) {
|
|
258
258
|
that.rgba = Color.hexToRgb(input);
|
|
259
259
|
} else {
|
|
260
260
|
that.rgba = Color.nameToRgb(input) || Color.hexToRgb(input);
|
|
@@ -265,7 +265,7 @@ var Color = function() {
|
|
|
265
265
|
else if (Array.isArray(r)) {
|
|
266
266
|
this.rgba = r;
|
|
267
267
|
} else if (b === undefined) {
|
|
268
|
-
var color = r &&
|
|
268
|
+
var color = r && "" + r;
|
|
269
269
|
if (color) {
|
|
270
270
|
parseString(color.toLowerCase());
|
|
271
271
|
}
|
|
@@ -280,16 +280,16 @@ var Color = function() {
|
|
|
280
280
|
}
|
|
281
281
|
createClass(Color, [
|
|
282
282
|
{
|
|
283
|
-
key:
|
|
283
|
+
key: "printRGB",
|
|
284
284
|
value: function printRGB(alpha) {
|
|
285
285
|
var rgb = alpha ? this.rgba : this.rgba.slice(0, 3), vals = rgb.map(function(x, i) {
|
|
286
286
|
return printNum(x, i === 3 ? 3 : 0);
|
|
287
287
|
});
|
|
288
|
-
return alpha ?
|
|
288
|
+
return alpha ? "rgba(" + vals + ")" : "rgb(" + vals + ")";
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
|
-
key:
|
|
292
|
+
key: "printHSL",
|
|
293
293
|
value: function printHSL(alpha) {
|
|
294
294
|
var mults = [
|
|
295
295
|
360,
|
|
@@ -297,32 +297,32 @@ var Color = function() {
|
|
|
297
297
|
100,
|
|
298
298
|
1
|
|
299
299
|
], suff = [
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
"",
|
|
301
|
+
"%",
|
|
302
|
+
"%",
|
|
303
|
+
""
|
|
304
304
|
];
|
|
305
305
|
var hsl = alpha ? this.hsla : this.hsla.slice(0, 3), vals = hsl.map(function(x, i) {
|
|
306
306
|
return printNum(x * mults[i], i === 3 ? 3 : 1) + suff[i];
|
|
307
307
|
});
|
|
308
|
-
return alpha ?
|
|
308
|
+
return alpha ? "hsla(" + vals + ")" : "hsl(" + vals + ")";
|
|
309
309
|
}
|
|
310
310
|
},
|
|
311
311
|
{
|
|
312
|
-
key:
|
|
312
|
+
key: "printHex",
|
|
313
313
|
value: function printHex(alpha) {
|
|
314
314
|
var hex = this.hex;
|
|
315
315
|
return alpha ? hex : hex.substring(0, 7);
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
|
-
key:
|
|
319
|
+
key: "rgba",
|
|
320
320
|
get: function get() {
|
|
321
321
|
if (this._rgba) {
|
|
322
322
|
return this._rgba;
|
|
323
323
|
}
|
|
324
324
|
if (!this._hsla) {
|
|
325
|
-
throw new Error(
|
|
325
|
+
throw new Error("No color is set");
|
|
326
326
|
}
|
|
327
327
|
return this._rgba = Color.hslToRgb(this._hsla);
|
|
328
328
|
},
|
|
@@ -335,25 +335,25 @@ var Color = function() {
|
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
337
|
{
|
|
338
|
-
key:
|
|
338
|
+
key: "rgbString",
|
|
339
339
|
get: function get() {
|
|
340
340
|
return this.printRGB();
|
|
341
341
|
}
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
|
-
key:
|
|
344
|
+
key: "rgbaString",
|
|
345
345
|
get: function get() {
|
|
346
346
|
return this.printRGB(true);
|
|
347
347
|
}
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
|
-
key:
|
|
350
|
+
key: "hsla",
|
|
351
351
|
get: function get() {
|
|
352
352
|
if (this._hsla) {
|
|
353
353
|
return this._hsla;
|
|
354
354
|
}
|
|
355
355
|
if (!this._rgba) {
|
|
356
|
-
throw new Error(
|
|
356
|
+
throw new Error("No color is set");
|
|
357
357
|
}
|
|
358
358
|
return this._hsla = Color.rgbToHsl(this._rgba);
|
|
359
359
|
},
|
|
@@ -366,26 +366,26 @@ var Color = function() {
|
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
368
|
{
|
|
369
|
-
key:
|
|
369
|
+
key: "hslString",
|
|
370
370
|
get: function get() {
|
|
371
371
|
return this.printHSL();
|
|
372
372
|
}
|
|
373
373
|
},
|
|
374
374
|
{
|
|
375
|
-
key:
|
|
375
|
+
key: "hslaString",
|
|
376
376
|
get: function get() {
|
|
377
377
|
return this.printHSL(true);
|
|
378
378
|
}
|
|
379
379
|
},
|
|
380
380
|
{
|
|
381
|
-
key:
|
|
381
|
+
key: "hex",
|
|
382
382
|
get: function get() {
|
|
383
383
|
var rgb = this.rgba, hex = rgb.map(function(x, i) {
|
|
384
384
|
return i < 3 ? x.toString(16) : Math.round(x * 255).toString(16);
|
|
385
385
|
});
|
|
386
|
-
return
|
|
387
|
-
return x.padStart(2,
|
|
388
|
-
}).join(
|
|
386
|
+
return "#" + hex.map(function(x) {
|
|
387
|
+
return x.padStart(2, "0");
|
|
388
|
+
}).join("");
|
|
389
389
|
},
|
|
390
390
|
set: function set(hex) {
|
|
391
391
|
this.rgba = Color.hexToRgb(hex);
|
|
@@ -393,11 +393,11 @@ var Color = function() {
|
|
|
393
393
|
}
|
|
394
394
|
], [
|
|
395
395
|
{
|
|
396
|
-
key:
|
|
396
|
+
key: "hexToRgb",
|
|
397
397
|
value: function hexToRgb(input) {
|
|
398
|
-
var hex = (input.startsWith(
|
|
398
|
+
var hex = (input.startsWith("#") ? input.slice(1) : input).replace(/^(\w{3})$/, "$1F").replace(/^(\w)(\w)(\w)(\w)$/, "$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/, "$1FF");
|
|
399
399
|
if (!hex.match(/^([0-9a-fA-F]{8})$/)) {
|
|
400
|
-
throw new Error(
|
|
400
|
+
throw new Error("Unknown hex color; " + input);
|
|
401
401
|
}
|
|
402
402
|
var rgba = hex.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(x) {
|
|
403
403
|
return parseInt(x, 16);
|
|
@@ -407,14 +407,14 @@ var Color = function() {
|
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
409
|
{
|
|
410
|
-
key:
|
|
410
|
+
key: "nameToRgb",
|
|
411
411
|
value: function nameToRgb(input) {
|
|
412
|
-
var hash = input.toLowerCase().replace(
|
|
413
|
-
return hex === undefined ? hex : Color.hexToRgb(hex.replace(/\-/g,
|
|
412
|
+
var hash = input.toLowerCase().replace("at", "T").replace(/[aeiouyldf]/g, "").replace("ght", "L").replace("rk", "D").slice(-5, 4), hex = colorNames[hash];
|
|
413
|
+
return hex === undefined ? hex : Color.hexToRgb(hex.replace(/\-/g, "00").padStart(6, "f"));
|
|
414
414
|
}
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
|
-
key:
|
|
417
|
+
key: "rgbToHsl",
|
|
418
418
|
value: function rgbToHsl(_ref) {
|
|
419
419
|
var _ref2 = slicedToArray(_ref, 4), r = _ref2[0], g = _ref2[1], b = _ref2[2], a = _ref2[3];
|
|
420
420
|
r /= 255;
|
|
@@ -449,7 +449,7 @@ var Color = function() {
|
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
|
-
key:
|
|
452
|
+
key: "hslToRgb",
|
|
453
453
|
value: function hslToRgb(_ref3) {
|
|
454
454
|
var _ref4 = slicedToArray(_ref3, 4), h = _ref4[0], s = _ref4[1], l = _ref4[2], a = _ref4[3];
|
|
455
455
|
var r = void 0, g = void 0, b = void 0;
|
|
@@ -488,7 +488,7 @@ var EventBucket = function() {
|
|
|
488
488
|
}
|
|
489
489
|
createClass(EventBucket, [
|
|
490
490
|
{
|
|
491
|
-
key:
|
|
491
|
+
key: "add",
|
|
492
492
|
value: function add(target, type, handler) {
|
|
493
493
|
target.addEventListener(type, handler, false);
|
|
494
494
|
this._events.push({
|
|
@@ -499,7 +499,7 @@ var EventBucket = function() {
|
|
|
499
499
|
}
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
|
-
key:
|
|
502
|
+
key: "remove",
|
|
503
503
|
value: function remove(target, type, handler) {
|
|
504
504
|
this._events = this._events.filter(function(e) {
|
|
505
505
|
var isMatch = true;
|
|
@@ -520,7 +520,7 @@ var EventBucket = function() {
|
|
|
520
520
|
}
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
|
-
key:
|
|
523
|
+
key: "destroy",
|
|
524
524
|
value: function destroy() {
|
|
525
525
|
this._events.forEach(function(e) {
|
|
526
526
|
return EventBucket._doRemove(e.target, e.type, e.handler);
|
|
@@ -530,7 +530,7 @@ var EventBucket = function() {
|
|
|
530
530
|
}
|
|
531
531
|
], [
|
|
532
532
|
{
|
|
533
|
-
key:
|
|
533
|
+
key: "_doRemove",
|
|
534
534
|
value: function _doRemove(target, type, handler) {
|
|
535
535
|
target.removeEventListener(type, handler, false);
|
|
536
536
|
}
|
|
@@ -539,7 +539,7 @@ var EventBucket = function() {
|
|
|
539
539
|
return EventBucket;
|
|
540
540
|
}();
|
|
541
541
|
function parseHTML(htmlString) {
|
|
542
|
-
var div = document.createElement(
|
|
542
|
+
var div = document.createElement("div");
|
|
543
543
|
div.innerHTML = htmlString;
|
|
544
544
|
return div.firstElementChild;
|
|
545
545
|
}
|
|
@@ -575,27 +575,27 @@ function dragTrack(eventBucket, area, callback) {
|
|
|
575
575
|
dragging = false;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
eventBucket.add(area,
|
|
578
|
+
eventBucket.add(area, "mousedown", function(e) {
|
|
579
579
|
onMouse(e, true);
|
|
580
580
|
});
|
|
581
|
-
eventBucket.add(area,
|
|
581
|
+
eventBucket.add(area, "touchstart", function(e) {
|
|
582
582
|
onTouch(e, true);
|
|
583
583
|
});
|
|
584
|
-
eventBucket.add(window,
|
|
585
|
-
eventBucket.add(area,
|
|
586
|
-
eventBucket.add(window,
|
|
584
|
+
eventBucket.add(window, "mousemove", onMouse);
|
|
585
|
+
eventBucket.add(area, "touchmove", onTouch);
|
|
586
|
+
eventBucket.add(window, "mouseup", function(e) {
|
|
587
587
|
dragging = false;
|
|
588
588
|
});
|
|
589
|
-
eventBucket.add(area,
|
|
589
|
+
eventBucket.add(area, "touchend", function(e) {
|
|
590
590
|
dragging = false;
|
|
591
591
|
});
|
|
592
|
-
eventBucket.add(area,
|
|
592
|
+
eventBucket.add(area, "touchcancel", function(e) {
|
|
593
593
|
dragging = false;
|
|
594
594
|
});
|
|
595
595
|
}
|
|
596
|
-
var BG_TRANSP =
|
|
596
|
+
var BG_TRANSP = "linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em";
|
|
597
597
|
var HUES = 360;
|
|
598
|
-
var EVENT_KEY =
|
|
598
|
+
var EVENT_KEY = "keydown", EVENT_CLICK_OUTSIDE = "mousedown", EVENT_TAB_MOVE = "focusin";
|
|
599
599
|
function $(selector, context) {
|
|
600
600
|
return (context || document).querySelector(selector);
|
|
601
601
|
}
|
|
@@ -606,6 +606,9 @@ function stopEvent(e) {
|
|
|
606
606
|
function onKey(bucket, target, keys, handler, stop) {
|
|
607
607
|
bucket.add(target, EVENT_KEY, function(e) {
|
|
608
608
|
if (keys.indexOf(e.key) >= 0) {
|
|
609
|
+
if (stop) {
|
|
610
|
+
stopEvent(e);
|
|
611
|
+
}
|
|
609
612
|
handler(e);
|
|
610
613
|
}
|
|
611
614
|
});
|
|
@@ -614,13 +617,13 @@ var Picker = function() {
|
|
|
614
617
|
function Picker(options) {
|
|
615
618
|
classCallCheck(this, Picker);
|
|
616
619
|
this.settings = {
|
|
617
|
-
popup:
|
|
618
|
-
layout:
|
|
620
|
+
popup: "right",
|
|
621
|
+
layout: "default",
|
|
619
622
|
alpha: true,
|
|
620
623
|
editor: true,
|
|
621
|
-
editorFormat:
|
|
624
|
+
editorFormat: "hex",
|
|
622
625
|
cancelButton: false,
|
|
623
|
-
defaultColor:
|
|
626
|
+
defaultColor: "#0cf"
|
|
624
627
|
};
|
|
625
628
|
this._events = new EventBucket();
|
|
626
629
|
this.onChange = null;
|
|
@@ -631,7 +634,7 @@ var Picker = function() {
|
|
|
631
634
|
}
|
|
632
635
|
createClass(Picker, [
|
|
633
636
|
{
|
|
634
|
-
key:
|
|
637
|
+
key: "setOptions",
|
|
635
638
|
value: function setOptions(options) {
|
|
636
639
|
var _this = this;
|
|
637
640
|
if (!options) {
|
|
@@ -640,6 +643,9 @@ var Picker = function() {
|
|
|
640
643
|
var settings = this.settings;
|
|
641
644
|
function transfer(source, target, skipKeys) {
|
|
642
645
|
for(var key in source){
|
|
646
|
+
if (skipKeys && skipKeys.indexOf(key) >= 0) {
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
643
649
|
target[key] = source[key];
|
|
644
650
|
}
|
|
645
651
|
}
|
|
@@ -673,11 +679,11 @@ var Picker = function() {
|
|
|
673
679
|
var openProxy = function openProxy(e) {
|
|
674
680
|
return _this.openHandler(e);
|
|
675
681
|
};
|
|
676
|
-
this._events.add(parent,
|
|
682
|
+
this._events.add(parent, "click", openProxy);
|
|
677
683
|
onKey(this._events, parent, [
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
684
|
+
" ",
|
|
685
|
+
"Spacebar",
|
|
686
|
+
"Enter"
|
|
681
687
|
], openProxy);
|
|
682
688
|
this._popupInited = true;
|
|
683
689
|
} else if (options.parent && !settings.popup) {
|
|
@@ -686,11 +692,11 @@ var Picker = function() {
|
|
|
686
692
|
}
|
|
687
693
|
},
|
|
688
694
|
{
|
|
689
|
-
key:
|
|
695
|
+
key: "openHandler",
|
|
690
696
|
value: function openHandler(e) {
|
|
691
697
|
if (this.show()) {
|
|
692
698
|
e && e.preventDefault();
|
|
693
|
-
this.settings.parent.style.pointerEvents =
|
|
699
|
+
this.settings.parent.style.pointerEvents = "none";
|
|
694
700
|
var toFocus = e && e.type === EVENT_KEY ? this._domEdit : this.domElement;
|
|
695
701
|
setTimeout(function() {
|
|
696
702
|
return toFocus.focus();
|
|
@@ -702,7 +708,7 @@ var Picker = function() {
|
|
|
702
708
|
}
|
|
703
709
|
},
|
|
704
710
|
{
|
|
705
|
-
key:
|
|
711
|
+
key: "closeHandler",
|
|
706
712
|
value: function closeHandler(e) {
|
|
707
713
|
var event = e && e.type;
|
|
708
714
|
var doHide = false;
|
|
@@ -718,7 +724,7 @@ var Picker = function() {
|
|
|
718
724
|
doHide = true;
|
|
719
725
|
}
|
|
720
726
|
if (doHide && this.hide()) {
|
|
721
|
-
this.settings.parent.style.pointerEvents =
|
|
727
|
+
this.settings.parent.style.pointerEvents = "";
|
|
722
728
|
if (event !== EVENT_CLICK_OUTSIDE) {
|
|
723
729
|
this.settings.parent.focus();
|
|
724
730
|
}
|
|
@@ -729,7 +735,7 @@ var Picker = function() {
|
|
|
729
735
|
}
|
|
730
736
|
},
|
|
731
737
|
{
|
|
732
|
-
key:
|
|
738
|
+
key: "movePopup",
|
|
733
739
|
value: function movePopup(options, open) {
|
|
734
740
|
this.closeHandler();
|
|
735
741
|
this.setOptions(options);
|
|
@@ -739,7 +745,7 @@ var Picker = function() {
|
|
|
739
745
|
}
|
|
740
746
|
},
|
|
741
747
|
{
|
|
742
|
-
key:
|
|
748
|
+
key: "setColor",
|
|
743
749
|
value: function setColor(color, silent) {
|
|
744
750
|
this._setColor(color, {
|
|
745
751
|
silent: silent
|
|
@@ -747,9 +753,9 @@ var Picker = function() {
|
|
|
747
753
|
}
|
|
748
754
|
},
|
|
749
755
|
{
|
|
750
|
-
key:
|
|
756
|
+
key: "_setColor",
|
|
751
757
|
value: function _setColor(color, flags) {
|
|
752
|
-
if (typeof color ===
|
|
758
|
+
if (typeof color === "string") {
|
|
753
759
|
color = color.trim();
|
|
754
760
|
}
|
|
755
761
|
if (!color) {
|
|
@@ -775,13 +781,13 @@ var Picker = function() {
|
|
|
775
781
|
}
|
|
776
782
|
},
|
|
777
783
|
{
|
|
778
|
-
key:
|
|
784
|
+
key: "setColour",
|
|
779
785
|
value: function setColour(colour, silent) {
|
|
780
786
|
this.setColor(colour, silent);
|
|
781
787
|
}
|
|
782
788
|
},
|
|
783
789
|
{
|
|
784
|
-
key:
|
|
790
|
+
key: "show",
|
|
785
791
|
value: function show() {
|
|
786
792
|
var parent = this.settings.parent;
|
|
787
793
|
if (!parent) {
|
|
@@ -795,25 +801,25 @@ var Picker = function() {
|
|
|
795
801
|
var html = this.settings.template || '<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>';
|
|
796
802
|
var wrapper = parseHTML(html);
|
|
797
803
|
this.domElement = wrapper;
|
|
798
|
-
this._domH = $(
|
|
799
|
-
this._domSL = $(
|
|
800
|
-
this._domA = $(
|
|
801
|
-
this._domEdit = $(
|
|
802
|
-
this._domSample = $(
|
|
803
|
-
this._domOkay = $(
|
|
804
|
-
this._domCancel = $(
|
|
805
|
-
wrapper.classList.add(
|
|
804
|
+
this._domH = $(".picker_hue", wrapper);
|
|
805
|
+
this._domSL = $(".picker_sl", wrapper);
|
|
806
|
+
this._domA = $(".picker_alpha", wrapper);
|
|
807
|
+
this._domEdit = $(".picker_editor input", wrapper);
|
|
808
|
+
this._domSample = $(".picker_sample", wrapper);
|
|
809
|
+
this._domOkay = $(".picker_done button", wrapper);
|
|
810
|
+
this._domCancel = $(".picker_cancel button", wrapper);
|
|
811
|
+
wrapper.classList.add("layout_" + this.settings.layout);
|
|
806
812
|
if (!this.settings.alpha) {
|
|
807
|
-
wrapper.classList.add(
|
|
813
|
+
wrapper.classList.add("no_alpha");
|
|
808
814
|
}
|
|
809
815
|
if (!this.settings.editor) {
|
|
810
|
-
wrapper.classList.add(
|
|
816
|
+
wrapper.classList.add("no_editor");
|
|
811
817
|
}
|
|
812
818
|
if (!this.settings.cancelButton) {
|
|
813
|
-
wrapper.classList.add(
|
|
819
|
+
wrapper.classList.add("no_cancel");
|
|
814
820
|
}
|
|
815
821
|
this._ifPopup(function() {
|
|
816
|
-
return wrapper.classList.add(
|
|
822
|
+
return wrapper.classList.add("popup");
|
|
817
823
|
});
|
|
818
824
|
this._setPosition();
|
|
819
825
|
if (this.colour) {
|
|
@@ -826,13 +832,13 @@ var Picker = function() {
|
|
|
826
832
|
}
|
|
827
833
|
},
|
|
828
834
|
{
|
|
829
|
-
key:
|
|
835
|
+
key: "hide",
|
|
830
836
|
value: function hide() {
|
|
831
837
|
return this._toggleDOM(false);
|
|
832
838
|
}
|
|
833
839
|
},
|
|
834
840
|
{
|
|
835
|
-
key:
|
|
841
|
+
key: "destroy",
|
|
836
842
|
value: function destroy() {
|
|
837
843
|
this._events.destroy();
|
|
838
844
|
if (this.domElement) {
|
|
@@ -841,14 +847,14 @@ var Picker = function() {
|
|
|
841
847
|
}
|
|
842
848
|
},
|
|
843
849
|
{
|
|
844
|
-
key:
|
|
850
|
+
key: "_bindEvents",
|
|
845
851
|
value: function _bindEvents() {
|
|
846
852
|
var _this2 = this;
|
|
847
853
|
var that = this, dom = this.domElement, events = this._events;
|
|
848
854
|
function addEvent(target, type, handler) {
|
|
849
855
|
events.add(target, type, handler);
|
|
850
856
|
}
|
|
851
|
-
addEvent(dom,
|
|
857
|
+
addEvent(dom, "click", function(e) {
|
|
852
858
|
return e.preventDefault();
|
|
853
859
|
});
|
|
854
860
|
dragTrack(events, this._domH, function(x, y) {
|
|
@@ -864,13 +870,13 @@ var Picker = function() {
|
|
|
864
870
|
}
|
|
865
871
|
var editInput = this._domEdit;
|
|
866
872
|
{
|
|
867
|
-
addEvent(editInput,
|
|
873
|
+
addEvent(editInput, "input", function(e) {
|
|
868
874
|
that._setColor(this.value, {
|
|
869
875
|
fromEditor: true,
|
|
870
876
|
failSilently: true
|
|
871
877
|
});
|
|
872
878
|
});
|
|
873
|
-
addEvent(editInput,
|
|
879
|
+
addEvent(editInput, "focus", function(e) {
|
|
874
880
|
var input = this;
|
|
875
881
|
if (input.selectionStart === input.selectionEnd) {
|
|
876
882
|
input.select();
|
|
@@ -884,15 +890,15 @@ var Picker = function() {
|
|
|
884
890
|
addEvent(window, EVENT_CLICK_OUTSIDE, popupCloseProxy);
|
|
885
891
|
addEvent(window, EVENT_TAB_MOVE, popupCloseProxy);
|
|
886
892
|
onKey(events, dom, [
|
|
887
|
-
|
|
888
|
-
|
|
893
|
+
"Esc",
|
|
894
|
+
"Escape"
|
|
889
895
|
], popupCloseProxy);
|
|
890
896
|
var timeKeeper = function timeKeeper(e) {
|
|
891
897
|
_this2.__containedEvent = e.timeStamp;
|
|
892
898
|
};
|
|
893
899
|
addEvent(dom, EVENT_CLICK_OUTSIDE, timeKeeper);
|
|
894
900
|
addEvent(dom, EVENT_TAB_MOVE, timeKeeper);
|
|
895
|
-
addEvent(_this2._domCancel,
|
|
901
|
+
addEvent(_this2._domCancel, "click", popupCloseProxy);
|
|
896
902
|
});
|
|
897
903
|
var onDoneProxy = function onDoneProxy(e) {
|
|
898
904
|
_this2._ifPopup(function() {
|
|
@@ -902,29 +908,29 @@ var Picker = function() {
|
|
|
902
908
|
_this2.onDone(_this2.colour);
|
|
903
909
|
}
|
|
904
910
|
};
|
|
905
|
-
addEvent(this._domOkay,
|
|
911
|
+
addEvent(this._domOkay, "click", onDoneProxy);
|
|
906
912
|
onKey(events, dom, [
|
|
907
|
-
|
|
913
|
+
"Enter"
|
|
908
914
|
], onDoneProxy);
|
|
909
915
|
}
|
|
910
916
|
},
|
|
911
917
|
{
|
|
912
|
-
key:
|
|
918
|
+
key: "_setPosition",
|
|
913
919
|
value: function _setPosition() {
|
|
914
920
|
var parent = this.settings.parent, elm = this.domElement;
|
|
915
921
|
if (parent !== elm.parentNode) {
|
|
916
922
|
parent.appendChild(elm);
|
|
917
923
|
}
|
|
918
924
|
this._ifPopup(function(popup) {
|
|
919
|
-
if (getComputedStyle(parent).position ===
|
|
920
|
-
parent.style.position =
|
|
925
|
+
if (getComputedStyle(parent).position === "static") {
|
|
926
|
+
parent.style.position = "relative";
|
|
921
927
|
}
|
|
922
|
-
var cssClass = popup === true ?
|
|
928
|
+
var cssClass = popup === true ? "popup_right" : "popup_" + popup;
|
|
923
929
|
[
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
930
|
+
"popup_top",
|
|
931
|
+
"popup_bottom",
|
|
932
|
+
"popup_left",
|
|
933
|
+
"popup_right"
|
|
928
934
|
].forEach(function(c) {
|
|
929
935
|
if (c === cssClass) {
|
|
930
936
|
elm.classList.add(c);
|
|
@@ -937,7 +943,7 @@ var Picker = function() {
|
|
|
937
943
|
}
|
|
938
944
|
},
|
|
939
945
|
{
|
|
940
|
-
key:
|
|
946
|
+
key: "_setHSLA",
|
|
941
947
|
value: function _setHSLA(h, s, l, a, flags) {
|
|
942
948
|
flags = flags || {};
|
|
943
949
|
var col = this.colour, hsla = col.hsla;
|
|
@@ -959,19 +965,19 @@ var Picker = function() {
|
|
|
959
965
|
}
|
|
960
966
|
},
|
|
961
967
|
{
|
|
962
|
-
key:
|
|
968
|
+
key: "_updateUI",
|
|
963
969
|
value: function _updateUI(flags) {
|
|
964
970
|
if (!this.domElement) {
|
|
965
971
|
return;
|
|
966
972
|
}
|
|
967
973
|
flags = flags || {};
|
|
968
|
-
var col = this.colour, hsl = col.hsla, cssHue =
|
|
969
|
-
var uiH = this._domH, uiSL = this._domSL, uiA = this._domA, thumbH = $(
|
|
974
|
+
var col = this.colour, hsl = col.hsla, cssHue = "hsl(" + hsl[0] * HUES + ", 100%, 50%)", cssHSL = col.hslString, cssHSLA = col.hslaString;
|
|
975
|
+
var uiH = this._domH, uiSL = this._domSL, uiA = this._domA, thumbH = $(".picker_selector", uiH), thumbSL = $(".picker_selector", uiSL), thumbA = $(".picker_selector", uiA);
|
|
970
976
|
function posX(parent, child, relX) {
|
|
971
|
-
child.style.left = relX * 100 +
|
|
977
|
+
child.style.left = relX * 100 + "%";
|
|
972
978
|
}
|
|
973
979
|
function posY(parent, child, relY) {
|
|
974
|
-
child.style.top = relY * 100 +
|
|
980
|
+
child.style.top = relY * 100 + "%";
|
|
975
981
|
}
|
|
976
982
|
posX(uiH, thumbH, hsl[0]);
|
|
977
983
|
this._domSL.style.backgroundColor = this._domH.style.color = cssHue;
|
|
@@ -979,19 +985,19 @@ var Picker = function() {
|
|
|
979
985
|
posY(uiSL, thumbSL, 1 - hsl[2]);
|
|
980
986
|
uiSL.style.color = cssHSL;
|
|
981
987
|
posY(uiA, thumbA, 1 - hsl[3]);
|
|
982
|
-
var opaque = cssHSL, transp = opaque.replace(
|
|
988
|
+
var opaque = cssHSL, transp = opaque.replace("hsl", "hsla").replace(")", ", 0)"), bg = "linear-gradient(" + [
|
|
983
989
|
opaque,
|
|
984
990
|
transp
|
|
985
|
-
] +
|
|
986
|
-
this._domA.style.background = bg +
|
|
991
|
+
] + ")";
|
|
992
|
+
this._domA.style.background = bg + ", " + BG_TRANSP;
|
|
987
993
|
if (!flags.fromEditor) {
|
|
988
994
|
var format = this.settings.editorFormat, alpha = this.settings.alpha;
|
|
989
995
|
var value = void 0;
|
|
990
996
|
switch(format){
|
|
991
|
-
case
|
|
997
|
+
case "rgb":
|
|
992
998
|
value = col.printRGB(alpha);
|
|
993
999
|
break;
|
|
994
|
-
case
|
|
1000
|
+
case "hsl":
|
|
995
1001
|
value = col.printHSL(alpha);
|
|
996
1002
|
break;
|
|
997
1003
|
default:
|
|
@@ -1003,7 +1009,7 @@ var Picker = function() {
|
|
|
1003
1009
|
}
|
|
1004
1010
|
},
|
|
1005
1011
|
{
|
|
1006
|
-
key:
|
|
1012
|
+
key: "_ifPopup",
|
|
1007
1013
|
value: function _ifPopup(actionIf, actionElse) {
|
|
1008
1014
|
if (this.settings.parent && this.settings.popup) {
|
|
1009
1015
|
actionIf && actionIf(this.settings.popup);
|
|
@@ -1013,13 +1019,13 @@ var Picker = function() {
|
|
|
1013
1019
|
}
|
|
1014
1020
|
},
|
|
1015
1021
|
{
|
|
1016
|
-
key:
|
|
1022
|
+
key: "_toggleDOM",
|
|
1017
1023
|
value: function _toggleDOM(toVisible) {
|
|
1018
1024
|
var dom = this.domElement;
|
|
1019
1025
|
if (!dom) {
|
|
1020
1026
|
return false;
|
|
1021
1027
|
}
|
|
1022
|
-
var displayStyle = toVisible ?
|
|
1028
|
+
var displayStyle = toVisible ? "" : "none", toggle = dom.style.display !== displayStyle;
|
|
1023
1029
|
if (toggle) {
|
|
1024
1030
|
dom.style.display = displayStyle;
|
|
1025
1031
|
}
|
|
@@ -1030,7 +1036,7 @@ var Picker = function() {
|
|
|
1030
1036
|
return Picker;
|
|
1031
1037
|
}();
|
|
1032
1038
|
{
|
|
1033
|
-
var style = document.createElement(
|
|
1039
|
+
var style = document.createElement("style");
|
|
1034
1040
|
style.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}';
|
|
1035
1041
|
document.documentElement.firstElementChild.appendChild(style);
|
|
1036
1042
|
Picker.StyleElement = style;
|