@digipair/skill-web-jsoneditor 0.112.3 → 0.114.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/README.md +7 -0
- package/{index.esm.js → dist/index.cjs.js} +18545 -18139
- package/{index.cjs.js → dist/index.esm.js} +18543 -18143
- package/{libs/skill-web-jsoneditor → dist}/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-web-jsoneditor → dist}/src/lib/jsoneditor.element.d.ts +1 -0
- package/dist/src/lib/jsoneditor.element.d.ts.map +1 -0
- package/dist/src/lib/skill-web-jsoneditor.d.ts +2 -0
- package/dist/src/lib/skill-web-jsoneditor.d.ts.map +1 -0
- package/{vanilla-picker.cjs.js → dist/vanilla-picker.cjs.js} +256 -262
- package/{vanilla-picker.esm.js → dist/vanilla-picker.esm.js} +255 -261
- package/package.json +26 -5
- package/index.d.ts +0 -1
- package/libs/skill-web-jsoneditor/src/lib/skill-web-jsoneditor.d.ts +0 -1
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/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,9 +606,6 @@ 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
|
-
}
|
|
612
609
|
handler(e);
|
|
613
610
|
}
|
|
614
611
|
});
|
|
@@ -617,13 +614,13 @@ var Picker = function() {
|
|
|
617
614
|
function Picker(options) {
|
|
618
615
|
classCallCheck(this, Picker);
|
|
619
616
|
this.settings = {
|
|
620
|
-
popup:
|
|
621
|
-
layout:
|
|
617
|
+
popup: 'right',
|
|
618
|
+
layout: 'default',
|
|
622
619
|
alpha: true,
|
|
623
620
|
editor: true,
|
|
624
|
-
editorFormat:
|
|
621
|
+
editorFormat: 'hex',
|
|
625
622
|
cancelButton: false,
|
|
626
|
-
defaultColor:
|
|
623
|
+
defaultColor: '#0cf'
|
|
627
624
|
};
|
|
628
625
|
this._events = new EventBucket();
|
|
629
626
|
this.onChange = null;
|
|
@@ -634,7 +631,7 @@ var Picker = function() {
|
|
|
634
631
|
}
|
|
635
632
|
createClass(Picker, [
|
|
636
633
|
{
|
|
637
|
-
key:
|
|
634
|
+
key: 'setOptions',
|
|
638
635
|
value: function setOptions(options) {
|
|
639
636
|
var _this = this;
|
|
640
637
|
if (!options) {
|
|
@@ -643,9 +640,6 @@ var Picker = function() {
|
|
|
643
640
|
var settings = this.settings;
|
|
644
641
|
function transfer(source, target, skipKeys) {
|
|
645
642
|
for(var key in source){
|
|
646
|
-
if (skipKeys && skipKeys.indexOf(key) >= 0) {
|
|
647
|
-
continue;
|
|
648
|
-
}
|
|
649
643
|
target[key] = source[key];
|
|
650
644
|
}
|
|
651
645
|
}
|
|
@@ -679,11 +673,11 @@ var Picker = function() {
|
|
|
679
673
|
var openProxy = function openProxy(e) {
|
|
680
674
|
return _this.openHandler(e);
|
|
681
675
|
};
|
|
682
|
-
this._events.add(parent,
|
|
676
|
+
this._events.add(parent, 'click', openProxy);
|
|
683
677
|
onKey(this._events, parent, [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
678
|
+
' ',
|
|
679
|
+
'Spacebar',
|
|
680
|
+
'Enter'
|
|
687
681
|
], openProxy);
|
|
688
682
|
this._popupInited = true;
|
|
689
683
|
} else if (options.parent && !settings.popup) {
|
|
@@ -692,11 +686,11 @@ var Picker = function() {
|
|
|
692
686
|
}
|
|
693
687
|
},
|
|
694
688
|
{
|
|
695
|
-
key:
|
|
689
|
+
key: 'openHandler',
|
|
696
690
|
value: function openHandler(e) {
|
|
697
691
|
if (this.show()) {
|
|
698
692
|
e && e.preventDefault();
|
|
699
|
-
this.settings.parent.style.pointerEvents =
|
|
693
|
+
this.settings.parent.style.pointerEvents = 'none';
|
|
700
694
|
var toFocus = e && e.type === EVENT_KEY ? this._domEdit : this.domElement;
|
|
701
695
|
setTimeout(function() {
|
|
702
696
|
return toFocus.focus();
|
|
@@ -708,7 +702,7 @@ var Picker = function() {
|
|
|
708
702
|
}
|
|
709
703
|
},
|
|
710
704
|
{
|
|
711
|
-
key:
|
|
705
|
+
key: 'closeHandler',
|
|
712
706
|
value: function closeHandler(e) {
|
|
713
707
|
var event = e && e.type;
|
|
714
708
|
var doHide = false;
|
|
@@ -724,7 +718,7 @@ var Picker = function() {
|
|
|
724
718
|
doHide = true;
|
|
725
719
|
}
|
|
726
720
|
if (doHide && this.hide()) {
|
|
727
|
-
this.settings.parent.style.pointerEvents =
|
|
721
|
+
this.settings.parent.style.pointerEvents = '';
|
|
728
722
|
if (event !== EVENT_CLICK_OUTSIDE) {
|
|
729
723
|
this.settings.parent.focus();
|
|
730
724
|
}
|
|
@@ -735,7 +729,7 @@ var Picker = function() {
|
|
|
735
729
|
}
|
|
736
730
|
},
|
|
737
731
|
{
|
|
738
|
-
key:
|
|
732
|
+
key: 'movePopup',
|
|
739
733
|
value: function movePopup(options, open) {
|
|
740
734
|
this.closeHandler();
|
|
741
735
|
this.setOptions(options);
|
|
@@ -745,7 +739,7 @@ var Picker = function() {
|
|
|
745
739
|
}
|
|
746
740
|
},
|
|
747
741
|
{
|
|
748
|
-
key:
|
|
742
|
+
key: 'setColor',
|
|
749
743
|
value: function setColor(color, silent) {
|
|
750
744
|
this._setColor(color, {
|
|
751
745
|
silent: silent
|
|
@@ -753,9 +747,9 @@ var Picker = function() {
|
|
|
753
747
|
}
|
|
754
748
|
},
|
|
755
749
|
{
|
|
756
|
-
key:
|
|
750
|
+
key: '_setColor',
|
|
757
751
|
value: function _setColor(color, flags) {
|
|
758
|
-
if (typeof color ===
|
|
752
|
+
if (typeof color === 'string') {
|
|
759
753
|
color = color.trim();
|
|
760
754
|
}
|
|
761
755
|
if (!color) {
|
|
@@ -781,13 +775,13 @@ var Picker = function() {
|
|
|
781
775
|
}
|
|
782
776
|
},
|
|
783
777
|
{
|
|
784
|
-
key:
|
|
778
|
+
key: 'setColour',
|
|
785
779
|
value: function setColour(colour, silent) {
|
|
786
780
|
this.setColor(colour, silent);
|
|
787
781
|
}
|
|
788
782
|
},
|
|
789
783
|
{
|
|
790
|
-
key:
|
|
784
|
+
key: 'show',
|
|
791
785
|
value: function show() {
|
|
792
786
|
var parent = this.settings.parent;
|
|
793
787
|
if (!parent) {
|
|
@@ -801,25 +795,25 @@ var Picker = function() {
|
|
|
801
795
|
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>';
|
|
802
796
|
var wrapper = parseHTML(html);
|
|
803
797
|
this.domElement = wrapper;
|
|
804
|
-
this._domH = $(
|
|
805
|
-
this._domSL = $(
|
|
806
|
-
this._domA = $(
|
|
807
|
-
this._domEdit = $(
|
|
808
|
-
this._domSample = $(
|
|
809
|
-
this._domOkay = $(
|
|
810
|
-
this._domCancel = $(
|
|
811
|
-
wrapper.classList.add(
|
|
798
|
+
this._domH = $('.picker_hue', wrapper);
|
|
799
|
+
this._domSL = $('.picker_sl', wrapper);
|
|
800
|
+
this._domA = $('.picker_alpha', wrapper);
|
|
801
|
+
this._domEdit = $('.picker_editor input', wrapper);
|
|
802
|
+
this._domSample = $('.picker_sample', wrapper);
|
|
803
|
+
this._domOkay = $('.picker_done button', wrapper);
|
|
804
|
+
this._domCancel = $('.picker_cancel button', wrapper);
|
|
805
|
+
wrapper.classList.add('layout_' + this.settings.layout);
|
|
812
806
|
if (!this.settings.alpha) {
|
|
813
|
-
wrapper.classList.add(
|
|
807
|
+
wrapper.classList.add('no_alpha');
|
|
814
808
|
}
|
|
815
809
|
if (!this.settings.editor) {
|
|
816
|
-
wrapper.classList.add(
|
|
810
|
+
wrapper.classList.add('no_editor');
|
|
817
811
|
}
|
|
818
812
|
if (!this.settings.cancelButton) {
|
|
819
|
-
wrapper.classList.add(
|
|
813
|
+
wrapper.classList.add('no_cancel');
|
|
820
814
|
}
|
|
821
815
|
this._ifPopup(function() {
|
|
822
|
-
return wrapper.classList.add(
|
|
816
|
+
return wrapper.classList.add('popup');
|
|
823
817
|
});
|
|
824
818
|
this._setPosition();
|
|
825
819
|
if (this.colour) {
|
|
@@ -832,13 +826,13 @@ var Picker = function() {
|
|
|
832
826
|
}
|
|
833
827
|
},
|
|
834
828
|
{
|
|
835
|
-
key:
|
|
829
|
+
key: 'hide',
|
|
836
830
|
value: function hide() {
|
|
837
831
|
return this._toggleDOM(false);
|
|
838
832
|
}
|
|
839
833
|
},
|
|
840
834
|
{
|
|
841
|
-
key:
|
|
835
|
+
key: 'destroy',
|
|
842
836
|
value: function destroy() {
|
|
843
837
|
this._events.destroy();
|
|
844
838
|
if (this.domElement) {
|
|
@@ -847,14 +841,14 @@ var Picker = function() {
|
|
|
847
841
|
}
|
|
848
842
|
},
|
|
849
843
|
{
|
|
850
|
-
key:
|
|
844
|
+
key: '_bindEvents',
|
|
851
845
|
value: function _bindEvents() {
|
|
852
846
|
var _this2 = this;
|
|
853
847
|
var that = this, dom = this.domElement, events = this._events;
|
|
854
848
|
function addEvent(target, type, handler) {
|
|
855
849
|
events.add(target, type, handler);
|
|
856
850
|
}
|
|
857
|
-
addEvent(dom,
|
|
851
|
+
addEvent(dom, 'click', function(e) {
|
|
858
852
|
return e.preventDefault();
|
|
859
853
|
});
|
|
860
854
|
dragTrack(events, this._domH, function(x, y) {
|
|
@@ -870,13 +864,13 @@ var Picker = function() {
|
|
|
870
864
|
}
|
|
871
865
|
var editInput = this._domEdit;
|
|
872
866
|
{
|
|
873
|
-
addEvent(editInput,
|
|
867
|
+
addEvent(editInput, 'input', function(e) {
|
|
874
868
|
that._setColor(this.value, {
|
|
875
869
|
fromEditor: true,
|
|
876
870
|
failSilently: true
|
|
877
871
|
});
|
|
878
872
|
});
|
|
879
|
-
addEvent(editInput,
|
|
873
|
+
addEvent(editInput, 'focus', function(e) {
|
|
880
874
|
var input = this;
|
|
881
875
|
if (input.selectionStart === input.selectionEnd) {
|
|
882
876
|
input.select();
|
|
@@ -890,15 +884,15 @@ var Picker = function() {
|
|
|
890
884
|
addEvent(window, EVENT_CLICK_OUTSIDE, popupCloseProxy);
|
|
891
885
|
addEvent(window, EVENT_TAB_MOVE, popupCloseProxy);
|
|
892
886
|
onKey(events, dom, [
|
|
893
|
-
|
|
894
|
-
|
|
887
|
+
'Esc',
|
|
888
|
+
'Escape'
|
|
895
889
|
], popupCloseProxy);
|
|
896
890
|
var timeKeeper = function timeKeeper(e) {
|
|
897
891
|
_this2.__containedEvent = e.timeStamp;
|
|
898
892
|
};
|
|
899
893
|
addEvent(dom, EVENT_CLICK_OUTSIDE, timeKeeper);
|
|
900
894
|
addEvent(dom, EVENT_TAB_MOVE, timeKeeper);
|
|
901
|
-
addEvent(_this2._domCancel,
|
|
895
|
+
addEvent(_this2._domCancel, 'click', popupCloseProxy);
|
|
902
896
|
});
|
|
903
897
|
var onDoneProxy = function onDoneProxy(e) {
|
|
904
898
|
_this2._ifPopup(function() {
|
|
@@ -908,29 +902,29 @@ var Picker = function() {
|
|
|
908
902
|
_this2.onDone(_this2.colour);
|
|
909
903
|
}
|
|
910
904
|
};
|
|
911
|
-
addEvent(this._domOkay,
|
|
905
|
+
addEvent(this._domOkay, 'click', onDoneProxy);
|
|
912
906
|
onKey(events, dom, [
|
|
913
|
-
|
|
907
|
+
'Enter'
|
|
914
908
|
], onDoneProxy);
|
|
915
909
|
}
|
|
916
910
|
},
|
|
917
911
|
{
|
|
918
|
-
key:
|
|
912
|
+
key: '_setPosition',
|
|
919
913
|
value: function _setPosition() {
|
|
920
914
|
var parent = this.settings.parent, elm = this.domElement;
|
|
921
915
|
if (parent !== elm.parentNode) {
|
|
922
916
|
parent.appendChild(elm);
|
|
923
917
|
}
|
|
924
918
|
this._ifPopup(function(popup) {
|
|
925
|
-
if (getComputedStyle(parent).position ===
|
|
926
|
-
parent.style.position =
|
|
919
|
+
if (getComputedStyle(parent).position === 'static') {
|
|
920
|
+
parent.style.position = 'relative';
|
|
927
921
|
}
|
|
928
|
-
var cssClass = popup === true ?
|
|
922
|
+
var cssClass = popup === true ? 'popup_right' : 'popup_' + popup;
|
|
929
923
|
[
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
924
|
+
'popup_top',
|
|
925
|
+
'popup_bottom',
|
|
926
|
+
'popup_left',
|
|
927
|
+
'popup_right'
|
|
934
928
|
].forEach(function(c) {
|
|
935
929
|
if (c === cssClass) {
|
|
936
930
|
elm.classList.add(c);
|
|
@@ -943,7 +937,7 @@ var Picker = function() {
|
|
|
943
937
|
}
|
|
944
938
|
},
|
|
945
939
|
{
|
|
946
|
-
key:
|
|
940
|
+
key: '_setHSLA',
|
|
947
941
|
value: function _setHSLA(h, s, l, a, flags) {
|
|
948
942
|
flags = flags || {};
|
|
949
943
|
var col = this.colour, hsla = col.hsla;
|
|
@@ -965,19 +959,19 @@ var Picker = function() {
|
|
|
965
959
|
}
|
|
966
960
|
},
|
|
967
961
|
{
|
|
968
|
-
key:
|
|
962
|
+
key: '_updateUI',
|
|
969
963
|
value: function _updateUI(flags) {
|
|
970
964
|
if (!this.domElement) {
|
|
971
965
|
return;
|
|
972
966
|
}
|
|
973
967
|
flags = flags || {};
|
|
974
|
-
var col = this.colour, hsl = col.hsla, cssHue =
|
|
975
|
-
var uiH = this._domH, uiSL = this._domSL, uiA = this._domA, thumbH = $(
|
|
968
|
+
var col = this.colour, hsl = col.hsla, cssHue = 'hsl(' + hsl[0] * HUES + ', 100%, 50%)', cssHSL = col.hslString, cssHSLA = col.hslaString;
|
|
969
|
+
var uiH = this._domH, uiSL = this._domSL, uiA = this._domA, thumbH = $('.picker_selector', uiH), thumbSL = $('.picker_selector', uiSL), thumbA = $('.picker_selector', uiA);
|
|
976
970
|
function posX(parent, child, relX) {
|
|
977
|
-
child.style.left = relX * 100 +
|
|
971
|
+
child.style.left = relX * 100 + '%';
|
|
978
972
|
}
|
|
979
973
|
function posY(parent, child, relY) {
|
|
980
|
-
child.style.top = relY * 100 +
|
|
974
|
+
child.style.top = relY * 100 + '%';
|
|
981
975
|
}
|
|
982
976
|
posX(uiH, thumbH, hsl[0]);
|
|
983
977
|
this._domSL.style.backgroundColor = this._domH.style.color = cssHue;
|
|
@@ -985,19 +979,19 @@ var Picker = function() {
|
|
|
985
979
|
posY(uiSL, thumbSL, 1 - hsl[2]);
|
|
986
980
|
uiSL.style.color = cssHSL;
|
|
987
981
|
posY(uiA, thumbA, 1 - hsl[3]);
|
|
988
|
-
var opaque = cssHSL, transp = opaque.replace(
|
|
982
|
+
var opaque = cssHSL, transp = opaque.replace('hsl', 'hsla').replace(')', ', 0)'), bg = 'linear-gradient(' + [
|
|
989
983
|
opaque,
|
|
990
984
|
transp
|
|
991
|
-
] +
|
|
992
|
-
this._domA.style.background = bg +
|
|
985
|
+
] + ')';
|
|
986
|
+
this._domA.style.background = bg + ', ' + BG_TRANSP;
|
|
993
987
|
if (!flags.fromEditor) {
|
|
994
988
|
var format = this.settings.editorFormat, alpha = this.settings.alpha;
|
|
995
989
|
var value = void 0;
|
|
996
990
|
switch(format){
|
|
997
|
-
case
|
|
991
|
+
case 'rgb':
|
|
998
992
|
value = col.printRGB(alpha);
|
|
999
993
|
break;
|
|
1000
|
-
case
|
|
994
|
+
case 'hsl':
|
|
1001
995
|
value = col.printHSL(alpha);
|
|
1002
996
|
break;
|
|
1003
997
|
default:
|
|
@@ -1009,7 +1003,7 @@ var Picker = function() {
|
|
|
1009
1003
|
}
|
|
1010
1004
|
},
|
|
1011
1005
|
{
|
|
1012
|
-
key:
|
|
1006
|
+
key: '_ifPopup',
|
|
1013
1007
|
value: function _ifPopup(actionIf, actionElse) {
|
|
1014
1008
|
if (this.settings.parent && this.settings.popup) {
|
|
1015
1009
|
actionIf && actionIf(this.settings.popup);
|
|
@@ -1019,13 +1013,13 @@ var Picker = function() {
|
|
|
1019
1013
|
}
|
|
1020
1014
|
},
|
|
1021
1015
|
{
|
|
1022
|
-
key:
|
|
1016
|
+
key: '_toggleDOM',
|
|
1023
1017
|
value: function _toggleDOM(toVisible) {
|
|
1024
1018
|
var dom = this.domElement;
|
|
1025
1019
|
if (!dom) {
|
|
1026
1020
|
return false;
|
|
1027
1021
|
}
|
|
1028
|
-
var displayStyle = toVisible ?
|
|
1022
|
+
var displayStyle = toVisible ? '' : 'none', toggle = dom.style.display !== displayStyle;
|
|
1029
1023
|
if (toggle) {
|
|
1030
1024
|
dom.style.display = displayStyle;
|
|
1031
1025
|
}
|
|
@@ -1036,7 +1030,7 @@ var Picker = function() {
|
|
|
1036
1030
|
return Picker;
|
|
1037
1031
|
}();
|
|
1038
1032
|
{
|
|
1039
|
-
var style = document.createElement(
|
|
1033
|
+
var style = document.createElement('style');
|
|
1040
1034
|
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}';
|
|
1041
1035
|
document.documentElement.firstElementChild.appendChild(style);
|
|
1042
1036
|
Picker.StyleElement = style;
|