FIX Update namespaces in Javascript and CSS, fix some Entwine bindings

This commit is contained in:
Robbie Averill 2017-08-24 15:14:39 +12:00
parent 100b84dc08
commit 1bbc473ed7
13 changed files with 11166 additions and 48 deletions

View File

@ -1 +1,235 @@
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){e.exports=jQuery},function(e,t,n){"use strict";var i=n(0),o=n.n(i),r=this;o.a.entwine("ss",function(){var e=null;o()(".uf-field-editor tbody").entwine({onmatch:function(){var t=0,n=0,i=0,s=o()(".uf-field-editor .ss-gridfield-buttonrow").addClass("sticky-buttons"),c=o()(".cms-content-header.north").height()+parseInt(o()(".sticky-buttons").css("padding-top"),10),u=o()(".uf-field-editor");r._super(),r.find(".ss-gridfield-item").each(function(){switch(o()(r).data("class")){case"EditableFormStep":return void(i=0);case"EditableFieldGroup":n=++i;break;case"EditableFieldGroupEnd":n=i--;break;default:n=i}for(o()(r).toggleClass("infieldgroup",n>0),t=1;t<=5;t++)o()(r).toggleClass("infieldgroup-level-"+t,n>=t)}),e=setInterval(function(){var e=u.offset().top;s.width("100%"),e>c||0===e?s.removeClass("sticky-buttons"):s.addClass("sticky-buttons")},300)},onunmatch:function(){r._super(),clearInterval(e)}}),o()(".uf-field-editor .ss-gridfield-buttonrow .action").entwine({onclick:function(e){r._super(e),r.trigger("addnewinline")}}),o()(".uf-field-editor").entwine({onmatch:function(){r._super(),r.on("addnewinline",function(){r.one("reload",function(){var e=r.find(".ss-gridfield-item").last(),t=null;"EditableFieldGroupEnd"===e.attr("data-class")?(t=e,t.prev().find(".col-Title input").focus(),e=t.add(t.prev()),t.css("visibility","hidden")):e.find(".col-Title input").focus(),e.addClass("flashBackground"),o()(".cms-content-fields").scrollTop(o()(".cms-content-fields")[0].scrollHeight),t&&t.css("visibility","visible")})})},onummatch:function(){r._super()}})})},function(e,t,n){"use strict";var i=n(0),o=n.n(i),r=this;o()(document).ready(function(){var e=o()('input[name="SendPlain"]'),t={updateFormatSpecificFields:function(){var t=e.is(":checked");o()(".field.toggle-html-only")[t?"hide":"show"](),o()(".field.toggle-plain-only")[t?"show":"hide"]()}};o.a.entwine("udf.recipient",function(){o()("#Form_ItemEditForm").entwine({onmatch:function(){t.updateFormatSpecificFields()},onunmatch:function(){r._super()}}),e.entwine({onchange:function(){t.updateFormatSpecificFields()}})})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1),n(2)}]);
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
window.jQuery.entwine('ss', function ($) {
var stickyHeaderInterval = null;
$('.uf-field-editor .ss-gridfield-items').entwine({
onmatch: function onmatch() {
var i = 0;
var thisLevel = 0;
var depth = 0;
var $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');
var navHeight = $('.cms-content-header.north').first().height() + parseInt($('.sticky-buttons').css('padding-top'), 10);
var fieldEditor = $('.uf-field-editor');
this._super();
this.find('.ss-gridfield-item').each(function (i, el) {
switch ($(el).data('class')) {
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep':
{
depth = 0;
return;
}
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup':
{
thisLevel = ++depth;
break;
}
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd':
{
thisLevel = depth--;
break;
}
default:
{
thisLevel = depth;
}
}
$(el).toggleClass('infieldgroup', thisLevel > 0);
for (i = 1; i <= 5; i++) {
$(el).toggleClass('infieldgroup-level-' + i, thisLevel >= i);
}
});
stickyHeaderInterval = setInterval(function () {
var offsetTop = fieldEditor.offset().top;
$buttonrow.width('100%');
if (offsetTop > navHeight || offsetTop === 0) {
$buttonrow.removeClass('sticky-buttons');
} else {
$buttonrow.addClass('sticky-buttons');
}
}, 300);
},
onunmatch: function onunmatch() {
this._super();
clearInterval(stickyHeaderInterval);
}
});
$('.uf-field-editor .ss-gridfield-buttonrow .action').entwine({
onclick: function onclick(e) {
this._super(e);
this.trigger('addnewinline');
}
});
$('.uf-field-editor').entwine({
onmatch: function onmatch() {
var _this = this;
this._super();
this.on('addnewinline', function () {
_this.one('reload', function () {
var $newField = _this.find('.ss-gridfield-item').last();
var $groupEnd = null;
if ($newField.attr('data-class') === 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd') {
$groupEnd = $newField;
$groupEnd.prev().find('.col-Title input').focus();
$newField = $groupEnd.add($groupEnd.prev());
$groupEnd.css('visibility', 'hidden');
} else {
$newField.find('.col-Title input').focus();
}
$newField.addClass('flashBackground');
$('.cms-content-fields').scrollTop($('.cms-content-fields')[0].scrollHeight);
if ($groupEnd) {
$groupEnd.css('visibility', 'visible');
}
});
});
},
onummatch: function onummatch() {
this._super();
}
});
});
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
var _this = this;
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.entwine('ss', function () {
var recipient = {
updateFormatSpecificFields: function updateFormatSpecificFields() {
var sendPlainChecked = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('input[name="SendPlain"]').is(':checked');
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();
}
};
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#Form_ItemEditForm .EmailRecipientForm').entwine({
onmatch: function onmatch() {
recipient.updateFormatSpecificFields();
},
onunmatch: function onunmatch() {
_this._super();
}
});
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({
onchange: function onchange() {
recipient.updateFormatSpecificFields();
}
});
});
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bundles_FieldEditor_js__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bundles_FieldEditor_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_bundles_FieldEditor_js__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bundles_Recipient_js__ = __webpack_require__(1);
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = jQuery;
/***/ })
/******/ ]);
//# sourceMappingURL=userforms-cms.js.map

