ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!--
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Plumrocket_ExtendedAdminUi::css/lib/chosen.css"/>
</head>
</page>
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!--
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2023 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Plumrocket_ExtendedAdminUi::css/tooltip.css"/>
</head>
</page>
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!--
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Plumrocket_ExtendedAdminUi::css/notice.css"/>
</head>
</page>
@@ -0,0 +1,52 @@
<?php
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2021 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
?>
<?php /** @var \Magento\Backend\Block\Template $block */ ?>
<?php
/** @var \Magento\Framework\Escaper $escaper */
$escaper = $escaper ?? $block->getEscaper();
?>
<script>
require(['pickr'], function(Pickr) {
var input = document.getElementById('<?= $escaper->escapeHtml($block->getData('elementId')) ?>');
var inheritCheckbox = document.getElementById(
'<?= $escaper->escapeHtml($block->getData('elementId')) ?>_inherit'
);
var pickr = Pickr.create(JSON.parse('<?= /* @noEscape */ $block->getData('jsonConfig') ?>'));
pickr.on('change', function (color, instance) {
if (null === color) {
input.value = '';
} else {
input.value = color.toHEXA();
}
});
pickr.on('clear', function (instance) {
input.value = '';
});
input.addEventListener('change', function (ev) {
if (ev.target.value === '') {
pickr.setColor(null);
} else {
pickr.setColor(ev.target.value);
}
});
// Use default/use system value
if (inheritCheckbox) {
inheritCheckbox.addEventListener('change', function (event) {
if (event.target.checked) {
pickr.disable();
} else {
pickr.enable();
}
});
}
});
</script>
@@ -0,0 +1,34 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
.colorpicker-input {
vertical-align: middle;
width: 50% !important;
}
.admin__field-control > .pickr {
margin: 0;
overflow: hidden;
cursor: pointer;
padding: 3px;
display: inline-block;
border: solid 1px #adadad;
background: #eaeaea;
color: #333;
vertical-align: middle;
box-sizing: border-box;
}
.admin__field-control > .pickr > button {
width: 25px;
height: 25px;
display: block;
border-radius: 0;
}
.admin__field-control > .pickr > button:focus {
box-shadow: none;
}
@@ -0,0 +1,58 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
.messages.hidden-input-table {
display: none
}
div.dynamic-table-field {
margin-bottom: 0;
padding-bottom: 0;
padding-top: 0;
}
.accordion .form-inline .config .dynamic-table-field td {
padding: 1rem;
vertical-align: middle;
}
div.dynamic-table-field td input.checkbox[disabled] {
display: none;
}
div.dynamic-table-field tr.not-active td,
div.dynamic-table-field tr.not-active input.input-text {
color: #999999;
}
div.dynamic-table-field td.dynamic-table-column-width-10 {
width: 10%;
}
div.dynamic-table-field td.dynamic-table-column-width-20 {
width: 20%;
}
div.dynamic-table-field td.dynamic-table-column-width-30 {
width: 30%;
}
div.dynamic-table-field td.dynamic-table-column-width-40 {
width: 40%;
}
div.dynamic-table-field td.dynamic-table-column-width-50 {
width: 50%;
}
div.dynamic-table-field td.dynamic-table-column-width-60 {
width: 60%;
}
div.dynamic-table-field td.dynamic-table-column-width-70 {
width: 70%;
}
div.dynamic-table-field td.dynamic-table-column-width-80 {
width: 80%;
}
button.dynamic-table-field.add-row-value {
margin-top: 5px;
}
@@ -0,0 +1,88 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2021 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
.plum_admin__field-wrapper{
width: 54% !important;
overflow: auto;
}
.plum_admin__field-image-radio-buttons {
display: inline-block;
width: auto;
margin: 0 4rem 2rem 0 !important;
vertical-align: top;
}
.plum_admin__field-wrapper .plum_admin__field-image-radio-buttons:last-of-type{
margin-right: 0 !important;
}
.plum_admin__field-image-radio-buttons .pr-radio-img-wrp {
margin-top: 1.5rem;
margin-left: -2.6rem;
}
.plum_admin__field-image-radio-buttons.admin__field-option > .admin__control-radio {
display: none;
}
.plum_admin__field-image-radio-buttons .admin__field-label:hover img{
box-shadow: 3px 3px 5px -1px #0000007d;
transition: .2s all ease-in-out;
}
.plum_admin__field-image-radio-buttons > .admin__control-radio:checked + label .pr-radio-img-wrp{
border: 1px solid #7f8eb5;
}
.plum_admin__field-image-radio-buttons .pr-radio-img-wrp{
position: relative;
border: 1px solid transparent;
padding: 0;
transition: .2s all ease-in-out;
}
.plum_admin__field-image-radio-buttons .pr-radio-img-wrp img{
display: block !important;
min-height: 40px;
}
.plum_admin__field-image-radio-buttons .pr-radio-img-wrp .image__anim{
display: none !important;
}
.pr-radio-img-wrp:hover .image__anim{
display: block !important;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.image__anim{
display: none;
}
.plum_admin__field-image-radio-buttons > .admin__control-radio:checked + label .pr-radio-img-wrp:before{
content: "";
position: absolute;
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg fill='%23fff' version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='10px' height='10px' viewBox='0 0 78.369 78.369' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M78.049,19.015L29.458,67.606c-0.428,0.428-1.121,0.428-1.548,0L0.32,40.015c-0.427-0.426-0.427-1.119,0-1.547l6.704-6.704 c0.428-0.427,1.121-0.427,1.548,0l20.113,20.112l41.113-41.113c0.429-0.427,1.12-0.427,1.548,0l6.703,6.704 C78.477,17.894,78.477,18.586,78.049,19.015z'/%3E%3C/g%3E%3C/svg%3E%0A");
top: 7px;
right: 7px;
z-index: 1;
width: 10px;
height: 10px;
}
.plum_admin__field-image-radio-buttons > .admin__control-radio:checked + label .pr-radio-img-wrp:after{
content: "";
border: 20px solid transparent;
border-top: 20px solid #e0510f;
border-right: 20px solid #e0510f;
position: absolute;
top: 0;
right: 0;
}
@@ -0,0 +1,469 @@
/*!
!!! FILE WAS EDITED TO TURN IT IN MAGENTO STYLE !!!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.8.7
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2018 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
.chosen-container {
position: relative;
display: inline-block;
vertical-align: middle;
font-size: 13px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.chosen-container * {
-webkit-box-sizing: border-box;
box-sizing: border-box
}
.chosen-container .chosen-drop {
position: absolute;
top: 100%;
z-index: 1010;
width: 100%;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
background-color: #ffffff;
border: 1px solid #007bdb;
border-radius: 1px;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
color: #41362f;
font-weight: 400;
left: 0;
list-style: none;
margin: 2px 0 0;
min-width: 0;
padding: 0;
right: 0;
}
.chosen-container.chosen-with-drop .chosen-drop {
clip: auto;
-webkit-clip-path: none;
clip-path: none
}
.chosen-container a {
cursor: pointer
}
.chosen-container .chosen-single .group-name, .chosen-container .search-choice .group-name {
margin-right: 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: 400;
color: #999
}
.chosen-container .chosen-single .group-name:after, .chosen-container .search-choice .group-name:after {
content: ":";
padding-left: 2px;
vertical-align: top
}
.chosen-container-single .chosen-single {
position: relative;
display: block;
overflow: hidden;
padding: 0 0 0 8px;
height: 25px;
border: 1px solid #aaa;
border-radius: 5px;
background-color: #fff;
background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #fff), color-stop(50%, #f6f6f6), color-stop(52%, #eee), to(#f4f4f4));
background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
background-clip: padding-box;
-webkit-box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, .1);
box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, .1);
color: #444;
text-decoration: none;
white-space: nowrap;
line-height: 24px
}
.chosen-container-single .chosen-default {
color: #999
}
.chosen-container-single .chosen-single span {
display: block;
overflow: hidden;
margin-right: 26px;
text-overflow: ellipsis;
white-space: nowrap
}
.chosen-container-single .chosen-single-with-deselect span {
margin-right: 38px
}
.chosen-container-single .chosen-single abbr {
position: absolute;
top: 6px;
right: 26px;
display: block;
width: 12px;
height: 12px;
background: url(../images/chosen-sprite.png) -42px 1px no-repeat;
font-size: 1px
}
.chosen-container-single .chosen-single abbr:hover {
background-position: -42px -10px
}
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
background-position: -42px -10px
}
.chosen-container-single .chosen-single div {
position: absolute;
top: 0;
right: 0;
display: block;
width: 18px;
height: 100%
}
.chosen-container-single .chosen-single div b {
display: block;
width: 100%;
height: 100%;
background: url(../images/chosen-sprite.png) no-repeat 0 2px
}
.chosen-container-single .chosen-search {
position: relative;
z-index: 1010;
margin: 0;
padding: 3px 4px;
white-space: nowrap
}
.chosen-container-single .chosen-search input[type=text] {
margin: 1px 0;
padding: 4px 20px 4px 5px;
width: 100%;
height: auto;
outline: 0;
border: 1px solid #aaa;
background: url(../images/chosen-sprite.png) no-repeat 100% -20px;
font-size: 1em;
font-family: sans-serif;
line-height: normal;
border-radius: 0
}
.chosen-container-single .chosen-drop {
margin-top: -1px;
border-radius: 0 0 4px 4px;
background-clip: padding-box
}
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%)
}
.chosen-container .chosen-results {
color: #444;
position: relative;
overflow-x: hidden;
overflow-y: auto;
margin: 0 4px 4px 0;
padding: 0 0 0 4px;
max-height: 240px;
-webkit-overflow-scrolling: touch
}
.chosen-container .chosen-results li {
display: none;
margin: 0;
padding: 5px 6px;
list-style: none;
line-height: 15px;
word-wrap: break-word;
-webkit-touch-callout: none
}
.chosen-container .chosen-results li.active-result {
display: list-item;
cursor: pointer
}
.chosen-container .chosen-results li.disabled-result {
display: list-item;
color: #ccc;
cursor: default
}
.chosen-container .chosen-results li.highlighted {
background-image: linear-gradient(#e3e3e3 20%, #e3e3e3 90%);
background-color: #e3e3e3;
}
.chosen-container .chosen-results li.no-results {
color: #777;
display: list-item;
background: #f4f4f4
}
.chosen-container .chosen-results li.group-result {
display: list-item;
font-weight: 700;
cursor: default
}
.chosen-container .chosen-results li {
padding: .6875em 1em;
}
.chosen-container .chosen-results li em {
font-style: normal;
text-decoration: underline
}
.chosen-container-multi .chosen-choices {
position: relative;
overflow: hidden;
margin: 0;
padding: 0;
width: 100%;
height: auto;
border: 1px solid #aaa;
background-color: #fff;
cursor: text
}
.chosen-container-multi .chosen-choices li {
float: left;
list-style: none
}
.chosen-container-multi .chosen-choices li.search-field {
margin: 0;
padding: 0;
white-space: nowrap
}
.chosen-container-multi .chosen-choices li.search-field input[type=text] {
margin: 1px 0;
height: 25px;
outline: 0;
border: 0 !important;
background: 0 0 !important;
-webkit-box-shadow: none;
box-shadow: none;
color: #999;
font-size: 100%;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
width: 25px
}
.chosen-container-multi .chosen-choices li.search-choice,
.chosen-container-multi .chosen-choices li.search-choice-disabled {
background-color: #f5f5f5;
border: 1px solid #a79d95;
border-radius: 1px;
display: inline-block;
font-size: 1.2rem;
margin: 0.3rem;
padding: 0.3rem 2.4rem 0.4rem 1rem;
position: relative;
transition: border-color 0.1s linear;
}
.chosen-container-multi .chosen-choices li.search-choice span {
word-wrap: break-word
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
bottom: 0;
font-size: .5em;
position: absolute;
right: 0;
top: 0;
width: 2rem;
display: inline-block;
padding: 0.6rem 1em 0.6rem;
text-align: center;
vertical-align: baseline;
-webkit-font-smoothing: antialiased;
font-family: 'Admin Icons', sans-serif;
font-style: normal;
font-weight: normal;
speak: none;
color: #514943;
text-decoration: none;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before {
content: '\e62f';
transition: color 0.1s linear;
}
.chosen-container-multi .chosen-choices li.search-choice-disabled {
padding-right: 1rem;
color: #666;
}
.chosen-container-multi .chosen-choices li.search-choice-focus {
background: #d4d4d4
}
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
background-position: -42px -10px
}
.chosen-container-multi .chosen-results {
margin: 0;
padding: 0
}
.chosen-container-multi .chosen-drop .result-selected {
display: list-item;
background-color: #e0f6fe;
cursor: default
}
.chosen-container-active .chosen-single {
border-color: #007bdb;
}
.chosen-container-active.chosen-with-drop .chosen-single {
border: 1px solid #aaa;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
border-left: none;
background: 0 0
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
background-position: -18px 2px
}
.chosen-container-active .chosen-choices {
border-color: #007bdb;
}
.chosen-container-active .chosen-choices li.search-field input[type=text] {
color: #222 !important
}
.chosen-disabled {
opacity: .5 !important;
cursor: default
}
.chosen-disabled .chosen-single {
cursor: default
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
cursor: default
}
.chosen-rtl {
text-align: right
}
.chosen-rtl .chosen-single {
overflow: visible;
padding: 0 8px 0 0
}
.chosen-rtl .chosen-single span {
margin-right: 0;
margin-left: 26px;
direction: rtl
}
.chosen-rtl .chosen-single-with-deselect span {
margin-left: 38px
}
.chosen-rtl .chosen-single div {
right: auto;
left: 3px
}
.chosen-rtl .chosen-single abbr {
right: auto;
left: 26px
}
.chosen-rtl .chosen-choices li {
float: right
}
.chosen-rtl .chosen-choices li.search-field input[type=text] {
direction: rtl
}
.chosen-rtl .chosen-choices li.search-choice {
margin: 3px 5px 3px 0;
padding: 3px 5px 3px 19px
}
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
right: auto;
left: 4px
}
.chosen-rtl.chosen-container-single .chosen-results {
margin: 0 0 4px 4px;
padding: 0 4px 0 0
}
.chosen-rtl .chosen-results li.group-option {
padding-right: 15px;
padding-left: 0
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
border-right: none
}
.chosen-rtl .chosen-search input[type=text] {
padding: 4px 5px 4px 20px;
background: url(../images/chosen-sprite.png) no-repeat -30px -20px;
direction: rtl
}
.chosen-rtl.chosen-container-single .chosen-single div b {
background-position: 6px 2px
}
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
background-position: -12px 2px
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
.chosen-container .chosen-results-scroll-down span, .chosen-container .chosen-results-scroll-up span, .chosen-container-multi .chosen-choices .search-choice .search-choice-close, .chosen-container-single .chosen-search input[type=text], .chosen-container-single .chosen-single abbr, .chosen-container-single .chosen-single div b, .chosen-rtl .chosen-search input[type=text] {
background-image: url(../images/chosen-sprite@2x.png) !important;
background-size: 52px 37px !important;
background-repeat: no-repeat !important
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,74 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
.accordion .config .pr_notice .pr-notice__content-wrapper {
padding-top: 2.2rem;
}
.accordion .form-inline .config .pr-notice__content {
background: #fffbbb;
color: #333333;
font-size: 1.4rem;
margin: 0 0 1px;
padding: 1.8rem 4rem 1.8rem 5.5rem;
position: relative;
text-shadow: none;
}
.accordion .form-inline .config .pr_notice--error .pr-notice__content {
background: #ffcccc;
}
.accordion .form-inline .config .pr_notice--note .pr-notice__content {
background: #f1f1f1;
}
.pr-notice__content::before {
background: none;
border: 0;
font-family: 'Admin Icons';
font-size: 1.9rem;
font-style: normal;
font-weight: 400;
height: auto;
left: 1.9rem;
line-height: inherit;
position: absolute;
speak: none;
text-shadow: none;
top: 50%;
margin-top: -1.25rem;
width: auto;
}
.pr_notice--note .pr-notice__content::before {
color: #007bdb;
content: '\e61a';
}
.pr_notice--info .pr-notice__content::before {
color: #007bdb;
content: '\e61a';
}
.pr_notice--success .pr-notice__content::before {
color: #79a22e;
content: '\e62d';
}
.pr_notice--warning .pr-notice__content::before {
color: #eb5202;
content: '\e623';
}
.pr_notice--error .pr-notice__content::before {
color: #e22626;
content: '\e632';
font-size: 1.5rem;
left: 2.2rem;
margin-top: -1.1rem;
}
@@ -0,0 +1,20 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
.plum_admin__field-radios-with-image {
display: inline-block;
width: auto;
margin-right: 4rem;
}
.plum_admin__field-radios-with-image .pr-radio-img-wrp {
margin-top: 1.5rem;
margin-left: -2.6rem;
}
.plum_admin__field-radios-with-image.admin__field-option > .admin__control-radio {
display: none;
}
@@ -0,0 +1,47 @@
.pr-tooltip {
position: relative;
display: inline-block;
padding: 5px 0;
margin: -5px 0;
cursor: pointer;
}
.pr-tooltip-toggle {
border-bottom: 1px dotted;
}
.pr-tooltip .pr-tooltip-content {
visibility: hidden;
width: 248px;
max-width: 248px;
left: 50%;
transform: translateX(-50%);
bottom: 100%;
text-align: center;
padding: 18px;
border-radius: 5px;
font-size: 13px;
line-height: 1.4;
background-color:
rgba(49, 48, 43, 0.8);
color: #fff;
position: absolute;
z-index: 1;
cursor: auto;
}
.pr-tooltip:hover .pr-tooltip-content {
visibility: visible;
}
.pr-tooltip-content:before {
border-bottom: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #35302c;
bottom: -5px;
content: '';
height: 0;
left: auto;
opacity: .8;
position: absolute;
right: 142px;
top: auto;
width: 0;
}
@@ -0,0 +1,150 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
define([
'jquery',
'Plumrocket_ExtendedAdminUi/js/lib/chosen.jquery.min'
], function ($) {
'use strict';
return {
/**
* Registry for all selects with class pr-chosen
*/
initializedSelects: [],
/**
* @param {string} selector
* @param {{enabled: boolean, allIndex: string}} dependConfig
*/
initializeChosen: function (selector, dependConfig) {
var selects = this.getChosenSelects(selector);
selects.forEach(function (select) {
if (! this.isInitializedSelect(select)) {
this.initializeSelect(select);
this.initializeOptionDepends(select, dependConfig);
}
}.bind(this));
},
/**
* @param {string} selector
* @returns {HTMLSelectElement[]}
*/
getChosenSelects: function (selector) {
var result = $(selector);
return result.length ? result.toArray() : [];
},
/**
* @param {HTMLSelectElement} select
* @returns {boolean|number|*}
*/
initializeSelect: function (select) {
if (!select instanceof HTMLElement) {
return false;
}
if (this.isInitializedSelect(select)) {
return this.getIndexOfRegisteredSelect(select);
}
var enableSearch = true;
if ('readonly' === select.getAttribute('readonly')) {
enableSearch = false;
}
$(select).chosen({
'display_selected_options': true,
'display_disabled_options': true,
'hide_results_on_select': true,
'group_search': enableSearch
});
return this.initializedSelects.push(select.name);
},
/**
* @param {HTMLSelectElement} select
* @returns {number}
*/
getIndexOfRegisteredSelect: function (select) {
return this.initializedSelects.indexOf(select.name);
},
/**
* @param {HTMLSelectElement} select
* @returns {boolean}
*/
isInitializedSelect: function (select) {
return -1 !== this.getIndexOfRegisteredSelect(select);
},
/**
* @param {HTMLSelectElement} select
*/
reinitializeSelect: function (select) {
if (this.isInitializedSelect(select)) {
$(select).chosen('destroy');
this.initializedSelects.splice(this.getIndexOfRegisteredSelect(select), 1);
this.initializeSelect(select);
}
},
/**
* @param {HTMLSelectElement} select
*/
updateSelect: function (select) {
this.initializeSelect(select);
$(select).trigger('chosen:updated');
},
/**
* @param {HTMLSelectElement} select
* @param {{enabled: boolean, allIndex: string}} dependConfig
*/
initializeOptionDepends: function (select, dependConfig) {
if (! dependConfig.enabled) {
return;
}
this.initializeSelect(select);
var $select = $(select);
var initialValues = !$select.val() ? [] : $select.val();
var initialShowToAllIndex = initialValues.indexOf(dependConfig.allIndex);
var chosenModel = this;
$select.on('change', function () {
var values = !$(this).val() ? [] : $(this).val();
var showToAllIndex = values.indexOf(dependConfig.allIndex);
if (-1 !== initialShowToAllIndex) {
if (-1 !== showToAllIndex && values.length > 1) {
for (var i = 0; i < values.length; i++) {
values.splice(showToAllIndex, 1);
}
$select.val(values);
}
} else {
if (-1 !== showToAllIndex && values.length > 1) {
$select.val([dependConfig.allIndex]);
}
}
if (!$(this).val()) {
$(this).val([dependConfig.allIndex]);
}
initialValues = $(this).val() === null ? [] : $(this).val();
initialShowToAllIndex = initialValues.indexOf(dependConfig.allIndex);
chosenModel.updateSelect(select);
});
}
};
});
@@ -0,0 +1,106 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
/**
* @deprecated added for magento 2.2
* for magento >= 2.3 please use their color picker
* @link https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-colorpicker.html
*/
define([
'mage/translate',
'Magento_Ui/js/form/element/abstract',
'pickr',
], function ($t, Abstract, Pickr) {
'use strict';
return Abstract.extend({
defaults: {
colorPickerConfig: {
theme: 'monolith',
useAsButton: false,
comparison: false,
swatches: [
'rgba(244, 67, 54, 1)',
'rgba(233, 30, 99, 0.95)',
'rgba(156, 39, 176, 0.9)',
'rgba(103, 58, 183, 0.85)',
'rgba(63, 81, 181, 0.8)',
'rgba(33, 150, 243, 0.75)',
'rgba(3, 169, 244, 0.7)',
'rgba(0, 188, 212, 0.7)',
'rgba(0, 150, 136, 0.75)',
'rgba(76, 175, 80, 0.8)',
'rgba(139, 195, 74, 0.85)',
'rgba(205, 220, 57, 0.9)',
'rgba(255, 235, 59, 0.95)',
'rgba(255, 193, 7, 1)'
],
components: {
// Main components
preview: true,
opacity: true,
hue: true,
// Input / output Options
interaction: {
hex: true,
rgba: true,
hsla: false,
hsva: false,
cmyk: false,
input: true,
clear: true,
save: false
}
}
}
},
/**
* Invokes initialize method of parent class,
* contains initialization logic
*/
initialize: function () {
this._super();
this.colorPickerConfig.default = this.value() ? this.value() : null;
this.colorPickerConfig.disabled = this.disabled();
this.colorPickerConfig.el = '#' + this.uid + '_color_picker';
return this;
},
initColorPicker: function () {
var self = this;
var pickr = Pickr.create(self.colorPickerConfig);
pickr.on('change', function (color, instance) {
if (null === color) {
self.value('');
} else {
self.value(color.toHEXA().toString());
}
});
pickr.on('clear', function (instance) {
self.value('');
});
self.value.subscribe(function (newValue) {
if (newValue === '') {
pickr.setColor(null);
} else {
pickr.setColor(newValue);
}
});
return this;
}
});
});
@@ -0,0 +1,49 @@
/**
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
*/
define([
'jquery'
], function ($) {
return {
initialize: function (rowId) {
var $grid = $('#' + rowId + ' > td.value .data-grid tbody');
this.waitMageInitialization($grid, function (rowId, $grid) {
const $inherit = $('#' + rowId + '_inherit:checked');
if ($inherit.length) {
$inherit.click();
}
let rowTemplate = $grid.find('tr:first-child').html();
$grid.find('tr:first-child').remove();
$grid.addClass('loaded');
this.initAddButton(rowId, $grid, rowTemplate);
this.initRemoveButton($grid);
}.bind(this, rowId, $grid))
},
initAddButton: function (rowId, $grid, template) {
$('#' + rowId + ' > td.value > .add-row-value').on('click', function () {
let name = 'row-value-' + Date.now();
$grid.append('<tr>'+ template.split('_TMPNAME_').join(name) +'</tr>');
return false;
});
},
initRemoveButton: function ($grid) {
$grid.on('click', '.remove-row-value', function () {
$(this).parent().parent().remove();
});
},
waitMageInitialization: function ($grid, callback) {
let interval = setInterval(function () {
if ($grid.find('*[data-mage-init]').length === 0) {
callback();
clearInterval(interval);
}
}, 200);
}
}
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_Extension
* @copyright Copyright (c) 2026 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
var __prinitparam = 'MzM5Njkw';
@@ -0,0 +1,7 @@
var config = {
map: {
'*': {
pickr: 'Plumrocket_ExtendedAdminUi/js/lib/pickr.es5.min',
}
}
};
@@ -0,0 +1,15 @@
<!--
* @package Plumrocket_ExtendedAdminUi
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license/ End-user License Agreement
-->
<div class="admin__field-control"
visible="visible"
css="$data.additionalClasses">
<div attr="id: uid + '_color_picker'"></div>
<input type="text" class="admin__control-text colorpicker-input"
ko-value="value" hasFocus="focused" disable="disabled"
attr="name: inputName, id: uid, placeholder: placeholder"
afterRender="initColorPicker">
</div>