This commit is contained in:
2021-11-23 22:59:50 +03:00
parent afdf3b389e
commit b396f5a545
7 changed files with 74 additions and 3 deletions
+5
View File
@@ -227,6 +227,11 @@ __PluginManager__.registerPlugins({
type: 'loader', type: 'loader',
deps: ['Logger', 'support'] deps: ['Logger', 'support']
}, },
fancybox: {
path: __pmConfig__.assetsPath + '/fancybox',
css: '/fancybox.css',
js: '/fancybox.umd.js',
},
}); });
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
View File
@@ -922,12 +922,15 @@ script, style {
.kit-icon-line img { .kit-icon-line img {
height: calc(1em * var(--font-ratio-height, 1)); height: calc(1em * var(--font-ratio-height, 1));
width: auto; width: auto;
max-width: 100%;
max-height: 100%;
vertical-align: baseline; vertical-align: baseline;
display: block; display: block;
fill: currentColor; fill: currentColor;
transition: inherit; transition: inherit;
object-fit: contain; object-fit: contain;
object-position: center; object-position: center;
margin: auto;
} }
+1 -1
View File
@@ -2,7 +2,7 @@
kit.PluginManager.register('lib',function(module, exports, require, global) { kit.PluginManager.register('lib',function(module, exports, require, global) {
/** /**
* @memberOf kitCore * @memberOf kit
*/ */
var lib = { var lib = {
svg: { svg: {
+18 -2
View File
@@ -151,7 +151,8 @@ input[type="color"] ~ .kit-field__color {
height: 100%; height: 100%;
border: none; border: none;
margin: 0; margin: 0;
padding: 2px 0 3px; padding-bottom: var(--kit-field-line-padding);
padding-top: var(--kit-field-line-padding);
text-align: left; text-align: left;
-moz-transition: color 0.3s 0.1s; -moz-transition: color 0.3s 0.1s;
transition: color 0.3s 0.1s; transition: color 0.3s 0.1s;
@@ -194,6 +195,22 @@ input[type="color"] ~ .kit-field__color {
--line-clamp: 1; --line-clamp: 1;
--line-clamp-height: var(--line-height-ratio); --line-clamp-height: var(--line-height-ratio);
} }
.kit-field input[type="file"] ~ .kit-field__label {
pointer-events: auto;
cursor: pointer;
}
.kit-field input[type="file"] ~ .kit-field__display {
cursor: auto;
}
.kit-field__display-file {
}
.kit-field__label-icon, .kit-field__display-file-icon {
width: 1em;
margin-right: 0.3em;
}
.kit-field textarea:focus, .kit-field textarea:focus,
.kit-field input:focus, .kit-field input:focus,
.kit-field textarea.focus, .kit-field textarea.focus,
@@ -949,7 +966,6 @@ select.kit-field__input:disabled ~.kit-field__hr {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
position: relative; position: relative;
padding-right: 30px !important;
text-align: left; text-align: left;
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
+44
View File
@@ -0,0 +1,44 @@
<?php
/**
* @var array $arParams
*/
use Wt\Core\Tools;
$arParams['TYPE'] = 'file';
$isReadonly = Tools::isTrue($arParams['READONLY']);
$isRequired = Tools::isTrue($arParams['REQUIRED']);
$isChecked = Tools::isTrue($arParams['CHECKED']);
$multiple = Tools::isTrue($arParams['MULTIPLE']);
$moduleId = $arParams['MODULE_ID']?:'main';
$MAX_FILE_SIZE = $arParams['MAX_FILE_SIZE']?:1048576;
if(is_array($arParams['VALUE'])) {
$arParams['VALUE'] = array_filter($arParams['VALUE']);
}
if($multiple) {
$value = (array)$arParams['VALUE'];
} else {
if(is_array($arParams['VALUE'])) {
$value = (int)$arParams['VALUE'][array_key_first($arParams['VALUE'])];
}
$value = (int)$arParams['VALUE'];
}
$isHint = (string)($arParams['HINT']) !== '';
$componentParams = array(
'INPUT_NAME' => $arParams['NAME'],
//'INPUT_NAME_UNSAVED' => 'FILE_NEW_TMP',
'INPUT_VALUE' => $value,
'MAX_FILE_SIZE' => $MAX_FILE_SIZE,
'MULTIPLE' => $multiple?'Y':'N',
'MODULE_ID' => $moduleId,
'ALLOW_UPLOAD' => 'A',
'ICO' => 'Y',
'HINT' => $arParams['HINT'],
'WRAP_CLASS' => $arParams['WRAP_CLASS'],
);
$GLOBALS["APPLICATION"]->IncludeComponent('bitrix:main.file.input', 'kit', $componentParams, false, Array("HIDE_ICONS" => "Y"));