@shoper/phoenix_design_system 0.23.0-1 → 0.24.0
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/build/cjs/{external → packages/phoenix/external}/classnames/index.js +16 -10
- package/build/{esm → cjs/packages/phoenix}/external/classnames/index.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js +70 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +12 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +115 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +22 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js +38 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +12 -0
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js +73 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js +13 -0
- package/build/cjs/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/tabs/tabs.js +0 -1
- package/build/cjs/packages/phoenix/src/components/tabs/tabs.js.map +1 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +4 -11
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +28 -0
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/{external → packages/phoenix/external}/classnames/index.js +16 -10
- package/build/{cjs → esm/packages/phoenix}/external/classnames/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.d.ts +14 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +68 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +21 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +113 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.d.ts +11 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +15 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.d.ts +9 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js +36 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.d.ts +14 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js +71 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js +9 -0
- package/build/esm/packages/phoenix/src/components/form/color_swatches_control/color_swatches_control_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/groups/toggle_button_group/toggle_button.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.js +0 -1
- package/build/esm/packages/phoenix/src/components/tabs/tabs.js.map +1 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.d.ts +1 -4
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +4 -11
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +4 -0
- package/build/esm/packages/phoenix/src/index.js +4 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -60,6 +60,10 @@ var toggle_button_group = require('./components/groups/toggle_button_group/toggl
|
|
|
60
60
|
var toggle_button = require('./components/groups/toggle_button_group/toggle_button.js');
|
|
61
61
|
var click_outside_controller_messages = require('./controllers/click_outside_controller/click_outside_controller_messages.js');
|
|
62
62
|
var backdrop = require('./components/backdrop/backdrop.js');
|
|
63
|
+
var color_swatches_control = require('./components/form/color_swatches_control/color_swatches_control.js');
|
|
64
|
+
var color_item = require('./components/color_swatches/color_item/color_item.js');
|
|
65
|
+
var color_swatches = require('./components/color_swatches/color_swatches.js');
|
|
66
|
+
var show_more = require('./components/color_swatches/show-more/show_more.js');
|
|
63
67
|
var visibility_controller = require('./controllers/visibility_controller/visibility_controller.js');
|
|
64
68
|
var slider = require('./components/slider/slider.js');
|
|
65
69
|
var tab = require('./components/tabs/tab/tab.js');
|
|
@@ -346,6 +350,30 @@ Object.defineProperty(exports, 'HBackdrop', {
|
|
|
346
350
|
return backdrop.HBackdrop;
|
|
347
351
|
}
|
|
348
352
|
});
|
|
353
|
+
Object.defineProperty(exports, 'HColorSwatchesControl', {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
get: function () {
|
|
356
|
+
return color_swatches_control.HColorSwatchesControl;
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
Object.defineProperty(exports, 'HColorItem', {
|
|
360
|
+
enumerable: true,
|
|
361
|
+
get: function () {
|
|
362
|
+
return color_item.HColorItem;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
Object.defineProperty(exports, 'HColorSwatches', {
|
|
366
|
+
enumerable: true,
|
|
367
|
+
get: function () {
|
|
368
|
+
return color_swatches.HColorSwatches;
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
Object.defineProperty(exports, 'HColorSwatchesShowMore', {
|
|
372
|
+
enumerable: true,
|
|
373
|
+
get: function () {
|
|
374
|
+
return show_more.HColorSwatchesShowMore;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
349
377
|
exports.VisibilityController = visibility_controller.VisibilityController;
|
|
350
378
|
Object.defineProperty(exports, 'HSlider', {
|
|
351
379
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createCommonjsModule } from '
|
|
1
|
+
import { createCommonjsModule } from '../../../../_virtual/_commonjsHelpers.js';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
Copyright (c)
|
|
4
|
+
Copyright (c) 2018 Jed Watson.
|
|
5
5
|
Licensed under the MIT License (MIT), see
|
|
6
6
|
http://jedwatson.github.io/classnames
|
|
7
7
|
*/
|
|
@@ -13,7 +13,7 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
13
13
|
|
|
14
14
|
var hasOwn = {}.hasOwnProperty;
|
|
15
15
|
|
|
16
|
-
function classNames
|
|
16
|
+
function classNames() {
|
|
17
17
|
var classes = [];
|
|
18
18
|
|
|
19
19
|
for (var i = 0; i < arguments.length; i++) {
|
|
@@ -24,16 +24,22 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
24
24
|
|
|
25
25
|
if (argType === 'string' || argType === 'number') {
|
|
26
26
|
classes.push(arg);
|
|
27
|
-
} else if (Array.isArray(arg)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
} else if (Array.isArray(arg)) {
|
|
28
|
+
if (arg.length) {
|
|
29
|
+
var inner = classNames.apply(null, arg);
|
|
30
|
+
if (inner) {
|
|
31
|
+
classes.push(inner);
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
} else if (argType === 'object') {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
if (arg.toString === Object.prototype.toString) {
|
|
36
|
+
for (var key in arg) {
|
|
37
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
38
|
+
classes.push(key);
|
|
39
|
+
}
|
|
36
40
|
}
|
|
41
|
+
} else {
|
|
42
|
+
classes.push(arg.toString());
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HColorItem extends PhoenixLightLitElement {
|
|
3
|
+
color: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
private _btnController;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
attributeChangedCallback(name: string, value: string | null, newValue: string | null): void;
|
|
11
|
+
private _syncAriaPressed;
|
|
12
|
+
private setupEvents;
|
|
13
|
+
private _dispatchClickedEvent;
|
|
14
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
3
|
+
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
|
+
import { BtnController } from '../../../controllers/btn_controller.js';
|
|
6
|
+
import { COLOR_SWATCHES_CSS_CLASSES } from '../color_swatches_constants.js';
|
|
7
|
+
import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item_constants.js';
|
|
8
|
+
|
|
9
|
+
let HColorItem = class HColorItem extends PhoenixLightLitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this.selected = false;
|
|
14
|
+
this._dispatchClickedEvent = () => {
|
|
15
|
+
this.dispatchEvent(new Event(COLOR_ITEM_EVENT_NAMES.selected, {
|
|
16
|
+
bubbles: true
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
this._btnController = new BtnController(this, this._dispatchClickedEvent);
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
super.connectedCallback();
|
|
23
|
+
this.setupEvents();
|
|
24
|
+
this.style.backgroundColor = this.color;
|
|
25
|
+
this._syncAriaPressed();
|
|
26
|
+
this.setAttribute('aria-label', this.label ? this.label : this.color);
|
|
27
|
+
this.disabled && this.removeAttribute('tabindex');
|
|
28
|
+
this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorItem);
|
|
29
|
+
}
|
|
30
|
+
attributeChangedCallback(name, value, newValue) {
|
|
31
|
+
super.attributeChangedCallback(name, value, newValue);
|
|
32
|
+
switch (name) {
|
|
33
|
+
case COLOR_ITEM_SELECTED_ATTRIBUTE: {
|
|
34
|
+
this._syncAriaPressed();
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
_syncAriaPressed() {
|
|
40
|
+
this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
|
|
41
|
+
}
|
|
42
|
+
setupEvents() {
|
|
43
|
+
!this.disabled && this.addEventListener('click', this._dispatchClickedEvent);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ type: String }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], HColorItem.prototype, "color", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: String }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], HColorItem.prototype, "label", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ type: Boolean, attribute: true }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], HColorItem.prototype, "disabled", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
property({ type: Boolean, attribute: true }),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], HColorItem.prototype, "selected", void 0);
|
|
62
|
+
HColorItem = __decorate([
|
|
63
|
+
phoenixCustomElement('h-color-item'),
|
|
64
|
+
__metadata("design:paramtypes", [])
|
|
65
|
+
], HColorItem);
|
|
66
|
+
|
|
67
|
+
export { HColorItem };
|
|
68
|
+
//# sourceMappingURL=color_item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_item_types.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_swatches/color_item/color_item_types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HColorItem } from "./color_item/color_item";
|
|
2
|
+
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
+
export declare class HColorSwatches extends PhoenixLightLitElement {
|
|
4
|
+
multiple: boolean;
|
|
5
|
+
numberOfVisibleColors: number;
|
|
6
|
+
selectedColors: HColorItem[];
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
private _addCssClasses;
|
|
9
|
+
private _hideItems;
|
|
10
|
+
private _showAllItemsEvent;
|
|
11
|
+
private _setupEvents;
|
|
12
|
+
private _handleColorClicked;
|
|
13
|
+
private _handleColorClickedForMultipleMode;
|
|
14
|
+
private _handleColorClickedForSingleMode;
|
|
15
|
+
private _toggleSelectedAttribute;
|
|
16
|
+
private _isColorAlreadyExistInArray;
|
|
17
|
+
private _removeExistingColorFromArray;
|
|
18
|
+
private _dispatchColorSelectEvent;
|
|
19
|
+
private _setColorsDispatchValue;
|
|
20
|
+
private _getOnlyColorValues;
|
|
21
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { property, state } from 'lit/decorators';
|
|
3
|
+
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
|
+
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
5
|
+
import { COLOR_SWATCHES_EVENT_NAMES, COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_HIDDEN_ATTRIBUTE } from './color_swatches_constants.js';
|
|
6
|
+
import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item/color_item_constants.js';
|
|
7
|
+
import { SHOW_MORE_EVENT_NAMES } from './show-more/show_more_constants.js';
|
|
8
|
+
|
|
9
|
+
let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.multiple = false;
|
|
13
|
+
this.selectedColors = [];
|
|
14
|
+
this._handleColorClicked = ({ target }) => {
|
|
15
|
+
const $colorItem = target;
|
|
16
|
+
this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorClickedForSingleMode($colorItem);
|
|
17
|
+
};
|
|
18
|
+
this._dispatchColorSelectEvent = () => {
|
|
19
|
+
const detail = {
|
|
20
|
+
colors: this._setColorsDispatchValue(this.selectedColors)
|
|
21
|
+
};
|
|
22
|
+
this.dispatchEvent(new CustomEvent(COLOR_SWATCHES_EVENT_NAMES.selected, {
|
|
23
|
+
bubbles: true,
|
|
24
|
+
detail
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
this._setupEvents();
|
|
31
|
+
this._addCssClasses();
|
|
32
|
+
this.numberOfVisibleColors && this._hideItems(this.numberOfVisibleColors);
|
|
33
|
+
this._showAllItemsEvent();
|
|
34
|
+
}
|
|
35
|
+
_addCssClasses() {
|
|
36
|
+
this.querySelectorAll(COLOR_ITEM_TAG_NAME).forEach(($colorItem) => $colorItem.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
|
|
37
|
+
this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
|
|
38
|
+
}
|
|
39
|
+
_hideItems(numberOfVisibleColors) {
|
|
40
|
+
this.querySelectorAll(COLOR_ITEM_TAG_NAME).forEach(($colorItem, index) => {
|
|
41
|
+
if (index > numberOfVisibleColors - 1) {
|
|
42
|
+
$colorItem.setAttribute(COLOR_SWATCHES_HIDDEN_ATTRIBUTE, '');
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
_showAllItemsEvent() {
|
|
47
|
+
this.addEventListener(SHOW_MORE_EVENT_NAMES.showMore, () => {
|
|
48
|
+
var _a;
|
|
49
|
+
this.querySelectorAll(COLOR_ITEM_TAG_NAME).forEach(($colorItem) => {
|
|
50
|
+
$colorItem.removeAttribute(COLOR_SWATCHES_HIDDEN_ATTRIBUTE);
|
|
51
|
+
});
|
|
52
|
+
(_a = this.querySelector('h-color-swatches-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute(COLOR_SWATCHES_HIDDEN_ATTRIBUTE, '');
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
_setupEvents() {
|
|
56
|
+
this.addEventListener(COLOR_ITEM_EVENT_NAMES.selected, this._handleColorClicked);
|
|
57
|
+
}
|
|
58
|
+
_handleColorClickedForMultipleMode($colorItem) {
|
|
59
|
+
!this._isColorAlreadyExistInArray($colorItem)
|
|
60
|
+
? (this.selectedColors = [...this.selectedColors, $colorItem])
|
|
61
|
+
: this._removeExistingColorFromArray($colorItem);
|
|
62
|
+
this._toggleSelectedAttribute($colorItem);
|
|
63
|
+
this._dispatchColorSelectEvent();
|
|
64
|
+
}
|
|
65
|
+
_handleColorClickedForSingleMode($colorItem) {
|
|
66
|
+
const $previouslySelected = this.selectedColors[0];
|
|
67
|
+
this._toggleSelectedAttribute($colorItem);
|
|
68
|
+
if ($previouslySelected && $previouslySelected !== $colorItem)
|
|
69
|
+
$previouslySelected.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE);
|
|
70
|
+
this.selectedColors = $previouslySelected === $colorItem ? [] : [$colorItem];
|
|
71
|
+
this._dispatchColorSelectEvent();
|
|
72
|
+
}
|
|
73
|
+
_toggleSelectedAttribute($colorItem) {
|
|
74
|
+
$colorItem.hasAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
|
|
75
|
+
? $colorItem.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
|
|
76
|
+
: $colorItem.setAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE, '');
|
|
77
|
+
}
|
|
78
|
+
_isColorAlreadyExistInArray($colorItem) {
|
|
79
|
+
return this.selectedColors.includes($colorItem);
|
|
80
|
+
}
|
|
81
|
+
_removeExistingColorFromArray($colorItem) {
|
|
82
|
+
const indexOfAlreadyExistingColor = this.selectedColors.indexOf($colorItem);
|
|
83
|
+
this.selectedColors.splice(indexOfAlreadyExistingColor, 1);
|
|
84
|
+
}
|
|
85
|
+
_setColorsDispatchValue(selectedColors) {
|
|
86
|
+
if (this.selectedColors.length > 1)
|
|
87
|
+
return this._getOnlyColorValues(selectedColors);
|
|
88
|
+
if (this.selectedColors.length === 1)
|
|
89
|
+
return selectedColors[0].color;
|
|
90
|
+
return '';
|
|
91
|
+
}
|
|
92
|
+
_getOnlyColorValues(selectedColors) {
|
|
93
|
+
return selectedColors.map((selectedColor) => selectedColor.color);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: Boolean }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], HColorSwatches.prototype, "multiple", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property({ type: Number, attribute: 'number-of-visible-colors' }),
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
|
+
], HColorSwatches.prototype, "numberOfVisibleColors", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
state(),
|
|
106
|
+
__metadata("design:type", Array)
|
|
107
|
+
], HColorSwatches.prototype, "selectedColors", void 0);
|
|
108
|
+
HColorSwatches = __decorate([
|
|
109
|
+
phoenixCustomElement('h-color-swatches')
|
|
110
|
+
], HColorSwatches);
|
|
111
|
+
|
|
112
|
+
export { HColorSwatches };
|
|
113
|
+
//# sourceMappingURL=color_swatches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const COLOR_ITEM_TAG_NAME = "h-color-item";
|
|
2
|
+
export declare const COLOR_SWATCHES_CSS_CLASSES: {
|
|
3
|
+
readonly colorItem: "color-item";
|
|
4
|
+
readonly colorSwatches: "color-swatches";
|
|
5
|
+
readonly colorSwatchesItem: "color-swatches__color-item";
|
|
6
|
+
readonly colorSwatchesItems: "color-swatches__color-items";
|
|
7
|
+
};
|
|
8
|
+
export declare const COLOR_SWATCHES_EVENT_NAMES: {
|
|
9
|
+
readonly selected: "colorSwatchesSelected";
|
|
10
|
+
};
|
|
11
|
+
export declare const COLOR_SWATCHES_HIDDEN_ATTRIBUTE = "hidden";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const baseCssClass = 'color-swatches';
|
|
2
|
+
const COLOR_ITEM_TAG_NAME = 'h-color-item';
|
|
3
|
+
const COLOR_SWATCHES_CSS_CLASSES = {
|
|
4
|
+
colorItem: 'color-item',
|
|
5
|
+
colorSwatches: baseCssClass,
|
|
6
|
+
colorSwatchesItem: `${baseCssClass}__color-item`,
|
|
7
|
+
colorSwatchesItems: `${baseCssClass}__color-items`
|
|
8
|
+
};
|
|
9
|
+
const COLOR_SWATCHES_EVENT_NAMES = {
|
|
10
|
+
selected: 'colorSwatchesSelected'
|
|
11
|
+
};
|
|
12
|
+
const COLOR_SWATCHES_HIDDEN_ATTRIBUTE = 'hidden';
|
|
13
|
+
|
|
14
|
+
export { COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_EVENT_NAMES, COLOR_SWATCHES_HIDDEN_ATTRIBUTE };
|
|
15
|
+
//# sourceMappingURL=color_swatches_constants.js.map
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_swatches_types.js","sourceRoot":"","sources":["../../../../../../../src/components/color_swatches/color_swatches_types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HColorSwatchesShowMore extends PhoenixLightLitElement {
|
|
3
|
+
private _btnController;
|
|
4
|
+
constructor();
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
private _addCssClasses;
|
|
7
|
+
private setupEvents;
|
|
8
|
+
private _dispatchClickedEvent;
|
|
9
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
3
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
4
|
+
import { BtnController } from '../../../controllers/btn_controller.js';
|
|
5
|
+
import { SHOW_MORE_EVENT_NAMES, SHOW_MORE_CSS_CLASS } from './show_more_constants.js';
|
|
6
|
+
|
|
7
|
+
let HColorSwatchesShowMore = class HColorSwatchesShowMore extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this._dispatchClickedEvent = () => {
|
|
11
|
+
this.dispatchEvent(new CustomEvent(SHOW_MORE_EVENT_NAMES.showMore, {
|
|
12
|
+
bubbles: true
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
this._btnController = new BtnController(this, this._dispatchClickedEvent);
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
this.setupEvents();
|
|
20
|
+
this._addCssClasses();
|
|
21
|
+
this.classList.add(SHOW_MORE_CSS_CLASS);
|
|
22
|
+
}
|
|
23
|
+
_addCssClasses() {
|
|
24
|
+
this.classList.add(SHOW_MORE_CSS_CLASS);
|
|
25
|
+
}
|
|
26
|
+
setupEvents() {
|
|
27
|
+
this.addEventListener('click', this._dispatchClickedEvent);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
HColorSwatchesShowMore = __decorate([
|
|
31
|
+
phoenixCustomElement('h-color-swatches-show-more'),
|
|
32
|
+
__metadata("design:paramtypes", [])
|
|
33
|
+
], HColorSwatchesShowMore);
|
|
34
|
+
|
|
35
|
+
export { HColorSwatchesShowMore };
|
|
36
|
+
//# sourceMappingURL=show_more.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
4
4
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
6
6
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../external/classnames/index.js';
|
|
8
8
|
import { CHECKBOX_PROPS_TO_SYNC, CHECKBOX_CONTROL_CSS_CLASSES } from './checkbox_constants.js';
|
|
9
9
|
|
|
10
10
|
let HCheckbox = class HCheckbox extends PhoenixLightLitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,0CAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_el
|
|
|
4
4
|
import { html } from 'lit-html';
|
|
5
5
|
import { property } from '@lit/reactive-element/decorators.js';
|
|
6
6
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../external/classnames/index.js';
|
|
8
8
|
import { ControlPropsSyncConsumerController } from '../controllers/props_synchronizing/control_props_sync_consumer_controller.js';
|
|
9
9
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
10
10
|
import { CHECKBOX_CONTROL_EVENTS, CHECKBOX_CONTROL_CSS_CLASSES } from './checkbox_constants.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,0CAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
+
export declare class HColorSwatchesControl extends PhoenixLightLitElement {
|
|
4
|
+
controlId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
required: boolean;
|
|
8
|
+
error: boolean;
|
|
9
|
+
selectedColors: string | undefined;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
private _setupEvents;
|
|
12
|
+
private _serializeArrayOfColors;
|
|
13
|
+
protected render(): TemplateResult;
|
|
14
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators';
|
|
4
|
+
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
|
+
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
6
|
+
import { INPUT_CONTROL_TYPES } from '../input/input_constants.js';
|
|
7
|
+
import classnames from '../../../../external/classnames/index.js';
|
|
8
|
+
import { COLOR_SWATCHES_CONTROL_CSS_CLASSES } from './color_swatches_control_constants.js';
|
|
9
|
+
import { COLOR_SWATCHES_EVENT_NAMES } from '../../color_swatches/color_swatches_constants.js';
|
|
10
|
+
|
|
11
|
+
let HColorSwatchesControl = class HColorSwatchesControl extends PhoenixLightLitElement {
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
super.connectedCallback();
|
|
14
|
+
this._setupEvents();
|
|
15
|
+
this.classList.add(COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControl);
|
|
16
|
+
const cssClasses = classnames({
|
|
17
|
+
[COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControlDisabled]: this.disabled,
|
|
18
|
+
[COLOR_SWATCHES_CONTROL_CSS_CLASSES.colorSwatchesControlError]: this.error
|
|
19
|
+
});
|
|
20
|
+
if (cssClasses)
|
|
21
|
+
this.classList.add(cssClasses);
|
|
22
|
+
}
|
|
23
|
+
_setupEvents() {
|
|
24
|
+
this.addEventListener(COLOR_SWATCHES_EVENT_NAMES.selected, (event) => {
|
|
25
|
+
const eventValue = event.detail.colors;
|
|
26
|
+
this.selectedColors = Array.isArray(eventValue) ? this._serializeArrayOfColors(eventValue) : eventValue;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
_serializeArrayOfColors(colors) {
|
|
30
|
+
return colors.reduce((colorPrev, colorCurr) => {
|
|
31
|
+
return colorPrev ? `${colorPrev}, ${colorCurr}` : colorCurr;
|
|
32
|
+
}, '');
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return html `
|
|
36
|
+
<h-input controlName="${this.name}">
|
|
37
|
+
<h-input-control type="${INPUT_CONTROL_TYPES.hidden}" value="${this.selectedColors}"></h-input-control>
|
|
38
|
+
</h-input>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorate([
|
|
43
|
+
property({ type: String, attribute: 'control-id' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], HColorSwatchesControl.prototype, "controlId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ type: String }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], HColorSwatchesControl.prototype, "name", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ type: Boolean }),
|
|
52
|
+
__metadata("design:type", Boolean)
|
|
53
|
+
], HColorSwatchesControl.prototype, "disabled", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ type: Boolean }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], HColorSwatchesControl.prototype, "required", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
property({ type: Boolean }),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], HColorSwatchesControl.prototype, "error", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
state(),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], HColorSwatchesControl.prototype, "selectedColors", void 0);
|
|
66
|
+
HColorSwatchesControl = __decorate([
|
|
67
|
+
phoenixCustomElement('h-color-swatches-control')
|
|
68
|
+
], HColorSwatchesControl);
|
|
69
|
+
|
|
70
|
+
export { HColorSwatchesControl };
|
|
71
|
+
//# sourceMappingURL=color_swatches_control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,0CAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const baseColorSwatchesControlClass = 'color-swatches-control';
|
|
2
|
+
const COLOR_SWATCHES_CONTROL_CSS_CLASSES = {
|
|
3
|
+
colorSwatchesControl: baseColorSwatchesControlClass,
|
|
4
|
+
colorSwatchesControlDisabled: `${baseColorSwatchesControlClass}_disabled`,
|
|
5
|
+
colorSwatchesControlError: `${baseColorSwatchesControlClass}_error`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { COLOR_SWATCHES_CONTROL_CSS_CLASSES };
|
|
9
|
+
//# sourceMappingURL=color_swatches_control_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|