1
client/dist/js/userforms-cms.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap 0725b68c82e72a079f59","webpack:///./client/src/bundles/FieldEditor.js","webpack:///./client/src/bundles/Recipient.js","webpack:///./client/src/bundles/bundle-cms.js","webpack:///external \"jQuery\""],"names":["window","jQuery","entwine","$","stickyHeaderInterval","onmatch","i","thisLevel","depth","$buttonrow","addClass","navHeight","first","height","parseInt","css","fieldEditor","_super","find","each","el","data","toggleClass","setInterval","offsetTop","offset","top","width","removeClass","onunmatch","clearInterval","onclick","e","trigger","on","one","$newField","last","$groupEnd","attr","prev","focus","add","scrollTop","scrollHeight","onummatch","recipient","updateFormatSpecificFields","sendPlainChecked","is","onchange"],"mappings":"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","file":"js/userforms-cms.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0725b68c82e72a079f59","/**\n * form builder behaviour.\n */\n\nwindow.jQuery.entwine('ss', ($) => {\n let stickyHeaderInterval = null;\n\n $('.uf-field-editor .ss-gridfield-items').entwine({\n onmatch() {\n let i = 0;\n let thisLevel = 0;\n let depth = 0;\n const $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');\n const navHeight = $('.cms-content-header.north').first().height()\n + parseInt($('.sticky-buttons').css('padding-top'), 10);\n const fieldEditor = $('.uf-field-editor');\n\n this._super();\n\n // Loop through all rows and set necessary styles\n this.find('.ss-gridfield-item').each((i, el) => {\n switch ($(el).data('class')) {\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep': {\n depth = 0;\n return;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup': {\n thisLevel = ++depth;\n break;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd': {\n thisLevel = depth--;\n break;\n }\n default: {\n thisLevel = depth;\n }\n }\n\n $(el).toggleClass('infieldgroup', thisLevel > 0);\n for (i = 1; i <= 5; i++) {\n $(el).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);\n }\n });\n\n // Make sure gridfield buttons stick to top of page when user scrolls down\n stickyHeaderInterval = setInterval(() => {\n const offsetTop = fieldEditor.offset().top;\n $buttonrow.width('100%');\n if (offsetTop > navHeight || offsetTop === 0) {\n $buttonrow.removeClass('sticky-buttons');\n } else {\n $buttonrow.addClass('sticky-buttons');\n }\n }, 300);\n },\n onunmatch() {\n this._super();\n\n clearInterval(stickyHeaderInterval);\n },\n });\n\n // When new fields are added.\n $('.uf-field-editor .ss-gridfield-buttonrow .action').entwine({\n onclick(e) {\n this._super(e);\n\n this.trigger('addnewinline');\n },\n });\n\n $('.uf-field-editor').entwine({\n onmatch() {\n this._super();\n\n // When the 'Add field' button is clicked set a one time listener.\n // When the GridField is reloaded focus on the newly added field.\n this.on('addnewinline', () => {\n this.one('reload', () => {\n // If fieldgroup, focus on the start marker\n let $newField = this.find('.ss-gridfield-item').last();\n let $groupEnd = null;\n if ($newField.attr('data-class') === 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd') {\n $groupEnd = $newField;\n $groupEnd.prev().find('.col-Title input').focus();\n $newField = $groupEnd.add($groupEnd.prev());\n $groupEnd.css('visibility', 'hidden');\n } else {\n $newField.find('.col-Title input').focus();\n }\n\n $newField.addClass('flashBackground');\n $('.cms-content-fields').scrollTop($('.cms-content-fields')[0].scrollHeight);\n if ($groupEnd) {\n $groupEnd.css('visibility', 'visible');\n }\n });\n });\n },\n onummatch() {\n this._super();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/FieldEditor.js","/**\n * Email recipient behaviour.\n */\n\nimport $ from 'jquery';\n\n$.entwine('ss', () => {\n const recipient = {\n // Some fields are only visible when HTML email are being sent.\n updateFormatSpecificFields: () => {\n const sendPlainChecked = $('input[name=\"SendPlain\"]').is(':checked');\n\n $('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();\n $('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();\n },\n };\n\n $('#Form_ItemEditForm .EmailRecipientForm').entwine({\n onmatch: () => {\n recipient.updateFormatSpecificFields();\n },\n\n onunmatch: () => {\n this._super();\n },\n });\n\n $('#Form_ItemEditForm .EmailRecipientForm input[name=\"SendPlain\"]').entwine({\n onchange: () => {\n recipient.updateFormatSpecificFields();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/Recipient.js","// Used for CMS form fields\nimport 'bundles/FieldEditor.js';\nimport 'bundles/Recipient.js';\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle-cms.js","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 3\n// module chunks = 0"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1,2 @@
@-webkit-keyframes flash-background{0%{background-color:#fff}10%{background-color:#dcfedd}70%{background-color:#dcfedd}}@-o-keyframes flash-background{0%{background-color:#fff}10%{background-color:#dcfedd}70%{background-color:#dcfedd}}@keyframes flash-background{0%{background-color:#fff}10%{background-color:#dcfedd}70%{background-color:#dcfedd}}.uf-field-editor{padding-bottom:0}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item{height:46px}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item:hover{background:#fff}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item td{border-right-width:0;border-top:1px solid #999}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item td:last-child{border-right-width:1px}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item .handle{min-height:46px}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.flash-background{-webkit-animation:flash-background 2s linear;-o-animation:flash-background 2s linear;animation:flash-background 2s linear}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.ui-sortable-placeholder{height:50px}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup:hover{background:#f2f9fd}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup td{border-bottom:0;border-top:1px solid #999}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup .col-reorder,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup .handle{background:#bee0f8;border-top:0}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .col-reorder,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .handle{background:#99cef4;border-top:0}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .col-reorder,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .handle{background:#89bef4;border-top:0}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep],.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep]:hover{background:#dae2e7}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep] label{font-weight:700;color:#000;font-size:1.1em}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep] td{border-top:1px solid #a6b6c1}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep]+.ss-gridfield-item td{border-top:1px solid #dae2e7}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroup] td,.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFormStep]+.ss-gridfield-item[data-class=EditableFieldGroup] td{border-top:1px solid #a8d7f5}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroup] label{font-weight:700;color:#444}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroupEnd] td{border-bottom:1px solid #a8d7f5}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroupEnd]+.ss-gridfield-item[data-class=EditableFieldGroupEnd]{border-top:0}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroupEnd] .col-buttons .action{display:none}.uf-field-editor table.ss-gridfield-table .ss-gridfield-item[data-class=EditableFieldGroupEnd] label{color:#777}.uf-field-editor .sticky-buttons{position:fixed;top:40px;z-index:2;background:#999;-webkit-box-shadow:0 12px -4px #999;box-shadow:0 12px -4px #999;padding:12px;margin-left:-12px}.uf-field-editor .sticky-buttons button.action{margin-bottom:0}.uf-field-editor .sticky-buttons~.ss-gridfield-table{margin-top:40px}
.uf-field-editor{padding-bottom:0}.uf-field-editor .grid-field__table .ss-gridfield-item{height:46px}.uf-field-editor .grid-field__table .ss-gridfield-item,.uf-field-editor .grid-field__table .ss-gridfield-item:hover{background:#fff}.uf-field-editor .grid-field__table .ss-gridfield-item td{border-right-width:0;border-top:1px solid #999}.uf-field-editor .grid-field__table .ss-gridfield-item td:last-child{border-right-width:1px}.uf-field-editor .grid-field__table .ss-gridfield-item .handle{min-height:46px}.uf-field-editor .grid-field__table .ss-gridfield-item.flash-background{-webkit-animation:flash-background 2s linear;-o-animation:flash-background 2s linear;animation:flash-background 2s linear}.uf-field-editor .grid-field__table .ss-gridfield-item.ui-sortable-placeholder{height:50px}.uf-field-editor .grid-field__table .ss-gridfield-item .form-group{padding:0}.uf-field-editor .grid-field__table .ss-gridfield-item .form-group:after{border-bottom:0}.uf-field-editor .grid-field__table .ss-gridfield-item .form-group .form__field-label{-webkit-box-flex:1;-webkit-flex:auto;flex:auto;max-width:100%}.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup,.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup:hover{background:#f2f9fd}.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup td{border-bottom:0;border-top:1px solid #999}.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .col-reorder,.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .handle{background:#bee0f8;border-top:0}.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .col-reorder,.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .handle{background:#99cef4;border-top:0}.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .col-reorder,.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .handle{background:#89bef4;border-top:0}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep],.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep]:hover{background:#f6f7f8}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep] label{font-weight:700;color:#000;font-size:1.1em}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep] td{border-top:1px solid #a6b6c1}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep]+.ss-gridfield-item td{border-top:1px solid #f6f7f8}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup] td,.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep]+.ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup] td{border-top:1px solid #a8d7f5}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup] .form__field-label{font-weight:700}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd] td{border-bottom:1px solid #a8d7f5}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd]+.ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd]{border-top:0}.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd] .col-buttons .action{display:none}.uf-field-editor .sticky-buttons{position:fixed;top:73px;z-index:2;background:#f6f7f8;border-bottom:1px solid #e5e8eb;padding:12px;margin-left:-12px}.uf-field-editor .sticky-buttons button.action{margin-bottom:0}.uf-field-editor .sticky-buttons~.ss-gridfield-table{margin-top:73px}
/*# sourceMappingURL=userforms-cms.css.map*/

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./client/src/styles/userforms-cms.scss?61a4","webpack:///./bundle-cms.scss?b4af"],"names":[],"mappings":"AAAA,iBACE,iBCCD,uDDKK,YCDL,oHDKO,gBCAP,0DDIO,qBACA,0BCAP,qEDGS,uBCCT,+DDIO,gBCAP,wEDIO,0HCAP,+EDIO,YCAP,mEDIO,UCAP,yEDGS,gBCCT,sFDGS,+CACA,eCCT,8IDOO,mBCFP,uEDMO,gBACA,0BCFP,6JDOO,mBACA,aCFP,uMDQS,mBACA,aCHT,uMDUS,mBACA,aCLT,oRDaO,mBCRP,6IDYO,gBACA,WACA,gBCRP,0IDYO,6BCRP,6JDYO,6BCRP,2XDkBO,6BCVP,4JDcO,gBCVP,+IDgBO,gCCZP,oPDgBO,aCZP,iKDgBO,aCZP,iCDkBG,eACA,SACA,UACA,mBACA,gCAEA,aACA,kBCfH,+CDkBK,gBCdL,qDDkBK","file":"styles/userforms-cms.css","sourcesContent":[".uf-field-editor {\n padding-bottom: 0;\n\n // Row styles\n .grid-field__table {\n // Standard rows\n .ss-gridfield-item {\n height: $height-base;\n\n &,\n &:hover {\n background: $body-bg;\n }\n\n td {\n border-right-width: 0;\n border-top: 1px solid $gray-light;\n\n &:last-child {\n border-right-width: 1px;\n }\n }\n\n .handle {\n min-height: $height-base;\n }\n\n &.flash-background {\n animation: flash-background 2s linear;\n }\n\n &.ui-sortable-placeholder {\n height: $placeholder-height;\n }\n\n .form-group {\n padding: 0;\n\n &:after {\n border-bottom: 0;\n }\n\n .form__field-label {\n flex: auto;\n max-width: 100%;\n }\n }\n }\n\n .ss-gridfield-item.infieldgroup {\n &,\n &:hover {\n background: $blue-light;\n }\n\n td {\n border-bottom: 0;\n border-top: 1px solid $gray-light;\n }\n\n .col-reorder,\n .handle {\n background: $blue;\n border-top: 0;\n }\n\n &.infieldgroup-level-2 {\n .col-reorder,\n .handle {\n background: $blue-dark;\n border-top: 0;\n }\n }\n\n &.infieldgroup-level-3 {\n .col-reorder,\n .handle {\n background: $blue-darker;\n border-top: 0;\n }\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] {\n &,\n &:hover {\n background: $background-main;\n }\n\n label {\n font-weight: bold;\n color: $gray-base;\n font-size: 1.1em;\n }\n\n td {\n border-top: 1px solid $gray;\n }\n\n + .ss-gridfield-item td {\n border-top: 1px solid $background-main;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 1px solid $blue-base;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] {\n td {\n border-top: 1px solid $blue-base;\n }\n\n .form__field-label {\n font-weight: bold;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n td {\n border-bottom: 1px solid $blue-base;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n }\n\n .col-buttons .action {\n display: none;\n }\n }\n }\n\n .sticky-buttons {\n position: fixed;\n top: $height-top;\n z-index: 2;\n background: $background-main;\n border-bottom: 1px solid $border-color-light;\n // box-shadow: 0 $padding-base $padding-xs -$padding-base-horizontal $gray-light;\n padding: $padding-base;\n margin-left: -$padding-base;\n\n & button.action {\n margin-bottom: 0;\n }\n\n ~ .ss-gridfield-table {\n margin-top: $height-top;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/userforms-cms.scss",".uf-field-editor {\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item {\n height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item,\n.uf-field-editor .grid-field__table .ss-gridfield-item:hover {\n background: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td {\n border-right-width: 0;\n border-top: 1px solid #999;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td:last-child {\n border-right-width: 1px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .handle {\n min-height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.flash-background {\n animation: flash-background 2s linear;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.ui-sortable-placeholder {\n height: 50px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group {\n padding: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group:after {\n border-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group .form__field-label {\n flex: auto;\n max-width: 100%;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup:hover {\n background: #f2f9fd;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup td {\n border-bottom: 0;\n border-top: 1px solid #999;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .col-reorder,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .handle {\n background: #bee0f8;\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .col-reorder,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-2 .handle {\n background: #99cef4;\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .col-reorder,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup.infieldgroup-level-3 .handle {\n background: #89bef4;\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"],\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"]:hover {\n background: #f6f7f8;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] label {\n font-weight: bold;\n color: #000;\n font-size: 1.1em;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] td {\n border-top: 1px solid #a6b6c1;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] + .ss-gridfield-item td {\n border-top: 1px solid #f6f7f8;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 1px solid #a8d7f5;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 1px solid #a8d7f5;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] .form__field-label {\n font-weight: bold;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] td {\n border-bottom: 1px solid #a8d7f5;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] .col-buttons .action {\n display: none;\n}\n\n.uf-field-editor .sticky-buttons {\n position: fixed;\n top: 73px;\n z-index: 2;\n background: #f6f7f8;\n border-bottom: 1px solid #e5e8eb;\n padding: 12px;\n margin-left: -12px;\n}\n\n.uf-field-editor .sticky-buttons button.action {\n margin-bottom: 0;\n}\n\n.uf-field-editor .sticky-buttons ~ .ss-gridfield-table {\n margin-top: 73px;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./bundle-cms.scss"],"sourceRoot":""}

View File

@ -1 +1,2 @@
.userform-progress .progress{position:relative;height:1em;background:#eee}.userform-progress .progress-bar{position:absolute;height:1em;background:#666}.userform-progress .step-buttons{margin-left:0;position:relative}.userform-progress .step-button-wrapper{display:inline-block;list-style-type:none}.userform-progress .step-button-wrapper.viewed .step-button-jump{opacity:1}.userform-progress .step-button-jump{position:absolute;top:0;opacity:.7}.step-navigation .step-buttons{margin-left:0}.step-navigation .step-button-wrapper{display:inline-block;list-style-type:none}.userform{clear:both;width:100%;max-width:100%}.userform .field label.right{color:#555}.userformsgroup{border:1px solid #ccc;border-radius:4px;padding:8px;margin-top:12px;margin-bottom:12px}.userformsgroup>legend{padding-left:4px;padding-right:4px;border:0;width:auto}.right-title{clear:both;display:block}.checkbox .right-title{display:inline}.userform .left{margin-bottom:5px;font-weight:700}
.userform-progress .progress{position:relative;height:1em;background:#eee}.userform-progress .progress-bar{position:absolute;height:1em;background:#666}.userform-progress .step-buttons{margin-left:0;position:relative}.userform-progress .step-button-wrapper{display:inline-block;list-style-type:none}.userform-progress .step-button-wrapper.viewed .step-button-jump{opacity:1}.userform-progress .step-button-jump{position:absolute;top:0;opacity:.7}.step-navigation .step-buttons{margin-left:0}.step-navigation .step-button-wrapper{display:inline-block;list-style-type:none}.userform{clear:both;width:100%;max-width:100%}.userform .field label.right{color:#555}.userformsgroup{border:1px solid #ccc;border-radius:4px;padding:8px;margin-top:12px;margin-bottom:12px}.userformsgroup>legend{padding-left:4px;padding-right:4px;border:0;width:auto}.right-title{clear:both;display:block}.checkbox .right-title{display:inline}.userform .left{margin-bottom:5px;font-weight:700}
/*# sourceMappingURL=userforms.css.map*/

1
client/dist/styles/userforms.css.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./client/src/styles/userforms.scss?1f22","webpack:///./bundle.scss?6663"],"names":[],"mappings":"AAEA,6BAEI,kBACA,WACA,gBCFH,iCDMG,kBACA,WACA,gBCFH,iCDMG,cACA,kBCFH,wCDMG,qBACA,qBCFH,iEDKK,UCDL,qCDMG,kBACA,MACA,WCFH,+BDQG,cCJH,sCDQG,qBACA,qBCJH,UDSC,WACA,WACA,eCLD,6BDQG,WCJH,gBDSC,sBACA,kBACA,YACA,gBACA,mBCLD,uBDQG,iBACA,kBACA,SACA,WCJH,aDSC,WACA,cCLD,uBDSC,eCLD,gBDSC,kBACA","file":"styles/userforms.css","sourcesContent":["// Lightweight base styles for the front-end form.\n\n.userform-progress {\n .progress {\n position: relative;\n height: 1em;\n background: $gray-lighter;\n }\n\n .progress-bar {\n position: absolute;\n height: 1em;\n background: $gray-progress-bg;\n }\n\n .step-buttons {\n margin-left: 0;\n position: relative;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n\n &.viewed .step-button-jump {\n opacity: 1;\n }\n }\n\n .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n }\n}\n\n.step-navigation {\n .step-buttons {\n margin-left: 0;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n }\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n\n .field label.right {\n color: $gray-dark-label;\n }\n}\n\n.userformsgroup {\n border: 1px solid $gray-light-border;\n border-radius: $padding-xs;\n padding: $padding-base-horizontal;\n margin-top: $padding-base;\n margin-bottom: $padding-base;\n\n > legend {\n padding-left: $padding-xs;\n padding-right: $padding-xs;\n border: 0;\n width: auto;\n }\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: $padding-sm;\n font-weight: bold;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/userforms.scss",".userform-progress .progress {\n position: relative;\n height: 1em;\n background: #eee;\n}\n\n.userform-progress .progress-bar {\n position: absolute;\n height: 1em;\n background: #666;\n}\n\n.userform-progress .step-buttons {\n margin-left: 0;\n position: relative;\n}\n\n.userform-progress .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform-progress .step-button-wrapper.viewed .step-button-jump {\n opacity: 1;\n}\n\n.userform-progress .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n}\n\n.step-navigation .step-buttons {\n margin-left: 0;\n}\n\n.step-navigation .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n}\n\n.userform .field label.right {\n color: #555;\n}\n\n.userformsgroup {\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n margin-bottom: 12px;\n}\n\n.userformsgroup > legend {\n padding-left: 4px;\n padding-right: 4px;\n border: 0;\n width: auto;\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./bundle.scss"],"sourceRoot":""}

View File

@ -2,35 +2,33 @@
* form builder behaviour.
*/
import $ from 'jquery';
$.entwine('ss', () => {
window.jQuery.entwine('ss', ($) => {
let stickyHeaderInterval = null;
$('.uf-field-editor tbody').entwine({
onmatch: () => {
$('.uf-field-editor .ss-gridfield-items').entwine({
onmatch() {
let i = 0;
let thisLevel = 0;
let depth = 0;
const $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');
const navHeight = $('.cms-content-header.north').height()
const navHeight = $('.cms-content-header.north').first().height()
+ parseInt($('.sticky-buttons').css('padding-top'), 10);
const fieldEditor = $('.uf-field-editor');
this._super();
// Loop through all rows and set necessary styles
this.find('.ss-gridfield-item').each(() => {
switch ($(this).data('class')) {
case 'EditableFormStep': {
this.find('.ss-gridfield-item').each((i, el) => {
switch ($(el).data('class')) {
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep': {
depth = 0;
return;
}
case 'EditableFieldGroup': {
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup': {
thisLevel = ++depth;
break;
}
case 'EditableFieldGroupEnd': {
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd': {
thisLevel = depth--;
break;
}
@ -39,9 +37,9 @@ $.entwine('ss', () => {
}
}
$(this).toggleClass('infieldgroup', thisLevel > 0);
$(el).toggleClass('infieldgroup', thisLevel > 0);
for (i = 1; i <= 5; i++) {
$(this).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);
$(el).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);
}
});
@ -56,7 +54,7 @@ $.entwine('ss', () => {
}
}, 300);
},
onunmatch: () => {
onunmatch() {
this._super();
clearInterval(stickyHeaderInterval);
@ -65,7 +63,7 @@ $.entwine('ss', () => {
// When new fields are added.
$('.uf-field-editor .ss-gridfield-buttonrow .action').entwine({
onclick: (e) => {
onclick(e) {
this._super(e);
this.trigger('addnewinline');
@ -73,7 +71,7 @@ $.entwine('ss', () => {
});
$('.uf-field-editor').entwine({
onmatch: () => {
onmatch() {
this._super();
// When the 'Add field' button is clicked set a one time listener.
@ -83,7 +81,7 @@ $.entwine('ss', () => {
// If fieldgroup, focus on the start marker
let $newField = this.find('.ss-gridfield-item').last();
let $groupEnd = null;
if ($newField.attr('data-class') === 'EditableFieldGroupEnd') {
if ($newField.attr('data-class') === 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd') {
$groupEnd = $newField;
$groupEnd.prev().find('.col-Title input').focus();
$newField = $groupEnd.add($groupEnd.prev());
@ -100,7 +98,7 @@ $.entwine('ss', () => {
});
});
},
onummatch: () => {
onummatch() {
this._super();
},
});

View File

@ -47,5 +47,5 @@ $padding-xs: 4px;
$padding-sm: 5px;
$height-base: 46px;
$height-top: 40px;
$height-top: 73px;
$placeholder-height: 50px;

View File

@ -1,3 +1,6 @@
// CMS SASS bundle
// See includePaths in webpack.config.js
@import "variables";
@import "userforms-variables";
@import "userforms-cms";

View File

@ -1,3 +1,6 @@
// Frontend SASS bundle
// See includePaths in webpack.config.js
@import "variables";
@import "userforms-variables";
@import "userforms";

View File

@ -1,16 +1,8 @@
// Animations
@keyframes flash-background {
0% {background-color: $body-bg;}
10% {background-color: $green-bg;}
70% {background-color: $green-bg;}
}
.uf-field-editor {
padding-bottom: 0;
// Row styles
table.ss-gridfield-table {
.grid-field__table {
// Standard rows
.ss-gridfield-item {
height: $height-base;
@ -40,6 +32,19 @@
&.ui-sortable-placeholder {
height: $placeholder-height;
}
.form-group {
padding: 0;
&:after {
border-bottom: 0;
}
.form__field-label {
flex: auto;
max-width: 100%;
}
}
}
.ss-gridfield-item.infieldgroup {
@ -76,10 +81,10 @@
}
}
.ss-gridfield-item[data-class="EditableFormStep"] {
.ss-gridfield-item[data-class="SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep"] {
&,
&:hover {
background: $gray-bg;
background: $background-main;
}
label {
@ -93,41 +98,36 @@
}
+ .ss-gridfield-item td {
border-top: 1px solid $gray-bg;
border-top: 1px solid $background-main;
}
+ .ss-gridfield-item[data-class="EditableFieldGroup"] td {
+ .ss-gridfield-item[data-class="SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup"] td {
border-top: 1px solid $blue-base;
}
}
.ss-gridfield-item[data-class="EditableFieldGroup"] {
.ss-gridfield-item[data-class="SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup"] {
td {
border-top: 1px solid $blue-base;
}
label {
.form__field-label {
font-weight: bold;
color: $gray-darker;
}
}
.ss-gridfield-item[data-class="EditableFieldGroupEnd"] {
.ss-gridfield-item[data-class="SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd"] {
td {
border-bottom: 1px solid $blue-base;
}
+ .ss-gridfield-item[data-class="EditableFieldGroupEnd"] {
+ .ss-gridfield-item[data-class="SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd"] {
border-top: 0;
}
.col-buttons .action {
display: none;
}
label {
color: $gray-dark;
}
}
}
@ -135,8 +135,9 @@
position: fixed;
top: $height-top;
z-index: 2;
background: $gray-light;
box-shadow: 0 $padding-base $padding-xs -$padding-base-horizontal $gray-light;
background: $background-main;
border-bottom: 1px solid $border-color-light;
// box-shadow: 0 $padding-base $padding-xs -$padding-base-horizontal $gray-light;
padding: $padding-base;
margin-left: -$padding-base;